-
-
Notifications
You must be signed in to change notification settings - Fork 419
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 add expands submodule relative path to full path #1764
Comments
Note that if you are using the default backend |
Yes, |
Yes, we don't keep relative paths if the backend doesn't support it, because the metadata will be eventually consumed by the backend when building the wheel, without PDM involved. |
FWIW, I tried build-backend pdm-pep517 to build pybind11 extension, by following this doc. The setup files are below. It just works! This is a very nice feature, should be added to pybind11 build doc. # pyproject.toml
[build-system]
requires = ["pdm-pep517>=1.0", "pybind11>=2.10.0"]
build-backend = "pdm.pep517.api"
[tool.pdm]
[tool.pdm.build]
setup-script = "myext.py"
run-setuptools = true and # myext.py
from pybind11.setup_helpers import Pybind11Extension
ext_modules = [
Pybind11Extension(
name="subproj.transformer",
sources=["subproj/transformer.cc"],
extra_compile_args=['-O3'],
cxx_std=20,
),
]
def build(setup_kwargs):
setup_kwargs.update(ext_modules=ext_modules) |
Steps to reproduce
In the project root
/home/user/projects/myproj
there are some submodules like/home/user/projects/myproj/submodules/subproj
. Add this submodule bypdm add ./submodules/subproj
will expand to full path in pyproject.toml like:or by
pdm add -e ./submodules/subproj --dev
, it expands the relative path to/home/user/projects/myproj/submo dules/other_proj
The problem is, these full paths can't be committed to vcs. This is a similar issue to jazzband/pip-tools#204, but in pip requirements.in or txt, it can be remedied as shown in this comment, and it seems working with the latest pip tools without this workaround.
Actual behavior
A relative path of git submodule is expanded to full path in pyproject.toml after running
pdm add
.Expected behavior
The relative path should not be changed.
Environment Information
The text was updated successfully, but these errors were encountered: