Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ __pycache__
# Build detritus
build/
dist/
dists/
.eggs
*.egg-info/

Expand Down
29 changes: 29 additions & 0 deletions scripts/release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#! python3.7

import glob
import subprocess


def upload(release):
if release:
repository = ["-r", "pypi"]
else:
repository = ["--repository-url", "https://test.pypi.org/legacy/"]

dist_files = glob.glob("dists/*")
args = ["twine", "upload"] + repository + dist_files

subprocess.check_call(args)


if __name__ == "__main__":
import argparse

parser = argparse.ArgumentParser(description="Make a release")
parser.add_argument(
"--release", action="store_true", help="Used to make a real release"
)

args = parser.parse_args()

upload(args.release)
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,10 @@ deps = twine
commands = python -m pep517.build --source --binary {toxinidir} \
--out-dir {toxinidir}/dists
twine check {toxinidir}/dists/*

[testenv:release]
description = Make a pypi release
basepython = python3.7
passenv = *
deps = twine
commands = python scripts/release.py {posargs}