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 does not set the executable bit on __pypackages__/*/bin/* #606

Closed
1 task done
frafra opened this issue Aug 18, 2021 · 0 comments · Fixed by #608
Closed
1 task done

pdm does not set the executable bit on __pypackages__/*/bin/* #606

frafra opened this issue Aug 18, 2021 · 0 comments · Fixed by #608
Labels
🐛 bug Something isn't working

Comments

@frafra
Copy link
Contributor

frafra commented Aug 18, 2021

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

Steps to reproduce

[frafra@e32 tmp.zSys4BFrls]$ pdm init 
Creating a pyproject.toml for PDM...
Please enter the Python interpreter to use
0. /usr/bin/python (3.9)
1. /usr/bin/python3 (3.9)
2. /usr/bin/python3.9 (3.9)
3. /usr/bin/python3.8 (3.8)
4. /usr/bin/python3.7 (3.7)
5. /usr/bin/python3.7m (3.7)
6. /usr/bin/pypy3 (3.6)
7. /usr/bin/pypy3.6 (3.6)
8. /usr/bin/python3.5m (3.5)
9. /usr/bin/python3.5 (3.5)
10. /usr/bin/python3.4m (3.4)
11. /usr/bin/python3.4 (3.4)
12. /usr/bin/python2 (2.7)
13. /usr/bin/python2.7 (2.7)
14. /usr/bin/pypy2.7 (2.7)
15. /usr/bin/pypy2 (2.7)
16. /usr/bin/pypy (2.7)
17. /home/frafra/.local/pipx/venvs/pdm/bin/python (3.9)
Please select: [0]: 
Using Python interpreter: /usr/bin/python (3.9)
Is the project a library that will be uploaded to PyPI? [y/N]: 
License(SPDX name) [MIT]: 
Author name [Francesco Frassinelli]: 
Author email [fraph24@gmail.com]: 
Python requires('*' to allow any) [>=3.9]: 
Changes are written to pyproject.toml.
[frafra@e32 tmp.zSys4BFrls]$ pdm add uwsgi
Adding packages to default dependencies: uwsgi
✔ 🔒 Lock successful
Changes are written to pdm.lock.
Changes are written to pyproject.toml.
Synchronizing working set with lock file: 1 to add, 0 to update, 0 to remove

  ✔ Install uwsgi 2.0.19.1 successful

🎉 All complete!
[frafra@e32 tmp.zSys4BFrls]$ pdm run uwsgi
[PdmUsageError]: Command 'uwsgi' is not found on your PATH.
[frafra@e32 tmp.zSys4BFrls]$ file $(pdm info --packages)/bin/uwsgi
/tmp/tmp.zSys4BFrls/__pypackages__/3.9/bin/uwsgi: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=14e74c627975285d489e98c08dc77591fd6f41d6, for GNU/Linux 3.2.0, with debug_info, not stripped
[frafra@e32 tmp.zSys4BFrls]$ $(pdm info --packages)/bin/uwsgi
bash: /tmp/tmp.zSys4BFrls/__pypackages__/3.9/bin/uwsgi: Permission denied
[frafra@e32 tmp.zSys4BFrls]$ ls -l $(pdm info --packages)/bin/uwsgi
-rw-rw-r-- 1 frafra frafra 1282056 Aug 18 22:33 /tmp/tmp.zSys4BFrls/__pypackages__/3.9/bin/uwsgi
[frafra@e32 tmp.zSys4BFrls]$ chmod +x $(pdm info --packages)/bin/uwsgi
[frafra@e32 tmp.zSys4BFrls]$ $(pdm info --packages)/bin/uwsgi
*** Starting uWSGI 2.0.19.1 (64bit) on [Wed Aug 18 22:37:39 2021] ***
compiled with version: 11.2.1 20210728 (Red Hat 11.2.1-1) on 18 August 2021 20:19:16
os: Linux-5.13.8-200.fc34.x86_64 #1 SMP Wed Aug 4 19:59:54 UTC 2021
[...]

Actual behavior

uwsgi is not executable.

Expected behavior

  1. How do I run CLI scripts in the local package directory?

The recommended way is to prefix your command with pdm run. It is also possible to run CLI scripts directly from the outside. PDM's installer has already injected the package path to the sys.path in the entry script file.

-- README.md

Python classic virtual environment set uwsgi to executable.

Environment Information

# Paste the output of `pdm info && pdm info --env` below:
PDM version:        1.8.0                                 
Python Interpreter: /usr/bin/python (3.9)                 
Project Root:       /tmp/tmp.zSys4BFrls                   
Project Packages:   /tmp/tmp.zSys4BFrls/__pypackages__/3.9
{
  "implementation_name": "cpython",
  "implementation_version": "3.9.6",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "5.13.8-200.fc34.x86_64",
  "platform_system": "Linux",
  "platform_version": "#1 SMP Wed Aug 4 19:59:54 UTC 2021",
  "python_full_version": "3.9.6",
  "platform_python_implementation": "CPython",
  "python_version": "3.9",
  "sys_platform": "linux"
}
@frafra frafra added the 🐛 bug Something isn't working label Aug 18, 2021
@frafra frafra changed the title pdm run does not set PATH correctly pdm does not set the executable bit on __pypackages__/*/bin/* Aug 18, 2021
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