mirror of
https://github.com/astral-sh/uv
synced 2026-01-20 21:10:10 -05:00
Add release workflow (#961)
## Summary This PR adds a release workflow powered by `cargo-dist`. It's similar to the version that's PR'd in Ruff (https://github.com/astral-sh/ruff/pull/9559), with the exception that it doesn't include the Docker build or the "update dependents" step for pre-commit.
This commit is contained in:
0
python/puffin/__init__.py
Normal file
0
python/puffin/__init__.py
Normal file
39
python/puffin/__main__.py
Normal file
39
python/puffin/__main__.py
Normal file
@@ -0,0 +1,39 @@
|
||||
import os
|
||||
import sys
|
||||
import sysconfig
|
||||
|
||||
|
||||
def find_puffin_bin() -> str:
|
||||
"""Return the puffin binary path."""
|
||||
|
||||
puffin_exe = "puffin" + sysconfig.get_config_var("EXE")
|
||||
|
||||
path = os.path.join(sysconfig.get_path("scripts"), puffin_exe)
|
||||
if os.path.isfile(path):
|
||||
return path
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
user_scheme = sysconfig.get_preferred_scheme("user")
|
||||
elif os.name == "nt":
|
||||
user_scheme = "nt_user"
|
||||
elif sys.platform == "darwin" and sys._framework:
|
||||
user_scheme = "osx_framework_user"
|
||||
else:
|
||||
user_scheme = "posix_user"
|
||||
|
||||
path = os.path.join(sysconfig.get_path("scripts", scheme=user_scheme), puffin_exe)
|
||||
if os.path.isfile(path):
|
||||
return path
|
||||
|
||||
raise FileNotFoundError(path)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
puffin = os.fsdecode(find_puffin_bin())
|
||||
if sys.platform == "win32":
|
||||
import subprocess
|
||||
|
||||
completed_process = subprocess.run([puffin, *sys.argv[1:]])
|
||||
sys.exit(completed_process.returncode)
|
||||
else:
|
||||
os.execvp(puffin, [puffin, *sys.argv[1:]])
|
||||
Reference in New Issue
Block a user