File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ __pycache__
88# Build detritus
99build /
1010dist /
11+ dists /
1112.eggs
1213* .egg-info /
1314
Original file line number Diff line number Diff line change 1+ #! python3.7
2+
3+ import glob
4+ import subprocess
5+
6+
7+ def upload (release ):
8+ if release :
9+ repository = ["-r" , "pypi" ]
10+ else :
11+ repository = ["--repository-url" , "https://test.pypi.org/legacy/" ]
12+
13+ dist_files = glob .glob ("dists/*" )
14+ args = ["twine" , "upload" ] + repository + dist_files
15+
16+ subprocess .check_call (args )
17+
18+
19+ if __name__ == "__main__" :
20+ import argparse
21+
22+ parser = argparse .ArgumentParser (description = "Make a release" )
23+ parser .add_argument (
24+ "--release" , action = "store_true" , help = "Used to make a real release"
25+ )
26+
27+ args = parser .parse_args ()
28+
29+ upload (args .release )
Original file line number Diff line number Diff line change @@ -57,3 +57,10 @@ deps = twine
5757commands = python -m pep517.build --source --binary {toxinidir} \
5858 --out-dir {toxinidir}/dists
5959 twine check {toxinidir}/dists/*
60+
61+ [testenv:release]
62+ description = Make a pypi release
63+ basepython = python3.7
64+ passenv = *
65+ deps = twine
66+ commands = python scripts/release.py {posargs}
You can’t perform that action at this time.
0 commit comments