python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.1k stars 2.25k forks source link

poetry.lock contains dependency on pyobjc on non MacOs system #2403

Closed gruel closed 2 years ago

gruel commented 4 years ago

Issue

It seems that is the bug was reported previously under another name and closed (https://github.com/python-poetry/poetry/issues/1024).

Here there are a very simple pyproject.toml to show the problem. When the package keyboard is added on linux (at least), poetry add pyobjc as dependency. One of the consequence is that any requirements.txt file created from it contain as dependency pyobjc and so stop the possibility to use shiv (for exemple).

olivierpelet commented 4 years ago

Issue

I'm facing the same issue. pyobjc is added as dependency on a raspberry pi when trying to install pybluez package. As a workaround, I have to manually delete the dependency from the lock file.

abn commented 4 years ago

@olivierpelet @gruel can you try using the latest pre-release please? You might also want to regenerate the lock file (poetry lock). Note that new lockfiles generated with 1.1.x will not be usable with 1.0.x.

olivierpelet commented 4 years ago

I've just tried with version 1.1.0b2, the issue is still there. I don't know if it can be related to the bug but I'm in a pyenv shell, using python version 3.6.9. Of course I don't have any virtualenvs running with pyenv.

danielquinn commented 3 years ago

For what it's worth, I've managed to reproduce this with the master branch. Here's a full reproduction with Docker:

$ docker run --rm -it python:3 bash
Unable to find image 'python:3' locally
3: Pulling from library/python
0bc3020d05f1: Pull complete 
a110e5871660: Pull complete 
83d3c0fa203a: Pull complete 
a8fd09c11b02: Pull complete 
14feb89c4a52: Pull complete 
70752631d778: Pull complete 
be0100d82341: Pull complete 
055b01fdac49: Pull complete 
7e4fe414911b: Pull complete 
Digest: sha256:604a312b2b55130a38ffa7a4d517417cbebd8704cb4ff1831ed0ced8ad40f425
Status: Downloaded newer image for python:3

root@7d6a2f2cecdd:/# curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -
Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

/root/.local/bin

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (1.1.7): Done

Poetry (1.1.7) is installed now. Great!

To get started you need Poetry's bin directory (/root/.local/bin) in your `PATH`
environment variable.

Add `export PATH="/root/.local/bin:$PATH"` to your shell configuration file.

Alternatively, you can call Poetry explicitly with `/root/.local/bin/poetry`.

You can test that everything is set up by executing:

`poetry --version`

root@7d6a2f2cecdd:/# export PATH="/root/.local/bin:$PATH"

root@7d6a2f2cecdd:/# poetry --version
Poetry version 1.1.7

root@7d6a2f2cecdd:/# mkdir /tmp/test-stuff
root@7d6a2f2cecdd:/# cd /tmp/test-stuff/
root@7d6a2f2cecdd:/tmp/test-stuff# poetry init

This command will guide you through creating your pyproject.toml config.

Package name [test-stuff]:  
Version [0.1.0]:  
Description []:  
Author [None, n to skip]:  
expected string or bytes-like object
Author [None, n to skip]:  
expected string or bytes-like object
Author [None, n to skip]:  n
License []:  
Compatible Python versions [^3.9]:  

Would you like to define your main dependencies interactively? (yes/no) [yes] no
Would you like to define your development dependencies interactively? (yes/no) [yes] no
Generated file

[tool.poetry]
name = "test-stuff"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]

[tool.poetry.dependencies]
python = "^3.9"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

Do you confirm generation? (yes/no) [yes] 

root@7d6a2f2cecdd:/tmp/test-stuff# poetry add pyautogui
Creating virtualenv test-stuff-9KwuRuYU-py3.9 in /root/.cache/pypoetry/virtualenvs
Using version ^0.9.53 for PyAutoGUI

Updating dependencies
Resolving dependencies... (104.2s)

Writing lock file

Package operations: 9 installs, 0 updates, 0 removals

  • Installing pyperclip (1.8.2)
  • Installing pyrect (0.1.4)
  • Installing python3-xlib (0.15)
  • Installing mouseinfo (0.1.3)
  • Installing pygetwindow (0.0.9)
  • Installing pymsgbox (1.0.9)
  • Installing pyscreeze (0.1.27)
  • Installing pytweening (1.0.3)
  • Installing pyautogui (0.9.53)

root@7d6a2f2cecdd:/tmp/test-stuff# poetry export --without-hashes
mouseinfo==0.1.3
pyautogui==0.9.53
pygetwindow==0.0.9
pymsgbox==1.0.9
pyobjc-core==7.3
pyobjc-framework-accessibility==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-accounts==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "14.0"
pyobjc-framework-addressbook==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-adservices==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-adsupport==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "18.0"
pyobjc-framework-applescriptkit==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-applescriptobjc==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "10.0"
pyobjc-framework-applicationservices==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-apptrackingtransparency==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-authenticationservices==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-automaticassessmentconfiguration==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-automator==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-avfoundation==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "16.0"
pyobjc-framework-avkit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "13.0"
pyobjc-framework-businesschat==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "18.0"
pyobjc-framework-calendarstore==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "9.0"
pyobjc-framework-callkit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-cfnetwork==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-classkit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-cloudkit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "14.0"
pyobjc-framework-cocoa==7.3
pyobjc-framework-collaboration==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "9.0"
pyobjc-framework-colorsync==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "17.0"
pyobjc-framework-contacts==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "15.0"
pyobjc-framework-contactsui==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "15.0"
pyobjc-framework-coreaudio==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-coreaudiokit==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-corebluetooth==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "14.0"
pyobjc-framework-coredata==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "14.0"
pyobjc-framework-corehaptics==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-corelocation==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "14.0"
pyobjc-framework-coremedia==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-coremediaio==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "11.0"
pyobjc-framework-coremidi==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-coreml==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "17.0"
pyobjc-framework-coremotion==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-coreservices==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "9.0"
pyobjc-framework-corespotlight==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "17.0"
pyobjc-framework-coretext==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-corewlan==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "10.0"
pyobjc-framework-cryptotokenkit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "14.0"
pyobjc-framework-devicecheck==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-dictionaryservices==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "9.0"
pyobjc-framework-discrecording==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-discrecordingui==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-diskarbitration==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-dvdplayback==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-eventkit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "12.0"
pyobjc-framework-exceptionhandling==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-executionpolicy==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-externalaccessory==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "17.0"
pyobjc-framework-fileprovider==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-fileproviderui==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-findersync==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "14.0"
pyobjc-framework-fsevents==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "9.0"
pyobjc-framework-gamecenter==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "12.0"
pyobjc-framework-gamecontroller==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "13.0"
pyobjc-framework-gamekit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "12.0"
pyobjc-framework-gameplaykit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "15.0"
pyobjc-framework-imagecapturecore==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "10.0"
pyobjc-framework-imserviceplugin==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "11.0"
pyobjc-framework-inputmethodkit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "9.0"
pyobjc-framework-installerplugins==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-instantmessage==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "9.0"
pyobjc-framework-intents==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "16.0"
pyobjc-framework-interfacebuilderkit==7.3; platform_release >= "9.0" and platform_release < "11.0" and python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-iosurface==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "10.0"
pyobjc-framework-ituneslibrary==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "10.0"
pyobjc-framework-kernelmanagement==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-latentsemanticmapping==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-launchservices==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-libdispatch==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "12.0"
pyobjc-framework-linkpresentation==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-localauthentication==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "14.0"
pyobjc-framework-mapkit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "13.0"
pyobjc-framework-mediaaccessibility==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "13.0"
pyobjc-framework-medialibrary==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "13.0"
pyobjc-framework-mediaplayer==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "16.0"
pyobjc-framework-mediatoolbox==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "13.0"
pyobjc-framework-message==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release < "13.0"
pyobjc-framework-metal==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "17.0"
pyobjc-framework-metalkit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "15.0"
pyobjc-framework-metalperformanceshaders==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-metalperformanceshadersgraph==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-mlcompute==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-modelio==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "15.0"
pyobjc-framework-multipeerconnectivity==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "14.0"
pyobjc-framework-naturallanguage==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "18.0"
pyobjc-framework-netfs==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "10.0"
pyobjc-framework-network==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "18.0"
pyobjc-framework-networkextension==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "15.0"
pyobjc-framework-notificationcenter==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "14.0"
pyobjc-framework-opendirectory==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "10.0"
pyobjc-framework-osakit==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-oslog==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-passkit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-pencilkit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-photos==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "15.0"
pyobjc-framework-photosui==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "15.0"
pyobjc-framework-preferencepanes==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-pubsub==7.3; platform_release >= "9.0" and platform_release < "18.0" and python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-pushkit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-quartz==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-quicklookthumbnailing==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-replaykit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-safariservices==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "15.0"
pyobjc-framework-scenekit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "11.0"
pyobjc-framework-screensaver==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-screentime==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-scriptingbridge==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "9.0"
pyobjc-framework-searchkit==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-security==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "14.0"
pyobjc-framework-securityfoundation==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-securityinterface==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-servernotification==7.3; platform_release >= "10.0" and platform_release < "13.0" and python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-servicemanagement==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "10.0"
pyobjc-framework-social==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "12.0"
pyobjc-framework-soundanalysis==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-speech==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-spritekit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "15.0"
pyobjc-framework-storekit==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "11.0"
pyobjc-framework-syncservices==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-systemconfiguration==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc-framework-systemextensions==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "19.0"
pyobjc-framework-uniformtypeidentifiers==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-usernotifications==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-usernotificationsui==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-videosubscriberaccount==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "18.0"
pyobjc-framework-videotoolbox==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "12.0"
pyobjc-framework-virtualization==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "20.0"
pyobjc-framework-vision==7.3; python_version >= "3.6" and platform_system == "Darwin" and platform_release >= "17.0"
pyobjc-framework-webkit==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyobjc==7.3; python_version >= "3.6" and platform_system == "Darwin"
pyperclip==1.8.2
pyrect==0.1.4
pyscreeze==0.1.27
python3-xlib==0.15; platform_system == "Linux" and python_version >= "3.0"
pytweening==1.0.3
rubicon-objc==0.4.0; python_version >= "3.5" and platform_system == "Darwin" 
dimbleby commented 2 years ago

this was an upstream issue, now resolved. Formerly, keyboard declared an unconditional dependency on pyobjc. Currently, it declares a darwin-only dependency on pyobjc:

$ curl -s https://pypi.org/pypi/keyboard/0.13.0/json | jq ".info.requires_dist"
[
  "pyobjc"
]

but

$ curl -s https://pypi.org/pypi/keyboard/json | jq ".info.requires_dist"
[
  "pyobjc ; sys_platform == \"darwin\""
]
github-actions[bot] commented 6 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.