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

Tests related updates #872

Merged
merged 4 commits into from
Jun 27, 2022
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
fail_fast: true
repos:
- repo: https://github.com/psf/black
rev: 22.1.0
rev: 22.3.0
hooks:
- id: black
language_version: python3
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
rev: 4.0.1
hooks:
- id: flake8
exclude: ^(tests|examples|docs)/.*
Expand Down
62 changes: 29 additions & 33 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,50 +51,38 @@ jobs:
IMAGE_NAME: 'ubuntu-latest'
PYTHON_VERSION: '3.10'
TOX_CMD: 'py310'
Linux numpy_117:
IMAGE_NAME: 'ubuntu-latest'
PYTHON_VERSION: '3.7'
TOX_CMD: 'numpy-117'
Linux numpy_118:
IMAGE_NAME: 'ubuntu-latest'
PYTHON_VERSION: '3.8'
TOX_CMD: 'numpy-118'
Linux numpy_119:
IMAGE_NAME: 'ubuntu-latest'
PYTHON_VERSION: '3.9'
TOX_CMD: 'numpy-119'
Linux numpy_120:
IMAGE_NAME: 'ubuntu-latest'
PYTHON_VERSION: '3.9'
TOX_CMD: 'numpy-120'
Linux tensorflow_115:
Linux numpy_121:
IMAGE_NAME: 'ubuntu-latest'
PYTHON_VERSION: '3.7'
TOX_CMD: 'tensorflow-115'
Linux tensorflow_20:
PYTHON_VERSION: '3.9'
TOX_CMD: 'numpy-121'
Linux numpy_122:
IMAGE_NAME: 'ubuntu-latest'
PYTHON_VERSION: '3.7'
TOX_CMD: 'tensorflow-20'
Linux tensorflow-21:
PYTHON_VERSION: '3.10'
TOX_CMD: 'numpy-122'
Linux numpy_123:
IMAGE_NAME: 'ubuntu-latest'
PYTHON_VERSION: '3.7'
TOX_CMD: 'tensorflow-21'
Linux tensorflow_22:
PYTHON_VERSION: '3.10'
TOX_CMD: 'numpy-123'
Linux tensorflow_26:
IMAGE_NAME: 'ubuntu-latest'
PYTHON_VERSION: '3.8'
TOX_CMD: 'tensorflow-22'
Linux tensorflow_23:
PYTHON_VERSION: '3.7'
TOX_CMD: 'tensorflow-26'
Linux tensorflow_27:
IMAGE_NAME: 'ubuntu-latest'
PYTHON_VERSION: '3.8'
TOX_CMD: 'tensorflow-23'
Linux tensorflow_24:
TOX_CMD: 'tensorflow-27'
Linux tensorflow-28:
IMAGE_NAME: 'ubuntu-latest'
PYTHON_VERSION: '3.8'
TOX_CMD: 'tensorflow-24'
Linux tensorflow_25:
PYTHON_VERSION: '3.9'
TOX_CMD: 'tensorflow-28'
Linux tensorflow_29:
IMAGE_NAME: 'ubuntu-latest'
PYTHON_VERSION: '3.8'
TOX_CMD: 'tensorflow-25'
PYTHON_VERSION: '3.10'
TOX_CMD: 'tensorflow-29'
Linux setup:
IMAGE_NAME: 'ubuntu-latest'
PYTHON_VERSION: '3.9'
Expand All @@ -119,11 +107,19 @@ jobs:
versionSpec: $(PYTHON_VERSION)
- bash: pip install tox
- bash: tox -e $TOX_CMD
- job: test_pre_commit
- job: test_pre_commit_39
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9'
- bash: bash ./tests/check_pre_commit.sh
- job: test_pre_commit_310
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.10'
- bash: bash ./tests/check_pre_commit.sh
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest==7.0.0 # tests/test_utils.py depends on that pytest version is exactly 7.0.0
pytest==7.1.2 # tests/test_utils.py depends on that pytest version is exactly 7.1.2
colorama
docopt
gitdb2
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Topic :: Utilities
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Artificial Intelligence
Expand Down Expand Up @@ -39,7 +40,7 @@
package_data={"sacred": [os.path.join("data", "*"), "py.typed"]},
scripts=[],
install_requires=Path("requirements.txt").read_text().splitlines(),
tests_require=["mock>=3.0, <5.0", "pytest==7.0.0"],
tests_require=["mock>=3.0, <5.0", "pytest==7.1.2"],
classifiers=list(filter(None, classifiers.split("\n"))),
description="Facilitates automated and reproducible experimental research",
long_description=Path("README.rst").read_text(encoding="utf-8"),
Expand Down
4 changes: 2 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def test_module_is_in_cache():

def test_get_package_version():
package_version = get_package_version("pytest")
assert str(package_version) == "7.0.0"
assert str(package_version) == "7.1.2"


def test_parse_version():
Expand All @@ -200,7 +200,7 @@ def test_parse_version():

def test_get_package_version_comparison():
package_version = get_package_version("pytest")
current_version = parse_version("7.0.0")
current_version = parse_version("7.1.2")
old_version = parse_version("6.2.0")
new_version = parse_version("7.2.4")
assert package_version == current_version
Expand Down
54 changes: 18 additions & 36 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and then run "tox" from this directory.

[tox]
envlist = py37, py38, py39, py310, setup, flake8, numpy-117, numpy-118, numpy-119, numpy-120, tensorflow-115, tensorflow-20, tensorflow-21, tensorflow-22, tensorflow-23, tensorflow-24
envlist = py37, py38, py39, py310, setup, flake8, numpy-120, numpy-121, numpy-122, numpy-123, tensorflow-26, tensorflow-27, tensorflow-28, tensorflow-29

[testenv]
deps =
Expand All @@ -13,35 +13,35 @@ commands =
pytest \
{posargs} # substitute with tox' positional arguments

[testenv:numpy-117]
[testenv:numpy-120]
basepython = python
deps =
-rdev-requirements.txt
numpy~=1.17.0
numpy~=1.20.0
commands =
pytest tests/test_config {posargs}

[testenv:numpy-118]
[testenv:numpy-121]
basepython = python
deps =
-rdev-requirements.txt
numpy~=1.18.0
numpy~=1.21.0
commands =
pytest tests/test_config {posargs}

[testenv:numpy-119]
[testenv:numpy-122]
basepython = python
deps =
-rdev-requirements.txt
numpy~=1.19.0
numpy~=1.22.0
commands =
pytest tests/test_config {posargs}

[testenv:numpy-120]
[testenv:numpy-123]
basepython = python
deps =
-rdev-requirements.txt
numpy~=1.20.0
numpy~=1.23.0
commands =
pytest tests/test_config {posargs}

Expand All @@ -54,64 +54,46 @@ commands =
pytest tests/test_stflow tests/test_optional.py \
{posargs}

[testenv:tensorflow-20]
basepython = python
deps =
-rdev-requirements.txt
tensorflow~=2.0.0
commands =
pytest tests/test_stflow tests/test_optional.py \
{posargs}

[testenv:tensorflow-21]
basepython = python
deps =
-rdev-requirements.txt
tensorflow~=2.1.0
commands =
pytest tests/test_stflow tests/test_optional.py \
{posargs}

[testenv:tensorflow-22]
[testenv:tensorflow-26]
basepython = python
deps =
-rdev-requirements.txt
tensorflow~=2.2.0
tensorflow~=2.6.0
commands =
pytest tests/test_stflow tests/test_optional.py \
{posargs}

[testenv:tensorflow-23]
[testenv:tensorflow-27]
basepython = python
deps =
-rdev-requirements.txt
tensorflow~=2.3.0
tensorflow~=2.7.0
commands =
pytest tests/test_stflow tests/test_optional.py \
{posargs}

[testenv:tensorflow-24]
[testenv:tensorflow-28]
basepython = python
deps =
-rdev-requirements.txt
tensorflow~=2.4.0
tensorflow~=2.8.0
commands =
pytest tests/test_stflow tests/test_optional.py \
{posargs}

[testenv:tensorflow-25]
[testenv:tensorflow-29]
basepython = python
deps =
-rdev-requirements.txt
tensorflow~=2.5.0
tensorflow~=2.9.0
commands =
pytest tests/test_stflow tests/test_optional.py \
{posargs}

[testenv:setup]
basepython = python
deps =
pytest==7.0.0
pytest==7.1.2
mock
commands =
pytest {posargs}
Expand Down