pdm-project / pdm

A modern Python package and dependency manager supporting the latest PEP standards
https://pdm-project.org
MIT License
7.98k stars 410 forks source link

Fails to lock when installing bleson #1337

Closed jimparis closed 2 years ago

jimparis commented 2 years ago

Steps to reproduce

pyproject.toml:

[project]
dependencies = [ "bleson" ]
requires-python = ">=3.9"

Running on a Linux host, it appears that pdm lock wants to check Windows and Darwin dependencies. It can't build the Darwin dependency, so it falls back to parsing package files, but fails.

$ pdm lock -v
python.use_venv is on, creating a virtualenv for this project...
Run command: ['/usr/bin/python3', '-m', 'virtualenv', '--no-pip', '--no-setuptools', '--no-wheel', '/tmp/pdm-test/.venv', '-p',
'/usr/bin/python3.9']
created virtual environment CPython3.9.2.final.0-64 in 85ms
  creator CPython3Posix(dest=/tmp/pdm-test/.venv, clear=False, no_vcs_ignore=False, global=False)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
Virtualenv is created successfully at /tmp/pdm-test/.venv
pdm.termui: ======== Start resolving requirements ========
pdm.termui:   bleson
pdm.termui:   python>=3.9
pdm.termui:   Adding requirement bleson
pdm.termui:   Adding requirement python>=3.9
pdm.termui: ======== Starting round 0 ========
pdm.termui: Pinning: python None
pdm.termui: ======== Ending round 0 ========
pdm.termui: ======== Starting round 1 ========
pdm.termui:   Adding requirement pyobjc; platform_system == "Darwin"(from bleson 0.1.8)
pdm.termui:   Adding requirement blesonwin; platform_system == "Windows"(from bleson 0.1.8)
pdm.termui: Pinning: bleson 0.1.8
pdm.termui: ======== Ending round 1 ========
pdm.termui: ======== Starting round 2 ========
pdm.termui: Pinning: blesonwin 0.0.12
pdm.termui: ======== Ending round 2 ========
pdm.termui: ======== Starting round 3 ========
pdm.termui:   Adding requirement pyobjc-core==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-AddressBook==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-AppleScriptKit==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ApplicationServices==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Automator==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CFNetwork==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Cocoa==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CoreAudio==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CoreAudioKit==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CoreData==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CoreMIDI==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CoreServices==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CoreText==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-DiscRecording==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-DiscRecordingUI==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-DiskArbitration==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-DVDPlayback==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ExceptionHandling==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-InstallerPlugins==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-LatentSemanticMapping==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-LaunchServices==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-OSAKit==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-PreferencePanes==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Quartz==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ScreenSaver==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Security==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-SecurityFoundation==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-SecurityInterface==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-SearchKit==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-SyncServices==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-SystemConfiguration==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-WebKit==8.5(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Message==8.5; platform_release < "13.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-AppleScriptObjC==8.5; platform_release >= "10.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CoreLocation==8.5; platform_release >= "10.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CoreWLAN==8.5; platform_release >= "10.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ImageCaptureCore==8.5; platform_release >= "10.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-IOSurface==8.5; platform_release >= "10.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-NetFS==8.5; platform_release >= "10.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-OpenDirectory==8.5; platform_release >= "10.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ServiceManagement==8.5; platform_release >= "10.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-iTunesLibrary==8.5; platform_release >= "10.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ServerNotification==8.5; platform_release >= "10.0" and platform_release < "13.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-AVFoundation==8.5; platform_release >= "11.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CoreMedia==8.5; platform_release >= "11.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CoreMediaIO==8.5; platform_release >= "11.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-IMServicePlugIn==8.5; platform_release >= "11.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-StoreKit==8.5; platform_release >= "11.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-SceneKit==8.5; platform_release >= "11.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-libdispatch==8.5; platform_release >= "12.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-AudioVideoBridging==8.5; platform_release >= "12.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Accounts==8.5; platform_release >= "12.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-EventKit==8.5; platform_release >= "12.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-GameCenter==8.5; platform_release >= "12.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Social==8.5; platform_release >= "12.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-GameKit==8.5; platform_release >= "12.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-VideoToolbox==8.5; platform_release >= "12.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-AVKit==8.5; platform_release >= "13.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-GameController==8.5; platform_release >= "13.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-MapKit==8.5; platform_release >= "13.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-MediaAccessibility==8.5; platform_release >= "13.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-MediaLibrary==8.5; platform_release >= "13.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-MediaToolbox==8.5; platform_release >= "13.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-SpriteKit==8.5; platform_release >= "13.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CloudKit==8.5; platform_release >= "14.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CoreBluetooth==8.5; platform_release >= "14.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CryptoTokenKit==8.5; platform_release >= "14.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-FinderSync==8.5; platform_release >= "14.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-LocalAuthentication==8.5; platform_release >= "14.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-MultipeerConnectivity==8.5; platform_release >= "14.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-NotificationCenter==8.5; platform_release >= "14.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Contacts==8.5; platform_release >= "15.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ContactsUI==8.5; platform_release >= "15.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Metal==8.5; platform_release >= "15.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-MetalKit==8.5; platform_release >= "15.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ModelIO==8.5; platform_release >= "15.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-NetworkExtension==8.5; platform_release >= "15.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Photos==8.5; platform_release >= "15.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-PhotosUI==8.5; platform_release >= "15.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-SafariServices==8.5; platform_release >= "15.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-GameplayKit==8.5; platform_release >= "15.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Intents==8.5; platform_release >= "16.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-MediaPlayer==8.5; platform_release >= "16.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ColorSync==8.5; platform_release >= "17.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CoreML==8.5; platform_release >= "17.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CoreSpotlight==8.5; platform_release >= "17.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ExternalAccessory==8.5; platform_release >= "17.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-MetalPerformanceShaders==8.5; platform_release >= "17.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Vision==8.5; platform_release >= "17.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-AdSupport==8.5; platform_release >= "18.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-BusinessChat==8.5; platform_release >= "18.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-NaturalLanguage==8.5; platform_release >= "18.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Network==8.5; platform_release >= "18.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-UserNotifications==8.5; platform_release >= "18.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-VideoSubscriberAccount==8.5; platform_release >= "18.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-AuthenticationServices==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-AutomaticAssessmentConfiguration==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CoreHaptics==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CoreMotion==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-DeviceCheck==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ExecutionPolicy==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-FileProvider==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-FileProviderUI==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-LinkPresentation==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-OSLog==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-PencilKit==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-PushKit==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-QuickLookThumbnailing==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Speech==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-SoundAnalysis==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-SystemExtensions==8.5; platform_release >= "19.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Accessibility==8.5; platform_release >= "20.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-AdServices==8.5; platform_release >= "20.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-AppTrackingTransparency==8.5; platform_release >= "20.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CallKit==8.5; platform_release >= "20.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ClassKit==8.5; platform_release >= "20.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-KernelManagement==8.5; platform_release >= "20.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-MetalPerformanceShadersGraph==8.5; platform_release >= "20.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-MLCompute==8.5; platform_release >= "20.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-PassKit==8.5; platform_release >= "20.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ReplayKit==8.5; platform_release >= "20.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ScreenTime==8.5; platform_release >= "20.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-UniformTypeIdentifiers==8.5; platform_release >= "20.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-UserNotificationsUI==8.5; platform_release >= "20.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Virtualization==8.5; platform_release >= "20.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-DataDetection==8.5; platform_release >= "21.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-IntentsUI==8.5; platform_release >= "21.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-LocalAuthenticationEmbeddedUI==8.5; platform_release >= "21.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-MailKit==8.5; platform_release >= "21.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-MetricKit==8.5; platform_release >= "21.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ShazamKit==8.5; platform_release >= "21.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ScreenCaptureKit==8.5; platform_release >= "21.4"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-CalendarStore==8.5; platform_release >= "9.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-Collaboration==8.5; platform_release >= "9.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-DictionaryServices==8.5; platform_release >= "9.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-FSEvents==8.5; platform_release >= "9.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-InputMethodKit==8.5; platform_release >= "9.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-InstantMessage==8.5; platform_release >= "9.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-ScriptingBridge==8.5; platform_release >= "9.0"(from pyobjc 8.5)
pdm.termui:   Adding requirement pyobjc-framework-PubSub==8.5; platform_release >= "9.0" and platform_release < "18.0"(from pyobjc 8.5)
pdm.termui: Pinning: pyobjc 8.5
pdm.termui: ======== Ending round 3 ========
pdm.termui: ======== Starting round 4 ========
pdm.termui: Pinning: pyobjc-core 8.5
pdm.termui: ======== Ending round 4 ========
pdm.termui: ======== Starting round 5 ========
unearth: Downloading <Link https://files.pythonhosted.org/packages/1f/02/00c0f23847bb8d2752a988490dedf36e4e3bcfe254aaa277f09057979723/pyobjc-framework-Accessibility-8.5.tar.gz (from None)> to /home/jim/tmp/pdm-download-mcbzxem4/pyobjc-framework-Accessibility-8.5.tar.gz
pdm.termui: Running PEP 517 backend to get metadata for <Link https://files.pythonhosted.org/packages/1f/02/00c0f23847bb8d2752a988490dedf36e4e3bcfe254aaa277f09057979723/pyobjc-framework-Accessibility-8.5.tar.gz (from None)>
pdm.termui: Preparing isolated env for PEP 517 build...
pdm.termui: Using pip 22.2.2 from /home/jim/.local/lib/python3.9/site-packages/pip (python 3.9)
pdm.termui: Collecting setuptools>=40.8.0
pdm.termui:   Using cached setuptools-65.3.0-py3-none-any.whl (1.2 MB)
pdm.termui: Collecting wheel
pdm.termui:   Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
pdm.termui: Installing collected packages: wheel, setuptools
pdm.termui:   Creating /home/jim/tmp/pdm-build-env-0xxoo4yz-shared/bin
pdm.termui:   changing mode of /home/jim/tmp/pdm-build-env-0xxoo4yz-shared/bin/wheel to 755
pdm.termui: ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pdm.termui: west 0.13.1 requires packaging, which is not installed.
pdm.termui: vpype 1.7.0 requires numpy<2.0,>=1.20, which is not installed.
pdm.termui: vpype 1.7.0 requires scipy<2.0,>=1.6, which is not installed.
pdm.termui: vpype 1.7.0 requires Shapely[vectorized]<1.8.0,>=1.7.1, which is not installed.
pdm.termui: vpype-dxf 0.0.3 requires numpy, which is not installed.
pdm.termui: sphinx 1.7.5 requires alabaster<0.8,>=0.7, which is not installed.
pdm.termui: sphinx 1.7.5 requires babel!=2.0,>=1.3, which is not installed.
pdm.termui: sphinx 1.7.5 requires imagesize, which is not installed.
pdm.termui: sphinx 1.7.5 requires Jinja2>=2.3, which is not installed.
pdm.termui: sphinx 1.7.5 requires packaging, which is not installed.
pdm.termui: pnoise 0.1.0 requires numpy>=1.19, which is not installed.
pdm.termui: vpype 1.7.0 requires click<8.1.0,>=8.0.1, but you have click 7.1.2 which is incompatible.
pdm.termui: vpype 1.7.0 requires setuptools<52.0.0,>=51.0.0, but you have setuptools 65.3.0 which is incompatible.
pdm.termui: sphinx-copybutton 0.5.0 requires sphinx>=1.8, but you have sphinx 1.7.5 which is incompatible.
pdm.termui: Successfully installed setuptools-65.3.0 wheel-0.37.1
pdm.termui: Traceback (most recent call last):
pdm.termui:   File "/home/jim/.local/lib/python3.9/site-packages/pep517/in_process/_in_process.py", line 363, in <module>
pdm.termui:     main()
pdm.termui:   File "/home/jim/.local/lib/python3.9/site-packages/pep517/in_process/_in_process.py", line 345, in main
pdm.termui:     json_out['return_val'] = hook(**hook_input['kwargs'])
pdm.termui:   File "/home/jim/.local/lib/python3.9/site-packages/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
pdm.termui:     return hook(config_settings)
pdm.termui:   File "/home/jim/tmp/pdm-build-env-0xxoo4yz-shared/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
pdm.termui:     return self._get_build_requires(config_settings, requirements=['wheel'])
pdm.termui:   File "/home/jim/tmp/pdm-build-env-0xxoo4yz-shared/lib/python3.9/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
pdm.termui:     self.run_setup()
pdm.termui:   File "/home/jim/tmp/pdm-build-env-0xxoo4yz-shared/lib/python3.9/site-packages/setuptools/build_meta.py", line 482, in run_setup
pdm.termui:     super(_BuildMetaLegacyBackend,
pdm.termui:   File "/home/jim/tmp/pdm-build-env-0xxoo4yz-shared/lib/python3.9/site-packages/setuptools/build_meta.py", line 335, in run_setup
pdm.termui:     exec(code, locals())
pdm.termui:   File "<string>", line 20, in <module>
pdm.termui:   File "/home/jim/tmp/pdm-build-n58tu__0/pyobjc_setup.py", line 463, in Extension
pdm.termui:     os_level = get_os_level()
pdm.termui:   File "/home/jim/tmp/pdm-build-n58tu__0/pyobjc_setup.py", line 232, in get_os_level
pdm.termui:     subprocess.check_output(["/usr/bin/sw_vers", "-productVersion"])
pdm.termui:   File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
pdm.termui:     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
pdm.termui:   File "/usr/lib/python3.9/subprocess.py", line 505, in run
pdm.termui:     with Popen(*popenargs, **kwargs) as process:
pdm.termui:   File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
pdm.termui:     self._execute_child(args, executable, preexec_fn, close_fds,
pdm.termui:   File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
pdm.termui:     raise child_exception_type(errno_num, err_msg, err_filename)
pdm.termui: FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/sw_vers'
pdm.termui: Failed to build package, try parsing project files.
Traceback (most recent call last):
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/models/candidates.py", line 481, in prepare_metadata
    self._metadata_dir = builder(
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/builders/wheel.py", line 14, in prepare_metadata
    requires = self._hook.get_requires_for_build_wheel(config_settings)
  File "/home/jim/.local/lib/python3.9/site-packages/pep517/wrappers.py", line 172, in get_requires_for_build_wheel
    return self._call_hook('get_requires_for_build_wheel', {
  File "/home/jim/.local/lib/python3.9/site-packages/pep517/wrappers.py", line 322, in _call_hook
    self._subprocess_runner(
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/builders/base.py", line 245, in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/builders/base.py", line 84, in log_subprocessor
    raise BuildError(
pdm.exceptions.BuildError: Call command ['/tmp/pdm-test/.venv/bin/python', '/home/jim/.local/lib/python3.9/site-packages/pep517/in_process/_in_process.py', 'get_requires_for_build_wheel', '/home/jim/tmp/tmpwcyrlft6'] return non-zero status(1). Make sure the package is PEP 517-compliant, or you can add `--no-isolation` to the command.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jim/.local/bin/pdm", line 8, in <module>
    sys.exit(main())
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/core.py", line 254, in main
    return Core().main(args)
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/core.py", line 187, in main
    raise cast(Exception, err).with_traceback(traceback)
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/core.py", line 182, in main
    f(options.project, options)
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/cli/commands/lock.py", line 27, in handle
    actions.do_lock(
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/cli/actions.py", line 101, in do_lock
    mapping, dependencies = resolve(
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/resolver/core.py", line 30, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "/home/jim/.local/lib/python3.9/site-packages/resolvelib/resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/home/jim/.local/lib/python3.9/site-packages/resolvelib/resolvers.py", line 373, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "/home/jim/.local/lib/python3.9/site-packages/resolvelib/resolvers.py", line 213, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "/home/jim/.local/lib/python3.9/site-packages/resolvelib/resolvers.py", line 203, in _get_updated_criteria
    for requirement in self._p.get_dependencies(candidate=candidate):
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/resolver/providers.py", line 180, in get_dependencies
    deps, requires_python, _ = self.repository.get_dependencies(candidate)
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/models/repositories.py", line 70, in get_dependencies
    requirements, requires_python, summary = getter(candidate)
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/models/repositories.py", line 35, in wrapper
    result = func(self, candidate)
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/models/repositories.py", line 217, in _get_dependencies_from_metadata
    deps = prepared.get_dependencies_from_metadata()
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/models/candidates.py", line 510, in get_dependencies_from_metadata
    self.req.project_name, self.metadata.requires or [], extras  # type: ignore
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/models/candidates.py", line 494, in metadata
    result = self.prepare_metadata()
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/models/candidates.py", line 486, in prepare_metadata
    setup = Setup.from_directory(self._unpacked_dir)
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/models/setup.py", line 32, in from_directory
    return _SetupReader.read_from_directory(dir)
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/models/setup.py", line 54, in read_from_directory
    new_result = file_reader(filepath)
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/models/setup.py", line 91, in read_setup_py
    install_requires=cls._find_install_requires(setup_call, body),
  File "/home/jim/.local/lib/python3.9/site-packages/pdm/models/setup.py", line 249, in _find_install_requires
    install_requires.append(el.s)
AttributeError: 'BinOp' object has no attribute 's'

Environment Information

$ pdm info
PDM version:
  2.1.2
Python Interpreter:
  /tmp/pdm-test/.venv/bin/python (3.9)
Project Root:
  /tmp/pdm-test
Project Packages:
  None

$ pdm info --env
{
  "implementation_name": "cpython",
  "implementation_version": "3.9.2",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "5.14.0-3-amd64",
  "platform_system": "Linux",
  "platform_version": "#1 SMP Debian 5.14.12-1 (2021-10-14)",
  "python_full_version": "3.9.2",
  "platform_python_implementation": "CPython",
  "python_version": "3.9",
  "sys_platform": "linux"
}
frostming commented 2 years ago

As you said, PDM fails to parse the setup.py because it uses binary + to build the dependency list, which the parser can't read(In fact, you can never build a 100% working setup.py parser due to the dynamic ability of Python language).

So I would suggest you generate the lock file on a macOS platform.