-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54e3982
commit 9063e17
Showing
2 changed files
with
11 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
import os | ||
import subprocess | ||
import logging | ||
|
||
if not (os.getenv("TWINE_USERNAME") and os.getenv("TWINE_PASSWORD")): | ||
raise EnvironmentError("You have to set your TWINE_USERNAME and TWINE_PASSWORD as environment variable") | ||
|
||
versions = {"3.6": "cp36-cp36m", "3.7": "cp37-cp37m", "3.8": "cp38-cp38", "3.9": "cp39-cp39"} | ||
for version in versions: | ||
print(f"Building wheel for Python {version}") | ||
logging.info(f"Building wheel for Python {version}") | ||
subprocess.call([f"/opt/python/{versions[version]}/bin/python", "setup.py", "bdist_wheel"]) | ||
|
||
print("Repairing wheels") | ||
logging.info("Repairing wheels") | ||
for file in os.listdir("dist"): | ||
if os.path.isfile(os.path.join(os.getcwd(), "dist", file)): | ||
subprocess.call(["auditwheel", "repair", os.path.join(os.getcwd(), "dist", file)]) | ||
|
||
|
||
logging.info("Uploading built binary to PyPI") | ||
subprocess.call(["twine", "upload", "wheelhouse/*"]) |