python / cpython

The Python programming language
https://www.python.org
Other
63.06k stars 30.2k forks source link

Allow windows launcher to specify bit lengths with & without minor version #74477

Closed 80c73838-aa1d-43ef-8f08-69c1afb3791f closed 7 years ago

80c73838-aa1d-43ef-8f08-69c1afb3791f commented 7 years ago
BPO 30291
Nosy @pfmoore, @tjguk, @zware, @eryksun, @zooba, @GadgetSteve, @miss-islington
PRs
  • python/cpython#1488
  • python/cpython#7849
  • python/cpython#12812
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = 'https://github.com/zooba' closed_at = created_at = labels = ['type-feature', '3.7', 'OS-windows'] title = 'Allow windows launcher to specify bit lengths with & without minor version' updated_at = user = 'https://github.com/GadgetSteve' ``` bugs.python.org fields: ```python activity = actor = 'miss-islington' assignee = 'steve.dower' closed = True closed_date = closer = 'Steve Barnes' components = ['Windows'] creation = creator = 'Steve Barnes' dependencies = [] files = [] hgrepos = [] issue_num = 30291 keywords = [] message_count = 12.0 messages = ['293153', '293178', '293181', '293187', '293235', '293239', '293285', '293591', '293610', '297212', '340119', '340122'] nosy_count = 7.0 nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'eryksun', 'steve.dower', 'Steve Barnes', 'miss-islington'] pr_nums = ['1488', '7849', '12812'] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = 'enhancement' url = 'https://bugs.python.org/issue30291' versions = ['Python 3.7'] ```

    80c73838-aa1d-43ef-8f08-69c1afb3791f commented 7 years ago

    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:

    80c73838-aa1d-43ef-8f08-69c1afb3791f commented 7 years ago

    Also noted when looking at the code that the validate function, (validate_version), has a couple of issues:

    I am not sure if these potential issues warrant a separate ticket.

    eryksun commented 7 years ago

    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.

    80c73838-aa1d-43ef-8f08-69c1afb3791f commented 7 years ago

    I believe that I have a fix in pull request bpo-1488 for the following points, and have manually tested for them:

    CLA - Signed and submitted but not a working day yet. All automatic checks passed. Will add another push to update to the help message.

    zooba commented 7 years ago

    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?

    zooba commented 7 years ago

    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.

    80c73838-aa1d-43ef-8f08-69c1afb3791f commented 7 years ago

    CLA Now showing on profile. Minor change to help message, (Defaults to matching 64 bit installation), pushed to hopefully auto-update the CLA flag.

    zooba commented 7 years ago

    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

    80c73838-aa1d-43ef-8f08-69c1afb3791f commented 7 years ago

    Closing as committed in https://github.com/python/cpython/commit/870f6a11dd3b2d5455f7057ce0d9c2cd31acc2f2

    zooba commented 7 years ago

    New changeset 5b8f972e093157cc55185841db9ad33fa332a641 by Steve Dower (Steve (Gadget) Barnes) in branch 'master': bpo-30362 : Add list options to launcher. (bpo-1578) https://github.com/python/cpython/commit/5b8f972e093157cc55185841db9ad33fa332a641

    zooba commented 5 years ago

    New changeset 1e2ad6c275d2b09e76b7cbba7281d5a125a593c1 by Steve Dower (mrh1997) in branch 'master': bpo-33922: Adding documentation for new "-64" suffix of Python launcher (GH-7849) https://github.com/python/cpython/commit/1e2ad6c275d2b09e76b7cbba7281d5a125a593c1

    miss-islington commented 5 years ago

    New changeset 395bb94a7f1c3ec9c29976738dfc6cb5d31f9aee by Miss Islington (bot) in branch '3.7': bpo-33922: Adding documentation for new "-64" suffix of Python launcher (GH-7849) https://github.com/python/cpython/commit/395bb94a7f1c3ec9c29976738dfc6cb5d31f9aee