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

Add oldest & minimal CI configurations. #474

Merged
merged 19 commits into from
Jan 22, 2021
Merged
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
78 changes: 66 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ orbs:
references:
restore_keys: &restore_keys
keys:
- python-env-v7-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements-precommit.txt" }}-{{ checksum ".pre-commit-config.yaml" }}
- python-env-v7-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "requirements/requirements-test.txt" }}-{{ checksum "requirements/requirements-test-optional.txt" }}-{{ checksum "requirements/requirements-precommit.txt" }}-{{ checksum ".pre-commit-config.yaml" }}

save_key: &save_key
key: python-env-v7-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements-precommit.txt" }}-{{ checksum ".pre-commit-config.yaml" }}
key: python-env-v7-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "requirements/requirements-test.txt" }}-{{ checksum "requirements/requirements-test-optional.txt" }}-{{ checksum "requirements/requirements-precommit.txt" }}-{{ checksum ".pre-commit-config.yaml" }}

jobs:
pre-checks:
Expand All @@ -31,7 +31,7 @@ jobs:
- run:
name: Install pre-check dependencies
command: |
pip install --progress-bar off --user -U -r requirements-precommit.txt
pip install --progress-bar off --user -U -r requirements/requirements-precommit.txt

- run:
name: Run pre-checks
Expand All @@ -48,6 +48,8 @@ jobs:
- image: circleci/python:3.9

environment:
BENCHMARKS: "RUN"
DEPENDENCIES: "NEWEST"
PYTHON: python

working_directory: ~/repo
Expand All @@ -71,7 +73,32 @@ jobs:
fi
${PYTHON} -m pip install --progress-bar off -U pip>=20.3
${PYTHON} -m pip install --progress-bar off -U codecov
${PYTHON} -m pip install --progress-bar off -U -e . -r requirements-test.txt
# DEPENDENCIES can be "OLDEST", "NEWEST", or "MINIMAL"
if [ "${DEPENDENCIES}" == "OLDEST" ]; then
# Some requirements below are not strictly the lowest versions,
# and are only needed for testing.
${PYTHON} -m pip install --progress-bar off \
click==7.1.2 \
coverage==5.3.1 \
deprecation==2.0 \
filelock==3.0.0 \
h5py==2.8.0 \
numpy==1.13.3 \
packaging==15.0 \
pandas==1.0.0 \
pytest-cov==2.10.1 \
pytest==6.2.1 \
tables==3.3.0 \
tqdm==4.10.0
elif [ "${DEPENDENCIES}" == "NEWEST" ]; then
${PYTHON} -m pip install --progress-bar off -U -r requirements/requirements-test.txt
${PYTHON} -m pip install --progress-bar off -U -r requirements/requirements-test-optional.txt
else
# "${DEPENDENCIES}" == "MINIMAL"
# Install only testing requirements.
${PYTHON} -m pip install --progress-bar off -U -r requirements/requirements-test.txt
fi
${PYTHON} -m pip install --progress-bar off -e .

- save_cache:
<<: *save_key
Expand All @@ -92,10 +119,12 @@ jobs:
- run:
name: Run benchmarks
command: |
# Benchmarks depend on pandas, which takes a long time to install on pypy.
if [[ "${CIRCLE_JOB}" != *"pypy"* ]]; then
# Benchmarks depend on pandas, which isn't available for pypy or
# minimal dependencies
# BENCHMARKS can be "RUN" or "SKIP"
if [[ "${BENCHMARKS}" == "RUN" ]]; then
. venv/bin/activate
${PYTHON} -m pip install --progress-bar off -r requirements-benchmark.txt
${PYTHON} -m pip install --progress-bar off -r requirements/requirements-benchmark.txt
${PYTHON} -m pip freeze
${PYTHON} benchmark.py run -N 100 1000 # this revision
${PYTHON} benchmark.py report
Expand All @@ -105,6 +134,15 @@ jobs:
${PYTHON} benchmark.py compare origin/master "${CIRCLE_SHA1}"
fi

linux-python-39-minimal:
<<: *linux-template
docker:
- image: circleci/python:3.9
environment:
BENCHMARKS: "SKIP"
DEPENDENCIES: "MINIMAL"
PYTHON: python

linux-python-38:
<<: *linux-template
docker:
Expand All @@ -115,16 +153,22 @@ jobs:
docker:
- image: circleci/python:3.7

linux-python-36:
linux-python-36-oldest:
<<: *linux-template
docker:
- image: circleci/python:3.6
environment:
BENCHMARKS: "SKIP"
DEPENDENCIES: "OLDEST"
PYTHON: python

linux-pypy-3:
<<: *linux-template
docker:
- image: pypy:3
environment:
BENCHMARKS: "SKIP"
DEPENDENCIES: "NEWEST"
PYTHON: pypy3

windows-python-38:
Expand All @@ -142,8 +186,11 @@ jobs:
- run:
name: Install dependencies
command: |
${PYTHON} -m pip install --progress-bar off -U pip>=20.3
${PYTHON} -m pip install --progress-bar off -U codecov
${PYTHON} -m pip install --progress-bar off -U -e . -r requirements-test.txt
${PYTHON} -m pip install --progress-bar off -U -r requirements/requirements-test.txt
${PYTHON} -m pip install --progress-bar off -U -r requirements/requirements-test-optional.txt
${PYTHON} -m pip install --progress-bar off -U -e .
- run:
name: Run tests
command: |
Expand All @@ -166,8 +213,11 @@ jobs:
python3 -m venv create test_env
. test_env/bin/activate
python --version
python -m pip install --progress-bar off -U pip>=20.3
python -m pip install --progress-bar off -U codecov
python -m pip install --progress-bar off -U -e . -r requirements-test.txt
python -m pip install --progress-bar off -U -r requirements/requirements-test.txt
python -m pip install --progress-bar off -U -r requirements/requirements-test-optional.txt
python -m pip install --progress-bar off -U -e .
python -m pytest --cov=signac --cov-report=xml tests/ -v
codecov

Expand Down Expand Up @@ -218,13 +268,16 @@ workflows:
- linux-python-39:
requires:
- pre-checks
- linux-python-39-minimal:
requires:
- pre-checks
- linux-python-38:
requires:
- pre-checks
- linux-python-37:
requires:
- pre-checks
- linux-python-36:
- linux-python-36-oldest:
requires:
- pre-checks
- linux-pypy-3:
Expand All @@ -246,9 +299,10 @@ workflows:
only: /release\/.*/
requires:
- linux-python-39
- linux-python-39-minimal
- linux-python-38
- linux-python-37
- linux-python-36
- linux-python-36-oldest
- linux-pypy-3
- windows-python-38
deploy:
Expand Down
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Changed
- Optimized ``H5Store`` initialization (#443).
- State points are loaded lazily when ``Job`` is opened by id (#238, #239).
- Optimized ``Job`` and ``Project`` classes to cache internal properties and initialize on access (#451).
- Python 3.6 is only tested with oldest dependencies (#474).

Deprecated
++++++++++
Expand Down
6 changes: 0 additions & 6 deletions requirements-benchmark.txt

This file was deleted.

6 changes: 6 additions & 0 deletions requirements/requirements-benchmark.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
click==7.1.2
gitdb2==4.0.2
GitPython==3.1.11
numpy==1.19.4
pandas==1.2.0; implementation_name=='cpython' --no-binary :none:
psutil==5.8.0
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
click==7.1.2
coverage==5.3.1
h5py==3.1.0; implementation_name=='cpython'
numpy==1.19.4
pandas==1.1.4; implementation_name=='cpython'
pandas==1.2.0; implementation_name=='cpython'
pymongo==3.11.2; implementation_name=='cpython'
pytest==6.2.1
pytest-cov==2.10.1
ruamel.yaml==0.16.12
tables==3.6.1; implementation_name=='cpython'
3 changes: 3 additions & 0 deletions requirements/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage==5.3.1
pytest==6.2.1
pytest-cov==2.10.1