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 init -n is slow #2463

Open
1 task done
deronnax opened this issue Dec 5, 2023 · 0 comments
Open
1 task done

pdm init -n is slow #2463

deronnax opened this issue Dec 5, 2023 · 0 comments
Labels
🐛 bug Something isn't working

Comments

@deronnax
Copy link
Sponsor Contributor

deronnax commented Dec 5, 2023

  • I have searched the issue tracker and believe that this is not a duplicate.

Steps to reproduce

➜ time pdm init -n -v
Creating a pyproject.toml for PDM...
Project is initialized successfully
pdm init -n -v  1,86s user 1,97s system 45% cpu 8,467 total

Actual behavior

pdm init -n is slow (consistently ~8 seconds).

Expected behavior

pdm init -n should be near instant.

Environment Information

I ran pdm init without the -n to have a better glimpse, and PDM to take an unreasonable amount of time just before the choose
your python question
. Then it behaves normally. I believe the search of all python interpreter on my system is what take him most of the time. Since I do a lot of packaging-related stuff, I have many python version on my machine. Here is what pdm init finds in the interactive mode:

Please enter the Python interpreter to use
0. /Users/mathieu/.pyenv/shims/python3 (3.10)
1. /Users/mathieu/.pyenv/shims/python (3.10)
2. /opt/homebrew/bin/python3.12 (3.12)
3. /Users/mathieu/.pyenv/shims/python3.11 (3.11)
4. /opt/homebrew/bin/python3.11 (3.11)
5. /Users/mathieu/.rye/py/cpython@3.11.5/install/bin/python3 (3.11)
6. /Users/mathieu/.pyenv/versions/3.11.5/bin/python3.11 (3.11)
7. /Users/mathieu/.pyenv/versions/pypy3.10-7.3.13/bin/pypy3.10 (3.10)
8. /Users/mathieu/.pyenv/versions/3.10.13/bin/python3.10 (3.10)
9. /Users/mathieu/.pyenv/shims/python3.10 (3.10)
10. /Users/mathieu/.rye/py/cpython@3.10.12/install/bin/python3 (3.10)
11. /Users/mathieu/.pyenv/versions/3.9.17/bin/python3.9 (3.9)
12. /usr/bin/python3 (3.9)
13. /Users/mathieu/.pyenv/versions/3.8.17/bin/python3.8 (3.8)
14. /Users/mathieu/.pyenv/versions/graalpy-22.3.0/bin/python3 (3.8)
15. /Users/mathieu/.pyenv/versions/graalpy-22.3.0/bin/python (3.8)
16. /Users/mathieu/.pyenv/versions/3.7.17/bin/python3.7m (3.7)
17. /Users/mathieu/.pyenv/versions/3.7.17/bin/python3.7 (3.7)
18. /Users/mathieu/.pyenv/versions/3.6.15/bin/python3.6m (3.6)
19. /Users/mathieu/.pyenv/versions/3.6.15/bin/python3.6 (3.6)
20. /opt/homebrew/Cellar/python@3.12/3.12.0/Frameworks/Python.framework/Versions/3.12/bin/python3.12 (3.12)
➜ pdm info && pdm info --env
PDM version:
  2.10.4
Python Interpreter:
  /Users/mathieu/Library/Application Support/pdm/venvs/arnault-poetry-0k1Cy1qo-3.10/bin/python (3.10)
Project Root:
  /tmp/pdmtest
Local Packages:
  
{
  "implementation_name": "cpython",
  "implementation_version": "3.10.13",
  "os_name": "posix",
  "platform_machine": "arm64",
  "platform_release": "23.1.0",
  "platform_system": "Darwin",
  "platform_version": "Darwin Kernel Version 23.1.0: Mon Oct  9 21:28:31 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T8112",
  "python_full_version": "3.10.13",
  "platform_python_implementation": "CPython",
  "python_version": "3.10",
  "sys_platform": "darwin"
}
@deronnax deronnax added the 🐛 bug Something isn't working label Dec 5, 2023
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

1 participant