浏览代码

Develop allow python 3.7 (#2544)

* relax versions, add python 3.7 to CI

* add workflows

* try paramaterized circleci build, disable slow test

* fix workflow

* fix (?) pyversion

* set job name, fix pip freeze output

* test_requirements.txt

* fix install

* fix paths (again) - should use pushd popd instead

* use pushd and popd

* sort deps, restore unit test, cleanup CI

* relax versions more

* clean up versions in docs

* test older libs for 3.6, newer for 3.7

* pip: progress bar off

* fix gym-unity pip install

* try cat'ing setups for checksum

* dont use fallback (temporarily)

* dont turn off progress bar before upgrading pip

* PR feedback

* add parameter descriptions in CI config
/develop-gpu-test
GitHub 5 年前
当前提交
d21be895
共有 8 个文件被更改,包括 84 次插入34 次删除
  1. 62
      .circleci/config.yml
  2. 2
      docs/Installation-Windows.md
  3. 6
      docs/Installation.md
  4. 12
      ml-agents-envs/setup.py
  5. 21
      ml-agents/setup.py
  6. 5
      test_constraints_max_version.txt
  7. 6
      test_constraints_min_version.txt
  8. 4
      test_requirements.txt

62
.circleci/config.yml


version: 2.0
version: 2.1
executors:
python361:
docker:
- image: circleci/python:3.6.1
python373:
docker:
- image: circleci/python:3.7.3
build:
docker:
- image: circleci/python:3.6.1
build_python:
parameters:
executor:
type: executor
pyversion:
type: string
description: python version to being used (currently only affects caching).
pip_constraints:
type: string
description: Constraints file that is passed to "pip install". We constraint older versions of libraries for older python runtime, in order to help ensure compatibility.
executor: << parameters.executor >>
- run:
# Combine all the python dependencies into one file so that we can use that for the cache checksum
name: Combine pip dependencies for caching
command: cat ml-agents/setup.py ml-agents-envs/setup.py gym-unity/setup.py test_requirements.txt << parameters.pip_constraints >> > python_deps.txt
- v1-dependencies-{{ checksum "ml-agents/setup.py" }}
# Parameterize the cache so that different python versions can get different versions of the packages
- v1-dependencies-py<< parameters.pyversion >>-{{ checksum "python_deps.txt" }}
- v1-dependencies-
- v1-dependencies-py<< parameters.pyversion >>-
- run:
name: Install Dependencies

pip install --upgrade pip
pip install --upgrade setuptools
cd ml-agents-envs && pip install -e .
cd ../ml-agents && pip install -e .
pip install pre-commit pytest-cov==2.6.1
cd ../gym-unity && pip install -e .
pip install --progress-bar=off -e ./ml-agents-envs -c << parameters.pip_constraints >>
pip install --progress-bar=off -e ./ml-agents -c << parameters.pip_constraints >>
pip install --progress-bar=off -r test_requirements.txt -c << parameters.pip_constraints >>
pip install --progress-bar=off -e ./gym-unity -c << parameters.pip_constraints >>
key: v1-dependencies-{{ checksum "ml-agents/setup.py" }}
key: v1-dependencies-py<< parameters.pyversion >>-{{ checksum "python_deps.txt" }}
# This also dumps the installed pip packages to a file, so we can see what versions are actually being used.
pip freeze > test-reports/pip_versions.txt
pytest --cov=ml-agents --cov=ml-agents-envs --cov=gym-unity --cov-report html --junitxml=test-reports/junit.xml -p no:warnings
- run:

- store_artifacts:
path: htmlcov
destination: htmlcov
markdown_link_check:
docker:

pre-commit run --hook-stage manual markdown-link-check --all-files
workflows:
version: 2
build_and_test:
workflow:
- build
- build_python:
name: python_3.6.1
executor: python361
pyversion: 3.6.1
# Test python 3.6 with the oldest supported versions
pip_constraints: test_constraints_min_version.txt
- build_python:
name: python_3.7.3
executor: python373
pyversion: 3.7.3
# Test python 3.7 with the newest supported versions
pip_constraints: test_constraints_max_version.txt
- markdown_link_check

2
docs/Installation-Windows.md


[Download](https://www.anaconda.com/download/#windows) and install Anaconda for
Windows. By using Anaconda, you can manage separate environments for different
distributions of Python. Python 3.5 or 3.6 is required as we no longer support
distributions of Python. Python 3.6.1 or higher is required as we no longer support
Python 2. In this guide, we are using Python version 3.6 and Anaconda version
5.1
([64-bit](https://repo.continuum.io/archive/Anaconda3-5.1.0-Windows-x86_64.exe)

6
docs/Installation.md


### Install Python and mlagents Package
In order to use ML-Agents toolkit, you need Python 3.6.
[Download](https://www.python.org/downloads/) and install Python 3.6 if you do not already have it.
In order to use ML-Agents toolkit, you need Python 3.6.1 or higher.
[Download](https://www.python.org/downloads/) and install the latest version of Python if you do not already have it.
If your Python environment doesn't include `pip3`, see these
[instructions](https://packaging.python.org/guides/installing-using-linux-tools/#installing-pip-setuptools-wheel-with-linux-package-managers)

**Notes:**
- We do not currently support Python 3.7 or Python 3.5.
- We do not currently support Python 3.5 or lower.
- If you are using Anaconda and are having trouble with TensorFlow, please see
the following
[link](https://www.tensorflow.org/install/pip)

12
ml-agents-envs/setup.py


"Topic :: Scientific/Engineering :: Artificial Intelligence",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Pillow>=4.2.1,<=5.4.1",
"numpy>=1.13.3,<=1.16.1",
"pytest>=3.2.2,<4.0.0",
"protobuf>=3.6,<3.7",
"grpcio>=1.11.0,<1.12.0",
"grpcio>=1.11.0",
"numpy>=1.13.3,<2.0",
"Pillow>=4.2.1",
"protobuf>=3.6",
python_requires=">=3.5,<3.8",
python_requires=">=3.5",
)

21
ml-agents/setup.py


"Topic :: Scientific/Engineering :: Artificial Intelligence",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
# find_namespace_packages will recurse through the directories and find all the packages
packages=find_namespace_packages(

install_requires=[
# Test-only dependencies should go in test_requirements.txt, not here.
"docopt",
"grpcio>=1.11.0",
"h5py>=2.9.0",
"jupyter",
"matplotlib",
"tensorflow>=1.7,<1.8",
"numpy>=1.13.3,<2.0",
"matplotlib",
"numpy>=1.13.3,<=1.14.5",
"jupyter",
"pytest>=3.2.2,<4.0.0",
"docopt",
"protobuf>=3.6",
"protobuf>=3.6,<3.7",
"grpcio>=1.11.0,<1.12.0",
"h5py>=2.9.0",
"tensorflow>=1.7,<2.0",
python_requires=">=3.6,<3.7",
python_requires=">=3.6.1",
entry_points={"console_scripts": ["mlagents-learn=mlagents.trainers.learn:main"]},
)

5
test_constraints_max_version.txt


# pip constraints to use the *highest* versions allowed in ml-agents/setup.py
# For projects with upper bounds, we should periodically update this list to the latest release version
grpcio>=1.23.0
numpy>=1.17.2
tensorflow>=1.14.0

6
test_constraints_min_version.txt


# pip constraints to use the *lowest* versions allowed in ml-agents/setup.py
grpcio==1.11.0
numpy==1.13.3
Pillow==4.2.1
protobuf==3.6
tensorflow==1.7

4
test_requirements.txt


# Test-only dependencies should go here, not in setup.py
pytest>=3.2.2,<4.0.0
pre-commit
pytest-cov==2.6.1
正在加载...
取消
保存