Skip to content

Commit

Permalink
drop compatibility with python3.8; container image: upgrade alpine ba…
Browse files Browse the repository at this point in the history
…se image from 3.19 to 3.20; test image build against arm64/aarch64 instead of armv7
  • Loading branch information
fphammerle committed Nov 17, 2024
1 parent cf6300f commit df75ef8
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 554 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
SETUPTOOLS_SCM_PRETEND_VERSION=0
platforms: |
linux/amd64
linux/arm/v7
linux/arm64
9 changes: 5 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install --upgrade pipenv==2023.6.18
- run: pip install --upgrade pipenv==2024.1.0
- run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
env:
PYTHON_VERSION: ${{ matrix.python-version }}
Expand All @@ -34,7 +34,6 @@ jobs:
strategy:
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
fail-fast: false
Expand All @@ -50,13 +49,15 @@ jobs:
# > [...]
# > [...]/coverage/inorout.py:507: CoverageWarning:
# . Module was never imported. (module-not-imported)
- run: pip install --upgrade pipenv==2023.6.18
- run: pip install --upgrade pipenv==2024.1.0
# by default pipenv picks the latest version in PATH
- run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
env:
PYTHON_VERSION: ${{ matrix.python-version }}
- run: pipenv graph
- run: pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)" --cov-report=term-missing --cov-fail-under=100
- run: >-
pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)"
--cov-report=term-missing --cov-fail-under=100
- run: pipenv run pylint "$(cat *.egg-info/top_level.txt)"
# https://github.com/PyCQA/pylint/issues/352
- run: pipenv run pylint tests/*
Expand Down
1 change: 0 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ load-plugins=pylint.extensions.check_elif,
pylint.extensions.comparison_placement,
pylint.extensions.confusing_elif,
pylint.extensions.consider_ternary_expression,
pylint.extensions.emptystring,
pylint.extensions.eq_without_hash,
pylint.extensions.for_any_all,
pylint.extensions.mccabe,
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- container image: upgrade alpine base image from 3.19 to 3.20

### Removed
- compatibility with `python3.8`
- container image: no longer test build on armv7

## [0.4.0] - 2024-08-12
### Added
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=docker.io/python:3.10-alpine3.19
ARG BASE_IMAGE=docker.io/python:3.10-alpine3.20
ARG SOURCE_DIR_PATH=/wireless-sensor-mqtt


Expand All @@ -16,7 +16,7 @@ RUN apk add --no-cache \
&& adduser -S build

USER build
RUN pip install --user --no-cache-dir pipenv==2021.5.29
RUN pip install --user --no-cache-dir pipenv==2024.1.0

ARG SOURCE_DIR_PATH
COPY --chown=build:nobody Pipfile Pipfile.lock $SOURCE_DIR_PATH/
Expand All @@ -25,7 +25,7 @@ ENV PIPENV_CACHE_DIR=/tmp/pipenv-cache \
PIPENV_VENV_IN_PROJECT=yes-please \
PATH=/home/build/.local/bin:$PATH
# `sponge` is not pre-installed
RUN jq 'del(.default."wireless-sensor-mqtt", .default."sanitized-package")' Pipfile.lock > Pipfile.lock~ \
RUN jq 'del(.default."wireless-sensor-mqtt")' Pipfile.lock > Pipfile.lock~ \
&& mv Pipfile.lock~ Pipfile.lock \
&& pipenv install --deploy --verbose
COPY --chown=build:nobody . $SOURCE_DIR_PATH
Expand Down
12 changes: 0 additions & 12 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,13 @@ name = "pypi"
[packages]
wireless-sensor-mqtt = {path = ".", editable = true}

# python3.8 compatibility
numpy = "<1.25"

[dev-packages]
black = "*"
mypy = "*"
pylint = "*"
pytest = "*"
pytest-cov = "*"

# python3.10 compatibility
# > File "[...]/lib/python3.10/site-packages/mypy/main.py", line 11, in <module>
# > from typing_extensions import Final, NoReturn
# > ModuleNotFoundError: No module named 'typing_extensions'
typing-extensions = {markers = ""}
# python<3.11 compatibility
# > File "[...]/lib/python3.10/site-packages/_pytest/_code/code.py", line 60, in <module>
# > from exceptiongroup import BaseExceptionGroup
Expand All @@ -30,10 +22,6 @@ exceptiongroup = {markers = "python_version < '3.11'"}
# > import tomli as tomllib
# > ModuleNotFoundError: No module named 'tomli'
tomli = {markers = "python_version < '3.11'"}
# > File "[...]/lib/python3.10/site-packages/astroid/decorators.py", line 16, in <module>
# > import wrapt
# > ModuleNotFoundError: No module named 'wrapt'
wrapt = "*"
# remove `"markers": "python_version >= '3.11'"` to workaround:
# > File "[...]/lib/python3.7/site-packages/pylint/lint/parallel.py", line 13, in <module>
# > import dill
Expand Down
Loading

0 comments on commit df75ef8

Please sign in to comment.