From 7c7c1abf7c3830595dab48786c02a5b64e391a30 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Thu, 28 Mar 2024 20:33:16 +0100 Subject: [PATCH 1/3] [CHANGE] Project file linter We don't use setup.cfg anymore, so we should lint the pyproject.toml file now. --- .pre-commit-config.yaml | 13 +++++--- pyproject.toml | 69 +++++++++++++++++++++-------------------- 2 files changed, 45 insertions(+), 37 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 826a651a..b2328a73 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -78,8 +78,13 @@ repos: - id: django-upgrade args: [--target-version=4.2] - - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.5.0 + - repo: https://github.com/tox-dev/pyproject-fmt + rev: 1.7.0 hooks: - - id: setup-cfg-fmt - args: [ --include-version-classifiers ] + - id: pyproject-fmt + name: pyproject.toml formatter + description: "Format the pyproject.toml file." + args: + - --indent=4 + additional_dependencies: + - tox==4.14.2 # https://github.com/tox-dev/tox/releases/latest diff --git a/pyproject.toml b/pyproject.toml index fb728a65..7afaabc1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,20 +1,21 @@ [build-system] -requires = ["flit_core >=3.2,<4"] build-backend = "flit_core.buildapi" +requires = [ + "flit_core<4,>=3.2", +] [project] name = "allianceauth" -dynamic = ["version", "description"] readme = "README.md" -license = {file = "LICENSE"} -requires-python = ">=3.8" -authors = [ - { name = "Alliance Auth", email = "adarnof@gmail.com" }, -] keywords = [ "allianceauth", "eveonline", ] +license = {file = "LICENSE"} +authors = [ + { name = "Alliance Auth", email = "adarnof@gmail.com" }, +] +requires-python = ">=3.8" classifiers = [ "Environment :: Web Environment", "Framework :: Django", @@ -23,6 +24,7 @@ classifiers = [ "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Operating System :: POSIX :: Linux", "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -31,56 +33,57 @@ classifiers = [ "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", ] +dynamic = [ + "description", + "version", +] dependencies = [ "bcrypt", "beautifulsoup4", + "celery<6,>=5.2", "celery-once>=3.0.1", - "celery>=5.2.0,<6", - 'django-bootstrap5>=23.3', + "django<5,>=4.2", "django-bootstrap-form", - "django-celery-beat>=2.3.0", - "django-esi>=5.0.0", - "django-redis>=5.2.0", - "django-registration>=3.3,<3.4", + "django-bootstrap5>=23.3", + "django-celery-beat>=2.3", + "django-esi>=5", + "django-redis>=5.2", + "django-registration<3.4,>=3.3", "django-sortedm2m", - "django>=4.2,<5", "dnspython", - "mysqlclient>=2.1.0", + "mysqlclient>=2.1", "openfire-restapi", - "packaging>=21.0", + "packaging>=21", "passlib", "pydiscourse", "python-slugify>=1.2", - "redis>=4.0.0", - "requests-oauthlib", + "redis>=4", "requests>=2.9.1", + "requests-oauthlib", "semantic-version", "slixmpp", ] - [project.optional-dependencies] +docs = [ + "myst-parser", + "sphinx", + "sphinx-copybutton", + "sphinx-tabs", + "sphinx_rtd_theme<3.0.0,>=2", + "sphinxcontrib-django", +] test = [ "coverage>=4.3.1", "django-webtest", - "requests-mock>=1.2.0" + "requests-mock>=1.2", ] -docs = [ - "sphinx", - "sphinx_rtd_theme>=2.0.0,<3.0.0", - "myst-parser", - "sphinxcontrib-django", - "sphinx-copybutton", - "sphinx-tabs", -] - -[project.scripts] -allianceauth = "allianceauth.bin.allianceauth:main" - [project.urls] -Homepage = "https://gitlab.com/allianceauth/allianceauth" Documentation = "https://allianceauth.readthedocs.io/" +Homepage = "https://gitlab.com/allianceauth/allianceauth" Source = "https://gitlab.com/allianceauth/allianceauth" Tracker = "https://gitlab.com/allianceauth/allianceauth/-/issues" +[project.scripts] +allianceauth = "allianceauth.bin.allianceauth:main" [tool.flit.module] name = "allianceauth" From c46741d3116e1eb9bfff9be4441581be7a10a6c2 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Thu, 28 Mar 2024 20:34:31 +0100 Subject: [PATCH 2/3] [MISC] Update repo versions --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b2328a73..5ebe1130 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -67,7 +67,7 @@ repos: ) - repo: https://github.com/asottile/pyupgrade - rev: v3.15.1 + rev: v3.15.2 hooks: - id: pyupgrade args: [ --py38-plus ] From 92548ba402bc4b6f561df9dcb1f9bb79386b3b64 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Thu, 28 Mar 2024 20:40:45 +0100 Subject: [PATCH 3/3] [ADD] pyproject.toml validation --- .pre-commit-config.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5ebe1130..ac0a0beb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -88,3 +88,10 @@ repos: - --indent=4 additional_dependencies: - tox==4.14.2 # https://github.com/tox-dev/tox/releases/latest + + - repo: https://github.com/abravalheri/validate-pyproject + rev: v0.16 + hooks: + - id: validate-pyproject + name: Validate pyproject.toml + description: "Validate the pyproject.toml file."