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

pdm install failed when using VCS dependencies with "subdirectory" in URL #1630

Closed
1 task done
lc6chang opened this issue Jan 18, 2023 · 1 comment · Fixed by j178/pdm#1
Closed
1 task done

pdm install failed when using VCS dependencies with "subdirectory" in URL #1630

lc6chang opened this issue Jan 18, 2023 · 1 comment · Fixed by j178/pdm#1
Labels
🐛 bug Something isn't working

Comments

@lc6chang
Copy link

  • I have searched the issue tracker and believe that this is not a duplicate.

Make sure you run commands with -v flag before pasting the output.

Steps to reproduce

  • Prepare an empty pdm workspace:

    mkdir pdmworkspace
    cd pdmworkspace
  • Create pyproject.toml with:

    [project]
    name = ""
    version = ""
    description = ""
    authors = []
    dependencies = [
        'testpdm1@git+ssh://[email protected]/lc6chang/test-pdm@master#subdirectory=test_pdm1',
        'testpdm2@git+ssh://[email protected]/lc6chang/test-pdm@master#subdirectory=test_pdm2',
    ]
    requires-python = ">=3.10"
    
    [tool.pdm]
  • Install by pdm:

    pdm install -v

Actual behavior

Failed with:

Lock file does not exist
Updating the lock file...
python.use_venv is on, creating a virtualenv for this project...
...
STATUS: Resolving dependencies
...
STATUS: Resolving: new pin python>=3.10
...
STATUS: Resolving: new pin testpdm1 0.0.0
...
STATUS: Resolving: new pin testpdm2 0.0.0
...
STATUS: Fetching hashes for resolved packages...
...
🔒 Lock successful
Changes are written to pdm.lock.
STATUS: Resolving packages from lockfile...
STATUS: Fetching hashes for resolved packages...
pdm.termui: Fetching hashes for testpdm1@git+ssh://[email protected]/lc6chang/test-pdm@3ec8f94e2862a135f349daf3d478cf5af97364dc
pdm.termui: Fetching hashes for testpdm2@git+ssh://[email protected]/lc6chang/test-pdm@3ec8f94e2862a135f349daf3d478cf5af97364dc
Synchronizing working set with lock file: 2 to add, 0 to update, 0 to remove
...
unearth.vcs.git: Cloning ssh://***@github.com/lc6chang/test-pdm (revision: 3ec8f94e2862a135f349daf3d478cf5af97364dc) to /var/...
unearth.vcs.git: Cloning ssh://***@github.com/lc6chang/test-pdm (revision: 3ec8f94e2862a135f349daf3d478cf5af97364dc) to /var/...
unearth.vcs.git: Resolved ssh://***@github.com/lc6chang/test-pdm to commit 3ec8f94e2862a135f349daf3d478cf5af97364dc
pdm.termui: Preparing isolated env for PEP 517 build...
unearth.vcs.git: Resolved ssh://***@github.com/lc6chang/test-pdm to commit 3ec8f94e2862a135f349daf3d478cf5af97364dc
pdm.termui: Preparing isolated env for PEP 517 build...
pdm.termui: Saving wheel to cache: <Link git+ssh://***@github.com/lc6chang/test-pdm@3ec8f94e2862a135f349daf3d478cf5af97364dc (from None)>
pdm.termui: Running PEP 517 backend to build a wheel for <Link git+ssh://***@github.com/lc6chang/test-pdm@3ec8f94e2862a135f349daf3d478cf5af97364dc (from None)>
pdm.termui: Saving wheel to cache: <Link git+ssh://***@github.com/lc6chang/test-pdm@3ec8f94e2862a135f349daf3d478cf5af97364dc (from None)>
pdm.termui: Running PEP 517 backend to build a wheel for <Link git+ssh://***@github.com/lc6chang/test-pdm@3ec8f94e2862a135f349daf3d478cf5af97364dc (from None)>
pdm.termui: error: Multiple top-level packages discovered in a flat-layout: ['test_pdm2', 'test_pdm1'].
pdm.termui: 
pdm.termui: To avoid accidental inclusion of unwanted files or directories,
pdm.termui: setuptools will not proceed with this build.
pdm.termui: 
pdm.termui: If you are trying to create a single distribution with multiple packages
pdm.termui: on purpose, you should not rely on automatic discovery.
pdm.termui: Instead, consider the following options:
pdm.termui: 
pdm.termui: 1. set up custom discovery (`find` directive with `include` or `exclude`)
pdm.termui: 2. use a `src-layout`
pdm.termui: 3. explicitly set `py_modules` or `packages` with a list of names
pdm.termui: 
pdm.termui: To find more information, look for "package discovery" on setuptools docs.
pdm.termui: error: Multiple top-level packages discovered in a flat-layout: ['test_pdm2', 'test_pdm1'].
pdm.termui: 
pdm.termui: To avoid accidental inclusion of unwanted files or directories,
pdm.termui: setuptools will not proceed with this build.
pdm.termui: 
pdm.termui: If you are trying to create a single distribution with multiple packages
pdm.termui: on purpose, you should not rely on automatic discovery.
pdm.termui: Instead, consider the following options:
pdm.termui: 
pdm.termui: 1. set up custom discovery (`find` directive with `include` or `exclude`)
pdm.termui: 2. use a `src-layout`
pdm.termui: 3. explicitly set `py_modules` or `packages` with a list of names
pdm.termui: 
pdm.termui: To find more information, look for "package discovery" on setuptools docs.
  ✖ Install testpdm2 0.0.0 failed
  ✖ Install testpdm1 0.0.0 failed
...

Expected behavior

Lock file does not exist
Updating the lock file...
python.use_venv is on, creating a virtualenv for this project...
Virtualenv is created successfully at ...
🔒 Lock successful
Changes are written to pdm.lock.
Synchronizing working set with lock file: 2 to add, 0 to update, 0 to remove

  ✔ Install testpdm1 0.0.0 successful
  ✔ Install testpdm2 0.0.0 successful

🎉 All complete!

Environment Information

# Paste the output of `pdm info && pdm info --env` below:
PDM version:
  2.4.0
Python Interpreter:
  /Users/myuser/pdmworkspace/.venv/bin/python (3.10)
Project Root:
  /Users/myuser/pdmworkspace
Project Packages:
  None
{
  "implementation_name": "cpython",
  "implementation_version": "3.10.8",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "18.6.0",
  "platform_system": "Darwin",
  "platform_version": "Darwin Kernel Version 18.6.0: Sun Apr 28 18:06:45 PDT 2019; root:xnu-4903.261.4~6/RELEASE_X86_64",
  "python_full_version": "3.10.8",
  "platform_python_implementation": "CPython",
  "python_version": "3.10",
  "sys_platform": "darwin"
}
@lc6chang lc6chang added the 🐛 bug Something isn't working label Jan 18, 2023
@lc6chang
Copy link
Author

lc6chang commented Jan 18, 2023

If I downgrade pdm to 2.1.3, it can be installed successfully; if I downgrade pdm to 2.1.4, it failed with a different error:

🔒 Lock successful
Changes are written to pdm.lock.
Synchronizing working set with lock file: 2 to add, 0 to update, 0 to remove

unearth.vcs.git: Cloning ssh://***@github.com/lc6chang/test-pdm (revision: 3ec8f94e2862a135f349daf3d478cf5af97364dc) to /var/...
unearth.vcs.git: Cloning ssh://***@github.com/lc6chang/test-pdm (revision: 3ec8f94e2862a135f349daf3d478cf5af97364dc) to /var/...
unearth.vcs.git: Resolved ssh://***@github.com/lc6chang/test-pdm to commit 3ec8f94e2862a135f349daf3d478cf5af97364dc
unearth.vcs.git: Resolved ssh://***@github.com/lc6chang/test-pdm to commit 3ec8f94e2862a135f349daf3d478cf5af97364dc
pdm.termui: Preparing isolated env for PEP 517 build...
pdm.termui: Preparing isolated env for PEP 517 build...
  ✖ Install testpdm2 0.0.0 failed
  ✖ Install testpdm1 0.0.0 failed
pdm.termui: Error occurs: 
...
  File ".../lib/python3.10/site-packages/pdm/pep517/base.py", line 143, in _read_pyproject_toml
    raise ProjectError("No pyproject.toml found")
pdm.pep517.exceptions.ProjectError: No pyproject.toml found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant