Experimental version of CLTK to incorporate stanza into an all-use NLP()
class.
$ pip install cltkv1
$ make docs
The following steps will give you a working development environment.
Use pyenv
to manage Python versions and poetry
for package builds.
- Install
pyenv
: - First time installation;
curl https://pyenv.run | bash
- To update
pyenv
:pyenv update
- Resource: Managing Multiple Python Versions With pyenv
- First time installation;
- Install
- Install supported versions of the Python language through
pyenv
into a dedicated virtualenv: $ pyenv install --list | grep 3.7.5
$ pyenv install 3.7.5
$ pyenv virtualenv 3.7.5 cltkv1
$ pyenv local cltkv1
. Open a new window and this should be activated, with a ``(cltkv1) `` prepended to your Bash prompt.
- Install supported versions of the Python language through
- Install
poetry
to support packaging: https://poetry.eustace.io/docs/ - Install dependencies in
poetry.lock
:$ poetry install
- Install Stanford NLP models:
$ poetry run python scripts/download_misc_dependencies.py
- Install Graphiz (necessary for building docs): https://graphviz.gitlab.io/download/
- Validate structure of
pyproject.toml
:$ poetry check
- Update project version with
poetry
:$ poetry version prepatch
(e.g.,1.0.0
to1.0.1-alpha.0
) - For minor version:
$ poetry version preminor
(1.0.0
to1.1.0-alpha.0
) - For major version:
$ poetry version premajor
(1.0.0
to2.0.0-alpha.0
)
- For minor version:
- Update project version with
- Update all dependencies to latest version (optional):
$ make updateDependencies
- Make package (sdist and wheel):
$ make build
- Check typing:
$ make typing
- View report at
.mypy_cache/index.html
- View report at
- Check typing:
- Run linter:
$ make lint
- View report at
pylint/pylint.html
- View report at
- Run linter:
- Auto-format code:
$ make format
- Build docs:
$ make docs
- View docs at
docs/_build/html/index.html
- View docs at
- Build docs:
- Make UML diagrams:
$ make uml
- View diagrams at
docs/classes.png
anddocs/packages.png
- View diagrams at
- Make UML diagrams:
- Run the above at each commit with
pre-commit
:$ poetry run pre-commit install
(just once) - Run tests:
$ make test
- Publish pre-release (permissions required):
$ make uploadTest
- Install from TestPyPI:
$ make installPyPITest
- Repeat the above as necessary
- Bump version:
$ poetry version patch
(e.g.,1.0.1-alpha.0
to1.0.1
) - For minor version:
$ poetry version minor
(1.0.1-alpha.0
to1.1.0
) - For major version:
$ poetry version major
(1.0.1-alpha.0
to2.0.0
) - If you need to publish multiple versions of an alpha pre-release, run
$ poetry version prerelease
(e.g.,1.0.1-alpha.0
to1.0.1-alpha.1
to1.0.1-alpha.2
)
- For minor version:
- Bump version:
- Publish to PyPI (permissions required):
$ make upload