-
Notifications
You must be signed in to change notification settings - Fork 7
Install typing_extensions
if needed
#98
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
Conversation
I copied multiple improvements from `chiron-utils`'s GitHub Actions setup to this file: - Enable running on pushes, which makes testing CI changes easier - Remove all GitHub API permissions for security - Cancel running CI job if a change is pushed - Update used actions to non-deprecated versions - Factor out Python version for easier reuse - Use stricter configuration for shell to catch more bugs Improvements copied from https://github.com/ALLAN-DIP/chiron-utils/blob/3a795038e73a7099dd9012c2480df7d35f74e05e/.github/workflows/checks.yaml
CI was broken because `ubuntu-latest` changed from Ubuntu 22.04 to 24.04, and the latter doesn't have Python 3.7. I pinned to using Ubuntu 22.04 so we can continue using Python 3.7. In addition, I pinned to the specific Python 3.7 patch release to limit possible breakage.
This commit contains multiple related changes: - Update `dev` dependencies as much as possible - The pinned versions did not work with Python 3.11, but using the latest versions does not work with Python 3.7. The new versions work for both Python 3.7 and 3.11. - Pin `black` and `isort` versions - Unlike the other `dev` dependencies, which are specified with `==`, these two dependencies were specified with `>=`. I pinned these to specific versions to match the other dependencies and limit breakage. - Update `pip` in `test-pr.yml` - The version of `pip` shipped in GitHub Actions shows warnings that are fixed by upgrading to the latest supported version.
The `typing_extensions` module was imported but not listed as a requirement, so importing `daidepp` failed if `typing_extensions` wasn't installed for another reason. I have added it as an explicit requirement and only use it if `Literal` or `get_args` cannot be imported directly from the `typing` module.
9016ce6
to
8636323
Compare
It turns out that the |
@mjspeck, do you want to review this PR, or should I just go ahead and merge it? |
@aphedges reviewing now |
Thanks! I've made the requested changes. |
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.
LGTM. Merge when ready.
I discovered a bug where importing from
typing_extensions
would fail because it's not listed as a dependency. Until now, I've always hadtyping_extensions
installed as a dependency of another package, so it took a while to encounter this particular bug.As part of this PR, I fixed the test setup so I could verify my changes don't break anything.