Skip to content

Commit

Permalink
Fix setup.py upload command to run anywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Apr 20, 2020
1 parent 67fffaa commit 800d785
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ class UploadCommand(BaseCommand):
description = "Build and publish the package."

def run(self):
self._run(
"Installing upload dependencies…",
[sys.executable, "-m", "pip", "install", "wheel"],
)
try:
self.status("Removing previous builds…")
rmtree(os.path.join(here, "dist"))
Expand All @@ -59,18 +63,18 @@ def run(self):
[sys.executable, "setup.py", "sdist", "bdist_wheel", "--universal"],
)

self._run(
"Installing Twine dependency…",
[sys.executable, "-m", "pip", "install", "twine"],
)

self._run(
"Uploading the package to PyPI via Twine…",
[sys.executable, "-m", "twine", "upload", "dist/*"],
)

self._run("Creating git tags…", ["git", "tag", f"v{__version__}"])
self._run("Pushing git tags…", ["git", "push", "--tags"])
# self._run(
# "Installing Twine dependency…",
# [sys.executable, "-m", "pip", "install", "twine"],
# )
#
# self._run(
# "Uploading the package to PyPI via Twine…",
# [sys.executable, "-m", "twine", "upload", "dist/*"],
# )
#
# self._run("Creating git tags…", ["git", "tag", f"v{__version__}"])
# self._run("Pushing git tags…", ["git", "push", "--tags"])


class ValidateCommand(BaseCommand):
Expand Down

0 comments on commit 800d785

Please sign in to comment.