Skip to content

Commit b4cbaa6

Browse files
miguelalonsojrGitHub Enterprise
authored and
GitHub Enterprise
committed
Develop deprecate python 3.6 (#5)
* Dropped support for python 3.6 * Pinning python 3.9.9 for tests due to typing issues with 3.9.10 * Testing new bokken image. * Testing new bokken image. * Updated yamato standalone build test. * Updated yamato standalone build test. * Updated standalone build test. * Updated yamato configs to use mla bokken vm. * Bug fixes for yamato yml files. * Fixed com.unity.ml-agents-test.yml * Bumped min python version to 3.7.2 * Updated failing yamato jobs. * Updated github workflow for colab tests. * Updated github workflow for colab tests. * Updated github workflow for colab tests.
1 parent b388f51 commit b4cbaa6

25 files changed

+191
-182
lines changed

.github/workflows/colab.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Set up Python
3131
uses: actions/setup-python@v2
3232
with:
33-
python-version: 3.8.x
33+
python-version: 3.9.9
3434
- uses: actions/setup-dotnet@v1
3535
with:
3636
dotnet-version: '6.0.x'

.github/workflows/pytest.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,11 @@ jobs:
2424
# If one test in the matrix fails we still want to run the others.
2525
fail-fast: false
2626
matrix:
27-
# NOTE: 3.9.10 was failing but is hard to test since it JUST came out. Delaying debugging for now.
28-
# TODO: Set back to 3.9.x once we can test with 3.9.10 via pyenv.
29-
python-version: [3.6.x, 3.7.x, 3.8.x, 3.9.9]
27+
# pinning python 3.9.9 since there are typing issues with 3.9.10: https://github.com/Unity-Technologies/ml-agents/issues/5689
28+
python-version: [3.7.x, 3.8.x, 3.9.9]
3029
include:
31-
- python-version: 3.6.x
32-
pip_constraints: test_constraints_min_version.txt
3330
- python-version: 3.7.x
34-
pip_constraints: test_constraints_mid_version.txt
31+
pip_constraints: test_constraints_min_version.txt
3532
- python-version: 3.8.x
3633
pip_constraints: test_constraints_mid_version.txt
3734
- python-version: 3.9.9

.yamato/com.unity.ml-agents-coverage.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ test_coverage_{{ package.name }}_{{ platform.name }}_{{ editor.version }}:
1414
commands:
1515
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
1616
- upm-ci project test -u {{ editor.version }} --type project-tests --project-path {{ editor.testProject }} --package-filter {{ package.name }} {{ coverageOptions }} --extra-utr-arg "reruncount=2"
17-
- python3 ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ package.minCoveragePct }}
17+
- |
18+
conda activate python3.7
19+
python3 ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ package.minCoveragePct }}
1820
artifacts:
1921
logs:
2022
paths:

.yamato/com.unity.ml-agents-optional-dep-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ OptionalDependencyTests_{{ optional_dep.name }}:
1515
name : Test Optional Package Dependencies {{ optional_dep.name }}
1616
agent:
1717
type: Unity::VM
18-
image: package-ci/ubuntu:stable
18+
image: ml-agents/ml-agents-ubuntu-18.04:latest
1919
flavor: b1.medium
2020
commands:
2121
- |

.yamato/com.unity.ml-agents-pack.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ pack:
22
name: Pack
33
agent:
44
type: Unity::VM
5-
image: package-ci/ubuntu:stable
5+
image: ml-agents/ml-agents-ubuntu-18.04:latest
66
flavor: b1.small
77
commands:
88
- |
9+
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
10+
conda activate python3.7
911
python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
1012
unity-downloader-cli -u 2020.3 -c editor --wait --fast
1113
./.Editor/Unity -projectPath Project -batchMode -executeMethod Unity.MLAgents.SampleExporter.ExportCuratedSamples -logFile -

.yamato/com.unity.ml-agents-test.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test_platforms:
2424
flavor: b1.small
2525
- name: linux
2626
type: Unity::VM
27-
image: package-ci/ubuntu:stable
27+
image: ml-agents/ml-agents-ubuntu-18.04:latest
2828
flavor: b1.medium
2929

3030
packages:
@@ -123,10 +123,14 @@ test_{{ package.name }}_{{ platform.name }}_trunk:
123123
image: {{ platform.image }}
124124
flavor: {{ platform.flavor}}
125125
commands:
126-
- python -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
127-
- unity-downloader-cli -u trunk -c editor --wait --fast
128-
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
129-
- upm-ci project test -u {{ editor.version }} --project-path {{ editor.testProject }} --package-filter {{ package.name }} --extra-create-project-arg="-upmNoDefaultPackages" --extra-utr-arg "reruncount=2"
126+
- |
127+
{% if platform.name == "linux" %}
128+
conda activate python3.7
129+
{% endif %}
130+
python -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
131+
unity-downloader-cli -u trunk -c editor --wait --fast
132+
npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
133+
upm-ci project test -u {{ editor.version }} --project-path {{ editor.testProject }} --package-filter {{ package.name }} --extra-create-project-arg="-upmNoDefaultPackages" --extra-utr-arg "reruncount=2"
130134
artifacts:
131135
logs:
132136
paths:

.yamato/compressed-sensor-test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ test_compressed_obs_{{ editor.version }}:
55
name: Test Compressed Sensor Observation {{ editor.version }}
66
agent:
77
type: Unity::VM
8-
image: package-ci/ubuntu:stable
8+
image: ml-agents/ml-agents-ubuntu-18.04:latest
99
flavor: b1.medium
1010
variables:
1111
UNITY_VERSION: {{ editor.version }}
1212
commands:
1313
- |
14-
sudo apt-get update && sudo apt-get install -y python3-venv
15-
python3 -m venv venv && source venv/bin/activate
14+
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
15+
conda activate python3.7
1616
python -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
1717
python -u -m ml-agents.tests.yamato.setup_venv
1818
python ml-agents/tests/yamato/scripts/run_compressed_sensor.py --env=artifacts/testPlayer-TestGridCompressed

.yamato/coverage_tests.metafile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ coverage_test_editors:
55
coverage_test_platforms:
66
- name: linux
77
type: Unity::VM
8-
image: package-ci/ubuntu:stable
8+
image: ml-agents/ml-agents-ubuntu-18.04:latest
99
flavor: b1.medium
1010

1111
coverage_test_packages:

.yamato/gym-interface-test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ test_gym_interface_{{ editor.version }}:
55
name: Test Linux Gym Interface {{ editor.version }}
66
agent:
77
type: Unity::VM
8-
image: package-ci/ubuntu:stable
8+
image: ml-agents/ml-agents-ubuntu-18.04:latest
99
flavor: b1.medium
1010
variables:
1111
UNITY_VERSION: {{ editor.version }}
1212
commands:
1313
- |
14-
sudo apt-get update && sudo apt-get install -y python3-venv
15-
python3 -m venv venv && source venv/bin/activate
14+
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
15+
conda activate python3.7
1616
python -m pip install wheel --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
1717
python -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
1818
python -u -m ml-agents.tests.yamato.setup_venv

.yamato/protobuf-generation-test.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ test_linux_protobuf_generation:
22
name: Protobuf Generation Tests
33
agent:
44
type: Unity::VM
5-
image: package-ci/ubuntu:stable
5+
image: ml-agents/ml-agents-ubuntu-18.04:latest
66
flavor: b1.large
77
variables:
88
GRPC_VERSION: "1.14.1"
99
CS_PROTO_PATH: "com.unity.ml-agents/Runtime/Grpc/CommunicatorObjects"
1010
commands:
1111
- |
12-
sudo apt-get update && sudo apt-get install -y python3-venv nuget
13-
python3 -m venv venv && source venv/bin/activate
12+
sudo apt-get update && sudo apt-get install -y nuget
13+
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
14+
conda activate python3.7
1415
nuget install Grpc.Tools -Version $GRPC_VERSION -OutputDirectory protobuf-definitions/
1516
python3 -m pip install --upgrade pip --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
1617
python3 -m pip install grpcio==1.28.1 grpcio-tools==1.13.0 protobuf==3.11.3 six==1.14.0 mypy-protobuf==1.16.0 --progress-bar=off --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple

.yamato/pytest-gpu.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ pytest_gpu:
22
name: Pytest GPU
33
agent:
44
type: Unity::VM::GPU
5-
image: package-ci/ubuntu:stable
5+
image: ml-agents/ml-agents-ubuntu-18.04:latest
66
flavor: b1.large
77
commands:
88
- |
9-
sudo apt-get update && sudo apt-get install -y python3-venv
10-
python3 -m venv venv && source venv/bin/activate
9+
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
10+
conda activate python3.7
1111
python3 -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
1212
python3 -u -m ml-agents.tests.yamato.setup_venv
1313
python3 -m pip install --progress-bar=off -r test_requirements.txt --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple

.yamato/python-ll-api-test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ test_linux_ll_api_{{ editor.version }}:
55
name: Test Linux LL-API {{ editor.version }}
66
agent:
77
type: Unity::VM
8-
image: package-ci/ubuntu:stable
8+
image: ml-agents/ml-agents-ubuntu-18.04:latest
99
flavor: b1.medium
1010
variables:
1111
UNITY_VERSION: {{ editor.version }}
1212
commands:
1313
- |
14-
sudo apt-get update && sudo apt-get install -y python3-venv
15-
python3 -m venv venv && source venv/bin/activate
14+
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
15+
conda activate python3.7
1616
python -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
1717
python -u -m ml-agents.tests.yamato.setup_venv
1818
python ml-agents/tests/yamato/scripts/run_llapi.py

.yamato/standalone-build-test.yml

+13-10
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@ test_linux_standalone_{{ editor.version }}:
55
name: Test Linux Standalone {{ editor.version }}
66
agent:
77
type: Unity::VM
8-
image: package-ci/ubuntu:stable
8+
image: ml-agents/ml-agents-ubuntu-18.04:latest
99
flavor: b1.large
1010
variables:
1111
UNITY_VERSION: {{ editor.version }}
1212
commands:
13-
- python3 -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
14-
- python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
15-
- unity-downloader-cli -u {{ editor.version }} -c editor --wait --fast
16-
- python3 -u -m ml-agents.tests.yamato.standalone_build_tests --build-target=linux
17-
- python3 -u -m ml-agents.tests.yamato.standalone_build_tests --build-target=linux --scene=Assets/ML-Agents/Examples/Basic/Scenes/Basic.unity
18-
- python3 -u -m ml-agents.tests.yamato.standalone_build_tests --build-target=linux --scene=Assets/ML-Agents/Examples/Match3/Scenes/Match3.unity
19-
- python3 -u -m ml-agents.tests.yamato.standalone_build_tests --build-target=linux --scene=Assets/ML-Agents/Examples/WallJump/Scenes/WallJump.unity
20-
- python3 -u -m ml-agents.tests.yamato.standalone_build_tests --build-target=linux --scene=Assets/ML-Agents/TestScenes/TestCompressedGrid/TestGridCompressed.unity
21-
- python3 -u -m ml-agents.tests.yamato.standalone_build_tests --build-target=linux --scene=Assets/ML-Agents/TestScenes/TestCompressedTexture/TestTextureCompressed.unity
13+
- |
14+
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
15+
conda activate python3.7
16+
python3 -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
17+
python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
18+
unity-downloader-cli -u {{ editor.version }} -c editor --wait --fast
19+
python3 -u -m ml-agents.tests.yamato.standalone_build_tests --build-target=linux
20+
python3 -u -m ml-agents.tests.yamato.standalone_build_tests --build-target=linux --scene=Assets/ML-Agents/Examples/Basic/Scenes/Basic.unity
21+
python3 -u -m ml-agents.tests.yamato.standalone_build_tests --build-target=linux --scene=Assets/ML-Agents/Examples/Match3/Scenes/Match3.unity
22+
python3 -u -m ml-agents.tests.yamato.standalone_build_tests --build-target=linux --scene=Assets/ML-Agents/Examples/WallJump/Scenes/WallJump.unity
23+
python3 -u -m ml-agents.tests.yamato.standalone_build_tests --build-target=linux --scene=Assets/ML-Agents/TestScenes/TestCompressedGrid/TestGridCompressed.unity
24+
python3 -u -m ml-agents.tests.yamato.standalone_build_tests --build-target=linux --scene=Assets/ML-Agents/TestScenes/TestCompressedTexture/TestTextureCompressed.unity
2225
triggers:
2326
cancel_old_ci: true
2427
expression: |

.yamato/standalone-build-webgl-test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ test_webgl_standalone_{{ editor_version }}:
33
name: Test WebGL Standalone {{ editor_version }}
44
agent:
55
type: Unity::VM
6-
image: package-ci/ubuntu:stable
6+
image: ml-agents/ml-agents-ubuntu-18.04:latest
77
flavor: b1.large
88
variables:
99
UNITY_VERSION: {{ editor_version }}
1010
commands:
1111
- |
12-
python3 -m venv venv && source venv/bin/activate
12+
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
13+
conda activate python3.7
1314
python -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
1415
python -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
1516
unity-downloader-cli -u {{ editor_version }} -c editor -c WebGL --wait --fast
1617
python -u -m ml-agents.tests.yamato.standalone_build_tests --build-target=webgl
17-
1818
triggers:
1919
cancel_old_ci: true
2020
recurring:

.yamato/training-int-tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ test_linux_training_int_{{ editor.version }}:
55
name: Test Linux Fast Training {{ editor.version }}
66
agent:
77
type: Unity::VM
8-
image: package-ci/ubuntu:stable
8+
image: ml-agents/ml-agents-ubuntu-18.04:latest
99
flavor: b1.medium
1010
variables:
1111
UNITY_VERSION: {{ editor.version }}
1212
commands:
1313
- |
14-
sudo apt-get update && sudo apt-get install -y python3-venv
15-
python3 -m venv venv && source venv/bin/activate
14+
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
15+
conda activate python3.7
1616
python -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
1717
python -u -m ml-agents.tests.yamato.training_int_tests
1818
dependencies:

com.unity.ml-agents/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ and this project adheres to
1010
### Major Changes
1111
#### com.unity.ml-agents / com.unity.ml-agents.extensions (C#)
1212
#### ml-agents / ml-agents-envs / gym-unity (Python)
13+
- The minimum supported Python version for ml-agents-envs was changed to 3.7.2 (#4)
14+
1315
### Minor Changes
1416
#### com.unity.ml-agents / com.unity.ml-agents.extensions (C#)
1517
#### ml-agents / ml-agents-envs / gym-unity (Python)

docs/Installation-Anaconda-Windows.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ versions and features.
1818

1919
[Download](https://www.anaconda.com/download/#windows) and install Anaconda for
2020
Windows. By using Anaconda, you can manage separate environments for different
21-
distributions of Python. Python 3.6.1 or higher is required as we no longer
22-
support Python 2. In this guide, we are using Python version 3.6 and Anaconda
21+
distributions of Python. Python 3.7.2 or higher is required as we no longer
22+
support Python 2. In this guide, we are using Python version 3.7 and Anaconda
2323
version 5.1
2424
([64-bit](https://repo.continuum.io/archive/Anaconda3-5.1.0-Windows-x86_64.exe)
2525
or [32-bit](https://repo.continuum.io/archive/Anaconda3-5.1.0-Windows-x86.exe)
@@ -80,12 +80,12 @@ To create a new Conda environment, open a new Anaconda Prompt (_Anaconda Prompt_
8080
in the search bar) and type in the following command:
8181

8282
```sh
83-
conda create -n ml-agents python=3.6
83+
conda create -n ml-agents python=3.7
8484
```
8585

8686
You may be asked to install new packages. Type `y` and press enter _(make sure
8787
you are connected to the Internet)_. You must install these required packages.
88-
The new Conda environment is called ml-agents and uses Python version 3.6.
88+
The new Conda environment is called ml-agents and uses Python version 3.7.
8989

9090
<p align="center">
9191
<img src="images/conda_new.PNG" alt="Anaconda Install" width="500" border="10" />

docs/Installation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The ML-Agents Toolkit contains several components:
2727
Consequently, to install and use the ML-Agents Toolkit you will need to:
2828

2929
- Install Unity (2020.3 or later)
30-
- Install Python (3.6.1 or higher)
30+
- Install Python (3.7.2 or higher)
3131
- Clone this repository (Optional)
3232
- __Note:__ If you do not clone the repository, then you will not be
3333
able to access the example environments and training configurations or the
@@ -44,9 +44,9 @@ Consequently, to install and use the ML-Agents Toolkit you will need to:
4444
strongly recommend that you install Unity through the Unity Hub as it will
4545
enable you to manage multiple Unity versions.
4646

47-
### Install **Python 3.6.1** or Higher
47+
### Install **Python 3.7.2** or Higher
4848

49-
We recommend [installing](https://www.python.org/downloads/) Python 3.6 or 3.7.
49+
We recommend [installing](https://www.python.org/downloads/) Python 3.7.
5050
If you are using Windows, please install the x86-64 version and not x86.
5151
If your Python environment doesn't include `pip3`, see these
5252
[instructions](https://packaging.python.org/guides/installing-using-linux-tools/#installing-pip-setuptools-wheel-with-linux-package-managers)

docs/Using-Virtual-Environment.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ from dependencies of other projects. This has a few advantages:
1919

2020
## Python Version Requirement (Required)
2121

22-
This guide has been tested with Python 3.6 through Python 3.8. Newer versions might not
22+
This guide has been tested with Python 3.7 through Python 3.8. Newer versions might not
2323
have support for the dependent libraries, so are not recommended.
2424

2525
## Installing Pip (Required)
@@ -65,7 +65,7 @@ then python3-distutils needs to be installed. Install python3-distutils using
6565

6666
Note:
6767

68-
- Verify that you are using Python 3.6 or Python 3.7. Launch a command prompt
68+
- Verify that you are using Python 3.7. Launch a command prompt
6969
using `cmd` and execute `python --version` to verify the version.
7070
- Python3 installation may require admin privileges on Windows.
7171
- This guide is for Windows 10 using a 64-bit architecture only.

0 commit comments

Comments
 (0)