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 use <python-spec> breaks if there is a file/folder named <python-spec> #1523

Closed
Hnasar opened this issue Nov 18, 2022 · 0 comments · Fixed by #1524
Closed

pdm use <python-spec> breaks if there is a file/folder named <python-spec> #1523

Hnasar opened this issue Nov 18, 2022 · 0 comments · Fixed by #1524
Labels
🐛 bug Something isn't working

Comments

@Hnasar
Copy link
Contributor

Hnasar commented Nov 18, 2022

To force PDM to use the python from a virtualenv, we have our CI scripts run pdm use python. Normally this worked, until we had a repo with a folder named "python". We discovered this bug after adding debug logging to PDM. As a workaround we changed it to pdm use .venv/bin/python but still, this bug should be fixed.

Steps to reproduce

  1. (Remove .pdm.toml if it exists, or otherwise run git clean -xfd)
  2. Create a file/folder named python
  3. Create a venv: python -m venv .venv
  4. Run pdm use --ignore-remembered python

Actual behavior

[NoPythonVersion]: No Python interpreter matching python is found.

Expected behavior

Using Python interpreter: .venv/bin/python (3.9)

Environment Information

> pdm info 
Virtualenv C:\Users\foo\projects\gitlab-ci\.venv is reused.
PDM version:
  2.2.1
Python Interpreter:
  C:\Users\foo\projects\gitlab-ci\.venv\Scripts\python.exe (3.11)
Project Root:
  C:/Users/foo/projects/gitlab-ci
Project Packages:
  None

> pdm info --env
{
  "implementation_name": "cpython",
  "implementation_version": "3.11.0",
  "os_name": "nt",
  "platform_machine": "AMD64",
  "platform_release": "10",
  "platform_system": "Windows",
  "platform_version": "10.0.22000",
  "python_full_version": "3.11.0",
  "platform_python_implementation": "CPython",
  "python_version": "3.11",
  "sys_platform": "win32"
}
@Hnasar Hnasar added the 🐛 bug Something isn't working label Nov 18, 2022
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