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:
Łukasz Langa 2019-10-21 15:03:01 +02:00 committed by GitHub
parent e9d4e7b67f
commit a701659da2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

2
.gitignore vendored
View File

@ -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

View File

@ -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

View File

@ -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()

View File

@ -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.",