Releasing a new package involves uploading new data to Zenodo and releasing the new version of the package on Pypi.
-
Create tars if needed
cd cropharvest/data tar -czf eo_data.tar.gz eo_data tar -czf features.tar.gz features cd ../..
-
Set zenodo token
export ZENODO_TOKEN=<your zenodo token>
-
Go to the newest version of CropHarvest on Zenodo and click "New Version" and leave the page open (note the sizes of the files).
-
Copy the deposit id from URL (after /deposit/) ie. https://zenodo.org/deposit/5567762 and set it as an environment variable:
export DEPOSITION_ID=5567762
-
Upload all or one of the files
./zenodo_upload.sh $DEPOSITION_ID /home/ubuntu/cropharvest/data/eo_data.tar.gz ./zenodo_upload.sh $DEPOSITION_ID /home/ubuntu/cropharvest/data/features.tar.gz ./zenodo_upload.sh $DEPOSITION_ID /home/ubuntu/cropharvest/data/labels.geojson
-
Go back to the Zenodo page, refresh and verify that the new tar.gz size is updated.
-
Click publish
- Update the
DATASET_VERSION_ID
in cropharvest/config - Update the package version in setup.py
- Set the package version as an environment variable:
export PACKAGE_VERSION=0.2.0
- Build the package
python -m build
- Install utility for publishing packages
pip install twine
- Check the distribution
twine check \ dist/cropharvest-${PACKAGE_VERSION}.tar.gz \ dist/cropharvest-${PACKAGE_VERSION}-py3-none-any.whl
- Uploads to test pypi
twine upload --repository testpypi \ dist/cropharvest-${PACKAGE_VERSION}.tar.gz \ dist/cropharvest-${PACKAGE_VERSION}-py3-none-any.whl
- Test package from testpypi
pip install -i https://test.pypi.org/simple/ cropharvest python >>> from cropharvest.datasets import CropHarvest >>> CropHarvest.create_benchmark_datasets("data")
- Uploads to real pypi
twine upload \ dist/cropharvest-${PACKAGE_VERSION}.tar.gz \ dist/cropharvest-${PACKAGE_VERSION}-py3-none-any.whl
-
After merging the PR with the above changes to the package, tag the release with the new version number
git tag v${PACKAGE_VERSION} git push --tags
-
Create a release on Github.