Skip to content
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

chore: add packaging without publish to CI #692

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bringhurst
Copy link
Contributor

Why is this needed?

CI currently does not exercise packaging for pypi.

Proposed Changes

  • Add a github actions workflow to test packaging (except for a pypi publish)

Does this PR introduce any breaking change?

No.

@bringhurst
Copy link
Contributor Author

At the moment, this appears to be failing on unrelated issues. See #691

@jeffwidman
Copy link
Member

I merged #691 (thank you for that!), so this is ready to be rebased / finish out...

@bringhurst bringhurst marked this pull request as ready for review January 22, 2023 18:47
@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.08 ⚠️

Comparison is base (33c348b) 94.78% compared to head (9cf8322) 94.71%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #692      +/-   ##
==========================================
- Coverage   94.78%   94.71%   -0.08%     
==========================================
  Files          57       57              
  Lines        8339     8339              
==========================================
- Hits         7904     7898       -6     
- Misses        435      441       +6     

see 5 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bringhurst
Copy link
Contributor Author

The force push is to get rid of the merge commit.

Copy link
Member

@StephenSorriaux StephenSorriaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Copy link
Member

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this looks fine, but it's also a heavy copy-paste of https://github.com/python-zk/kazoo/blob/1c0c4535c9c82092d94ce36fb7a0be4c43483bb4/.github/workflows/release.yml

The problem will be that if changes happen here or there, they may not be reflected to the other copy.

Could we instead chain the actions such that the steps are DRY'd up... one workflow does the build, the other workflow does the publish, and can trigger the build as part of it's initial steps?

I'm not an actions expert, but a quick google makes it look like this might be possible?
https://docs.github.com/en/actions/using-workflows/reusing-workflows

- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should pin this not here but instead using .python-version file so that other tooling can use it?

https://github.com/actions/setup-python#basic-usage

Also, now that 3.11 dropped, we should probably use that rather than 3.10?

@StephenSorriaux
Copy link
Member

@jeffwidman Re-thinking about this, it seems we should actually publish "dev" version to the TestPyPI repository (using a version name like X.Y.Z.dev+{short_commit_id} or anything else if someone has a better idea) so that every step are tested every time. It would require a little more changes like adding a new secret for the repo.

Concerning Python 3.11 vs Python 3.10, I agree this is something that we can change once we add a pipeline for the 3.11 version of Python (we "only" have testing for up to 3.10 right now).

On my side, even if it is not perfect, I am fine going forward with the current state of the PR and doing the changes I mentioned above in another PR unless, of course, @bringhurst is interested in doing it on his side.

@bringhurst
Copy link
Contributor Author

I think it's probably ok to commit this as-is. It's not perfect, but it gets the job done.

it seems we should actually publish "dev" version to the TestPyPI repository

I was looking at the cookiecutter-hypermodern-python project to to get ideas on how to do that, but I haven't had time to really dig in. They seem to have a very nice setup.

https://github.com/cjolowicz/cookiecutter-hypermodern-python/tree/main/{{cookiecutter.project_name}}/.github/workflows

@jeffwidman
Copy link
Member

jeffwidman commented Jan 31, 2023

Totally fine to punt on publishing to TestPyPI and 3.11, but I'd really rather we didn't introduce more copy/paste when we don't need to... that just increases risk of divergence in the build steps down the line resulting in fake confidence that our packaging is correct.

AFAICT, it should be straightforward to wire up actions such that we've got one workflow that handles all builds, and then a second workflow takes the output from first and actually publishes it...

bringhurst and others added 2 commits March 10, 2023 13:52
Upload to TestPyPI after some sucessful tests
Only keep 2 GA workflows, with all the funny things it means
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.

4 participants