Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Update to install pip editable in dev mode and remove dependency on s…
Browse files Browse the repository at this point in the history
…etuptools_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.

Author:    Emmanuel Awa <[email protected]>
Date:      Tue Sep 17 20:58:48 2019 +0000
  • Loading branch information
Emmanuel Awa committed Sep 18, 2019
1 parent 50b1738 commit 693931b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 22 deletions.
10 changes: 6 additions & 4 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]: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 [email protected]: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:

Expand Down
3 changes: 2 additions & 1 deletion VERSIONING.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def read(*names, **kwargs):
},
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=[],
)
1 change: 0 additions & 1 deletion tools/generate_conda_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
"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": (
Expand Down
14 changes: 1 addition & 13 deletions utils_nlp/__init__.py
Original file line number Diff line number Diff line change
@@ -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__

0 comments on commit 693931b

Please sign in to comment.