From 5debad09858e2c491f7f6e766c2a6f5912afa8b1 Mon Sep 17 00:00:00 2001 From: Jens Diemer Date: Sun, 4 Aug 2024 21:05:16 +0200 Subject: [PATCH] Use min. Python 3.11 --- .github/workflows/tests.yml | 2 +- dev-cli.py | 2 +- for_runners_ynh/tests/test_project_setup.py | 5 +---- pyproject.toml | 10 ++-------- tests/test_project_setup.py | 7 +------ 5 files changed, 6 insertions(+), 20 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 19f1b36..f2c2de1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.12", "3.11", "3.10"] + python-version: ["3.12", "3.11"] steps: - name: Checkout run: | diff --git a/dev-cli.py b/dev-cli.py index 70e9b2f..059bf12 100755 --- a/dev-cli.py +++ b/dev-cli.py @@ -33,7 +33,7 @@ else: sys.exit(-1) -assert sys.version_info >= (3, 10), f'Python version {sys.version_info} is too old!' +assert sys.version_info >= (3, 11), f'Python version {sys.version_info} is too old!' if sys.platform == 'win32': # wtf diff --git a/for_runners_ynh/tests/test_project_setup.py b/for_runners_ynh/tests/test_project_setup.py index 9311703..0158f63 100644 --- a/for_runners_ynh/tests/test_project_setup.py +++ b/for_runners_ynh/tests/test_project_setup.py @@ -1,10 +1,7 @@ from for_runners_ynh.cli.dev import PACKAGE_ROOT -try: - import tomllib # New in Python 3.11 -except ImportError: - import tomli as tomllib +import tomllib from bx_django_utils.filename import clean_filename from bx_py_utils.path import assert_is_dir, assert_is_file diff --git a/pyproject.toml b/pyproject.toml index 358e4c7..a744e9e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ readme = "README.md" authors = [ {name = 'Jens Diemer', email = 'git@jensdiemer.de'} ] -requires-python = ">=3.9" # Stay with 3.9 until YunoHost used >=Debian 11 (Bullseye) +requires-python = ">=3.11" dependencies = [ "django_for_runners>=0.18.1", # https://github.com/jedie/django-for-runners # @@ -45,12 +45,6 @@ dev = [ # https://github.com/pycqa/isort # https://github.com/pygments/pygments "darker[flynt, isort, color]", - - # indirect depencies added because of bug: - # https://github.com/pypa/pip/issues/9644 / https://github.com/jazzband/pip-tools/issues/1866 - # to avoid errors like: - # In --require-hashes mode, all requirements must have their versions pinned with ==. These do not: ... - "tomli", # Only needed for Python <3.11 ] [project.urls] @@ -138,7 +132,7 @@ exclude_lines = [ legacy_tox_ini = """ [tox] isolated_build = True -envlist = py{312,311,310} +envlist = py{312,311} skip_missing_interpreters = True [testenv] diff --git a/tests/test_project_setup.py b/tests/test_project_setup.py index a385582..4b114f9 100644 --- a/tests/test_project_setup.py +++ b/tests/test_project_setup.py @@ -1,13 +1,8 @@ import os +import tomllib from pathlib import Path from unittest import TestCase - -try: - import tomllib # New in Python 3.11 -except ImportError: - import tomli as tomllib - from bx_django_utils.filename import clean_filename from bx_py_utils.path import assert_is_dir, assert_is_file from django_tools.unittest_utils.project_setup import check_editor_config