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

iconsur: update test #163904

Closed
wants to merge 1 commit into from
Closed

Conversation

chenrui333
Copy link
Member

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

found in #163887

  ==> Testing iconsur
  ==> /opt/homebrew/Cellar/iconsur/1.7.0/bin/iconsur set /private/tmp/iconsur-test-20240223-90832-fsquse/Test.app -k AppleDeveloper
  Processing /private/tmp/iconsur-test-20240223-90832-fsquse/Test.app...
  Plist file might be corrupted; using fallback name and AppIcon.icns as default icon location.
  Re-run with option -k or --keyword to specify custom app name to search for.
  Re-run with option -i or --input to specify custom input image for an adaptive icon.
  (node:90842) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
  (Use `node --trace-deprecation ...` to show where the warning was created)
  Searching iOS App with name: AppleDeveloper
  Found iOS app: Apple Developer with icon: https://is1-ssl.mzstatic.com/image/thumb/Purple116/v4/f0/35/e8/f035e8fc-5cf5-e062-9b20-6c53a4e73854/AppIcon-Release-0-1x_U007emarketing-0-0-0-7-0-0-0-85-220-0.png/512x512bb.jpg
  If this app is incorrect, specify the correct name with -k or --keyword, or generate an icon locally with option -l or --local
  Performing one-time user-level installation of required Python packages: pyobjc-core pyobjc-framework-Cocoa - this can take while...
  error: externally-managed-environment
  
  × This environment is externally managed
  ╰─> To install Python packages system-wide, try brew install
      xyz, where xyz is the package you are trying to
      install.
      
      If you wish to install a non-brew-packaged Python package,
      create a virtual environment using python3 -m venv path/to/venv.
      Then use path/to/venv/bin/python and path/to/venv/bin/pip.
      
      If you wish to install a non-brew packaged Python application,
      it may be easiest to use pipx install xyz, which will manage a
      virtual environment for you. Make sure you have pipx installed.
  
  note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.

Signed-off-by: Rui Chen <rui@chenrui.dev>
@chenrui333 chenrui333 added the CI-no-bottles Merge without publishing bottles label Feb 23, 2024
@github-actions github-actions bot added nodejs Node or npm use is a significant feature of the PR or issue macos-only Formula depends on macOS labels Feb 23, 2024
@cho-m
Copy link
Member

cho-m commented Feb 23, 2024

The test failure is correct and we should set up a separate venv for python@3.12 otherwise failure will be seen by users.

Upstream code doesn't work with system /usr/bin/python3 (and tells users to install python@3) and it pip3 installs which doesn't work with PEP 668 https://github.com/rikumi/iconsur/blob/1.7.0/src/fileicon.sh#L230-L249

      local ec=$? packageNames='pyobjc-core pyobjc-framework-Cocoa'
      done=1
      if (( ec )); then # The call failed.
        (( retrying )) && die "An unexpected error occured: $output" # Even on-demand pyobjc installation failed -> abort.
        # First, make sure that `python3` is actually Python, and not just the *stub* executable.
        python3 --version | /usr/bin/grep -q ' 3.' || die "The 'python3' binary in your path is not functional, presumably because it is the preinstalled stub at /usr/bin/python3 that triggers a prompt for on-demand installation. Perform this installation, or, if you have Homebrew installed, install Python 3 with \`brew install python@3\`"
        # Assume that the problem is the absence of the required pyobjc-* packages; attempt installation now.
        # Tips for debugging:
        #  * To exercise this function, from the repo dir.:
        #      touch /tmp/tf; ./bin/fileicon set /tmp/tf ./test/.fixtures/img.png
        #  * To manage packages; prepend `sudo -H` to see machine-level packages
        #      pip3 list -v                                          # shows installed packages and their locations
        #      pip3 uninstall -y pyobjc-core pyobjc-framework-Cocoa  # uninstalls the required pyobjc-* packages
        #  * To manage pip3's package *cache*
        #      pip3 cache list   # list cached packages
        #      pip3 cache purge  # clear cache
        #      pip config set global.cache-dir false   # disable cache globally
        #      pip config unset global.cache-dir       # re-enable globacl cache
        echo "Performing one-time user-level installation of required Python packages: $packageNames - this can take while..." >&2
        pip3 install -q --user $packageNames || die "On-demand installation of Python packages failed unexpectedly."

@chenrui333
Copy link
Member Author

The test failure is correct and we should set up a separate venv for python@3.12 otherwise failure will be seen by users.

Upstream code doesn't work with system /usr/bin/python3 (and tells users to install python@3) and it pip3 installs which doesn't work with PEP 668 https://github.com/rikumi/iconsur/blob/1.7.0/src/fileicon.sh#L230-L249

yeah, sounds about right

note, the python3 env change was done in rikumi/iconsur#37 when macos removed the python2.

@chenrui333 chenrui333 marked this pull request as draft February 23, 2024 15:36
@p-linnane p-linnane mentioned this pull request Feb 25, 2024
6 tasks
@chenrui333 chenrui333 mentioned this pull request Mar 7, 2024
1 task
@Porkepix Porkepix mentioned this pull request Mar 9, 2024
1 task
@chenrui333
Copy link
Member Author

#165617

@chenrui333 chenrui333 closed this Mar 9, 2024
@chenrui333 chenrui333 added the superseded PR was replaced by another PR label Mar 9, 2024
@github-actions github-actions bot added the outdated PR was locked due to age label Apr 9, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI-no-bottles Merge without publishing bottles macos-only Formula depends on macOS nodejs Node or npm use is a significant feature of the PR or issue outdated PR was locked due to age superseded PR was replaced by another PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants