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

Installation failed when install.cache = true #2355

Closed
1 task done
ethanluoyc opened this issue Nov 1, 2023 · 2 comments · Fixed by #2359
Closed
1 task done

Installation failed when install.cache = true #2355

ethanluoyc opened this issue Nov 1, 2023 · 2 comments · Fixed by #2359
Assignees
Labels
🐛 bug Something isn't working

Comments

@ethanluoyc
Copy link
Contributor

  • 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.

The output is very lengthy, but the interesting bit is

IsADirectoryError: [Errno 21] Is a directory: '/home/name/projects/pdm-example/.venv/lib/python3.10/site-packages/examples'

Steps to reproduce

Here is my pyproject.toml.

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

[project]
name = "pdm-example"
version = "0.1.0"
description = ""
authors = [{ name = "Yicheng Luo", email = "[email protected]" }]
dependencies = [
    "rlax>=0.1.6",
]
requires-python = ">=3.10,<3.11"
readme = "README.md"
license = { text = "MIT" }

[[tool.pdm.source]]
name = "jax_cuda"
url = "https://storage.googleapis.com/jax-releases/jax_cuda_releases.html"
verify_ssl = true
type = "find_links"

[tool.pdm.dev-dependencies]
dev = ["pytest>=7.4.3", "pytest-xdist>=3.3.1"]

You can use a Dockerfile to reproduce this.

# build stage
FROM python:3.10-slim

# install PDM
RUN pip install -U pip setuptools wheel
RUN pip install pdm

# copy files
COPY pyproject.toml README.md /project/

# install dependencies and project into the local packages directory
WORKDIR /project
RUN pdm config install.cache true && pdm install

Actual behavior

the rlax package has some packaging issues that includes a requirements and examples folder which was not supposed to be packaged. Also it is declared as a namespace package. I have reached out to the project maintainer for a fix. Still, I don't think PDM should fail to install the package.

Expected behavior

I expect installing rlax to succeed.

Environment Information

# Paste the output of `pdm info && pdm info --env` below:
PDM version:
  2.10.0
Python Interpreter:
  /home/yicheng/projects/pdm-example/.venv/bin/python (3.10)
Project Root:
  /home/yicheng/projects/pdm-example
Local Packages:

{
  "implementation_name": "cpython",
  "implementation_version": "3.10.13",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "5.15.0-87-generic",
  "platform_system": "Linux",
  "platform_version": "#97~20.04.1-Ubuntu SMP Thu Oct 5 08:25:28 UTC 2023",
  "python_full_version": "3.10.13",
  "platform_python_implementation": "CPython",
  "python_version": "3.10",
  "sys_platform": "linux"
}
@ethanluoyc ethanluoyc added the 🐛 bug Something isn't working label Nov 1, 2023
@xzmeng
Copy link
Contributor

xzmeng commented Nov 1, 2023

Both rlax and its dependency distrax have a examples package, with the latter one is a namespace package.

So PDM internally tries to remove the old symlink but just find a directory. Maybe we can provide more useful information.

BTW, pdm config --local install.cache_method pth should work for this situation.

@ethanluoyc
Copy link
Contributor Author

Yeah I figured that out with some other issues in this repo. Thanks for the swift response!

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.

3 participants