forked from dr-leo/pandaSDMX
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from khaeru/remove-distutils
Update data source tests for Python 3.12
- Loading branch information
Showing
7 changed files
with
32 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,9 +25,10 @@ jobs: | |
- "3.8" # Earliest supported version | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" # Latest supported version | ||
- "3.11" | ||
- "3.12" # Latest supported version | ||
# commented: only enable once next Python version enters RC | ||
# - "3.12.0-rc.1" # Development version | ||
# - "3.13.0-rc.1" # Development version | ||
|
||
fail-fast: false | ||
|
||
|
@@ -53,7 +54,7 @@ jobs: | |
run: python -m pip install --upgrade pip wheel | ||
|
||
- name: Install the Python package and dependencies | ||
run: pip install .[cache,docs,tests] | ||
run: pip install .[cache,tests] | ||
|
||
- name: Run pytest | ||
env: | ||
|
@@ -68,10 +69,6 @@ jobs: | |
- name: Upload test coverage to Codecov.io | ||
uses: codecov/codecov-action@v3 | ||
|
||
- name: Test documentation build using Sphinx | ||
if: contains(matrix.os, 'ubuntu') | ||
run: make --directory=doc html | ||
|
||
pre-commit: | ||
name: Code quality | ||
|
||
|
@@ -80,4 +77,11 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: { python-version: 3.x } | ||
|
||
- name: Force recreation of pre-commit virtual environment for mypy | ||
if: github.event_name == 'schedule' # Comment this line to run on a PR | ||
run: gh cache list -L 999 | cut -f2 | grep pre-commit | xargs -I{} gh cache delete "{}" || true | ||
env: { GH_TOKEN: "${{ github.token }}" } | ||
|
||
- uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,24 @@ | ||
import importlib | ||
from distutils import version | ||
from typing import Optional, Tuple | ||
|
||
import pytest | ||
from packaging.version import Version | ||
|
||
|
||
# thanks to xarray | ||
def _importorskip(modname, minversion=None): | ||
def _importorskip( | ||
modname: str, minversion: Optional[str] = None | ||
) -> Tuple[bool, pytest.MarkDecorator]: | ||
try: | ||
mod = importlib.import_module(modname) | ||
has = True | ||
if minversion is not None: | ||
if LooseVersion(mod.__version__) < LooseVersion(minversion): | ||
if minversion is not None: # pragma: no cover | ||
if Version(mod.__version__) < Version(minversion): | ||
raise ImportError("Minimum version not satisfied") | ||
except ImportError: | ||
has = False | ||
func = pytest.mark.skipif(not has, reason="requires {}".format(modname)) | ||
func = pytest.mark.skipif(not has, reason=f"requires {modname}") | ||
return has, func | ||
|
||
|
||
def LooseVersion(vstring): | ||
# When the development version is something like '0.10.9+aac7bfc', this | ||
# function will just discard the git commit id. | ||
vstring = vstring.split("+")[0] | ||
return version.LooseVersion(vstring) | ||
|
||
|
||
has_requests_cache, requires_requests_cache = _importorskip("requests_cache") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters