-
Notifications
You must be signed in to change notification settings - Fork 33
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
QA: mypy, reformatting, and linting #69
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a77f73d
reformat, lint, mypy hints
woodruffw 2d6584d
pyproject: strong mypy config
woodruffw 0a30408
base: __future__
woodruffw 1d0a65f
cleanup docs, make consistent, use furo
woodruffw ecbe369
workflows: add release workflow
woodruffw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
name: release | ||
|
||
jobs: | ||
pypi: | ||
name: upload release to PyPI | ||
runs-on: ubuntu-latest | ||
environment: release | ||
permissions: | ||
# Used for OIDC publishing. | ||
# Used to sign the release's artifacts with sigstore-python. | ||
id-token: write | ||
|
||
# Used to attach signing artifacts to the published release. | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: deps | ||
run: python -m pip install -U setuptools build wheel | ||
|
||
- name: build | ||
run: python -m build | ||
|
||
- name: publish | ||
uses: pypa/[email protected] | ||
|
||
- name: sign | ||
uses: sigstore/[email protected] | ||
with: | ||
inputs: ./dist/*.tar.gz ./dist/*.whl | ||
release-signing-artifacts: true | ||
bundle-only: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
miketheman marked this conversation as resolved.
Show resolved
Hide resolved
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import pkgutil | ||
|
||
import pytest | ||
|
||
import stdlib_list | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 am not familiar with this step yet, but we sign after we've published to PyPI?
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.
Yep, for the moment -- PyPI doesn't support these signatures (yet) and the action writes to the same input directory, so doing it before the publishing step confuses the bejeezus out of the underlying
twine upload dist/*
invocation.Happy to refactor, though, if you'd prefer -- this is primarily laziness on my part (and it's what I do on other projects for the time being) 🙂
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.
No need for a refactor - I was curious as to the order of operations.
However, now that you've mentioned twine, it makes me inquire "why use flit at all" if the gh-action responsbile for the publish part is already using twine, and flit's primary purpose is to:
If we're not using it for its primary function, should we continue 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.
I've been using it for its PEP 517 build backend, out of muscle memory -- IIRC I chose it years ago because it had a mature 517 backend at a time when setuptools' own backend was still a work in progress.
(I actually had no idea it also supported publishing -- I thought its primary function was to be a packaging backend a la
setuptools
orhatch
.)IMO we should continue to use it unless we have a compelling security or performance reason not to -- switching to another 517 backend would involve a small amount of
pyproject.toml
churn for no discernible change in output 🙂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.
Nowadays that's probably its main function, but it predates PEP 517, and I wanted to be able to build packages and publish them with one command. And so far the upload functionality hasn't been all that much effort to maintain (although I'm just now working on better support for using tokens to do uploads).