Skip to content

Commit

Permalink
split record_vcs_info from sdist, add subcommand for it
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Feb 29, 2024
1 parent c22bd46 commit 1cbc65c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ def make_rpm() -> None:
disttarxz = os.path.join("dist", tarxz)
if os.path.exists(disttarxz):
os.unlink(disttarxz)
record_vcs_info()
saved = sys.argv
try:
sys.argv = ["./setup.py", "sdist", "--formats=xztar"]
Expand Down Expand Up @@ -520,7 +521,6 @@ def make_rpm() -> None:


def sdist() -> None:
record_vcs_info()
try:
from setuptools import setup
except ImportError:
Expand Down Expand Up @@ -550,6 +550,7 @@ def show_help(args) -> int:
cmd = args[0]
print("invalid number of arguments, usage:")
print(f"{cmd} sdist")
print(f"{cmd} record-vcs-info")
print(f"{cmd} install")
print(f"{cmd} install ROOT [INSTALL_DIR] [CONFIG_DIR] [MINIFIER]")
print(f"{cmd} deb")
Expand All @@ -563,8 +564,12 @@ def main(args) -> int:
return show_help(args)
cmd = args[1]
if cmd == "sdist":
record_vcs_info()
sdist()
return 0
if cmd == "record-vcs-info":
record_vcs_info()
return 0
if cmd == "install":
if not load_vcs_info():
try:
Expand Down

0 comments on commit 1cbc65c

Please sign in to comment.