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

Also run unit tests under Python 3.12 beta #1920

Merged
merged 3 commits into from
Jul 31, 2023
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
7 changes: 6 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ permissions:
actions: write # Needed for skip-duplicate-jobs job
contents: read

env:
# Needed if we want colors in pytest output without tty and script -e -c wrapper
PY_COLORS: "1"
FORCE_COLOR: "1"

jobs:
# Special job which skips duplicate jobs
pre_job:
Expand Down Expand Up @@ -80,7 +85,7 @@ jobs:

- name: Run tox target
run: |
script -e -c "tox -e integration-storage"
tox -e integration-storage
env:
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ permissions:
actions: write # Needed for skip-duplicate-jobs job
contents: read

env:
# Needed if we want colors in pytest output without tty and script -e -c wrapper
PY_COLORS: "1"
FORCE_COLOR: "1"

jobs:
# Special job which skips duplicate jobs
pre_job:
Expand Down Expand Up @@ -54,6 +59,7 @@ jobs:
- 3.9
- "3.10"
- "3.11"
- "3.12-dev"
# TODO: Investigate why it started failing with cryptic error on CI
#- "pypy-3.7"
os:
Expand Down Expand Up @@ -119,12 +125,12 @@ jobs:

- name: Run unit tests tox target
run: |
script -e -c "tox -e py${{ matrix.python_version }}"
tox -e py${{ matrix.python_version }}

- name: Run dist install checks tox target
if: ${{ matrix.python_version != 'pypy-3.7' && matrix.python_version != 'pyjion' }}
run: |
script -e -c "tox -e py${{ matrix.python_version }}-dist,py${{ matrix.python_version }}-dist-wheel"
tox -e py${{ matrix.python_version }}-dist,py${{ matrix.python_version }}-dist-wheel

code_coverage:
name: Generate Code Coverage
Expand Down Expand Up @@ -166,7 +172,7 @@ jobs:

- name: Run Checks
run: |
script -e -c "tox -e coverage-ci"
tox -e coverage-ci

- name: Upload Coverage to codecov.io
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
Expand Down Expand Up @@ -214,7 +220,7 @@ jobs:

- name: Run Checks
run: |
script -e -c "tox -e black-check,isort-check,pyupgrade,checks,import-timings,lint,pylint"
tox -e black-check,isort-check,pyupgrade,checks,import-timings,lint,pylint

build_test_docker_image:
name: Build and Verify Docker Image
Expand Down Expand Up @@ -310,7 +316,7 @@ jobs:

- name: Run Bandit Check
run: |
script -e -c "tox -e bandit"
tox -e bandit

micro-benchmarks:
name: Micro Benchmarks
Expand Down Expand Up @@ -352,7 +358,7 @@ jobs:

- name: Run Micro Benchmarks
run: |
script -e -c "tox -e micro-benchmarks"
tox -e micro-benchmarks

docs:
name: Build and upload Documentation
Expand Down Expand Up @@ -399,7 +405,7 @@ jobs:

- name: Build Docs
run: |
script -e -c "tox -e docs-ci"
tox -e docs-ci

- name: Trigger ReadTheDocs build
env:
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[build-system]
requires = ["setuptools~=66.1", "wheel~=0.37.1"]
build-backend = "setuptools.build_meta"

[tool.black]
line_length = 100
target_version = ['py37', 'py38', 'py39', 'py310']
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ def run(self):
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
Expand Down
9 changes: 5 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ allowlist_externals =
/bin/bash
scripts/*.sh
basepython =
py3.12-dev: python3.12
pypypy3: pypy3
pypypy3.7: pypy3.7
pypypy-3.7: pypy3.7
Expand All @@ -38,7 +39,7 @@ setenv =
# python setup.py test
# for pytest-xdist, we want to distribute tests by file aka --dist loadfile
commands = cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
pytest -rsx -vvv --capture=tee-sys -o log_cli=True --durations=10 --timeout=15 -n auto --dist loadfile --ignore libcloud/test/benchmarks/ --ignore-glob "*test_list_objects_filtering_performance*"
pytest --color=yes -rsx -vvv --capture=tee-sys -o log_cli=True --durations=10 --timeout=15 -n auto --dist loadfile --ignore libcloud/test/benchmarks/ --ignore-glob "*test_list_objects_filtering_performance*"

[testenv:py3.6-dist]
# Verify library installs without any dependencies when using python setup.py
Expand Down Expand Up @@ -319,7 +320,7 @@ setenv =
deps =
-r{toxinidir}/requirements-tests.txt
-r{toxinidir}/integration/storage/requirements.txt
commands = pytest -rsx -vvv --capture=tee-sys -o log_cli=True --durations=10 integration/storage
commands = pytest --color=yes -rsx -vvv --capture=tee-sys -o log_cli=True --durations=10 integration/storage

[testenv:coverage]
deps =
Expand Down Expand Up @@ -386,8 +387,8 @@ commands =
[testenv:micro-benchmarks]
commands =
cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
pytest -s -v --timeout 60 --benchmark-only --benchmark-name=short --benchmark-columns=min,max,mean,stddev,median,ops,rounds --benchmark-histogram=benchmark_histograms/benchmark --benchmark-group-by=group,param:sort_objects libcloud/test/benchmarks/test_list_objects_filtering_performance.py
pytest -s -v --timeout 60 --benchmark-only --benchmark-name=short --benchmark-columns=min,max,mean,stddev,median,ops,rounds --benchmark-histogram=benchmark_histograms/benchmark --benchmark-group-by=group,func,param:read_in_chunks_func libcloud/test/benchmarks/test_read_in_chunks.py
pytest --color=yes -s -v --timeout 60 --benchmark-only --benchmark-name=short --benchmark-columns=min,max,mean,stddev,median,ops,rounds --benchmark-histogram=benchmark_histograms/benchmark --benchmark-group-by=group,param:sort_objects libcloud/test/benchmarks/test_list_objects_filtering_performance.py
pytest --color=yes -s -v --timeout 60 --benchmark-only --benchmark-name=short --benchmark-columns=min,max,mean,stddev,median,ops,rounds --benchmark-histogram=benchmark_histograms/benchmark --benchmark-group-by=group,func,param:read_in_chunks_func libcloud/test/benchmarks/test_read_in_chunks.py

[testenv:import-timings]
setenv =
Expand Down