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

Type-checking maintenance updates #2016

Merged
merged 3 commits into from
Feb 10, 2025
Merged

Type-checking maintenance updates #2016

merged 3 commits into from
Feb 10, 2025

Conversation

mattwthompson
Copy link
Member

@mattwthompson mattwthompson commented Feb 7, 2025

Resolves #2014

Copy link

codecov bot commented Feb 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.08%. Comparing base (c2ad537) to head (a70155e).
Report is 1 commits behind head on main.

Additional details and impacted files

@@ -22,12 +22,11 @@ dependencies:
- openff-interchange-base =0.4
- openff-nagl-base >=0.4.0
- openff-nagl-models >=0.3.0
- typing_extensions
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a runtime requirement, not a "only when we run the type-checker" requirement. It's brought in by several other packages so it's not likely to be missed at runtime, but I'm listing it here according to the philosophy of listing all (non-optional) runtime requirements in this sections

and (chain.id == last_chain.id)
and (chain.id == last_chain.id) # type: ignore[union-attr]
Copy link
Member Author

Choose a reason for hiding this comment

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

This appears to be the change that causes the breakage associated with #2014

@@ -76,6 +76,7 @@ exclude_lines = [
]

[tool.mypy]
python_version=3.12
Copy link
Member Author

@mattwthompson mattwthompson Feb 7, 2025

Choose a reason for hiding this comment

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

If I'm reading things correctly, this setting allows for Mypy to "use" a particular version of Python no matter what is actually installed in the environment. I think this is a better setting to use than having the conditional live in the CI workflow because this (should!) ensure that all developers get a similar Mypy experience. I've been bit by something like this before

https://mypy.readthedocs.io/en/stable/config_file.html#confval-python_version

@mattwthompson mattwthompson marked this pull request as ready for review February 7, 2025 21:39
@j-wags j-wags self-assigned this Feb 10, 2025
Copy link
Member

@j-wags j-wags left a comment

Choose a reason for hiding this comment

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

Thanks @mattwthompson!

@@ -50,13 +49,3 @@ dependencies:
- nbval
# No idea why this is necessary, see https://github.com/openforcefield/openff-toolkit/pull/1821
- nomkl
- mypy
Copy link
Member

Choose a reason for hiding this comment

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

(not blocking) just double checking that this removal is intended

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep - it's not run when this environment file is used

@mattwthompson mattwthompson merged commit 14d16ae into main Feb 10, 2025
13 checks passed
@mattwthompson mattwthompson deleted the mypy-1.15.0 branch February 10, 2025 20:41
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.

Mypy 1.15.0 changes
2 participants