浏览代码
Deploy new versions to pypi (#2789)
Deploy new versions to pypi (#2789)
* add VERSION variable to each setup.py * update setups and config * fix index * fix indent for real * fix parameter * Bump version to 0.11.0.dev0 * Change CircleCI config to support dev releases * Minor fix to deploy regex * fix url in comments * More circleCI tweaks * Remove filters / 0.11.0.dev3 * Use test .pypirc * Add config file flag to twine * Manually pass user and pass to twine * 0.11.0.dev0 * add precommit validation step * remove todo * Revert version to 0.10.1 * Docstring tweaks * fix gym version/develop-gpu-test
GitHub
5 年前
当前提交
0438acbf
共有 6 个文件被更改,包括 194 次插入 和 11 次删除
-
65.circleci/config.yml
-
5.pre-commit-config.yaml
-
29gym-unity/setup.py
-
30ml-agents-envs/setup.py
-
37ml-agents/setup.py
-
39utils/validate_versions.py
|
|||
#!/usr/bin/env python |
|||
|
|||
import os |
|||
import sys |
|||
from typing import Dict |
|||
|
|||
VERSION_LINE_START = "VERSION = " |
|||
|
|||
DIRECTORIES = ["ml-agents", "ml-agents-envs", "gym-unity"] |
|||
|
|||
|
|||
def extract_version_string(filename): |
|||
with open(filename) as f: |
|||
for l in f.readlines(): |
|||
if l.startswith(VERSION_LINE_START): |
|||
return l.replace(VERSION_LINE_START, "").strip() |
|||
return None |
|||
|
|||
|
|||
def check_versions() -> bool: |
|||
version_by_dir: Dict[str, str] = {} |
|||
for directory in DIRECTORIES: |
|||
path = os.path.join(directory, "setup.py") |
|||
version = extract_version_string(path) |
|||
print(f"Found version {version} for {directory}") |
|||
version_by_dir[directory] = version |
|||
|
|||
# Make sure we have exactly one version, and it's not none |
|||
versions = set(version_by_dir.values()) |
|||
if len(versions) != 1 or None in versions: |
|||
print("Each setup.py must have the same VERSION string.") |
|||
return False |
|||
return True |
|||
|
|||
|
|||
if __name__ == "__main__": |
|||
ok = check_versions() |
|||
return_code = 0 if ok else 1 |
|||
sys.exit(return_code) |
撰写
预览
正在加载...
取消
保存
Reference in new issue