https://github.com/GeoscienceAustralia/PyRate
Raw File
Tip revision: 3579612cbfec20e43cb2c7b8311c50851ae4fc4a authored by S M T Chua on 25 February 2022, 04:08:37 UTC
Merge pull request #380 from GeoscienceAustralia/develop
Tip revision: 3579612
developer_hints.txt
# publish package to PyPI

follow the steps at: https://medium.com/@joel.barmettler/how-to-upload-your-python-package-to-pypi-65edc5fe9c56

Summary:

1) create new 'release' in Github. this will tag a commit hash.
2) copy link to tar.gz Source Code from github release, add to download_url in setup.py
3) update version number in setup.py (to match the Github release)
4) `python3 setup.py sdist bdist_wheel` - prepare package
5) `python3 -m twine upload --repository testpypi dist/*` - test upload that does not affect real PyPI
5) `python3 -m twine upload dist/*` - upload package to PyPI

check out here also: https://packaging.python.org/tutorials/packaging-projects/

---------------------------------------------
# Clone Github repo
cd ~
git clone git@github.com:GeoscienceAustralia/PyRate.git
or
git clone https://github.com/GeoscienceAustralia/PyRate.git 

# build PyRate package
cd ~/PyRate
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -r requirements-test.txt
python3 setup.py install

# Run workflow, one step at a time
pyrate conv2tif -f input_parameters.conf
pyrate prepifg -f input_parameters.conf
pyrate correct -f input_parameters.conf
pyrate timeseries -f input_parameters.conf
pyrate stack -f input_parameters.conf
pyrate merge -f input_parameters.conf

# or run all workflow steps in order
pyrate workflow -f input_parameters.conf

# alternatively run commands via python, e.g.
python3 pyrate/main.py workflow -f input_parameters.conf

---------------------------------------
# Build Sphinx docs
pip install -r requirements-dev.txt
cd /PyRate/docs && make html

---------------------------------------
# Run unit tests, avoiding those marked as "slow"
pip install -r requirements-test.txt
cd /PyRate
# file permission change required for a test:
chmod 444 tests/test_data/small_test/tif/geo_070709-070813_unw.tif
pytest tests/ -m "not slow"

---------------------------------------
NCI Gadi supercomputer

ssh <username>@gadi.nci.org.au

rm -rf ~/PyRate
rm -rf ~/PyRateVenv

git clone git@github.com:GeoscienceAustralia/PyRate.git
source PyRate/scripts/nci_load_modules.sh
python3 -m venv ~/PyRateVenv
source ~/PyRateVenv/bin/activate
cd ~/PyRate
pip install -r requirements-dev.txt
pip install -r requirements-test.txt
pip install -r requirements.txt

python3 setup.py install

# run with debug messages
pyrate -v DEBUG workflow -f input_parameters.conf

# run using MPI
mpirun -n 6 pyrate workflow -f input_parameters.conf
back to top