Skip to content

Commit b30f5d2

Browse files
pypi
1 parent 83cb061 commit b30f5d2

File tree

5 files changed

+44
-6
lines changed

5 files changed

+44
-6
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ jobs:
8787
run: mkdir dist && mv artifacts/wheels/* dist/
8888

8989
- name: Publish distribution 📦 to Test PyPI
90-
uses: pypa/gh-action-pypi-publish@master
90+
uses: pypa/gh-action-pypi-publish@release/v1
9191
with:
9292
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
9393
repository_url: https://test.pypi.org/legacy/
9494

9595
- name: Publish distribution 📦 to PyPI
9696
if: startsWith(github.ref, 'refs/tags')
97-
uses: pypa/gh-action-pypi-publish@master
97+
uses: pypa/gh-action-pypi-publish@release/v1
9898
with:
9999
password: ${{ secrets.PYPI_API_TOKEN }}

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.10.6
4+
5+
* Change supported pythons to be 3.7-3.10
6+
7+
## 0.10.5
8+
9+
* No changes
10+
311
## 0.10.4
412

513
* Support `render_mode` to gym environment and update docs to remove references to the confusing `render=True` option.

procgen-build/procgen_build/build_package.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ def main():
2323
}
2424
)
2525
if platform.system() == "Linux":
26-
if "TRAVIS_TAG" in os.environ:
26+
if "GITHUB_REF" in os.environ:
2727
# pass TRAVIS_TAG to the container so that it can build wheels with the correct version number
2828
os.environ["CIBW_ENVIRONMENT"] = (
2929
os.environ["CIBW_ENVIRONMENT"]
30-
+ " TRAVIS_TAG=" + os.environ["TRAVIS_TAG"]
30+
+ " GITHUB_REF=" + os.environ["GITHUB_REF"]
3131
)
3232
os.environ["CIBW_ENVIRONMENT"] = (
3333
os.environ["CIBW_ENVIRONMENT"]

procgen/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.10.5
1+
0.10.6

setup.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,44 @@
33
import os
44
import sys
55
import glob
6+
import subprocess
67

78
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
89
PACKAGE_ROOT = os.path.join(SCRIPT_DIR, "procgen")
910
README = open(os.path.join(SCRIPT_DIR, "README.md"), "rb").read().decode("utf8")
1011

1112
# dynamically determine version number based on git commit
12-
version = open(os.path.join(PACKAGE_ROOT, "version.txt"), "r").read().strip()
13+
def determine_version():
14+
version = open(os.path.join(PACKAGE_ROOT, "version.txt"), "r").read().strip()
15+
sha = "unknown"
1316

17+
try:
18+
sha = (
19+
subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=SCRIPT_DIR)
20+
.decode("ascii")
21+
.strip()
22+
)
23+
except Exception:
24+
pass
25+
26+
if "GITHUB_REF" in os.environ:
27+
ref = os.environ["GITHUB_REF"]
28+
parts = ref.split("/")
29+
assert parts[0] == "refs"
30+
if parts[1] == "tags":
31+
tag = parts[2]
32+
assert tag == version, "mismatch in tag vs version, expected: %s actual: %s" % (
33+
tag,
34+
version,
35+
)
36+
return version
37+
38+
if sha == "unknown":
39+
return version
40+
else:
41+
return version + "+" + sha[:7]
42+
43+
version = determine_version()
1444

1545
# build shared library
1646
class DummyExtension(Extension):

0 commit comments

Comments
 (0)