Skip to content

Update pyproject.toml validation #4344

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

Merged
merged 5 commits into from
May 9, 2024

Conversation

abravalheri
Copy link
Contributor

Summary of changes

  • Update dependency version for validate-pyproject
  • Update automatically generated code
  • Add yet another exception in mypy.ini (¿shouldn't *._validate_pyproject.* already be excluded?)

Closes #4341

Pull Request Checklist

@abravalheri abravalheri force-pushed the update-validate-pyproject branch from d2b092d to 0576d60 Compare May 7, 2024 18:47
@abravalheri abravalheri marked this pull request as ready for review May 7, 2024 18:49
Comment on lines +13 to +19
if typing.TYPE_CHECKING:
import sys

if sys.version_info < (3, 11):
from typing_extensions import Self
else:
from typing import Self
Copy link
Contributor

@Avasam Avasam May 7, 2024

Choose a reason for hiding this comment

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

To be fixed upstream, but this double check is redundant!

Suggested change
if typing.TYPE_CHECKING:
import sys
if sys.version_info < (3, 11):
from typing_extensions import Self
else:
from typing import Self
if typing.TYPE_CHECKING:
from typing_extensions import Self

Copy link
Contributor Author

@abravalheri abravalheri May 9, 2024

Choose a reason for hiding this comment

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

Not sure if I introduced this one myself, but I think I get why it is there... Probably the intention is this code to allow automatic update (using either ruff or pyupgrade) once Python 3.11 comes and remove typing_extensions when viable?

I agree that is not needed, but I would not worry too much about it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah it's minor. Type-checkers will still understand it and typing_extensions is still not used at runtime.
If it's just an artefact of code generation logic it doesn't hurt, just redundant.

According to review suggestion

Co-authored-by: Avasam <samuel.06@hotmail.com>
Copy link
Contributor Author

@abravalheri abravalheri left a comment

Choose a reason for hiding this comment

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

Thank you very much @Avasam for having a look. Let's see how the CI reacts to the changes, sometimes I have the impression that it is a cat/mouse game with mypy...

Comment on lines +13 to +19
if typing.TYPE_CHECKING:
import sys

if sys.version_info < (3, 11):
from typing_extensions import Self
else:
from typing import Self
Copy link
Contributor Author

@abravalheri abravalheri May 9, 2024

Choose a reason for hiding this comment

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

Not sure if I introduced this one myself, but I think I get why it is there... Probably the intention is this code to allow automatic update (using either ruff or pyupgrade) once Python 3.11 comes and remove typing_extensions when viable?

I agree that is not needed, but I would not worry too much about it.

@abravalheri abravalheri merged commit 6d4902a into pypa:main May 9, 2024
20 of 22 checks passed
@abravalheri abravalheri deleted the update-validate-pyproject branch May 9, 2024 15:36
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.

[BUG] optional dependency identifiers in a dynamic section cannot contain hyphens
2 participants