Skip to content

Latest commit

 

History

History
80 lines (74 loc) · 2.47 KB

release_steps.md

File metadata and controls

80 lines (74 loc) · 2.47 KB

Release Steps

Releasing a new package involves uploading new data to Zenodo and releasing the new version of the package on Pypi.

Zenodo Upload Instructions

  1. Create tars if needed

    cd cropharvest/data
    tar -czf eo_data.tar.gz eo_data
    tar -czf features.tar.gz features
    cd ../..
  2. Set zenodo token

    export ZENODO_TOKEN=<your zenodo token>
  3. Go to the newest version of CropHarvest on Zenodo and click "New Version" and leave the page open (note the sizes of the files).

  4. 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
  5. 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
  6. Go back to the Zenodo page, refresh and verify that the new tar.gz size is updated.

  7. Click publish

Python Package Release

  1. Update the DATASET_VERSION_ID in cropharvest/config
  2. Update the package version in setup.py
  3. Set the package version as an environment variable:
    export PACKAGE_VERSION=0.2.0
  4. Build the package
    python -m build
  5. Install utility for publishing packages
    pip install twine
  6. Check the distribution
    twine check \
    dist/cropharvest-${PACKAGE_VERSION}.tar.gz \
    dist/cropharvest-${PACKAGE_VERSION}-py3-none-any.whl
  7. Uploads to test pypi
    twine upload --repository testpypi \
    dist/cropharvest-${PACKAGE_VERSION}.tar.gz \
    dist/cropharvest-${PACKAGE_VERSION}-py3-none-any.whl
  8. Test package from testpypi
    pip install -i https://test.pypi.org/simple/ cropharvest
    python
    >>> from cropharvest.datasets import CropHarvest
    >>> CropHarvest.create_benchmark_datasets("data")
  9. Uploads to real pypi
    twine upload \
    dist/cropharvest-${PACKAGE_VERSION}.tar.gz \
    dist/cropharvest-${PACKAGE_VERSION}-py3-none-any.whl

Tag and Github Release

  1. 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
  2. Create a release on Github.