BUG: Distutils patch to allow for 2 as a minor version (!)#20155
Merged
charris merged 1 commit intonumpy:mainfrom Oct 21, 2021
Merged
BUG: Distutils patch to allow for 2 as a minor version (!)#20155charris merged 1 commit intonumpy:mainfrom
charris merged 1 commit intonumpy:mainfrom
Conversation
The float representation of e.g. 14.2 is not exact, leading to a minor version number of int(1.999999) == 1 in the original code.
charris
reviewed
Oct 21, 2021
charris
reviewed
Oct 21, 2021
Member
|
Thanks Matthew. The use of a float is a bit flaky, but that problems lies elsewhere. |
Contributor
Author
|
For my reference: The distutils code takes the major version number from the first two character of: (above), and then subtracts (effectively) 5, and takes only the third digit as the minor version number. |
matthew-brett
added a commit
to matthew-brett/numpy
that referenced
this pull request
Oct 22, 2021
The comment in the original code came about because of the bug fixed in numpygh-20155. The fixed subsequent clause should now give the correct assembly version for the given Python. In fact, the original clause matches the MSVC for Python 3.7.1: ``` PS C:\> .\Python37\python.exe .\io\check_versions.py sys.version 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] distutils build version 14.1 msvcrt.CRT_ASSEMBLY_VERSION 14.15.26726.0 ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found this one testing build with Mingw-w64.
The float representation of e.g. 14.2 is not exact, leading to a minor
version number of int(1.999999) == 1 in the original code.
Turn to string and split on decimal point instead.