PythonCDT
PythonCDT copied to clipboard
Distribute PythonCDT in PyPI
Hi @artem-ogre,
Thank you for the great work on the CDT library and bindings! I want to publish on PyPI my project https://gitlab.windenergy.dtu.dk/TOPFARM/OptiWindNet/, which uses PythonCDT. It happens that PyPI only allows projects whose requirements are all published there too.
This PR goes a long way towards publishing PythonCDT on PyPI, using Github Actions and cibuildwheel. I tested it by creating a PythonCDT project in TestPyPI: https://test.pypi.org/project/PythonCDT/.
You would need to create the project in production PyPI and enable your github repo and the workflow .yml file as a Trusted Publisher. Minor changes in buildpublish.yml are required. I can walk you through it if you are inclined to merge this.
Hi, this is great. I always wanted to publish a pip package but never got to it. I will take a look this/next week. Thanks for the effort, Mauricio!
I updated the workflow to point to production PyPI and to be triggered only manually or when a version tag is pushed ('v[0-9]+.[0-9]+.[0-9]+').
It is possible to have the build system fetch the tag for setting project.version's value instead of using a hard-coded one in pyproject.toml, but that is not pursued in this PR.
The only thing missing is setting up the project in PyPI:
- login to your account
- open "Your projects" -> "Publishing"
- in "Add a new pending publisher" -> "GitHub":
- PyPI Project Name: PythonCDT
- Owner: artem-ogre
- Repository name: PythonCDT
- Workflow name: buildpublish.yml
- Environment name: pypi
- The "Add" button concludes the process.
After you push a new version tag to any branch, e.g. 'v0.0.1', the action will do its thing and the project will be published and ready for pip install PythonCDT.
Hi, quick heads up: I will try to look at this PR this week.
Meanwhile, I have made my fork available as condeltri on PyPI. I will gladly revert back to PythonCDT when the wheels are published.
pip install condeltri
import condeltri as cdt
FYI:
PythonCDT is now available as condeltri both in PyPI and conda-forge:
pip install condeltriconda install -c conda-forge condeltri