Repository: jazzband/django-simple-menu (language: python)

Issue:
Improve developer experience
This PR

 - migrates from `setup.py` to `setup.cfg`+`pyproject.toml`, making amount of files smaller
 - adds auto-updated requirements-dev.txt for easier environment setup

**TODO:** add a developer's guide to the docs


Discussion / hints:
# [Codecov](https://codecov.io/gh/jazzband/django-simple-menu/pull/119?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jazzband) Report
> Merging [#119](https://codecov.io/gh/jazzband/django-simple-menu/pull/119?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jazzband) (5ff7e85) into [master](https://codecov.io/gh/jazzband/django-simple-menu/commit/955b8727def7034b8f01060ff9eaf8a6f35d9734?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jazzband) (955b872) will **not change** coverage.
> The diff coverage is `n/a`.

```diff
@@           Coverage Diff           @@
##           master     #119   +/-   ##
=======================================
  Coverage   89.88%   89.88%           
=======================================
  Files           2        2           
  Lines         178      178           
  Branches       26       26           
=======================================
  Hits          160      160           
  Misses          9        9           
  Partials        9        9           
```



:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jazzband)

Seems to work fine. I'll merge it later today
Let's rethink this in #131 

Fix patch:
diff --git a/.coveragerc b/.coveragerc
deleted file mode 100644
index 08a9b69..0000000
--- a/.coveragerc
+++ /dev/null
@@ -1,6 +0,0 @@
-[run]
-source = simple_menu
-branch = 1
-
-[report]
-omit = *migrations*,.tox/*,setup.py,*settings.py,menu/*
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 3ea782b..cbc2651 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,11 +1,15 @@
+ci:
+    autoupdate_schedule: monthly
+
 repos:
 -   repo: https://github.com/pre-commit/pre-commit-hooks
     rev: v4.4.0
     hooks:
-    -   id: check-yaml
     -   id: end-of-file-fixer
     -   id: trailing-whitespace
     -   id: mixed-line-ending
+    -   id: check-toml
+    -   id: check-yaml
 -   repo: https://github.com/asottile/pyupgrade
     rev: v3.7.0
     hooks:
@@ -25,3 +29,15 @@ repos:
     -   id: python-no-log-warn
     -   id: rst-backticks
     -   id: rst-directive-colons
+-   repo: https://github.com/asottile/setup-cfg-fmt
+    rev: v2.3.0
+    hooks:
+    -   id: setup-cfg-fmt
+-   repo: https://github.com/tox-dev/pyproject-fmt
+    rev: "0.12.1"
+    hooks:
+    -   id: pyproject-fmt
+-   repo: https://github.com/tox-dev/tox-ini-fmt
+    rev: "1.2.0"
+    hooks:
+    -   id: tox-ini-fmt
diff --git a/pyproject.toml b/pyproject.toml
index a62484f..0e88c12 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,7 +1,20 @@
 [build-system]
-requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
+build-backend = "setuptools.build_meta"
+requires = [
+  "setuptools>=42",
+  "setuptools_scm[toml]>=3.4",
+]
 
 [tool.setuptools_scm]
 # this empty section means: use_scm_version=True
 version_scheme = "guess-next-dev"
 local_scheme = "no-local-version"
+
+[tool.coverage.run]
+source = [
+  "simple_menu",
+]
+plugins = ["covdefaults"]
+
+[tool.coverage.report]
+fail_under = 85
diff --git a/setup.cfg b/setup.cfg
index b1c4cd3..74266a4 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,25 +1,25 @@
 [metadata]
-name = django-simple-menu
+name = django_simple_menu
+description = Simple, yet powerful, code-based menus for Django applications
+long_description = file: README.rst
+long_description_content_type = text/x-rst
 url = https://github.com/jazzband/django-simple-menu
 author = Evan Borgstrom
 author_email = evan@borgstrom.ca
-description = Simple, yet powerful, code-based menus for Django applications
-long_description = file: README.rst
-license = BSD 2-Clause "Simplified" License
+license = BSD-2-Clause
+license_files = LICENSE
 classifiers =
     Development Status :: 5 - Production/Stable
     Framework :: Django
     Framework :: Django :: 3.2
     Framework :: Django :: 4.0
     Framework :: Django :: 4.1
+    Framework :: Django :: 4.2
     Intended Audience :: Developers
     License :: OSI Approved :: BSD License
     Natural Language :: English
     Operating System :: OS Independent
-    Topic :: Software Development :: Libraries
-    Topic :: Software Development :: Libraries :: Python Modules
     Programming Language :: Python
-    Programming Language :: Python :: 3
     Programming Language :: Python :: 3 :: Only
     Programming Language :: Python :: 3.6
     Programming Language :: Python :: 3.7
@@ -27,15 +27,18 @@ classifiers =
     Programming Language :: Python :: 3.9
     Programming Language :: Python :: 3.10
     Programming Language :: Python :: 3.11
+    Programming Language :: Python :: 3.12
+    Topic :: Software Development :: Libraries
+    Topic :: Software Development :: Libraries :: Python Modules
 
 [options]
 packages =
     simple_menu
     menu
-include_package_data = True
-python_requires = >=3.6,<4.0
 install_requires =
     Django>=2.2
-    importlib_metadata; python_version < '3.8'
+    importlib-metadata;python_version < '3.8'
+python_requires = >=3.6,<4.0
+include_package_data = True
 setup_requires =
-    setuptools_scm
+    setuptools-scm
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 36f7fe7..0000000
--- a/setup.py
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env python3
-from setuptools import setup
-
-setup()
diff --git a/simple_menu/__init__.py b/simple_menu/__init__.py
index 7164b78..46d2316 100644
--- a/simple_menu/__init__.py
+++ b/simple_menu/__init__.py
@@ -9,7 +9,7 @@
 
 try:
     __version__ = version("django-simple-menu")
-except PackageNotFoundError:
+except PackageNotFoundError:  # pragma: no cover
     # package is not installed
     __version__ = None
 
diff --git a/tox.ini b/tox.ini
index 4a703c9..9bcd412 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,12 +1,30 @@
 [tox]
-usedevelop = true
-; https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
 envlist =
-    py3{6,7,8,9,10}-dj32
-    py3{8,9,10}-dj40
-    py3{8,9,10,11}-dj41
-    py3{8,9,10,11}-dj42
-    py3{10,11,12}-djmain
+    py3{11, 10, 9, 8}-dj42
+    py3{11, 10, 9, 8}-dj41
+    py3{10, 9, 8}-dj40
+    py3{10, 9, 8, 7, 6}-dj32
+    py3{12, 11, 10}-djmain
+isolated_build = true
+
+[testenv]
+deps =
+    covdefaults
+    coverage[toml]
+    dj32: Django~=3.2.16
+    dj40: Django~=4.0.8
+    dj41: Django~=4.1.3
+    dj42: Django~=4.2.1
+    djmain: https://github.com/django/django/tarball/main
+pass_env =
+    FORCE_COLOR
+    NO_COLOR
+setenv =
+    DJANGO_SETTINGS_MODULE = simple_menu.test_settings
+commands =
+    coverage run -m django test -v2 {posargs:simple_menu}
+    coverage report
+    coverage xml
 
 [gh-actions]
 python =
@@ -19,25 +37,9 @@ python =
     3.12: py312
 
 [gh-actions:env]
-DJANGO =
+django =
     3.2: dj32
     4.0: dj40
     4.1: dj41
     4.2: dj42
     main: djmain
-
-[testenv]
-usedevelop = true
-deps =
-    coverage
-    dj32: Django~=3.2.16
-    dj40: Django~=4.0.8
-    dj41: Django~=4.1.3
-    dj42: Django~=4.2.1
-    djmain: https://github.com/django/django/tarball/main
-setenv =
-    DJANGO_SETTINGS_MODULE=simple_menu.test_settings
-commands =
-    coverage run -m django test -v2 {posargs:simple_menu}
-    coverage report
-    coverage xml


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 09c66b7..5da2e99 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -7,6 +7,9 @@ on:
   pull_request:
     branches: [master]
 
+env:
+  FORCE_COLOR: "1"
+
 jobs:
   build:
     name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})