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

Check for COMMAND_LINE_INSTALL variable in Python_Documentation.pkg #83761

Closed
flammable mannequin opened this issue Feb 7, 2020 · 8 comments
Closed

Check for COMMAND_LINE_INSTALL variable in Python_Documentation.pkg #83761

flammable mannequin opened this issue Feb 7, 2020 · 8 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes OS-mac

Comments

@flammable
Copy link
Mannequin

flammable mannequin commented Feb 7, 2020

BPO 39580
Nosy @ronaldoussoren, @ned-deily, @miss-islington, @flammable, @rickheil
PRs
  • bpo-39580: add check for CLI installation on macOS #20271
  • [3.9] bpo-39580: add check for CLI installation on macOS (GH-20271) #21139
  • [3.8] bpo-39580: add check for CLI installation on macOS (GH-20271) #21140
  • 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/ned-deily'
    closed_at = <Date 2020-06-25.11:05:59.323>
    created_at = <Date 2020-02-07.21:44:10.266>
    labels = ['OS-mac', '3.7', '3.8', '3.9', '3.10']
    title = 'Check for COMMAND_LINE_INSTALL variable in Python_Documentation.pkg'
    updated_at = <Date 2020-06-25.11:05:59.322>
    user = 'https://github.com/flammable'

    bugs.python.org fields:

    activity = <Date 2020-06-25.11:05:59.322>
    actor = 'ned.deily'
    assignee = 'ned.deily'
    closed = True
    closed_date = <Date 2020-06-25.11:05:59.323>
    closer = 'ned.deily'
    components = ['macOS']
    creation = <Date 2020-02-07.21:44:10.266>
    creator = 'flammable'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39580
    keywords = ['patch']
    message_count = 8.0
    messages = ['361610', '369472', '370062', '371789', '372338', '372341', '372342', '372343']
    nosy_count = 5.0
    nosy_names = ['ronaldoussoren', 'ned.deily', 'miss-islington', 'flammable', 'rickheil']
    pr_nums = ['20271', '21139', '21140']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue39580'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10']

    @flammable
    Copy link
    Mannequin Author

    flammable mannequin commented Feb 7, 2020

    Hello Python developers!

    I'm looking to deploy Python 3 silently to the Macs that I manage, so I can use Python for various scripts. I'm using Munki to accomplish this. However, the Python_Documentation.pkg subpackage includes this code in the postinstall script:

    # make link in /Applications/Python m.n/ for Finder users
    if [ -d "${APPDIR}" ]; then
        ln -fhs "${FWK_DOCDIR}/index.html" "${APPDIR}/Python Documentation.html"
        open "${APPDIR}" || true  # open the applications folder
    fi
    

    Would it be possible to test for the $COMMAND_LINE_INSTALL variable before opening a Finder window? If the $COMMAND_LINE_INSTALL exists, it'd be really great if it didn't open the Finder. This would allow me to silently deploy Python 3 without disrupting my users.

    Thanks!

    Mike

    @flammable flammable mannequin added 3.8 only security fixes OS-mac labels Feb 7, 2020
    @rickheil
    Copy link
    Mannequin

    rickheil mannequin commented May 20, 2020

    In case folks reading this are not aware, installer(8) sets an environmental variable COMMAND_LINE_INSTALL when an installation is triggered on the command line versus when a user double-clicks a package in the GUI to kick off the install.

    I've filed the linked PR to add a test on the APPDIR open statement to avoid popping up the Finder when the package is installed on the command line. If there's a different method by which I should do this, please point me in the vague direction and I'm happy to update!

    (note - I just signed the CLA today so it should be registered soonish)

    @ned-deily
    Copy link
    Member

    Thanks for the PR! It looks reasonable but I do want to test it first on older macOS versions that we support before merging it. I'll do that before the next releases.

    @ned-deily ned-deily added 3.7 (EOL) end of life 3.9 only security fixes 3.10 only security fixes labels May 27, 2020
    @ned-deily
    Copy link
    Member

    New changeset 966036a by Ned Deily in branch '3.7':
    bpo-39580: add check for CLI installation on macOS
    966036a

    @ned-deily
    Copy link
    Member

    New changeset 5f190d2 by Rick Heil in branch 'master':
    bpo-39580: add check for CLI installation on macOS (GH-20271)
    5f190d2

    @miss-islington
    Copy link
    Contributor

    New changeset 4564ebb by Miss Islington (bot) in branch '3.8':
    bpo-39580: add check for CLI installation on macOS (GH-20271)
    4564ebb

    @miss-islington
    Copy link
    Contributor

    New changeset bdc55eb by Miss Islington (bot) in branch '3.9':
    bpo-39580: add check for CLI installation on macOS (GH-20271)
    bdc55eb

    @ned-deily
    Copy link
    Member

    Thanks again for the PR. The change will be included in python.org installers for macOS as of 3.9.0b4, 3.8.4, and 3.7.8.

    @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 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes OS-mac
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants