-
Notifications
You must be signed in to change notification settings - Fork 28
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
Modernise python package management: #166
Conversation
yakutovicha
commented
Nov 21, 2022
- Use flit instead of setuptools
- Replace setup.json & setup.py with pyproject.toml
- Update publish workflow
- Remove MANIFEST.in
- Use flit instead of setuptools - Replace setup.json & setup.py with pyproject.toml - Update publish workflow - Remove MANIFEST.in
.github/workflows/publish.yml
Outdated
- uses: softprops/[email protected] | ||
name: Create release | ||
with: | ||
generate_release_notes: true |
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.
How does this work? Is this supposed to create the tag automatically? If so, this will never get called though, because the workflow is only run when a tag is pushed.
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.
I typically use bumpver
to create a tag automatically. I will add the tool in the next PR together with a section in the README explaining how to use it.
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.
Ok, so the tag will have been created locally, and then the action is just responsible for creating a release entry on Github. However, did I understand correctly that this also pushes the build to PyPI? If so, then you don't want to have flit publish
in the next step. Because then you are pushing to PyPI twice.
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.
However, did I understand correctly that this also pushes the build to PyPI?
No, publishing on PyPi is typically done as the next step, see for example https://github.com/nanotech-empa/aiida-gaussian/blob/master/.github/workflows/publish.yml
"License :: OSI Approved :: MIT License", | ||
"Operating System :: POSIX :: Linux", | ||
"Operating System :: MacOS :: MacOS X", | ||
"Programming Language :: Python :: 3", |
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.
Good practice to indicate explicitly which Python 3 versions are supported.
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.
Let's leave it for the next PR if that is fine.
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.
] | ||
|
||
[project.entry-points."aiida.calculations"] | ||
cp2k = "aiida_cp2k.calculations:Cp2kCalculation" |
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.
Does the identifier need to be quoted? That's what I have in my pyproject.toml's but not sure if it is required
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.
I don't know 🤷
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.
Mainly looks good to me thanks, just a little change for the publish CI
@sphuber I just checked the https://github.com/softprops/action-gh-release action, and it doesn't provide build-in However, as @chrisjsewell suggested, |
Thanks for the links @yakutovicha . I might understand it incorrectly, but why are you calling the release action before the |
I placed - name: Build source distribution
run: flit build right before the gh-release action. It will create the [UPDATE] |
I see, maybe I was still being shown some old diff from the cache. Then it makes sense. Yes, moving the release action after the |
One final difference between this workflow and what we use in other packages in |
This part is fully automated with the bumpver, so I don't think this is needed.
I also don't think this is needed. With bumpver, the releases are always done through the automatically generated commit (here is an example). And the only change is the version number. Overall, I prefer simplicity when the advantage of adding more stuff is not super obvious. |
Yeah sure, I see that for your approach this makes perfect sense. Just thought I'd mention it for more context. |