浏览代码

update setups and config

/tag-0.11.0.dev0
Chris Elion 5 年前
当前提交
229d0cc3
共有 4 个文件被更改,包括 149 次插入6 次删除
  1. 75
      .circleci/config.yml
  2. 23
      gym-unity/setup.py
  3. 26
      ml-agents-envs/setup.py
  4. 31
      ml-agents/setup.py

75
.circleci/config.yml


path: /tmp/proto.patch
destination: proto.patch
deploy:
parameters:
version:
type: directory
docker:
- image: circleci/python:3.6
steps:
- checkout
- run:
name: install python dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install setuptools wheel twine
- run:
name: verify git tag vs. version
command: |
python3 -m venv venv
. venv/bin/activate
cd << parameters.directory >>
python setup.py verify
- run:
name: init .pypirc
# TODO update username for final release
command: |
echo -e "[pypi]" >> ~/.pypirc
echo -e "username = mlagents-test" >> ~/.pypirc
echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
- run:
# TODO example doesn't use venv here but I think we need it
name: create packages
command: |
. venv/bin/activate
cd << parameters.directory >>
python setup.py sdist
python setup.py bdist_wheel
- run:
name: upload to pypi
# TODO remove --repository-url for final release
command: |
. venv/bin/activate
cd << parameters.directory >>
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
workflows:
workflow:
jobs:

pip_constraints: test_constraints_max_version.txt
- markdown_link_check
- protobuf_generation_check
- deploy:
name: deploy ml-agents-envs
directory: ml-agents-envs
requires:
- python_3.7.3
filters:
tags:
only: /[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- deploy:
name: deploy ml-agents
directory: ml-agents
requires:
- python_3.7.3
filters:
tags:
only: /[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- deploy:
name: deploy gym-unity
directory: gym-unity
requires:
- python_3.7.3
filters:
tags:
only: /[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/

23
gym-unity/setup.py


#!/usr/bin/env python
import os
import sys
from setuptools.command.install import install
class VerifyVersionCommand(install):
"""
Custom command to verify that the git tag matches our version
See https://circleci.com/blog/Adding-container-security-scanning-anchore/
"""
description = "verify that the git tag matches our version"
def run(self):
tag = os.getenv("CIRCLE_TAG")
if tag != VERSION:
info = "Git tag: {0} does not match the version of this app: {1}".format(
tag, VERSION
)
sys.exit(info)
setup(
name="gym_unity",
version=VERSION,

url="https://github.com/Unity-Technologies/ml-agents",
packages=find_packages(),
install_requires=["gym", "mlagents_envs=={}".format(VERSION)],
cmdclass={"verify": VerifyVersionCommand},
)

26
ml-agents-envs/setup.py


import os
import sys
from os import path
from setuptools.command.install import install
here = path.abspath(path.dirname(__file__))
here = os.path.abspath(os.path.dirname(__file__))
class VerifyVersionCommand(install):
"""
Custom command to verify that the git tag matches our version
See https://circleci.com/blog/Adding-container-security-scanning-anchore/
"""
description = "verify that the git tag matches our version"
def run(self):
tag = os.getenv("CIRCLE_TAG")
if tag != VERSION:
info = "Git tag: {0} does not match the version of this app: {1}".format(
tag, VERSION
)
sys.exit(info)
setup(
name="mlagents_envs",

"protobuf>=3.6",
],
python_requires=">=3.5",
cmdclass={"verify": VerifyVersionCommand},
)

31
ml-agents/setup.py


from setuptools import setup, find_namespace_packages
from os import path
import os
import sys
from setuptools import setup, find_namespace_packages
from setuptools.command.install import install
here = path.abspath(path.dirname(__file__))
here = os.path.abspath(os.path.dirname(__file__))
class VerifyVersionCommand(install):
"""
Custom command to verify that the git tag matches our version
See https://circleci.com/blog/Adding-container-security-scanning-anchore/
"""
description = "verify that the git tag matches our version"
def run(self):
tag = os.getenv("CIRCLE_TAG")
if tag != VERSION:
info = "Git tag: {0} does not match the version of this app: {1}".format(
tag, VERSION
)
sys.exit(info)
with open(path.join(here, "README.md"), encoding="utf-8") as f:
with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setup(

],
python_requires=">=3.6.1",
entry_points={"console_scripts": ["mlagents-learn=mlagents.trainers.learn:main"]},
cmdclass={"verify": VerifyVersionCommand},
)
正在加载...
取消
保存