From fc407f5b94e1751a8f2042931f63be5aee232c21 Mon Sep 17 00:00:00 2001 From: fjebaker Date: Thu, 2 May 2024 15:46:05 +0100 Subject: [PATCH] chore: use pyproject.toml See PEP 518 and PEP 621. Distutils is also being discontinued so want to always the modern tools. The only thing that doesn't play nicely at the moment is flake8, which wants its configuration in `tox.ini` instead of `pyproject.toml`. But this is also pretty standard, and even used in the sample Python project that PyPa maintain. --- pyproject.toml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 11 ---------- setup.py | 39 --------------------------------- tox.ini | 2 ++ 4 files changed, 60 insertions(+), 50 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py create mode 100644 tox.ini diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..069c408 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,58 @@ +[build-system] +requires = ["setuptools >= 61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "mdb" +version = "0.0.0" +dependencies = [ + "click==8.1.7", + "matplotlib==3.8.3", + "numpy==1.26.4", + "pexpect==4.9.0", + "typing_extensions==4.10.0", +] +requires-python = ">= 3.8" +authors = [ + {name = "Tom Meltzer" }, +] +maintainers = [ + {name = "Tom Meltzer" }, +] +readme = "README.md" +license = { file = "LICENSE" } + +[project.scripts] +mdb = "mdb.mdb:run_main" + +[project.optional-dependencies] +termgraph = [ + "termgraph==0.5.3", +] +develop = [ + "black==24.3.0", + "flake8==7.0.0", + "mypy==1.9.0", + "types-setuptools==69.2.0.20240317", + "pytest==8.1.1", + "pytest-cov==4.1.0", +] +docs = [ + "sphinx", + "sphinx_click", + "sphinx_rtd_theme", +] + +[project.urls] +Documentation = "https://mdb.readthedocs.io/en/latest/" +Repository = "https://github.com/TomMelt/mdb" +Issues = "https://github.com/TomMelt/mdb/issues" + +[tool.isort] +profile = "black" + +[tool.pycodestyle] +ignore = ["E203", "E501"] + +[tool.mypy] +exclude = ["conf.py"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 4ca20d8..0000000 --- a/setup.cfg +++ /dev/null @@ -1,11 +0,0 @@ -[isort] -# use black to format imports for isort -profile=black -[pycodestyle] -# ignore line_length limit - E501 -# ignore whitespace before ':' for slices (see https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#slices) -ignore = E203, E501 -[flake8] -extend-ignore = E203, E501 -[mypy] -exclude = conf.py diff --git a/setup.py b/setup.py deleted file mode 100644 index 6d9c63c..0000000 --- a/setup.py +++ /dev/null @@ -1,39 +0,0 @@ -from setuptools import find_packages, setup - -setup( - name="mdb", - version="0.0.0", - packages=find_packages(), - include_package_data=True, - install_requires=[ - "click", - "matplotlib", - "numpy", - "pexpect", - "rich", - "typing_extensions", - ], - extras_require={ - "termgraph": [ - "termgraph", - ], - "develop": [ - "black", - "flake8", - "mypy", - "types-setuptools", - "pytest", - "pytest-cov", - ], - "docs": [ - "sphinx", - "sphinx_click", - "sphinx_rtd_theme", - ], - }, - entry_points={ - "console_scripts": [ - "mdb = mdb.mdb:run_main", - ], - }, -) diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..e32c94f --- /dev/null +++ b/tox.ini @@ -0,0 +1,2 @@ +[flake8] +extend-ignore = E203, E501