budai4medtech / xfetus

xfetus -- A library for ultrasound fetal imaging synthesis using techniques from GANs, transformers, and diffusion models.
6 stars 1 forks source link

Workflow to build python package #4

Closed mxochicale closed 1 year ago

mxochicale commented 1 year ago
mxochicale commented 1 year ago

Switching to main branch and creating tag

git checkout main
git pull origin main
git tag -a v0.0.0 -m 'First pre-alpha release'
git push origin v0.0.0
mxochicale commented 1 year ago
  1. Create a PyPI API token
  2. Add the PyPI API token to the GitHub project’s secrets https://github.com/mxochicale/medisynth/settings/secrets/actions >

Reference https://www.seanh.cc/2022/05/21/publishing-python-packages-from-github-actions/

mxochicale commented 1 year ago

(1) Delete all local tags and get the list of remote tags: (2) Remove all remote tags (3) Clean up local tags

git tag -l | xargs git tag -d
git fetch
git tag -l | xargs -n 1 git push --delete origin
git tag -l | xargs git tag -d
mxochicale commented 1 year ago

then do it again

git checkout main
git pull origin main
git tag -a v0.0.0 -m 'First pre-alpha release'
git push origin v0.0.0
mxochicale commented 1 year ago
python setup.py bdist_wheel
pip install -e .
python setup.py sdist
python setup.py bdist_wheel sdist
twine upload dist/*

from > https://www.youtube.com/watch?v=7AF3HvKz070

:tada:

(medisynVE) mxochicale@precision-5570:~/repositories/mxochicale/medisynth$ twine upload dist/*
Uploading distributions to https://upload.pypi.org/legacy/
Enter your username: mxochicale
Enter your password: 
Uploading medisynth-0.0.0-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.1/6.1 kB • 00:00 • ?
Uploading medisynth-0.0.0.tar.gz
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.5/7.5 kB • 00:00 • ?

View at:
https://pypi.org/project/medisynth/0.0.0/

https://pypi.org/project/medisynth/

mxochicale commented 1 year ago

Close this one in favour of #22

mxochicale commented 1 year ago

Manual building debugging

python -m build
pip install -e .
twine check dist/*

upload

twine upload dist/*

https://pypi.org/project/medisynth/0.0.3/ https://pypi.org/project/medisynth/0.0.4/


todo: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/