-
Notifications
You must be signed in to change notification settings - Fork 12
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
Remove Python version floor #63
Conversation
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.
Seems reasonable with some comments.
@@ -30,7 +30,6 @@ authors = [ | |||
] | |||
license = "{{ license }}" | |||
readme = {"file" = "README.md", "content-type" = "text/markdown"} | |||
requires-python = ">=3.10" |
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.
I think this is ok to remove.
Idk how hatch handles it, but if I remove version floors in pdm then it goes hogwild trying to find versions that also dont have version floors when resolving the environment. I see we have encountered that with myst already. I think it relates to conversations in other issues - is this supposed to be "best practices python template" or "arbitrary flexible python template?" I think usually best practices would say that you dont want to allow for a version that you dont test for/arent sure if it works. Bc you're right, we don't know the resulting package will be 3.10 and up. Dep resolution is my only concern, but if hatch is fine with it then I am too. Like what happens when we try to add scipy or something to the deps, does it get resolved as some super ancient version? Edit: I guess secondary concern is if this gets new programmers that are using this in a difficult spot thats hard to understand. I'll give it a whirl and see what it does when I start adding deps |
@sneakers-the-rat I haven't used PDM, but I'm a bit surprised if having no |
@@ -241,6 +234,7 @@ extra-dependencies = [ | |||
"mkdocs-awesome-pages-plugin ~=2.9", | |||
] | |||
{%- elif documentation == "sphinx" %} | |||
python = "3.10" |
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.
This can also be a list, e.g. ["3.10", "3.11", "3.12"]
, but I don't think we want to matrix docs builds. And hatch doesn't seem to support open ended version ranges ">=3.10"
:(
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.
I think eventually we'll want to start taking all these consts out of the templates themselves and into .yaml files that we load into the template contexts, so this is totally fine to me and in the future we can give ourselves a handle if we want to have better control over the python version in the generated project.
tested this out, no problem, hatch doesn't resolve a dep graph so requires-python looks like it has no effect except on downstream packages |
I get that there is no need for being restrictive on the lower version, however, I would generally like to encourage new projects to start with a relatively new version. No need to start with old syntax if there is no good reason for it. |
It's not always about not using old (deprecated) syntax, it's about not using new syntax. The whole Fall Festival the only syntax used was def, if, else, try, except, import. I am for encouraging newer interpreters, but setting this floor makes it harder to use without also teaching an interpreter upgrade story. |
If you're not generating lockfiles, I think that the floor is only necessary when you want to signal that a version is known to be incompatible with a python version so when it is installed pip or other installers will iterate through prior versions until it finds one with a requires-python that includes the currently running python version. the only time that would cause a problem is if the package used language features unsupported by the installing version, or packages that have no version that's compatible with the installing version. it seems like having a floor and not having a floor both have potential gotchas for new programmers: with the floor they might run into a problem where pip is telling them they can't install the package, and without the floor they might run into a problem eventually where someone tries to use their package with an old python and they, eg. have used the Having the floor would cause the problem sooner, and not having it would cause it later in a way that might cause some harder-to-handle but less likely problems like having to issue postrelease patches for all the versions that didn't have a floor until the last version that was compatible with the old python. To me it's a wash which is preferable from a principle of least surprise POV, though I see where @ucodery is coming from w/ not adding a constraint until it's known to be needed. edit: fwiw, the oldest python version hatch is able to use seems to be 3.7, and the base "import the package" test seems to work in 3.7, though that's not really saying much :) edit2: actually now that i'm thinking of this, the ruff rule being |
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 are good arguments for removing the lower bound.
Thanks all. @lwasser I don't think I have merge permissions here, so I will leave it for whomever does. |
91b7b91
to
ad29ca8
Compare
i click da boton |
Fixes #62