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

use_uv with workspaces fails to install workspace packages #3312

Open
1 task
ksquarekumar opened this issue Nov 25, 2024 · 4 comments
Open
1 task

use_uv with workspaces fails to install workspace packages #3312

ksquarekumar opened this issue Nov 25, 2024 · 4 comments
Labels
🐛 bug Something isn't working

Comments

@ksquarekumar
Copy link

ksquarekumar commented Nov 25, 2024

Describe the bug

# root pyproject.toml
[tool.pdm.dev-dependencies]
library = [
  "-e file:///${PROJECT_ROOT}/src/library",
]
models = [
  "-e file:///${PROJECT_ROOT}/src/models",
]
service = [
  "-e file:///${PROJECT_ROOT}/src/service"
]

To reproduce

pdm install -G:all -v --frozen-lockfile

error: Failed to install: service-0.0.1-cp312-cp312-manylinux_2_40_x86_64.whl (service==0.0.1 (from file:///projects/org/org-monorepo/src/service))
  Caused by: failed to fill whole buffer

Expected Behavior

Should be able to install the workspace packages

Environment Information

PDM version:
  2.20.1
Python Interpreter:
  /projects/org/org-monorepo/.venv/bin/python (3.12)
Project Root:
  /projects/org/org-monorepo
Local Packages:
  
{
  "implementation_name": "cpython",
  "implementation_version": "3.12.3",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "6.12.1-2-cachyos",
  "platform_system": "Linux",
  "platform_version": "#1 SMP PREEMPT_DYNAMIC Fri, 22 Nov 2024 17:05:17 +0000",
  "python_full_version": "3.12.7",
  "platform_python_implementation": "CPython",
  "python_version": "3.12",
  "sys_platform": "linux"
}

pdm -v output

❯ pdm -v

Usage: pdm [-h] [-V] [-c CONFIG] [-v | -q] [--no-cache] [-I] [--pep582 [SHELL]] [-n] ...

    ____  ____  __  ___
   / __ \/ __ \/  |/  /
  / /_/ / / / / /|_/ /
 / ____/ /_/ / /  / /
/_/   /_____/_/  /_/

Options:
  -h, --help            Show this help message and exit.
  -V, --version         Show the version and exit
  -c CONFIG, --config CONFIG
                        Specify another config file path [env var: PDM_CONFIG_FILE]
  -v, --verbose         Use `-v` for detailed output and `-vv` for more detailed
  -q, --quiet           Suppress output
  --no-cache            Disable the cache for the current command. [env var: PDM_NO_CACHE]
  -I, --ignore-python   Ignore the Python path saved in .pdm-python. [env var: PDM_IGNORE_SAVED_PYTHON]
  --pep582 [SHELL]      Print the command line to be eval'd by the shell for PEP 582
  -n, --non-interactive
                        Don't show interactive prompts but use defaults. [env var: PDM_NON_INTERACTIVE]

Commands:
  add                   Add package(s) to pyproject.toml and install them
  build                 Build artifacts for distribution
  cache                 Control the caches of PDM
  completion            Generate completion scripts for the given shell
  config                Display the current configuration
  export                Export the locked packages set to other formats
  fix                   Fix the project problems according to the latest version of PDM
  import                Import project metadata from other formats
  info                  Show the project information
  init                  Initialize a pyproject.toml for PDM. Built-in templates: - default: `pdm init`, A simple template with a basic structure. - minimal: `pdm init minimal`, A minimal template with only `pyproject.toml`.
  install               Install dependencies from lock file
  list                  List packages installed in the current working set
  lock                  Resolve and lock dependencies
  outdated              Check for outdated packages and list the latest versions on indexes.
  publish               Build and publish the project to PyPI
  python (py)           Manage installed Python interpreters
  remove                Remove packages from pyproject.toml
  run                   Run commands or scripts with local packages loaded
  search                Search for PyPI packages
  self (plugin)         Manage the PDM program itself (previously known as plugin)
  show                  Show the package information
  sync                  Synchronize the current working set with lock file
  update                Update package(s) in pyproject.toml
  use                   Use the given python version or path as base interpreter. If not found, PDM will try to install one.
  venv                  Virtualenv management

Additional Context

It works fine when use_uv is set to false, but is a couple of orders of magnitude slower.
locking works fine, it's the install phase that bugs out.

# service pyproject.toml
[tool.pdm]
distribution = true
version = { source = "file", path = "./service/__init__.py" }

[project]
name = "service"
dynamic = [
  "version",
]
description = "Simple Service"

requires-python = ">= 3.12,<3.13"
readme = "README.md"
license = { file = "LICENSE" }

dependencies = [
  "library @ file:///${PROJECT_ROOT}/../library",
  "aiohttp>=3.11.4",
  "litestar[standard,prometheus]>=2.12.1",
  "orjson>=3.10.11",
  "picologging>=0.9.3",
  "pyyaml>=6.0.2",
  "uvicorn[standard]>=0.32.0",
  "uvloop>=0.21.0",
]

[build-system]
requires = [
  "pdm-backend",
]
build-backend = "pdm.backend"

[tool.pdm.build]
run-setuptools = true

[tool.pdm.build.wheel-data]
scripts = [
  "../../deployments/*",
]
use_uv = true

[venv]
backend = "virtualenv"
in_project = true
with_pip = true

[install]
cache = true

[strategy]
inherit_metadata = false

It might be that I am doing something wring here, but then it works as intended with use_uv set to false.

> tree -a -L 2 .
|-- .env
|-- .gitignore
|-- .venv
|   |-- .gitignore
|   |-- bin
|   |-- etc
|   |-- lib
|   |-- pyvenv.cfg
|   |-- share
|   `-- src
|-- LICENSE
|-- README.md
|-- deployments
|   |-- .gitkeep
|   |-- service
|       |-- Dockerfile
|       |-- .gitkeep
|       |-- settings.default.json
|       |-- launch.py
|-- noxfile.py
|-- pdm.lock
|-- pdm.toml
|-- pyproject.toml
|-- scripts
|   |-- .gitkeep
|   |-- ...
|-- src
|   |-- .gitkeep
|   |-- service
|       |-- pyproject.toml
|       |-- service
|           |-- __init__.py
|           |-- app.py
|           |-- settings.py
|           |-- ...
|   |-- library
|       |-- pyproject.toml
|       |-- library
|           |-- __init__.py
|           |-- lib-module
|               |-- __init__.py
|               |-- ...
|           |-- settings.py
|           |-- ...
|   |-- models
|       |-- pyproject.toml
|       |-- models
|           |-- __init__.py
|           |-- models-module
|               |-- __init__.py
|               |-- ...
|           |-- base.py
|           |-- ...
`-- tests
    |-- __init__.py
    |-- conftest.py
    |-- ...

Are you willing to submit a PR to fix this bug?

  • Yes, I would like to submit a PR.
@ksquarekumar ksquarekumar added the 🐛 bug Something isn't working label Nov 25, 2024
@ksquarekumar ksquarekumar changed the title use_uv with workspace fails to install workspace packages use_uv with workspaces fails to install workspace packages Nov 25, 2024
@frostming
Copy link
Collaborator

When using uv, please stick to the feature set provided by PDM, rather than uv. Otherwise use uv directly. Also the uv integration is experimental.

@frostming frostming closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2024
@ksquarekumar
Copy link
Author

@frostming I don't think I am using any feature outside of pdm, am I ?

@frostming
Copy link
Collaborator

Do you have a repo for reproducing?

@ksquarekumar
Copy link
Author

@frostming sadly, it's private repo, but I you have specifics I would be more than happy to reproduce them.

@frostming frostming reopened this Dec 17, 2024
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

No branches or pull requests

2 participants