-
Notifications
You must be signed in to change notification settings - Fork 163
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
generate StrEnum for python 3.11+ #4090
Conversation
name=self._get_class_name(), | ||
extends=[ | ||
# If using python 3.11+, generate classes with StrEnum instead of (str, Enum) | ||
if sys.version_info >= (3, 11): |
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.
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.
why? that already sets up the pyproject.toml -- does that not determine the env that the generator runs in? Happy to plumb it but it doesn't quite feel right to me since that config is a version string for a solver, not true version info
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.
ugh I see that's just for the generated project... will this even work if the generator is running via 3.9? I'm not sure how the reference imports work (if it's just straight up string concat or not) but StrEnum isn't in the stdlib until 3.11 so if it relies on the presence of the thing we're kinda SOL
8982460
to
8905822
Compare
ebb3f1d
to
5a6bfc6
Compare
5a6bfc6
to
6b40950
Compare
94b1877
to
005bf26
Compare
4eb9f86
to
9180bd7
Compare
(str, Enum) mixins have undergone a breaking change in python 3.11 - see python/cpython#100458
This PR adds poetry core to the dependencies to allow for version constraint parsing, and lists an explicit set of python minor versions to allow.
The target version is the lowest version that satisfies the constraint.
Also I don't have a good way to generate the lockfiles with poetry 1.7, so if somebody could regenerate them for me that'd be appreciated