File tree Expand file tree Collapse file tree 13 files changed +2127
-78
lines changed Expand file tree Collapse file tree 13 files changed +2127
-78
lines changed Original file line number Diff line number Diff line change 14
14
// on large machines).
15
15
" --shm-size=6gb"
16
16
],
17
- "postCreateCommand" : " pip install --editable .[dev] " ,
17
+ "postCreateCommand" : " .devcontainer/setup.sh " ,
18
18
"customizations" : {
19
19
"vscode" : {
20
20
"extensions" : [
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # Copyright 2024 DeepMind Technologies Limited.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ # Set up devcontainer
18
+ set -e
19
+ pip install --require-virtualenv --require-hashes -r requirements.txt
20
+ pip install --require-virtualenv --no-deps --no-index --no-build-isolation --editable .
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- name : install-meltingpot
1
+ name : install
2
2
3
3
inputs :
4
4
python-version :
@@ -34,16 +34,16 @@ runs:
34
34
else
35
35
exit 1
36
36
fi
37
- echo "key=${name}-${version}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('setup.py ') }}" >> $GITHUB_OUTPUT
37
+ echo "key=${name}-${version}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('requirements.txt ') }}" >> $GITHUB_OUTPUT
38
38
39
- - name : Restore Melting Pot installation
39
+ - name : Restore installation
40
40
id : restore
41
41
uses : actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
42
42
with :
43
43
path : |
44
44
meltingpot/assets
45
45
venv
46
- key : install-meltingpot- ${{ steps.cache-key.outputs.key }}
46
+ key : install-${{ steps.cache-key.outputs.key }}
47
47
48
48
- name : Create venv
49
49
if : steps.restore.outputs.cache-hit != 'true'
@@ -56,11 +56,12 @@ runs:
56
56
run : |
57
57
echo "${PWD}/venv/bin" >> $GITHUB_PATH
58
58
59
- - name : Install Melting Pot
59
+ - name : Install
60
60
if : steps.restore.outputs.cache-hit != 'true'
61
61
shell : bash
62
62
run : |
63
- pip install --editable .[dev]
63
+ pip install --require-virtualenv --require-hashes -r requirements.txt
64
+ pip install --require-virtualenv --no-deps --no-index --no-build-isolation --editable .
64
65
65
66
- name : Show installation
66
67
shell : bash
77
78
pytype --version
78
79
pip list
79
80
80
- - name : Save Melting Pot installation
81
+ - name : Save installation
81
82
if : steps.restore.outputs.cache-hit != 'true'
82
83
uses : actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
83
84
with :
Original file line number Diff line number Diff line change 5
5
branches :
6
6
- main
7
7
paths :
8
- - ' .github/actions/install-examples/action.yml'
9
- - ' .github/actions/install-meltingpot/action.yml'
8
+ - ' .github/actions/install/action.yml'
10
9
- ' .github/workflows/test-examples.yml'
11
10
- ' .pylintrc'
12
11
- ' examples/**'
13
12
- ' meltingpot/**'
14
13
- ' pyproject.toml'
14
+ - ' requirements.txt'
15
15
- ' setup.py'
16
16
pull_request :
17
17
branches :
18
18
- main
19
19
paths :
20
- - ' .github/actions/install-examples.yml'
21
- - ' .github/actions/install-meltingpot.yml'
20
+ - ' .github/actions/install/action.yml'
22
21
- ' .github/workflows/test-examples.yml'
23
22
- ' .pylintrc'
24
23
- ' examples/**'
25
24
- ' meltingpot/**'
26
25
- ' pyproject.toml'
26
+ - ' requirements.txt'
27
27
- ' setup.py'
28
28
workflow_dispatch :
29
29
42
42
- name : Checkout Melting Pot
43
43
uses : actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
44
44
45
- - name : Install examples
46
- uses : ./.github/actions/install-examples
45
+ - name : Install Melting Pot
46
+ uses : ./.github/actions/install
47
47
48
48
- name : Test examples
49
49
run : pytest examples
Original file line number Diff line number Diff line change 5
5
branches :
6
6
- main
7
7
paths :
8
- - ' .github/actions/install-meltingpot /action.yml'
8
+ - ' .github/actions/install/action.yml'
9
9
- ' .github/workflows/test-meltingpot.yml'
10
10
- ' .pylintrc'
11
11
- ' meltingpot/**'
12
12
- ' pyproject.toml'
13
+ - ' requirements.txt'
13
14
- ' setup.py'
14
15
pull_request :
15
16
branches :
16
17
- main
17
18
paths :
18
- - ' .github/actions/install-meltingpot /action.yml'
19
+ - ' .github/actions/install/action.yml'
19
20
- ' .github/workflows/test-meltingpot.yml'
20
21
- ' .pylintrc'
21
22
- ' meltingpot/**'
22
23
- ' pyproject.toml'
24
+ - ' requirements.txt'
23
25
- ' setup.py'
24
26
workflow_dispatch :
25
27
38
40
uses : actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
39
41
40
42
- name : Install Melting Pot
41
- uses : ./.github/actions/install-meltingpot
43
+ uses : ./.github/actions/install
42
44
43
45
- name : Test Melting Pot
44
46
run : pytest meltingpot
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # Copyright 2024 DeepMind Technologies Limited.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ # Installation script.
18
+ set -e
19
+ python3 -m venv venv
20
+ source venv/bin/activate
21
+ pip install --require-virtualenv --require-hashes -r requirements.txt
22
+ pip install --require-virtualenv --no-deps --no-index --no-build-isolation --editable .
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # Copyright 2024 DeepMind Technologies Limited.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ # Test meltingpot.
18
+ FAILURES=false
19
+
20
+ echo " pytest meltingpot..."
21
+ pytest meltingpot || FAILURES=true
22
+ echo
23
+ echo
24
+
25
+ echo " pytype meltingpot..."
26
+ pytype meltingpot || FAILURES=true
27
+ echo
28
+ echo
29
+
30
+ echo " pylint meltingpot..."
31
+ pylint --errors-only meltingpot || FAILURES=true
32
+ echo
33
+ echo
34
+
35
+ if " ${FAILURES} " ; then
36
+ echo -e ' \033[0;31mFAILURE\033[0m' && exit 1
37
+ else
38
+ echo -e ' \033[0;32mSUCCESS\033[0m'
39
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # Copyright 2024 DeepMind Technologies Limited.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ # Test the examples.
18
+ FAILURES=false
19
+
20
+ echo " pytest examples..."
21
+ pytest examples || FAILURES=true
22
+ echo
23
+ echo
24
+
25
+ echo " pytype examples..."
26
+ pytype examples || FAILURES=true
27
+ echo
28
+ echo
29
+
30
+ echo " pylint examples..."
31
+ pylint --errors-only examples || FAILURES=true
32
+ echo
33
+ echo
34
+
35
+ if " ${FAILURES} " ; then
36
+ echo -e ' \033[0;31mFAILURE\033[0m' && exit 1
37
+ else
38
+ echo -e ' \033[0;32mSUCCESS\033[0m'
39
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # Copyright 2024 DeepMind Technologies Limited.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ # Update requirements.txt.
18
+
19
+ pip-compile \
20
+ --quiet --generate-hashes --reuse-hashes --upgrade --strip-extras \
21
+ --extra dev setup.py || exit 1
You can’t perform that action at this time.
0 commit comments