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

Reusable workflows for packaging and Poetry-CI #1

Merged
merged 3 commits into from
Feb 8, 2022
Merged

Conversation

DMRobertson
Copy link
Contributor

@DMRobertson DMRobertson commented Feb 8, 2022

This introduces two reusable workflows:

  • one using pypa build to build wheels and sdists, then run twine check on the results.
  • one using setup-python-poetry to run CI checks for projects using poetry.

In the future I would also like to include an "automatically push releases to PyPI" action here.

To see this in action, see this CI run on this Sydent PR.

@DMRobertson DMRobertson force-pushed the dmr/poetry-ci branch 2 times, most recently from d4deca6 to b46b25b Compare February 8, 2022 11:31
@DMRobertson DMRobertson changed the title WIP Reusable workflows for packaging and Poetry-CI Feb 8, 2022
@DMRobertson DMRobertson marked this pull request as ready for review February 8, 2022 12:13
@DMRobertson DMRobertson requested a review from a team February 8, 2022 12:37
@reivilibre reivilibre self-assigned this Feb 8, 2022
Copy link
Contributor

@reivilibre reivilibre left a comment

Choose a reason for hiding this comment

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

Looks good to me; just some optional tweaks, really (I think having the tool name there is helpful for recognition when you haven't had enough coffee to remember what 'semantic checks' are, for example) — though I now realise these are probably not the top-level job names anyway, so probably doesn't matter.

Comment on lines +35 to +38
- uses: actions/upload-artifact@v2
with:
name: Sdist
path: dist/*.tar.gz
Copy link
Contributor

Choose a reason for hiding this comment

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

are we going to use this pipeline for Synapse eventually? Do we want this automatic upload for Synapse (it would change the current procedure).
I'm actually fairly happy to have it done automatically, but I guess it's something that could be checked with the team.

Depending on the answer, we might want this to be gated behind a condition / input flag.

Edit: this also applies to the wheel

Edit 2: Wait — is this uploading to GitHub or to PyPI? I now think this is GitHub, right? Installing twine beforehand confused me; if it's not just me being stupid, would it be OK to add a comment saying that this uploads to GitHub... 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just to github. Twine is there as a "check we could upload this wheel to PyPI if we wanted to".

Copy link
Contributor Author

@DMRobertson DMRobertson Feb 8, 2022

Choose a reason for hiding this comment

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

How does d38fe95 suit you?

.github/workflows/python-poetry-ci.yml Outdated Show resolved Hide resolved
.github/workflows/python-poetry-ci.yml Outdated Show resolved Hide resolved
.github/workflows/python-poetry-ci.yml Outdated Show resolved Hide resolved
David Robertson and others added 2 commits February 8, 2022 15:52
Co-authored-by: reivilibre <olivier@librepush.net>
Not just for Christmas.
Copy link
Contributor

@reivilibre reivilibre left a comment

Choose a reason for hiding this comment

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

parfaît!

@DMRobertson DMRobertson merged commit b66c739 into main Feb 8, 2022
Comment on lines +12 to +25
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Poetry
uses: matrix-org/setup-python-poetry@v1

- name: Import order (isort)
run: poetry run isort --check --diff .

- name: Code style (black)
run: poetry run black --check .

- name: Semantic checks (flake8)
run: poetry run flake8
Copy link

Choose a reason for hiding this comment

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

Not to bikeshed (don't block on this) but I've found GitHub renders steps quite reasonably when names are omitted... wonder if we'd be better / equally served by pervasively doing:

Suggested change
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Poetry
uses: matrix-org/setup-python-poetry@v1
- name: Import order (isort)
run: poetry run isort --check --diff .
- name: Code style (black)
run: poetry run black --check .
- name: Semantic checks (flake8)
run: poetry run flake8
- uses: actions/checkout@v2
- uses: matrix-org/setup-python-poetry@v1
- run: poetry run isort --check --diff .
- run: poetry run black --check .
- run: poetry run flake8

@DMRobertson DMRobertson deleted the dmr/poetry-ci branch August 1, 2022 10:12
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.

3 participants