mirror of
https://github.com/Instagram/LibCST.git
synced 2025-12-23 10:35:53 +00:00
disable setuptools local scheme when env var is set (#551)
This commit is contained in:
parent
5c05001c2d
commit
2cd43c4b78
2 changed files with 15 additions and 1 deletions
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
|
|
@ -181,6 +181,10 @@ jobs:
|
|||
- name: Validate Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: exit 1
|
||||
- name: Disable scmtools local scheme
|
||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||
run: >-
|
||||
echo LIBCST_NO_LOCAL_SCHEME=1 >> $GITHUB_ENV
|
||||
- name: Build a binary wheel and a source tarball
|
||||
run: >-
|
||||
python -m
|
||||
|
|
|
|||
12
setup.py
12
setup.py
|
|
@ -4,7 +4,7 @@
|
|||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
|
||||
from os import path
|
||||
from os import path, environ
|
||||
|
||||
import setuptools
|
||||
|
||||
|
|
@ -13,9 +13,19 @@ this_directory: str = path.abspath(path.dirname(__file__))
|
|||
with open(path.join(this_directory, "README.rst"), encoding="utf-8") as f:
|
||||
long_description: str = f.read()
|
||||
|
||||
|
||||
def no_local_scheme(version: str) -> str:
|
||||
return ""
|
||||
|
||||
|
||||
setuptools.setup(
|
||||
use_scm_version={
|
||||
"write_to": "libcst/_version.py",
|
||||
**(
|
||||
{"local_scheme": no_local_scheme}
|
||||
if "LIBCST_NO_LOCAL_SCHEME" in environ
|
||||
else {}
|
||||
),
|
||||
},
|
||||
name="libcst",
|
||||
description="A concrete syntax tree with AST-like properties for Python 3.5, 3.6, 3.7 and 3.8 programs.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue