classification
Title: Allow windows launcher to specify bit lengths with & without minor version
Type: enhancement Stage: resolved
Components: Windows Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: steve.dower Nosy List: Steve Barnes, eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2017-05-06 09:57 by Steve Barnes, last changed 2017-06-28 19:14 by steve.dower. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1488 merged python-dev, 2017-05-07 11:14
Messages (10)
msg293153 - (view) Author: Steve Barnes (Steve Barnes) * Date: 2017-05-06 09:57
Currently you can use, assuming all are installed:

py -2 # gets the latest python 2 with 64 bit as the default
py -2.7 # gets python 2.7 with 64 bit as the default
py -2.7-32 # gets -32 bit python 2.7
py -3 # gets the latest python 3 with 64 bit as the default
py -3.5 # gets python 3.5 with 64 bit as the default
py -3.5-32 # gets -32 bit python 3.5

But you cannot use:

py -2-32 # Usage Error but would be handy for the latest 32 bit python 2
py -3-32 # Usage Error but would be handy for the latest 32 bit python 3

Note that you also cannot use:
py -3.5-64  # Unknown option: -3 would be handy for testing with I need 64 bit python 3.5 with an error if it doesn't exist currently -3.5 defaults to 3.5 64 bit if available 32 bit otherwise.

For testing packages and programs it would be very useful to be able to specify any of:

 - Latest available 32 bit python 2 or 3
 - 64 bit python 3 fail if unavailable.
msg293178 - (view) Author: Steve Barnes (Steve Barnes) * Date: 2017-05-07 06:54
Also noted when looking at the code that the validate function, (validate_version), has a couple of issues:

 - It will allow python major versions 0-9 (at the moment only 2 or 3 are valid).
 - It will not allow minor versions with more than one digit so if/when python 3.10 comes out it will stop working, (if there is a 3.10 rather than or as well as 4.0).

I am not sure if these potential issues warrant a separate ticket.
msg293181 - (view) Author: Eryk Sun (eryksun) * Date: 2017-05-07 07:21
I don't see a pressing need to support a -64 architecture suffix. If you run 3.6 and get a 32-bit version, you can assume there's no 64-bit version installed and error out if you need 64-bit. That said, supporting this suffix would make the interface and error handling more consistent.

I also noticed the problem with double-digit minor versions, but that's years away. It would be an obvious problem resolved early in 3.10 development, assuming 3.10 even uses the py launcher as it exists today. I'd just kick the can on that one. Maybe add a comment noting the potential problem.
msg293187 - (view) Author: Steve Barnes (Steve Barnes) * Date: 2017-05-07 11:36
I believe that I have a fix in pull request #1488 for the following points, and have manually tested for them:

 - py Still defaults to highest py3 with 64 bits as the default
 - py -2/3.n-32 Still works or reports not present as appropriate
 - py -2/3.n-64 Works or reports not present as appropriate
 - py -2/3 Still defaults to highest then 64 bit if present
 - py -2/3-32/64 Gives highest python 2/3 or reports not present
 - py -2/3.nn Should now work if/when there is such a version present, (any number of digits as far as the validation goes), or reports no such python.
 - py -4, etc., Ditto
 - py n.m-anything other than 32 or 64 - no change of behaviour.

CLA - Signed and submitted but not a working day yet. All automatic checks passed. Will add another push to update to the help message.
msg293235 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2017-05-08 14:22
The actual change I want here is to support Company/Tag pairs as defined in PEP 514. There is no suffix on 64-bit CPython tags, so interpreting "-64" is going outside the PEP.

I'd also be okay with a strict mode that requires -32 for 32-bit interpreters, rather than assuming the language version is close enough. Perhaps a "-only" flag or suffix?
msg293239 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2017-05-08 16:01
With a few more minutes thought, being able to nicely support PEP 514 here might be too much for this poor launcher to handle, so it may just be best to do that as a separate tool. (In particular, the matching rules would have to change from "enter a Python version" to "enter some convenient search pattern as a command line option", and that's a non-trivial change.)

Given that, I'm in favour of this change. When Eryk says the code is good (and the CLA notice comes through), I'll merge it.
msg293285 - (view) Author: Steve Barnes (Steve Barnes) * Date: 2017-05-09 06:48
CLA Now showing on profile.
Minor change to help message, (Defaults to matching 64 bit installation), pushed to hopefully auto-update the CLA flag.
msg293591 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2017-05-12 23:21
New changeset 870f6a11dd3b2d5455f7057ce0d9c2cd31acc2f2 by Steve Dower (Steve (Gadget) Barnes) in branch 'master':
bpo-30291 Changes to launcher so as to allow py -3-32, -2.7-64, 3.10, etc.
https://github.com/python/cpython/commit/870f6a11dd3b2d5455f7057ce0d9c2cd31acc2f2
msg293610 - (view) Author: Steve Barnes (Steve Barnes) * Date: 2017-05-13 10:12
Closing as committed in https://github.com/python/cpython/commit/870f6a11dd3b2d5455f7057ce0d9c2cd31acc2f2
msg297212 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2017-06-28 19:14
New changeset 5b8f972e093157cc55185841db9ad33fa332a641 by Steve Dower (Steve (Gadget) Barnes) in branch 'master':
bpo-30362 : Add list options to launcher. (#1578)
https://github.com/python/cpython/commit/5b8f972e093157cc55185841db9ad33fa332a641
History
Date User Action Args
2017-06-28 19:14:55steve.dowersetmessages: + msg297212
2017-05-13 10:12:25Steve Barnessetstatus: open -> closed
resolution: fixed
messages: + msg293610

stage: resolved
2017-05-12 23:21:28steve.dowersetmessages: + msg293591
2017-05-09 06:48:55Steve Barnessetmessages: + msg293285
2017-05-08 16:02:01steve.dowersetassignee: steve.dower
2017-05-08 16:01:56steve.dowersetmessages: + msg293239
2017-05-08 14:22:30steve.dowersetmessages: + msg293235
2017-05-07 11:36:17Steve Barnessetmessages: + msg293187
2017-05-07 11:14:36python-devsetpull_requests: + pull_request1590
2017-05-07 07:22:00eryksunsetnosy: + eryksun
messages: + msg293181
2017-05-07 06:54:54Steve Barnessetmessages: + msg293178
2017-05-06 19:55:39zach.waresetnosy: + tim.golden, steve.dower, zach.ware, paul.moore

components: + Windows
versions: + Python 3.7, - Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6
2017-05-06 09:57:32Steve Barnescreate