- Make sure you have twine and build installed:
pip install twine build
- Make sure you have added your PyPI credentials to
~/.pypirc
- Make sure you have anaconda-client installed:
conda install anaconda-client
- Log into Anaconda Cloud
anaconda login
- Make sure that the version number is updated in
package.json
. - Navigate to the directory where the repository was checked out:
cd g2nb
- Remove any residual build artifacts from the last time g2nb was built. This step is not necessary the first time the package is built.
rm dist/*.tar.gz
- Build the sdist artifacts.
python setup.py sdist bdist_wheel
- Upload the files by running:
twine upload -r pypitest dist/*.tar.gz; twine upload -r pypitest dist/*.whl
- If the upload fails go to https://testpypi.python.org/pypi and manually upload dist/g2nb-*.tar.gz.
- Test the deploy by uninstalling and reinstalling the package:
pip uninstall g2nb; pip install -i https://test.pypi.org/simple/ g2nb
- First deploy to test and ensure everything is working correctly (see above).
- Make sure that the version number is updated in
package.json
. - Navigate to the directory where the repository was checked out:
cd g2nb
- Remove any residual build artifacts from the last time g2nb was built. This step is not necessary the first time the package is built.
rm dist/*.tar.gz
- Build the sdist artifacts.
python setup.py sdist bdist_wheel
- Upload the files by running:
twine upload dist/*
- If the upload fails go to https://testpypi.python.org/pypi and manually upload dist/g2nb-*.tar.gz.
- Test the deploy by uninstalling and reinstalling the package:
pip uninstall g2nb; pip install g2nb
- Deploy to Production PyPi
- Navigate to Anaconda directory
cd /anaconda3
- Activate a clean environment.
conda activate clean
- Run the following, removing the existing directory if necessary:
conda skeleton pypi g2nb --version XXX
- Build the package:
conda build g2nb
- Converting this package to builds for other operating systems can be done as shown below. You will need to upload each built version using a separate upload command.
conda convert --platform all /anaconda3/conda-bld/osx-64/g2nb-XXX-py39_0.tar.bz2 -o conda-bld/
- Upload the newly built package:
anaconda upload /anaconda3/conda-bld/*/g2nb-XXX-py39_0.tar.bz2 -u g2nb
- Log into the Anaconda website to make sure everything is good.