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

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

Closed
GadgetSteve mannequin opened this issue May 6, 2017 · 12 comments
Closed

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

GadgetSteve mannequin opened this issue May 6, 2017 · 12 comments
Assignees
Labels
3.7 OS-windows type-feature

Comments

@GadgetSteve
Copy link
Mannequin

@GadgetSteve GadgetSteve mannequin commented May 6, 2017

BPO 30291
Nosy @pfmoore, @tjguk, @zware, @eryksun, @zooba, @GadgetSteve, @miss-islington
PRs
  • #1488
  • #7849
  • #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:

    assignee = 'https://github.com/zooba'
    closed_at = <Date 2017-05-13.10:12:25.324>
    created_at = <Date 2017-05-06.09:57:32.454>
    labels = ['type-feature', '3.7', 'OS-windows']
    title = 'Allow windows launcher to specify bit lengths with & without minor version'
    updated_at = <Date 2019-04-12.22:32:37.328>
    user = 'https://github.com/GadgetSteve'

    bugs.python.org fields:

    activity = <Date 2019-04-12.22:32:37.328>
    actor = 'miss-islington'
    assignee = 'steve.dower'
    closed = True
    closed_date = <Date 2017-05-13.10:12:25.324>
    closer = 'Steve Barnes'
    components = ['Windows']
    creation = <Date 2017-05-06.09:57:32.454>
    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']

    @GadgetSteve
    Copy link
    Mannequin Author

    @GadgetSteve GadgetSteve mannequin commented May 6, 2017

    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.

    @GadgetSteve GadgetSteve mannequin added the type-feature label May 6, 2017
    @GadgetSteve
    Copy link
    Mannequin Author

    @GadgetSteve GadgetSteve mannequin commented May 7, 2017

    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.

    @eryksun
    Copy link
    Contributor

    @eryksun eryksun commented May 7, 2017

    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.

    @GadgetSteve
    Copy link
    Mannequin Author

    @GadgetSteve GadgetSteve mannequin commented May 7, 2017

    I believe that I have a fix in pull request bpo-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.

    @zooba
    Copy link
    Member

    @zooba zooba commented May 8, 2017

    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
    Copy link
    Member

    @zooba zooba commented May 8, 2017

    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.

    @zooba zooba self-assigned this May 8, 2017
    @GadgetSteve
    Copy link
    Mannequin Author

    @GadgetSteve GadgetSteve mannequin commented May 9, 2017

    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
    Copy link
    Member

    @zooba zooba commented May 12, 2017

    New changeset 870f6a1 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.
    870f6a1

    @GadgetSteve
    Copy link
    Mannequin Author

    @GadgetSteve GadgetSteve mannequin commented May 13, 2017

    Closing as committed in 870f6a1

    @GadgetSteve GadgetSteve mannequin closed this as completed May 13, 2017
    @zooba
    Copy link
    Member

    @zooba zooba commented Jun 28, 2017

    New changeset 5b8f972 by Steve Dower (Steve (Gadget) Barnes) in branch 'master':
    bpo-30362 : Add list options to launcher. (bpo-1578)
    5b8f972

    @zooba
    Copy link
    Member

    @zooba zooba commented Apr 12, 2019

    New changeset 1e2ad6c by Steve Dower (mrh1997) in branch 'master':
    bpo-33922: Adding documentation for new "-64" suffix of Python launcher (GH-7849)
    1e2ad6c

    @miss-islington
    Copy link
    Contributor

    @miss-islington miss-islington commented Apr 12, 2019

    New changeset 395bb94 by Miss Islington (bot) in branch '3.7':
    bpo-33922: Adding documentation for new "-64" suffix of Python launcher (GH-7849)
    395bb94

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 OS-windows type-feature
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants