Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump the pip group with 34 updates #3

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"name": "Concordia",
"image": "mcr.microsoft.com/devcontainers/python:0-3.11",
"postCreateCommand": ".devcontainer/setup.sh",
"postCreateCommand": "./bin/install.sh",
"customizations": {
"vscode": {
"extensions": [
Expand Down
10 changes: 1 addition & 9 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,13 @@ runs:
- name: Create venv
if: steps.restore.outputs.cache-hit != 'true'
shell: bash
run: |
python -m venv venv
run: ./bin/setup_venv.sh venv

- name: Activate venv
shell: bash
run: |
echo "${PWD}/venv/bin" >> $GITHUB_PATH

- name: Install
if: steps.restore.outputs.cache-hit != 'true'
shell: bash
run: |
pip install --require-virtualenv --require-hashes -r requirements.txt
pip install --require-virtualenv --no-deps --no-index --no-build-isolation --editable .

- name: Show installation
shell: bash
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ updates:
directory: /
schedule:
interval: monthly
groups:
pip:
patterns:
- "*"

- package-ecosystem: github-actions
directories:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pypi-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ jobs:
fail-fast: false
matrix:
os:
- macos-12
- macos-13
- macos-latest
- ubuntu-20.04
- ubuntu-latest
python-version:
- '3.11'
- '3.12'
- '3.13'

steps:
- name: Set up Python ${{ matrix.python_version }}
Expand Down
17 changes: 11 additions & 6 deletions .devcontainer/setup.sh → bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Set up devcontainer
set -e
# Install concordia.
set -euxo pipefail
cd "$(dirname "$0")/.."

python --version
pip --version
pip list
echo 'Installing requirements...'
pip install --no-deps --require-hashes --requirement requirements.txt
echo
echo

pip install --no-deps --require-hashes -r requirements.txt
echo 'Installing Concordia...'
pip install --no-deps --no-index --no-build-isolation --editable .
echo
echo

pip list
36 changes: 36 additions & 0 deletions bin/setup_venv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
#
# Copyright 2024 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Sets up the virtual environment.
set -euo pipefail
cd "$(dirname "$0")/.."

readonly VENV_PATH="${1:-venv}"
if [[ -d "${VENV_PATH}" ]]; then
read -p "Virtual environment "${VENV_PATH}" already exists. Overwrite? (Y/N) " confirm
[[ "${confirm}" = [Yy]* ]] && rm -rf "${VENV_PATH}" || exit 1
fi

echo "Creating virtual environment at ${VENV_PATH}..."
python3 -m venv "${VENV_PATH}"
source "${VENV_PATH}"/bin/activate
python --version
pip --version
pip list
echo
echo

./bin/install.sh
41 changes: 41 additions & 0 deletions bin/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
#
# Copyright 2024 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Test concordia.
set -euxo pipefail
cd "$(dirname "$0")/.."
FAILURES=false

echo "pytest concordia..."
pytest concordia || FAILURES=true
echo
echo

echo "pytype concordia..."
pytype concordia || FAILURES=true
echo
echo

echo "pylint concordia..."
pylint --errors-only concordia || FAILURES=true
echo
echo

if "${FAILURES}"; then
echo -e '\033[0;31mFAILURE\033[0m' && exit 1
else
echo -e '\033[0;32mSUCCESS\033[0m'
fi
56 changes: 56 additions & 0 deletions bin/test_examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash
#
# Copyright 2024 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Test the examples.
set -euxo pipefail
cd "$(dirname "$0")/.."
FAILURES=false

echo "pytest examples..."
pytest examples || FAILURES=true
echo
echo

echo "pytype examples..."
pytype examples || FAILURES=true
echo
echo

echo "pylint examples..."
pylint --errors-only examples || FAILURES=true
echo
echo

echo "convert notebooks..."
./bin/convert_notebooks.sh notebooks
echo
echo

echo "pytype notebooks..."
pytype --pythonpath=. notebooks || FAILURES=true
echo
echo

echo "pylint notebooks..."
pylint --errors-only notebooks || FAILURES=true
echo
echo

if "${FAILURES}"; then
echo -e '\033[0;31mFAILURE\033[0m' && exit 1
else
echo -e '\033[0;32mSUCCESS\033[0m'
fi
22 changes: 22 additions & 0 deletions bin/update_requirements.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
#
# Copyright 2024 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Update requirements.txt.
set -euxo pipefail
cd "$(dirname "$0")/.."

pip-compile --quiet --generate-hashes --reuse-hashes --upgrade --strip-extras \
--extra dev setup.py examples/requirements.in
2 changes: 1 addition & 1 deletion examples/requirements.txt → examples/requirements.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Requirements for the Concordia examples.
absl-py
docstring-parser
gdm-concordia
immutabledict
IPython
matplotlib
Expand Down
Loading
Loading