Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Update Windows download popup and list for 3.9. (#1611) #1655
Conversation
{% if os.slug == 'windows' and r.name >= 'Python 3.5' %} | ||
<p><strong>Note that {{ r.name }} <em>cannot</em> be used on Windows XP or earlier.</strong></p> | ||
{% if os.slug == 'windows' %} | ||
{% if r.name >= 'Python 3.9' %} |
ned-deily
Oct 5, 2020
Author
Member
Probably! But that's just what the existing code does. I was going to open a separate issue to go through the whole repo to fix all similar version checks prior to 3.10.0 a year from now. Do you have any idea if there are other such version checks?
hugovk
Oct 5, 2020
Contributor
Yep!
>>> 'Python 3.10' >= 'Python 3.9'
False
A quick grep doesn't show any more of this pattern:
$ git grep -E "[23]\..* [<>][=]? "
$ git grep -E " [<>][=]? .*[23]\."
static/sass/_layout.scss: & > .column { width: 33.3333%; }
templates/downloads/os_list.html: {% if os.slug == 'windows' and r.name >= 'Python 3.5' %}
Running https://github.com/asottile/flake8-2020/ doesn't find anything:
$ pip install -qU flake8-2020 && flake8 --select YTT
$
Still worth a more thorough review.
ned-deily
Oct 5, 2020
Author
Member
If anyone wants to come up with a proper version test, please feel free to do so! My immediate concern is the imminent 3.9.0 release.
hugovk
Oct 5, 2020
Contributor
Agreed, this PR looks good for 3.9.0, and we've a year to fix it properly for 3.10.0.
Something like this?
>>> from packaging import version # pip install packaging
>>> def parse_version(version_string):
... return version.parse(version_string.split()[1])
...
>>> parse_version("Python 3.10") >= parse_version("Python 3.9")
True
>>> parse_version("Python 3.10") <= parse_version("Python 3.9")
False
>>> parse_version("Python 3.10") == parse_version("Python 3.10")
True
>>>
hugovk
Oct 5, 2020
Contributor
And rather than the .split()[1]
, looks like we could use r.get_version()
:
def parse_version(version_string):
return version.parse(version_string)
pythondotorg/downloads/models.py
Lines 121 to 125 in 0f07e9d
pythondotorg/downloads/tests/test_models.py
Lines 63 to 66 in 0f07e9d
OK, including this is urgent for 3.9 to not mislead the users to think 3.9 works on Windows Vista and Windows 7. My vote is: let's merge the current state, unblocking 3.9.0, and fix forward for 3.10. |
As of Python 3.9, only Windows 7 and later systems are supported. With the release of 3.9.0, change the download popup to state that (since we assume the download popup button will never move back to 3.8.x or earlier) and change the Windows download list to show Windows 7 for 3.9 and later releases and continue to show Windows XP for 3.5 through 3.8..