s/_version.py/_black_version.py/ (#1082)
Some users are installing Black as a dependency in their project. Having a _version.py in site-packages is asking for a conflict sooner or later. Ideally we shouldn't require a separate version file at all, that's an additional import we need to make. But I'll leave that bikeshedding for a different time.
This commit is contained in:
parent
e9d4e7b67f
commit
a701659da2
2
.gitignore
vendored
2
.gitignore
vendored
@ -9,6 +9,6 @@ black.egg-info
|
|||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
pip-wheel-metadata/
|
pip-wheel-metadata/
|
||||||
_version.py
|
_black_version.py
|
||||||
.idea
|
.idea
|
||||||
.eggs
|
.eggs
|
||||||
|
2
black.py
2
black.py
@ -52,7 +52,7 @@
|
|||||||
from blib2to3.pgen2.grammar import Grammar
|
from blib2to3.pgen2.grammar import Grammar
|
||||||
from blib2to3.pgen2.parse import ParseError
|
from blib2to3.pgen2.parse import ParseError
|
||||||
|
|
||||||
from _version import version as __version__
|
from _black_version import version as __version__
|
||||||
|
|
||||||
DEFAULT_LINE_LENGTH = 88
|
DEFAULT_LINE_LENGTH = 88
|
||||||
DEFAULT_EXCLUDES = r"/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|\.svn|_build|buck-out|build|dist)/" # noqa: B950
|
DEFAULT_EXCLUDES = r"/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|\.svn|_build|buck-out|build|dist)/" # noqa: B950
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
import black
|
import black
|
||||||
import click
|
import click
|
||||||
|
|
||||||
from _version import version as __version__
|
from _black_version import version as __version__
|
||||||
|
|
||||||
# This is used internally by tests to shut down the server prematurely
|
# This is used internally by tests to shut down the server prematurely
|
||||||
_stop_signal = asyncio.Event()
|
_stop_signal = asyncio.Event()
|
||||||
|
2
setup.py
2
setup.py
@ -17,7 +17,7 @@ def get_long_description() -> str:
|
|||||||
setup(
|
setup(
|
||||||
name="black",
|
name="black",
|
||||||
use_scm_version={
|
use_scm_version={
|
||||||
"write_to": "_version.py",
|
"write_to": "_black_version.py",
|
||||||
"write_to_template": 'version = "{version}"\n',
|
"write_to_template": 'version = "{version}"\n',
|
||||||
},
|
},
|
||||||
description="The uncompromising code formatter.",
|
description="The uncompromising code formatter.",
|
||||||
|
Loading…
Reference in New Issue
Block a user