Skip to content

Commit 39de5bc

Browse files
author
Chris Elion
authored
Pass artifactory url for all pip calls in yamato (#4282)
* pass artifactory url for all pip calls in yamato * pip proto generation libs * undo pyupgrade on generated code
1 parent 2af67f5 commit 39de5bc

File tree

8 files changed

+28
-23
lines changed

8 files changed

+28
-23
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ repos:
4444
hooks:
4545
- id: pyupgrade
4646
args: [--py3-plus, --py36-plus]
47-
exclude: .*barracuda.py
47+
exclude: >
48+
(?x)^(
49+
.*barracuda.py|
50+
.*_pb2.py|
51+
.*_pb2_grpc.py
52+
)$
4853
4954
- repo: https://github.com/pre-commit/pre-commit-hooks
5055
rev: v2.5.0

.yamato/gym-interface-test.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test_gym_interface_{{ editor.version }}:
1111
variables:
1212
UNITY_VERSION: {{ editor.version }}
1313
commands:
14-
- pip install pyyaml
14+
- pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
1515
- python -u -m ml-agents.tests.yamato.setup_venv
1616
- ./venv/bin/python ml-agents/tests/yamato/scripts/run_gym.py --env=artifacts/testPlayer-Basic
1717
dependencies:
@@ -21,12 +21,12 @@ test_gym_interface_{{ editor.version }}:
2121
expression: |
2222
(pull_request.target eq "master" OR
2323
pull_request.target match "release.+") AND
24-
NOT pull_request.draft AND
25-
(pull_request.changes.any match "com.unity.ml-agents/**" OR
26-
pull_request.changes.any match "Project/**" OR
27-
pull_request.changes.any match "ml-agents/**" OR
28-
pull_request.changes.any match "ml-agents-envs/**" OR
29-
pull_request.changes.any match "gym-unity/**" OR
24+
NOT pull_request.draft AND
25+
(pull_request.changes.any match "com.unity.ml-agents/**" OR
26+
pull_request.changes.any match "Project/**" OR
27+
pull_request.changes.any match "ml-agents/**" OR
28+
pull_request.changes.any match "ml-agents-envs/**" OR
29+
pull_request.changes.any match "gym-unity/**" OR
3030
pull_request.changes.any match ".yamato/gym-interface-test.yml") AND
3131
NOT pull_request.changes.all match "**/*.md"
3232
{% endfor %}

.yamato/protobuf-generation-test.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ test_mac_protobuf_generation:
1313
nuget install Grpc.Tools -Version $GRPC_VERSION -OutputDirectory protobuf-definitions/
1414
python3 -m venv venv
1515
. venv/bin/activate
16-
pip install --upgrade pip
17-
pip install grpcio-tools==1.13.0 --progress-bar=off
18-
pip install mypy-protobuf==1.16.0 --progress-bar=off
16+
pip install --upgrade pip --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
17+
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
1918
cd protobuf-definitions
2019
chmod +x Grpc.Tools.$GRPC_VERSION/tools/macosx_x64/protoc
2120
chmod +x Grpc.Tools.$GRPC_VERSION/tools/macosx_x64/grpc_csharp_plugin

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ test_mac_ll_api_{{ editor.version }}:
1111
variables:
1212
UNITY_VERSION: {{ editor.version }}
1313
commands:
14-
- pip install pyyaml
14+
- pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
1515
- python -u -m ml-agents.tests.yamato.setup_venv
16-
- ./venv/bin/python ml-agents/tests/yamato/scripts/run_llapi.py
16+
- ./venv/bin/python ml-agents/tests/yamato/scripts/run_llapi.py
1717
- ./venv/bin/python ml-agents/tests/yamato/scripts/run_llapi.py --env=artifacts/testPlayer-Basic
1818
- ./venv/bin/python ml-agents/tests/yamato/scripts/run_llapi.py --env=artifacts/testPlayer-WallJump
1919
- ./venv/bin/python ml-agents/tests/yamato/scripts/run_llapi.py --env=artifacts/testPlayer-Bouncer
@@ -24,11 +24,11 @@ test_mac_ll_api_{{ editor.version }}:
2424
expression: |
2525
(pull_request.target eq "master" OR
2626
pull_request.target match "release.+") AND
27-
NOT pull_request.draft AND
28-
(pull_request.changes.any match "com.unity.ml-agents/**" OR
29-
pull_request.changes.any match "Project/**" OR
30-
pull_request.changes.any match "ml-agents/**" OR
31-
pull_request.changes.any match "ml-agents-envs/**" OR
27+
NOT pull_request.draft AND
28+
(pull_request.changes.any match "com.unity.ml-agents/**" OR
29+
pull_request.changes.any match "Project/**" OR
30+
pull_request.changes.any match "ml-agents/**" OR
31+
pull_request.changes.any match "ml-agents-envs/**" OR
3232
pull_request.changes.any match ".yamato/python-ll-api-test.yml") AND
3333
NOT pull_request.changes.all match "**/*.md"
3434
{% endfor %}

.yamato/standalone-build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test_mac_standalone_{{ editor.version }}:
1212
variables:
1313
UNITY_VERSION: {{ editor.version }}
1414
commands:
15-
- pip install pyyaml
15+
- pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
1616
- python -u -m ml-agents.tests.yamato.standalone_build_tests
1717
- python -u -m ml-agents.tests.yamato.standalone_build_tests --scene=Assets/ML-Agents/Examples/Basic/Scenes/Basic.unity
1818
- python -u -m ml-agents.tests.yamato.standalone_build_tests --scene=Assets/ML-Agents/Examples/Bouncer/Scenes/Bouncer.unity

.yamato/training-int-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test_mac_training_int_{{ editor.version }}:
1212
variables:
1313
UNITY_VERSION: {{ editor.version }}
1414
commands:
15-
- pip install pyyaml
15+
- pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
1616
- python -u -m ml-agents.tests.yamato.training_int_tests
1717
# Backwards-compatibility tests.
1818
# If we make a breaking change to the communication protocol, these will need

ml-agents-envs/mlagents_envs/communicator_objects/unity_to_external_pb2_grpc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from mlagents_envs.communicator_objects import unity_message_pb2 as mlagents__envs_dot_communicator__objects_dot_unity__message__pb2
55

66

7-
class UnityToExternalProtoStub:
7+
class UnityToExternalProtoStub(object):
88
# missing associated documentation comment in .proto file
99
pass
1010

@@ -21,7 +21,7 @@ def __init__(self, channel):
2121
)
2222

2323

24-
class UnityToExternalProtoServicer:
24+
class UnityToExternalProtoServicer(object):
2525
# missing associated documentation comment in .proto file
2626
pass
2727

ml-agents/tests/yamato/yamato_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ def init_venv(
136136
if extra_packages:
137137
pip_commands += extra_packages
138138
for cmd in pip_commands:
139+
pip_index_url = "--index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple"
139140
subprocess.check_call(
140-
f"source {venv_path}/bin/activate; python -m pip install -q {cmd}",
141+
f"source {venv_path}/bin/activate; python -m pip install -q {cmd} {pip_index_url}",
141142
shell=True,
142143
)
143144
return venv_path

0 commit comments

Comments
 (0)