mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 00:46:28 +03:00
avoid shadowing __name__
This commit is contained in:
parent
4c9e3c7911
commit
9cc4f8d5b3
2
setup.py
2
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']},
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 "
|
||||
|
|
Loading…
Reference in New Issue
Block a user