-
Notifications
You must be signed in to change notification settings - Fork 41
Releasing
- Edit the version name in the
setup.py
file - Test installing your package locally by running
pip install -e .
from the project's root directory - If install is successful, run unit tests in release branch
- If all tests pass, upload the beta release or release candidate to PyPI (steps detailed below)
- Test & use your release with
pip install nlptest==version-name --pre
(don't forget the--pre
flag) - Iterate as many times as necessary. If satisfied with release tests, proceed to stable release.
- Edit the version name in the
setup.py
file - Test installing your package locally by running
pip install -e .
from the project's root directory - If install is successful, run unit tests in release branch
- If all tests pass, upload the stable release to PyPI (steps detailed below) -
โ ๏ธ overwriting a release is basically impossible, so at this point you should be certain your package is fully functioning before uploading it - Test & use your release with
pip install nlptest==version-name
- Release on Anaconda
- Create a new release on GitHub repo with release notes (steps detailed below)
- Announce release on socials
Semantic Versioning guidelines are as follows: MAJOR.MINOR.PATCH.IDENTIFIER.NUMBER
Examples:
- Beta release:
version="1.0.0.beta.1"
- Release candidate:
version="1.0.0.rc.1"
- Stable release:
version="1.0.0"
This naming convention applies to both the PyPI uploads and the GitHub release tag names.
Releases should be made from release/
branches. Once the stable release is up and running on PyPI, the release/
branch can be merged into main
.
Step 1: Package the nlptest Python package
In the project's root directory, run:
python setup.py sdist bdist_wheel
This command creates a dist directory containing source distribution (.tar.gz
) and wheel distribution (.whl
) files.
Step 2: Upload the nlptest package to PyPI
Use twine to upload your package to PyPI:
twine upload dist/*
You'll be prompted to enter your PyPI username and password.
Before you start, install anaconda-client and conda-build:
conda install anaconda-client conda-build
Make sure you are logged in as JohnSnowLabs
conda login
Create nlp-.tar.gz Run the following in the root of the nlptest project to create the .tar.gz file which is contained in the /dist folder.
python setup.py sdist bdist_wheel
Purge the previous builds:
conda build purge
Turn off auto-upload:
conda config --set anaconda_upload no
Update the values in meta.yaml: fn, url and sha256 need to be updated to the values of the tar.gz PyPI upload or file
Make sure you have these channels added
conda config --env --add channels johnsnowlabs
conda config --env --add channels conda-forge
Build nlptest
from the latest PyPI tar:
cd conda/
conda build . --python=3.7 && conda build . --python=3.8 && conda build . --python=3.9
Create a new anaconda venv and test the package locally before uploading.
If this runs error free, the package an be uploaded to anaconda
conda create -n nlptest_r<version> -v py3.7
conda activate nlptest_r<version>
conda install --update-deps --use-local <local package>
python
from nlptest import Harness
Harness('ner', model='dslim/bert-base-NER', hub='huggingface').generate().run().report()
Example of uploading Conda package to Anaconda Cloud:
anaconda upload /home/user/anaconda3/conda-bld/noarch/nlptest-1.0.0-py37_0.tar.bz2
Install spark-nlp by using conda:
conda install -c johnsnowlabs spark-nlp
Step 1: Create a new tag name
This should be the version name. Example: 1.0.0
Step 2: Pick the target branch
For a stable release, this should be main
.
Step 3: Give it a title
This should be in the following format: John Snow Labs NLP Test 1.0.0
Step 4: Write release notes This has to be done well before the release is created. Here is an example of good release notes.
Step 5: Tick off "Create a discussion for this release"
Step 6: Publish release