Update to install pip editable in dev mode and remove dependency on setuptools_scm.

1. And remove setuptools_scm dependencies due to permission issues with pip and scm

2. Add instruction that removes the need to update pip if any changes are made to utils package.

3. Document the known issue with setuptools_scm and pip that fails to give setuptools_scm permission to scm metadata files.
This commit is contained in:
Emmanuel Awa 2019-09-17 20:58:48 +00:00
Родитель 50b1738b95
Коммит 6250e06c9c
5 изменённых файлов: 12 добавлений и 22 удалений

Просмотреть файл

@ -96,13 +96,15 @@ If you are using the DSVM, you can [connect to JupyterHub](https://docs.microsof
<p>
A setup.py file is provided in order to simplify the installation of this utilities in this repo from the main directory.
To install, please run the command below
To install the package, please run the command below (from directory root)
python setup.py install
pip install -e .
It is also possible to install directly from Github, which is the best way to utilize the `utils_nlp` package in external projects.
Running the command tells pip to install the `utils_nlp` package from source in [development mode](https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode). This just means that any updates to `utils_nlp` source directory will immediately be reflected in the installed package without needing to reinstall; a very useful practice for a package with constant updates.
pip install -e git+git@github.com:microsoft/nlp.git@master#egg=utils_nlp
> It is also possible to install directly from Github, which is the best way to utilize the `utils_nlp` package in external projects (while still reflecting updates to the source as it's installed as an editable `'-e'` package).
> `pip install -e git+git@github.com:microsoft/nlp.git@master#egg=utils_nlp`
Either command, from above, makes `utils_nlp` available in your conda virtual environment. You can verify it was properly installed by running:

Просмотреть файл

@ -1,9 +1,10 @@
# Semantic Versioning
> NOTE: Support for `setuptools_scm` is currently removed due to a known [issue](https://github.com/pypa/setuptools_scm/issues/357) with the way pip installations restrict access to certain SCM metadata during package installation. Support will be restored when `setuptools_scm` and `pip` developers fix this with a patch.
This library is configured to use
[setuptools_scm](https://github.com/pypa/setuptools_scm/) to automatically get package version from git commit histories.
> NOTE: **There shouldn't be any references to manually coded versions**.
**There shouldn't be any references to manually coded versions**.
Verify what git tag to use by running:

Просмотреть файл

@ -58,9 +58,9 @@ setup(
},
keywords=["Microsoft NLP", "Natural Language Processing", "Text Processing", "Word Embedding"],
python_requires=">=3.6",
install_requires=["setuptools_scm>=3.2.0"],
install_requires=[],
dependency_links=[],
extras_require={},
use_scm_version={"root": ".", "relative_to": __file__},
setup_requires=["setuptools_scm"],
use_scm_version=False,
setup_requires=[],
)

Просмотреть файл

@ -75,7 +75,6 @@ PIP_BASE = {
"pre-commit": "pre-commit>=1.14.4",
"scikit-learn": "scikit-learn>=0.19.0,<=0.20.3",
"seaborn": "seaborn>=0.9.0",
"setuptools_scm": "setuptools_scm==3.2.0",
"sklearn-crfsuite": "sklearn-crfsuite>=0.3.6",
"spacy": "spacy>=2.1.4",
"spacy-models": (

Просмотреть файл

@ -1,28 +1,16 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from setuptools_scm import get_version
__title__ = "Microsoft NLP"
__author__ = "AI CAT at Microsoft"
__license__ = "MIT"
__copyright__ = "Copyright 2018-present Microsoft Corporation"
__version__ = "1.0.0"
# Synonyms
TITLE = __title__
AUTHOR = __author__
LICENSE = __license__
COPYRIGHT = __copyright__
# Determine semantic versioning automatically
# from git commits if the package is installed
# into your environment, otherwise
# we set version to default for development
try:
__version__ = get_version()
except LookupError:
__version__ = "0.0.0"
VERSION = __version__