Skip to content

Add console_scripts entry point to executable #1149

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

Merged
merged 4 commits into from
Jul 23, 2025

Conversation

Jeukoh
Copy link
Contributor

@Jeukoh Jeukoh commented Jul 10, 2025

Added [project.entry-points.console_scripts] section to expose the setuptools-scm CLI via uv and other modern tools.

Without this, uv does not recognize the CLI as an executable.
This resolves installability issues when using setuptools-scm as a tool dependency with uv.

ASIS

$ uv tool install setuptools-scm        
Resolved 3 packages in 2ms
Installed 3 packages in 8ms
 + packaging==25.0
 + setuptools==80.9.0
 + setuptools-scm==8.3.1
No executables are provided by `setuptools-scm`

TOBE

$ uv tool install setuptools-scm@git+https://github.com/Jeukoh/setuptools-scm.git@feature/make-it-excutable
    Updated https://github.com/Jeukoh/setuptools-scm.git (ab893770fa9dcd0f2caaa4aa8ecf9c01eee15acd)
Resolved 3 packages in 1.71s
      Built setuptools-scm @ git+https://github.com/Jeukoh/setuptools-scm.git@ab893770fa9dcd0f2caaa4aa8ecf9c01eee15acd
Prepared 1 package in 696ms
Installed 3 packages in 12ms
 + packaging==25.0
 + setuptools==80.9.0
 + setuptools-scm==0.1.dev1861+gab89377 (from git+https://github.com/Jeukoh/setuptools-scm.git@ab893770fa9dcd0f2caaa4aa8ecf9c01eee15acd)
Installed 1 executable: setuptools-scm

$ setuptools-scm
8.3.2.dev15+gab89377

for info

$ which setuptools-scm
/home/jeuk/.local/bin/setuptools-scm

$ cat /home/jeuk/.local/bin/setuptools-scm
#!/home/jeuk/.local/share/uv/tools/setuptools-scm/bin/python3
# -*- coding: utf-8 -*-
import sys
from setuptools_scm._cli import main
if __name__ == "__main__":
    if sys.argv[0].endswith("-script.pyw"):
        sys.argv[0] = sys.argv[0][:-11]
    elif sys.argv[0].endswith(".exe"):
        sys.argv[0] = sys.argv[0][:-4]
    sys.exit(main())

$ cd myproject
$ setuptools-scm
setuptools-scm
0.1.0

Copy link
Contributor

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its unfortunate there's no entrypoint like the pipx one as i wanted to avoid having a script

@Jeukoh
Copy link
Contributor Author

Jeukoh commented Jul 15, 2025

Its unfortunate there's no entrypoint like the pipx one as i wanted to avoid having a script

I feel the same — thanks for understanding. By the way, do you know when the next release is planned?

@RonnyPfannschmidt
Copy link
Contributor

Ill try to do it before the weekend

Im a bit stretched

@RonnyPfannschmidt RonnyPfannschmidt merged commit 3483c74 into pypa:main Jul 23, 2025
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants