Skip to content

Commit

Permalink
Address lacking importlib metadata in Python ≤ 3.9 (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gallaecio committed Jan 23, 2024
1 parent e60cf07 commit 10f8b0c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ jobs:
- name: Run tests
run: tox -e ${{ matrix.tox-env }}

- name: Run off-tox tests
# https://github.com/scrapinghub/shub/issues/441
run: |
python -m venv venv
. venv/bin/activate
pip install .
python -c "from shub.image.utils import get_docker_client; get_docker_client(validate=False)"
- name: Upload coverage report
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@
install_requires=[
'click',
'docker',
'importlib-metadata; python_version < "3.8"',
'importlib-metadata; python_version < "3.10"',
'packaging',
'pip',
'PyYAML',
'retrying',
'requests',
'scrapinghub>=2.3.1',
'setuptools',
'tqdm==4.55.1',
'toml',
],
Expand Down
2 changes: 1 addition & 1 deletion shub/image/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
ShubDeprecationWarning, print_warning, BadParameterException,
)

if sys.version_info < (3, 8):
if sys.version_info < (3, 10):
import importlib_metadata as metadata
else:
from importlib import metadata
Expand Down

0 comments on commit 10f8b0c

Please sign in to comment.