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

Drop support for <3.8 #440

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
118 changes: 10 additions & 108 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,28 @@ on:
- master

jobs:
tests-ubuntu:
name: "Test: py${{ matrix.python-version }}, Ubuntu"
runs-on: ${{ matrix.os }}
tests:
name: "Test: py${{ matrix.python-version }}, ${{ matrix.os }}"
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: '3.6'
os: ubuntu-20.04
tox-env: min
- python-version: '3.6'
os: ubuntu-20.04
tox-env: py
- python-version: '3.7'
os: ubuntu-latest
tox-env: py
- python-version: '3.8'
os: ubuntu-latest
tox-env: py
- python-version: '3.9'
os: ubuntu-latest
tox-env: py
- python-version: '3.10'
os: ubuntu-latest
tox-env: py
- python-version: '3.11'
os: ubuntu-latest
tox-env: py
- python-version: '3.12'
os: ubuntu-latest
tox-env: py
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [Ubuntu, macOS, Windows]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install tox
run: pip install tox

- name: Run tests
run: tox -e ${{ matrix.tox-env }}
run: tox -e py

- name: Run off-tox tests
# https://github.com/scrapinghub/shub/issues/441
Expand All @@ -64,83 +41,8 @@ jobs:
python -c "from shub.image.utils import get_docker_client; get_docker_client(validate=False)"

- name: Upload coverage report
if: matrix.os == 'Ubuntu'
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov

tests-macos:
name: "Test: py${{ matrix.python-version }}, macOS"
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: '3.6'
tox-env: min
- python-version: '3.6'
tox-env: py
- python-version: '3.7'
tox-env: py
- python-version: '3.8'
tox-env: py
- python-version: '3.9'
tox-env: py
- python-version: '3.10'
tox-env: py
- python-version: '3.11'
tox-env: py
- python-version: '3.12'
tox-env: py

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install tox
run: pip install tox

- name: Run tests
run: tox -e ${{ matrix.tox-env }}

tests-windows:
name: "Test: py${{ matrix.python-version }}, Windows"
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: '3.6'
tox-env: min
- python-version: '3.6'
tox-env: py
- python-version: '3.7'
tox-env: py
- python-version: '3.8'
tox-env: py
- python-version: '3.9'
tox-env: py
- python-version: '3.10'
tox-env: py
- python-version: '3.11'
tox-env: py
- python-version: '3.12'
tox-env: py

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install tox
run: pip install tox

- name: Run tests
run: tox -e ${{ matrix.tox-env }}
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ without leaving the command line.
Requirements
------------

* Python >= 3.6
* Python >= 3.8


Installation
Expand All @@ -36,8 +36,8 @@ the Python Package Index::

pip install shub

Please note that if you are using Python < 3.6,
you should pin `shub` to `2.13.0` or lower.
Please note that if you are using Python < 3.8,
you should pin to `shub<=2.15.4`.

We also supply stand-alone binaries. You can find them in our `latest GitHub
release`_.
Expand Down
5 changes: 1 addition & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
},
include_package_data=True,
zip_safe=False,
python_requires='>=3.6',
python_requires='>=3.8',
install_requires=[
'click',
'docker',
'importlib-metadata; python_version < "3.10"',
'packaging',
'pip',
'PyYAML',
Expand All @@ -39,8 +38,6 @@
'Natural Language :: English',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
Expand Down
7 changes: 2 additions & 5 deletions shub/image/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
ShubDeprecationWarning, print_warning, BadParameterException,
)

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


STATUS_FILE_LOCATION = '.releases'
Expand Down Expand Up @@ -86,7 +83,7 @@ def get_docker_client(validate=True):
except ImportError:
raise ImportError(DOCKER_PY_UNAVAILABLE_MSG)
for dep in metadata.distributions():
if dep.name == 'docker-py':
if dep.metadata['Name'] == 'docker-py':
raise ImportError(DOCKER_PY_UNAVAILABLE_MSG)

docker_host = os.environ.get('DOCKER_HOST')
Expand Down
4 changes: 0 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ deps =
commands =
pytest --cov=shub --cov-report=term-missing --cov-report=html --cov-report=xml {posargs:shub tests}

[testenv:min]
deps =
{[testenv]deps}
Comment on lines -13 to -15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see this was the same as py.

Ideally we should have a min env with pinned minimum versions of dependencies, but since it was not there, I’m OK with removing it and adding it back properly later in a separate PR.


[testenv:freeze]
install_command =
python -m pip install {opts} {packages}
Expand Down
Loading