From 2b21a749f415f2a18fe7782dcf24b52d77aa62d9 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 3 Sep 2024 00:16:52 +0200 Subject: [PATCH] Remove setup.cfg * flake8 doesn't support pyproject.toml, so move to .flake8 * coverage requires the toml extra to read pyproject.toml, so add that * mypy supports it by default Remove since we want to get rid of setup.py, so might as well remove setup.cfg as well. --- .flake8 | 5 +++++ meson.build | 1 - pyproject.toml | 32 +++++++++++++++++++++++++++++++- setup.cfg | 32 -------------------------------- 4 files changed, 36 insertions(+), 34 deletions(-) create mode 100644 .flake8 delete mode 100644 setup.cfg diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..547020e --- /dev/null +++ b/.flake8 @@ -0,0 +1,5 @@ +[flake8] +ignore=E402,E741 +builtins=buffer,unichr +max-line-length = 100 +exclude = build diff --git a/meson.build b/meson.build index db87e90..aba0514 100644 --- a/meson.build +++ b/meson.build @@ -23,7 +23,6 @@ endif for_wheel = get_option('wheel') fs = import('fs') -fs.copyfile('setup.cfg', 'setup.cfg') cc = meson.get_compiler('c') diff --git a/pyproject.toml b/pyproject.toml index 27ddcda..9380d68 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,10 +17,40 @@ mypy = {version = "1.8.0", markers = "platform_python_implementation != 'PyPy'"} flake8 = "^7.0.0" Sphinx = "^6.2.1" sphinx-rtd-theme = "^2.0.0" -coverage = "^7.2.3" +coverage = {extras = ["toml"], version = "^7.2.3"} sphinx-autobuild = "^2021.3.14" setuptools = "^69.0.3" +[tool.coverage.run] +include = [ + "cairo/*", + "tests/*" +] + +[tool.mypy] +disallow_any_unimported = true +disallow_any_expr = true +disallow_any_generics = true +disallow_subclassing_any = true +disallow_untyped_calls = true +disallow_untyped_defs = true +check_untyped_defs = true +warn_return_any = true +no_implicit_optional = true +disallow_any_decorated = true +disallow_any_explicit = false +strict_optional = true +follow_imports = "silent" +exclude = ["^(examples/|build|docs/)"] + +[[tool.mypy.overrides]] +module = "setup" +ignore_errors = true + +[[tool.mypy.overrides]] +module = "tests.*" +ignore_errors = true + [tool.meson-python.args] setup = ["-Dwheel=true", "-Dtests=false"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index e1d1105..0000000 --- a/setup.cfg +++ /dev/null @@ -1,32 +0,0 @@ -[flake8] -ignore=E402,E741 -builtins=buffer,unichr -max-line-length = 100 -exclude = build - -[coverage:run] -include= - cairo/* - tests/* - -[mypy-setup] -ignore_errors = True - -[mypy-tests.*] -ignore_errors = True - -[mypy] -disallow_any_unimported = True -disallow_any_expr = True -disallow_any_generics = True -disallow_subclassing_any = True -disallow_untyped_calls = True -disallow_untyped_defs = True -check_untyped_defs = True -warn_return_any = True -no_implicit_optional = True -disallow_any_decorated = True -disallow_any_explicit = False -strict_optional = True -follow_imports = silent -exclude = ^(examples/|build|docs/) \ No newline at end of file