From 9cc4f8d5b373aefd18efb7185d7f338630d69f63 Mon Sep 17 00:00:00 2001 From: Henning Peters Date: Mon, 15 Feb 2016 01:33:39 +0100 Subject: [PATCH] avoid shadowing __name__ --- setup.py | 2 +- spacy/about.py | 2 +- spacy/en/download.py | 8 ++++---- spacy/util.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index a726aa539..ad6e6e14d 100644 --- a/setup.py +++ b/setup.py @@ -162,7 +162,7 @@ def setup_package(): generate_cython(root, 'spacy') setup( - name=about['__name__'], + name=about['__title__'], zip_safe=False, packages=PACKAGES, package_data={'': ['*.pyx', '*.pxd', '*.txt', '*.tokens']}, diff --git a/spacy/about.py b/spacy/about.py index 77c536946..115d711a1 100644 --- a/spacy/about.py +++ b/spacy/about.py @@ -3,7 +3,7 @@ # https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/ # https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py -__name__ = 'spacy' +__title__ = 'spacy' __version__ = '0.100.5' __summary__ = 'Industrial-strength NLP' __uri__ = 'https://spacy.io' diff --git a/spacy/en/download.py b/spacy/en/download.py index ae1e62e44..993b8b16d 100644 --- a/spacy/en/download.py +++ b/spacy/en/download.py @@ -29,20 +29,20 @@ def migrate(path): ) def main(data_size='all', force=False): if force: - sputnik.purge(about.__name__, about.__version__) + sputnik.purge(about.__title__, about.__version__) try: - sputnik.package(about.__name__, about.__version__, about.__default_model__) + sputnik.package(about.__title__, about.__version__, about.__default_model__) print("Model already installed. Please run 'python -m " "spacy.en.download --force' to reinstall.", file=sys.stderr) sys.exit(1) except (PackageNotFoundException, CompatiblePackageNotFoundException): pass - package = sputnik.install(about.__name__, about.__version__, about.__default_model__) + package = sputnik.install(about.__title__, about.__version__, about.__default_model__) try: - sputnik.package(about.__name__, about.__version__, about.__default_model__) + sputnik.package(about.__title__, about.__version__, about.__default_model__) except (PackageNotFoundException, CompatiblePackageNotFoundException): print("Model failed to install. Please run 'python -m " "spacy.en.download --force'.", file=sys.stderr) diff --git a/spacy/util.py b/spacy/util.py index 390c83a03..7a5a1aa0c 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -22,7 +22,7 @@ def get_package(data_dir): def get_package_by_name(name=None, via=None): try: - return sputnik.package(about.__name__, about.__version__, + return sputnik.package(about.__title__, about.__version__, name or about.__default_model__, data_path=via) except PackageNotFoundException as e: raise RuntimeError("Model not installed. Please run 'python -m "