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

Expand 'typing' reqs to all python versions #883

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

sirosen
Copy link
Member

@sirosen sirosen commented Oct 20, 2023

We were building our pinned requirements data for typing only under the python version used for mypy linting in CI: Python 3.11.

This makes mypy-linting of code non-functional on lower interpreter versions. While some SDK developers are using pyenv or a similar solution to install multiple pythons in their home dirs, so we didn't notice the constraint, this is not meant to be a requirement for all contributors.

To make tox r -e mypy work on all pythons, the tox target for "freezedeps" has been modified to generate the extra requirements, and the freezedeps job has been run.

The fix was verified with

tox r -e mypy --discover $(which python3.7)
tox r -e mypy --discover $(which python3.9)

It is possible that this will cause some drift and issues, especially around our lower-bound for python version (e.g. latest mypy drops support for a version we use), but at present such issues are speculative. We can deal with additional tightening of bounds and adjustments to CI to run some of these versions in the future.


NB: This was found by someone trying to contribute a change on py3.9 specifically, and running into issues with make lint.
The fact that it works there is therefore one of the important litmus tests for this fix.


📚 Documentation preview 📚: https://globus-sdk-python--883.org.readthedocs.build/en/883/

We were building our pinned requirements data for typing only
under the python version used for `mypy` linting in CI: Python 3.11.

This makes mypy-linting of code non-functional on lower interpreter
versions. While some SDK developers are using pyenv or a similar
solution to install multiple pythons in their home dirs, so we didn't
notice the constraint, this is not meant to be a requirement for all
contributors.

To make `tox r -e mypy` work on all pythons, the `tox` target for
"freezedeps" has been modified to generate the extra requirements,
and the freezedeps job has been run.

The fix was verified with

    tox r -e mypy --discover $(which python3.7)
    tox r -e mypy --discover $(which python3.9)

It is possible that this will cause some drift and issues, especially
around our lower-bound for python version (e.g. latest `mypy` drops
support for a version we use), but at present such issues are
speculative. We can deal with additional tightening of bounds and
adjustments to CI to run some of these versions in the future.
@sirosen sirosen added the no-news-is-good-news This change does not require a news file label Oct 20, 2023
@sirosen sirosen merged commit a5cc9c2 into globus:main Oct 20, 2023
16 checks passed
@sirosen sirosen deleted the expand-typing-requirements-versions branch October 20, 2023 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-news-is-good-news This change does not require a news file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants