Skip to content
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

Cutting release 0.18.2. #63

Merged
merged 1 commit into from
Oct 12, 2017
Merged

Cutting release 0.18.2. #63

merged 1 commit into from
Oct 12, 2017

Conversation

dhermes
Copy link
Collaborator

@dhermes dhermes commented Oct 12, 2017

No description provided.

@dhermes
Copy link
Collaborator Author

dhermes commented Oct 12, 2017

@jonparrott Should I add a link to https://www.python.org/dev/peps/pep-0397/? Are there better docs somewhere for py.exe?

UPDATE: https://docs.python.org/3/using/windows.html#launcher

@dhermes
Copy link
Collaborator Author

dhermes commented Oct 12, 2017

@jonparrott It just occurred to me that #53 may come up short for 32-bit Python. Maybe we should hold off on a release?

@theacodes
Copy link
Collaborator

@dhermes WDYT? How common is 32bit Python? How much of an issue will it cause?

@dhermes
Copy link
Collaborator Author

dhermes commented Oct 12, 2017

OK I rebased this after #64 and #65. I also added a link to the launcher in the CHANGELOG

@dhermes
Copy link
Collaborator Author

dhermes commented Oct 12, 2017

TL;DR

  • nox allows no way to explicitly ask for 32-bit
  • If a system has both 32- and 64-bit versions of the same Python, the 64-bit version wins via py.exe
  • nox looks for pythonX.Y on the PATH before using py.exe but the official Python.org binaries only ship python.exe and pythonw.exe (i.e. you can't simply add a directory to your PATH)

Launcher sleuthing. My current Windows 10 install has 32- and 64-bit versions of 2.7, 3.5 and 3.6.

I want to know where they are installed and their "bit"-ness:

# info.py
import platform
import sys


def main():
    print(sys.executable)
    print(platform.architecture())


if __name__ == '__main__':
    main()

Running this:

C:\Users\dhermes>py -2.7 info.py
C:\Python27\python.exe
('64bit', 'WindowsPE')

C:\Users\dhermes>py -2.7-32 info.py
C:\Python27-32\python.exe
('32bit', 'WindowsPE')

C:\Users\dhermes>py -3.5 info.py
C:\Users\dhermes\AppData\Local\Programs\Python\Python35\python.exe
('64bit', 'WindowsPE')

C:\Users\dhermes>py -3.5-32 info.py
C:\Users\dhermes\AppData\Local\Programs\Python\Python35-32\python.exe
('32bit', 'WindowsPE')

C:\Users\dhermes>py -3.6 info.py
C:\Users\dhermes\AppData\Local\Programs\Python\Python36\python.exe
('64bit', 'WindowsPE')

C:\Users\dhermes>py -3.6-32 info.py
C:\Users\dhermes\AppData\Local\Programs\Python\Python36-32\python.exe
('32bit', 'WindowsPE')

Now if I manually use the 3.6.3 Windows 64-bit web-based installer to uninstall it (temporarily), the launcher says:

C:\Users\dhermes>py -3.6 info.py
C:\Users\dhermes\AppData\Local\Programs\Python\Python36-32\python.exe
('32bit', 'WindowsPE')

C:\Users\dhermes>py -3.6-32 info.py
C:\Users\dhermes\AppData\Local\Programs\Python\Python36-32\python.exe
('32bit', 'WindowsPE')

The way the current behavior works (only on Windows, mind you), if the value of interpreter is explicitly provided, but not found on the PATH, then the interpreter value must be of the form pythonX.Y (where X and Y are digits):

>>> import re
>>>
>>> def f(interpreter):
...     match = re.match(r'^python(?P<ver>\d\.\d)$', interpreter)
...     if match is None:
...         return None
...     else:
...         return match.group('ver')
...
>>>
>>> f('python2.7')
'2.7'
>>> f('python3.6')
'3.6'
>>> f('python2.7-32') is None
True
>>> f('python8.7')
'8.7'

Since nox does "defer" to the path, this is somewhat OK, but none of the official Python.org versions come with pythonX.Y:

C:\Users\dhermes>set OLD_PATH=%PATH%

2.7 64-bit

C:\Users\dhermes>set PATH=C:\Python27;%OLD_PATH%

C:\Users\dhermes>python info.py
C:\Python27\python.exe
('64bit', 'WindowsPE')

C:\Users\dhermes>dir /B C:\Python27\python*.exe
python.exe
pythonw.exe

2.7 32-bit

C:\Users\dhermes>set PATH=C:\Python27-32;%OLD_PATH%

C:\Users\dhermes>python info.py
C:\Python27-32\python.exe
('32bit', 'WindowsPE')

C:\Users\dhermes>dir /B C:\Python27-32\python*.exe
python.exe
pythonw.exe

3.5 64-bit

C:\Users\dhermes>set PATH=C:\Users\dhermes\AppData\Local\Programs\Python\Python35;%OLD_PATH%

C:\Users\dhermes>python info.py
C:\Users\dhermes\AppData\Local\Programs\Python\Python35\python.exe
('64bit', 'WindowsPE')

C:\Users\dhermes>dir /B C:\Users\dhermes\AppData\Local\Programs\Python\Python35\python*.exe
python.exe
pythonw.exe

3.5 32-bit

C:\Users\dhermes>set PATH=C:\Users\dhermes\AppData\Local\Programs\Python\Python35-32;%OLD_PATH%

C:\Users\dhermes>python info.py
C:\Users\dhermes\AppData\Local\Programs\Python\Python35-32\python.exe
('32bit', 'WindowsPE')

C:\Users\dhermes>dir /B C:\Users\dhermes\AppData\Local\Programs\Python\Python35-32\python*.exe
python.exe
pythonw.exe

3.6 64-bit

C:\Users\dhermes>set PATH=C:\Users\dhermes\AppData\Local\Programs\Python\Python36;%OLD_PATH%

C:\Users\dhermes>python info.py
C:\Users\dhermes\AppData\Local\Programs\Python\Python36\python.exe
('64bit', 'WindowsPE')

C:\Users\dhermes>dir /B C:\Users\dhermes\AppData\Local\Programs\Python\Python36\python*.exe
python.exe
pythonw.exe

3.6 32-bit

C:\Users\dhermes>set PATH=C:\Users\dhermes\AppData\Local\Programs\Python\Python36-32;%OLD_PATH%

C:\Users\dhermes>python info.py
C:\Users\dhermes\AppData\Local\Programs\Python\Python36-32\python.exe
('32bit', 'WindowsPE')

C:\Users\dhermes>dir /B C:\Users\dhermes\AppData\Local\Programs\Python\Python36-32\python*.exe
python.exe
pythonw.exe

Restore

C:\Users\dhermes>set PATH=%OLD_PATH%

C:\Users\dhermes>python info.py
C:\Users\dhermes\AppData\Local\Continuum\Miniconda2\python.exe
('64bit', 'WindowsPE')

C:\Users\dhermes>dir /B C:\Users\dhermes\AppData\Local\Continuum\Miniconda2\python*.exe
python.exe
pythonw.exe

@theacodes
Copy link
Collaborator

@dhermes is there anything we need to do to address that in this release? It seems like asking explicitly for a 32bit interpreter should be a separate feature.

@dhermes
Copy link
Collaborator Author

dhermes commented Oct 12, 2017

@jonparrott I suppose yes it could be a separate feature (definitely relates to #60 since that is 32- vs. 64- on OS X and to #62 since not all users would care about passing the architecture)

Press the big green button?

(Then maybe I should copy-paste this into a new issue?)

@theacodes
Copy link
Collaborator

Press the big green button?

Go for it.

(Then maybe I should copy-paste this into a new issue?)

Sounds good.

@dhermes dhermes merged commit 7360b26 into wntrblm:master Oct 12, 2017
@dhermes dhermes deleted the cut-0.18.2 branch October 12, 2017 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants