Repository: crate/sphinx_csv_filter (language: python)

Issue:
`namespace_packages` is deprecated
When invoking `python setup.py build_sphinx`, there is a warning.
```
SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated, consider using implicit namespaces instead (PEP 420).
```

When improving the situation, we may think about deprecating use of package namespaces completely. I think there is no reason this module must be living within the `crate.sphinx.csv` namespace, so I suggest to just call the package namespace `sphinx_csv_filter` instead.



Discussion / hints:

Fix patch:
diff --git a/docs/conf.py b/docs/conf.py
index 4e26e4b..9005ade 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,3 +1,5 @@
+project = "sphinx"
+
 # The suffix of source filenames.
 source_suffix = '.txt'
 
diff --git a/docs/index.txt b/docs/index.txt
index ccab560..10e8dd1 100644
--- a/docs/index.txt
+++ b/docs/index.txt
@@ -3,10 +3,10 @@ Example Table
 =============
 
 This example excludes all rows if the value of column ``Attend?`` (Idx: 3)
-matches the regex pattern.
+matches the regex pattern. It should display 3 columns, and 1 row, with
+details for "Ernst Handel", with *no* table header.
 
 .. csv-filter:: Example Table
-   :header: Company,Contact,Country,Attend?
    :delim: U+0009
    :file: example.csv
    :exclude: {3: '(?i)Y\w*'}
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..7deaaab
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,88 @@
+[build-system]
+requires = [
+    "setuptools==71.1.0",
+]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "sphinx-csv-filter"
+version = "0.4.2"
+description='A CSV filter directive for docutils and Sphinx, that extends the "csv-table" reStructuredText directive to add row filtering options.'
+readme = "README.rst"
+requires-python = ">=3.9"
+license.file = "LICENSE"
+authors = [
+    {name="Crate.IO GmbH", email="office@crate.io"}
+]
+maintainers = [
+    {name="Crate.IO GmbH", email="office@crate.io"}
+]
+keywords= [
+    "sphinx",
+    "csv",
+    "filter",
+    "docutils",
+    "directive",
+    "plugin",
+    "csv-table",
+    "csv-filter",
+    "restructuredtext'",
+]
+classifiers = [
+    "Development Status :: 4 - Beta",
+    "Intended Audience :: Developers",
+    "License :: OSI Approved :: Apache Software License",
+    "Operating System :: OS Independent",
+    "Programming Language :: Python",
+    "Programming Language :: Python :: 3",
+    "Programming Language :: Python :: 3.9",
+    "Programming Language :: Python :: 3.10",
+    "Programming Language :: Python :: 3.11",
+    "Programming Language :: Python :: 3.12",
+    "Programming Language :: Python :: 3.13",
+    "Programming Language :: Python :: Implementation :: CPython",
+    "Topic :: Documentation",
+    "Topic :: Documentation :: Sphinx",
+    "Topic :: Education",
+    "Topic :: Software Development :: Code Generators",
+    "Topic :: Software Development :: Documentation",
+    "Topic :: Text Processing :: Markup :: reStructuredText",
+]
+dependencies = [
+    "Sphinx",
+]
+
+[project.optional-dependencies]
+
+development = [
+    "build",
+    "setuptools",
+    "twine",
+    "wheel",
+]
+testing = [
+    "flake8",
+    "pytest",
+    "pytest-cov",
+    "pytest-flake8",
+    "pytest-isort",
+]
+
+[project.urls]
+Homepage = 'https://github.com/crate/sphinx_csv_filter'
+Issues = 'https://github.com/crate/sphinx_csv_filter/issues'
+
+# Flake8 doesn't believe in pyproject.toml. For now, configuration is in tox.ini
+# [tool.flake8]
+
+[tool.isort]
+combine_as_imports = true
+default_section = "THIRDPARTY"
+include_trailing_comma = true
+known_first_party = ["croud"]
+line_length = 88
+multi_line_output = 3
+
+[tool.pytest.ini_options]
+addopts = "-vvv --flake8 --isort --cov --cov-report=term-missing --cov-report=xml"
+doctest_optionflags = "NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ELLIPSIS"
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index 581eba1..0000000
--- a/setup.cfg
+++ /dev/null
@@ -1,28 +0,0 @@
-[wheel]
-universal = 1
-
-[build_sphinx]
-project = sphinx
-source-dir = docs
-build-dir = out
-builder = html
-warning-is-error = true
-
-[flake8]
-max-line-length = 88
-ignore = E203 W503
-extend-exclude = .venv
-
-[tool:pytest]
-addopts = -vvv --flake8 --isort --cov --cov-report=term-missing --cov-report=xml
-doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ELLIPSIS
-flake8-max-line-length = 88
-flake8-ignore = E203 W503
-
-[isort]
-combine_as_imports = true
-default_section = THIRDPARTY
-include_trailing_comma = true
-known_first_party = croud
-line_length = 88
-multi_line_output = 3
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 5a217d8..0000000
--- a/setup.py
+++ /dev/null
@@ -1,90 +0,0 @@
-# -*- coding: utf-8; -*-
-#
-# Licensed to Crate.IO GmbH ("Crate") under one or more contributor
-# license agreements.  See the NOTICE file distributed with this work for
-# additional information regarding copyright ownership.  Crate licenses
-# this file to you under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.  You may
-# obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-# However, if you have executed another commercial license agreement
-# with Crate these terms will supersede the license and you may use the
-# software solely pursuant to the terms of the relevant commercial agreement.
-
-import os
-
-from setuptools import find_packages, setup
-
-
-def read(path):
-    with open(os.path.join(os.path.dirname(__file__), path)) as f:
-        return f.read()
-
-
-setup(
-    name='sphinx-csv-filter',
-    version='0.4.2',
-    url='https://github.com/crate/sphinx_csv_filter',
-    author='Crate.IO GmbH',
-    author_email='office@crate.io',
-    package_dir={'': 'src'},
-    description='A CSV filter directive for docutils and Sphinx, that extends the '
-                '"csv-table" reStructuredText directive to add row filtering options.',
-    long_description=read('README.rst'),
-    long_description_content_type='text/x-rst',
-    platforms=['any'],
-    license='Apache License 2.0',
-    keywords='sphinx csv filter docutils directive plugin '
-             'csv-table csv-filter restructuredtext',
-    packages=find_packages('src'),
-    namespace_packages=['crate'],
-    entry_points={},
-    extras_require={
-        "development": [
-            "build",
-            "setuptools",
-            "twine",
-            "wheel",
-        ],
-        "testing": [
-            "flake8",
-            "pytest",
-            "pytest-cov",
-            "pytest-flake8",
-            "pytest-isort",
-        ]
-    },
-    install_requires=[
-        "Sphinx",
-    ],
-    python_requires=">=3.3",
-    classifiers=[
-        'Development Status :: 4 - Beta',
-        'Intended Audience :: Developers',
-        'License :: OSI Approved :: Apache Software License',
-        'Operating System :: OS Independent',
-        'Programming Language :: Python',
-        'Programming Language :: Python :: 3',
-        'Programming Language :: Python :: 3.8',
-        'Programming Language :: Python :: 3.9',
-        'Programming Language :: Python :: 3.10',
-        'Programming Language :: Python :: 3.11',
-        'Programming Language :: Python :: 3.12',
-        'Programming Language :: Python :: 3.13',
-        'Programming Language :: Python :: Implementation :: CPython',
-        'Topic :: Documentation',
-        'Topic :: Documentation :: Sphinx',
-        'Topic :: Education',
-        'Topic :: Software Development :: Code Generators',
-        'Topic :: Software Development :: Documentation',
-        'Topic :: Text Processing :: Markup :: reStructuredText',
-    ],
-)
diff --git a/src/crate/__init__.py b/src/crate/__init__.py
deleted file mode 100644
index c8fb9dc..0000000
--- a/src/crate/__init__.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- coding: utf-8; -*-
-#
-# Licensed to Crate.IO GmbH ("Crate") under one or more contributor
-# license agreements.  See the NOTICE file distributed with this work for
-# additional information regarding copyright ownership.  Crate licenses
-# this file to you under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.  You may
-# obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-# However, if you have executed another commercial license agreement
-# with Crate these terms will supersede the license and you may use the
-# software solely pursuant to the terms of the relevant commercial agreement.
-
-# this is a namespace package
-try:
-    import pkg_resources
-
-    pkg_resources.declare_namespace(__name__)
-except ImportError:
-    import pkgutil
-
-    __path__ = pkgutil.extend_path(__path__, __name__)
diff --git a/src/crate/sphinx/__init__.py b/src/crate/sphinx/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/tox.ini b/tox.ini
index 01770a4..886042d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,3 +1,8 @@
+# Flake8 doesn't believe in pyproject.toml
+[flake8]
+max-line-length = 88
+ignore = E203 W503
+extend-exclude = .venv
 
 [tox]
 envlist = py{38,39,310,311,312,313}
@@ -7,3 +12,7 @@ extras =
     testing
 commands =
     python -m pytest {posargs}
+
+[testenv:docs]
+commands =
+    python -m sphinx --fail-on-warning --builder html docs out


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 43aa8f9..d5bbd7f 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -21,11 +21,11 @@ jobs:
     strategy:
       matrix:
         os: ['ubuntu-22.04']
-        python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
+        python-version: ['3.9', '3.10', '3.11', '3.12', '3.13-dev']
       fail-fast: true
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v5
         with:
@@ -37,13 +37,14 @@ jobs:
         run: pip install -e .[testing]
 
       - name: Invoke tests
-        run: pytest
+        run: python -m pytest
 
       - name: Build documentation
-        run: python setup.py build_sphinx
+        run: python -m sphinx --fail-on-warning --builder html docs out
 
-      # https://github.com/codecov/codecov-action
-      - name: Upload coverage results to Codecov
-        uses: codecov/codecov-action@v3
+      - name: Store Coverage Data
+        uses: actions/upload-artifact@v4.3.6
         with:
-          fail_ci_if_error: true
+          name: coverage-data-${{ matrix.python-version }}
+          path: "coverage.xml"
+          if-no-files-found: ignore