We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
On a MacOS machine, create the following pyproject.toml
pyproject.toml
[project] name = "" version = "" description = "" authors = [ {name = "", email = ""}, ] dependencies = [] requires-python = ">=3.9" [project.optional-dependencies] cpu = [ 'torch==2.0.1 ; sys_platform == "darwin"', 'torch==2.0.1+cpu ; sys_platform == "linux"', ]
Run the following commands:
$ pdm config pypi.torch.url https://download.pytorch.org/whl/cpu -v $ pdm lock -G cpu -v $ pdm sync -G cpu -v
$ pdm lock -G cpu -v STATUS: Resolving dependencies pdm.termui: ======== Start resolving requirements ======== pdm.termui: torch==2.0.1+cpu; sys_platform == "linux" pdm.termui: python>=3.9 pdm.termui: Adding requirement torch==2.0.1+cpu; sys_platform == "linux" pdm.termui: Adding requirement python>=3.9 pdm.termui: ======== Starting round 0 ======== STATUS: Resolving: new pin python>=3.9 pdm.termui: Pinning: python None pdm.termui: ======== Ending round 0 ======== pdm.termui: ======== Starting round 1 ======== pdm.termui: Adding requirement filelock(from torch 2.0.1+cpu) pdm.termui: Adding requirement typing-extensions(from torch 2.0.1+cpu) pdm.termui: Adding requirement sympy(from torch 2.0.1+cpu) pdm.termui: Adding requirement networkx(from torch 2.0.1+cpu) pdm.termui: Adding requirement jinja2(from torch 2.0.1+cpu) STATUS: Resolving: new pin torch 2.0.1+cpu pdm.termui: Pinning: torch 2.0.1+cpu pdm.termui: ======== Ending round 1 ======== pdm.termui: ======== Starting round 2 ======== STATUS: Resolving: new pin filelock 3.12.2 pdm.termui: Pinning: filelock 3.12.2 pdm.termui: ======== Ending round 2 ======== pdm.termui: ======== Starting round 3 ======== pdm.termui: Adding requirement MarkupSafe>=2.0(from jinja2 3.1.2) STATUS: Resolving: new pin jinja2 3.1.2 pdm.termui: Pinning: jinja2 3.1.2 pdm.termui: ======== Ending round 3 ======== pdm.termui: ======== Starting round 4 ======== STATUS: Resolving: new pin networkx 3.1 pdm.termui: Pinning: networkx 3.1 pdm.termui: ======== Ending round 4 ======== pdm.termui: ======== Starting round 5 ======== pdm.termui: Adding requirement mpmath>=0.19(from sympy 1.12) STATUS: Resolving: new pin sympy 1.12 pdm.termui: Pinning: sympy 1.12 pdm.termui: ======== Ending round 5 ======== pdm.termui: ======== Starting round 6 ======== STATUS: Resolving: new pin typing-extensions 4.6.3 pdm.termui: Pinning: typing-extensions 4.6.3 pdm.termui: ======== Ending round 6 ======== pdm.termui: ======== Starting round 7 ======== STATUS: Resolving: new pin MarkupSafe 2.1.3 pdm.termui: Pinning: MarkupSafe 2.1.3 pdm.termui: ======== Ending round 7 ======== pdm.termui: ======== Starting round 8 ======== STATUS: Resolving: new pin mpmath 1.3.0 pdm.termui: Pinning: mpmath 1.3.0 pdm.termui: ======== Ending round 8 ======== pdm.termui: ======== Starting round 9 ======== pdm.termui: ======== Resolution Result ======== pdm.termui: Stable pins: pdm.termui: python None pdm.termui: torch 2.0.1+cpu pdm.termui: filelock 3.12.2 pdm.termui: jinja2 3.1.2 pdm.termui: networkx 3.1 pdm.termui: sympy 1.12 pdm.termui: typing-extensions 4.6.3 pdm.termui: markupsafe 2.1.3 pdm.termui: mpmath 1.3.0 STATUS: Fetching hashes for resolved packages... pdm.termui: Fetching hashes for filelock@3.12.2 pdm.termui: Fetching hashes for typing-extensions@4.6.3 pdm.termui: Fetching hashes for jinja2@3.1.2 pdm.termui: Fetching hashes for sympy@1.12 pdm.termui: Fetching hashes for networkx@3.1 pdm.termui: Fetching hashes for mpmath@1.3.0 pdm.termui: Fetching hashes for MarkupSafe@2.1.3 pdm.termui: Fetching hashes for torch@2.0.1+cpu 🔒 Lock successful Changes are written to pdm.lock. $ pdm sync -G cpu -v STATUS: Resolving packages from lockfile... STATUS: Fetching hashes for resolved packages... All packages are synced to date, nothing to do. 🎉 All complete!
When syncing, torch for MacOS should be installed. The dependency 'torch==2.0.1 ; sys_platform == "darwin"' is currently ignored.
torch
'torch==2.0.1 ; sys_platform == "darwin"'
$ pdm info && pdm info --env PDM version: 2.7.4 Python Interpreter: /Users/bilelomrani/.pyenv/versions/3.9.16/envs/test-pdm/bin/python (3.9) Project Root: /Users/bilelomrani/Documents/ILLUIN.nosync/test-torch-package Local Packages: { "implementation_name": "cpython", "implementation_version": "3.9.16", "os_name": "posix", "platform_machine": "x86_64", "platform_release": "22.3.0", "platform_system": "Darwin", "platform_version": "Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64", "python_full_version": "3.9.16", "platform_python_implementation": "CPython", "python_version": "3.9", "sys_platform": "darwin" }
The text was updated successfully, but these errors were encountered:
We currently not support multiple specifications for the same package.
As a workaround, you put them in different groups and create two lockfiles for them separately.
Sorry, something went wrong.
No branches or pull requests
Steps to reproduce
On a MacOS machine, create the following
pyproject.toml
Run the following commands:
Actual behavior
Expected behavior
When syncing,
torch
for MacOS should be installed. The dependency'torch==2.0.1 ; sys_platform == "darwin"'
is currently ignored.Environment Information
The text was updated successfully, but these errors were encountered: