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 Python 3.8 #771

Merged
merged 2 commits into from
Mar 11, 2025
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
2 changes: 1 addition & 1 deletion .black.cfg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
include = '\.pyi?$'
line-length = 100
skip-string-normalization = true
target-version = ['py38', 'py39', 'py310']
target-version = ['py39', 'py310']
4 changes: 1 addition & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
strategy:
matrix:
python_version:
- "3.8"
- "3.9"
- "3.10"

Expand Down Expand Up @@ -73,7 +72,6 @@ jobs:
strategy:
matrix:
python_version:
- "3.8"
- "3.9"
- "3.10"

Expand Down Expand Up @@ -138,7 +136,7 @@ jobs:

- name: Check that compiled Python dependency manifests are up-to-date with their sources
# FIXME: There are issues related to testing with multiple Python versions.
if: ${{ startsWith(steps.set_up_python.outputs.python-version, '3.8.') }}
if: ${{ startsWith(steps.set_up_python.outputs.python-version, '3.9.') }}
run: |
source "$PYTHON_VIRTUALENV_ACTIVATE"
make python-deps-sync-check
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ The full documentation is at <https://lib-cl-sii-python.readthedocs.io>.

## Supported Python versions

Only Python 3.8, 3.9 and 3.10. Python 3.7 and below will not work because we use some features
introduced in Python 3.8.
Only Python 3.9 and 3.10. Python 3.8 and below will not work because we use some features
introduced in Python 3.9.

## Quickstart

Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[mypy]
python_version = 3.8
python_version = 3.9
platform = linux
mypy_path =
src
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
Expand Down
3 changes: 1 addition & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --allow-unsafe --strip-extras requirements-dev.in
Expand Down Expand Up @@ -182,7 +182,6 @@ typing-extensions==4.12.2
# -c requirements.txt
# black
# mypy
# rich
# tox
# types-lxml
urllib3==1.26.19
Expand Down
18 changes: 2 additions & 16 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --allow-unsafe --strip-extras requirements.in
Expand All @@ -12,11 +12,6 @@ attrs==23.2.0
# via
# jsonschema
# referencing
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -r requirements.in
# django
# djangorestframework
certifi==2024.7.4
# via signxml
cffi==1.16.0
Expand All @@ -39,10 +34,6 @@ djangorestframework==3.15.2
# via -r requirements.in
importlib-metadata==8.5.0
# via -r requirements.in
importlib-resources==6.4.5
# via
# jsonschema
# jsonschema-specifications
jsonschema==4.23.0
# via -r requirements.in
jsonschema-specifications==2023.12.1
Expand All @@ -55,8 +46,6 @@ marshmallow==3.22.0
# via -r requirements.in
packaging==24.1
# via marshmallow
pkgutil-resolve-name==1.3.10
# via jsonschema
pycparser==2.22
# via cffi
pydantic==2.10.6
Expand All @@ -82,12 +71,9 @@ sqlparse==0.5.0
typing-extensions==4.12.2
# via
# -r requirements.in
# annotated-types
# asgiref
# pydantic
# pydantic-core
# pyopenssl
zipp==3.20.2
# via
# importlib-metadata
# importlib-resources
# via importlib-metadata
13 changes: 8 additions & 5 deletions src/tests/test_libs_xml_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,14 @@ def _get_cert_chain_verifier(
)

# Without cert: fails because the issuer of the cert in the signature is not a known CA.
with self.assertRaises(XmlSignatureInvalidCertificate) as cm, mock.patch.object(
signxml.verifier.XMLVerifier,
'get_cert_chain_verifier',
side_effect=_get_cert_chain_verifier,
) as mock_get_cert_chain_verifier:
with (
self.assertRaises(XmlSignatureInvalidCertificate) as cm,
mock.patch.object(
signxml.verifier.XMLVerifier,
'get_cert_chain_verifier',
side_effect=_get_cert_chain_verifier,
) as mock_get_cert_chain_verifier,
):
verify_xml_signature(xml_doc, trusted_x509_cert=None)
self.assertEqual(
cm.exception.args,
Expand Down
19 changes: 11 additions & 8 deletions src/tests/test_rut_crypto_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,17 @@ def test_get_subject_rut_from_certificate_pfx_does_not_throw_attribute_error_if_
value=certificate_extension_value,
)

with patch.object(
cryptography.hazmat.primitives.serialization.pkcs12,
'load_key_and_certificates',
Mock(return_value=(None, x509_cert, None)),
), patch.object(
x509_cert.extensions,
'get_extension_for_class',
Mock(return_value=certificate_extension),
with (
patch.object(
cryptography.hazmat.primitives.serialization.pkcs12,
'load_key_and_certificates',
Mock(return_value=(None, x509_cert, None)),
),
patch.object(
x509_cert.extensions,
'get_extension_for_class',
Mock(return_value=certificate_extension),
),
):
pfx_file_bytes = b'hello'
password = 'fake_password'
Expand Down
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[tox]
envlist =
py38,
py39,
py310,

Expand All @@ -12,6 +11,5 @@ deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-dev.txt
basepython =
py38: python3.8
py39: python3.9
py310: python3.10