Skip to content

Distribute PythonCDT in PyPI #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

mdealencar
Copy link

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.

@artem-ogre
Copy link
Owner

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!

@mdealencar
Copy link
Author

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.

@artem-ogre
Copy link
Owner

artem-ogre commented Apr 6, 2025

Hi, quick heads up: I will try to look at this PR this week.

@mdealencar
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants