You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In pdm 2.4.6, the current directory __pypackages__/{version}/lib is not referenced, but reference parent directory's one.
Suppose you have the following directory structure.
For example, when python is executed in package1, get_packages_path() in sitecustomize.py returns the location of __pypackages__ in package0.
Similarly, package2 refers to __pypackages__ in package1.
Can't this be made to use __pypackages__ in the current directory?
I assume that the lib directory exists in all __pypackages__ directories.
In fact, the append function works as I expected.
I am wondering if this is the expected behavior according to pdm.
$ cd work_dir
$ mkdir -p package0/package1/
$ cd package0
$ pdm init
# All interactive must be set to 'yes'. Otherwise, the 'name' variable will not be initialized in pyproject.toml
$ pdm add isort # anything is ok.
$ cd package1
$ pdm init
$ pdm add mypy
Good
$ pwd
/path/to/work_dir/package0/package1
$ python -c "import mypy"
$ python -c "import isort"# ModuleNotFoundError: No module named 'isort'
Bad?
$ pwd
/path/to/work_dir/package0/package1
$ python
>>> import isort
>>> import mypy
Traceback (most recent call last):
File "<stdin>", line 1, in<module>
ModuleNotFoundError: No module named 'mypy'
Is your feature request related to a problem? Please describe.
In pdm 2.4.6, the current directory
__pypackages__/{version}/lib
is not referenced, but reference parent directory's one.Suppose you have the following directory structure.
For example, when python is executed in package1,
get_packages_path()
insitecustomize.py
returns the location of__pypackages__
inpackage0
.Similarly,
package2
refers to__pypackages__
inpackage1
.Can't this be made to use
__pypackages__
in the current directory?Version
pdm: 2.4.6
python: 3.10
OS:
Describe the solution you'd like
Use
find_paths.append(script_dir)
pdm/src/pdm/pep582/sitecustomize.py
Line 30 in 62f0cc9
I did not understand the intention of using "insert".
I have looked into the issue and am sorry if this has already been discussed.
The text was updated successfully, but these errors were encountered: