-
Notifications
You must be signed in to change notification settings - Fork 75
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
Automate publishing Python package on PyPI #1580
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
I think snapcraft 8 lets us get rid of the setup.py
file, but we'll find out when I run the CI
The
From a Python (packaging) point of view the use of |
The ModuleNotFoundError: No module named 'craft_cli' I can't see that the Can anyone see what is the problem? |
Okay, looks like there is a problem with the
The problem is that that with the new setup the returned version string also contains the package name. I'll try to find a solution. Suggestions welcome! EDIT: Stupid me! A closing |
The CI jobs all pass now (on my personal fork). I rebased the branch, and I made separate commits to document the specific changes that were necessary to work around a few build issues. 📜 Hope that looks good enough now for the PR to be merged. 🤞 |
I have signed the CLA now. I use a different email address on Launchpad than on GitHub, that's why the check probably didn't find my Launchpad account. |
The cla-check still fails. I checked my Launchpad account again; looks like there was another account with the email address I use on GitHub. I merged the accounts on Launchpad now. |
I received an email notification this morning saying, I was added as a member of Canonical Contributor Agreement. I assume, the cla-check job would now succeed. |
@lengau Let me know what needs to be changed, if anything, so that I can help getting this merged. Thank you! 👍 |
I rebased the branch of this PR again to keep it up-to-date with the If the changes look okay, I'd be happy to see this merged. Otherwise, please let me know what needs to be changed. |
Is there a reason why this PR isn't considered for merging? Any arguments against the changes? Anything that needs to be updated? It would be very helpful if the recent release(s) of charmcraft were published also on PyPI. For example, I'm currently blocked by the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please re-add setup.py, and then I'm happy with this :-)
I've created #1635 for seeing if we can remove setup.py at a later date so we don't block this PR with it
ping 🔔 @lengau Alex, I think this PR is now ready for merging. Can you (or some other maintainer) take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Pull Request is not mergeable
Thanks for merging! 💯 Now don't forget to add the secrets to the project settings to make automatic publishing succeed! 🤖 |
Adds two Tox environments that help with publishing the Python package on PyPI.
tox -e package
can be used for linting to help detect packaging issues.tox -e package -- upload
allows to publish the package on PyPI.tox -e ensure_version_matches $GIT_TAG
verifies that the package version matches the semantic Git tag on the current commit. This is used by the GHA configuration to prevent a mismatch of tags and the version of the published package.To make publishing work, you need to add the 2 secrets
PYPI_USERNAME
andPYPI_PASSWORD
to Settings ➜ Secrets ➜ Actions with the PyPI access token for the project, as described in the Python packaging user guide.Related
setup.py
deprecated? – The use as a command line tool is deprecated