-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathupload_package.py
More file actions
33 lines (26 loc) · 781 Bytes
/
Copy pathupload_package.py
File metadata and controls
33 lines (26 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Python script for uploading package to Python index (PyPI)
# Created on 25.06.2022 by Bartlomiej Duda
import os
import shutil
import subprocess
try:
shutil.rmtree("./dist")
except FileNotFoundError:
pass
try:
shutil.rmtree("./ReverseBox.egg-info")
except FileNotFoundError:
pass
try:
shutil.rmtree("./reversebox/ReverseBox.egg-info")
except FileNotFoundError:
pass
repository_url = os.environ["REPOSITORY_URL"]
reversebox_username = os.environ["REVERSEBOX_USERNAME"]
reversebox_password = os.environ["REVERSEBOX_PASSWORD"]
subprocess.call("python setup.py sdist", shell=True)
subprocess.call(
f"twine upload --repository-url {repository_url} dist/* "
f"--username {reversebox_username} --password {reversebox_password}",
shell=True,
)