Repository: m-rossi/jupyter-docx-bundler (language: python)

Issue:
Modernize packaging
See https://packaging.python.org/en/latest/tutorials/packaging-projects


Discussion / hints:

Fix patch:
diff --git a/.coveragerc b/.coveragerc
deleted file mode 100644
index 6fe9d15..0000000
--- a/.coveragerc
+++ /dev/null
@@ -1,2 +0,0 @@
-[run]
-omit = jupyter_docx_bundler/test/*
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 81cecd1..c596f4b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -59,7 +59,7 @@ jobs:
           miniforge-variant: Mambaforge
           python-version: ${{ matrix.python-version }}
       - name: Install dependencies
-        run: mamba install --yes --quiet --file requirements.txt --file requirements_test.txt "python=${{ matrix.python-version }}.*=*_cpython" "pandoc<3"
+        run: mamba install --yes --quiet --file requirements.txt --file requirements_test.txt "python=${{ matrix.python-version }}.*=*_cpython" "pandoc=2"
       - name: Execute pytest
         run: pytest .
       - uses: codecov/codecov-action@v1
diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml
index b9ca905..251f7da 100644
--- a/conda.recipe/meta.yaml
+++ b/conda.recipe/meta.yaml
@@ -18,8 +18,8 @@ requirements:
   host:
     - pip
     - python
-    - setuptools >=38.6.0
-    - setuptools-scm
+    - setuptools >=61.0
+    - setuptools-scm >=6.2
   run:
     - importlib_resources  # [py<39]
     - lxml
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..e2d2704
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,76 @@
+[build-system]
+requires = [
+    "setuptools>=61.0",
+    "setuptools_scm[toml]>=6.2",
+]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "jupyter-docx-bundler"
+authors = [
+  {name="Marco Rossi", email="developer@marco-rossi.com"},
+]
+description = "Jupyter bundler extension to export notebook as a docx file"
+dynamic = ["version"]
+readme = "README.md"
+requires-python = ">=3.6"
+classifiers = [
+    "Development Status :: 4 - Beta",
+    "Framework :: Jupyter :: JupyterLab",
+    "Framework :: Jupyter",
+    "License :: OSI Approved :: MIT License",
+    "Operating System :: OS Independent",
+    "Programming Language :: Python :: 3",
+    "Programming Language :: Python :: 3.6",
+    "Programming Language :: Python :: 3.7",
+    "Programming Language :: Python :: 3.8",
+    "Programming Language :: Python :: 3.9",
+    "Programming Language :: Python :: 3.10",
+    "Programming Language :: Python :: 3.11",
+]
+dependencies = [
+    'importlib-resources; python_version<"3.9"',
+    "lxml",
+    "nbconvert>=7.0",
+    "notebook>=5.0",
+    "pandas",
+    "pandocfilters",
+    "pypandoc>=1.4",
+    "requests",
+    "tabulate",
+    "tornado",
+]
+
+[project.entry-points."nbconvert.exporters"]
+docx = "jupyter_docx_bundler:DocxExporter"
+
+[project.optional-dependencies]
+test = [
+    "ipython>=7.0",
+    "kaleido",
+    "matplotlib>=3.1",
+    "mock",
+    "nbformat",
+    "numpy",
+    "pillow>=6.0.0",
+    "plotly",
+    "pytest",
+    "pytest-cov",
+    "pytest-lazy-fixture",
+    "sympy",
+]
+
+[project.urls]
+repository = "https://github.com/m-rossi/jupyter-docx-bundler"
+"Bug Tracker" = "https://github.com/m-rossi/jupyter-docx-bundler/issues"
+changelog = "https://github.com/m-rossi/jupyter-docx-bundler/blob/main/CHANGELOG.md"
+
+[tool.coverage.run]
+omit = ["jupyter_docx_bundler/test/*"]
+
+[tool.pytest.ini_options]
+minversion = "6.0"
+norecursedirs = ".* build dist CVS _darcs {arch} *.egg venv conda.recipe"
+addopts = "--cov=jupyter_docx_bundler --cov-report xml"
+
+[tool.setuptools_scm]
diff --git a/setup.py b/setup.py
deleted file mode 100644
index ccb4308..0000000
--- a/setup.py
+++ /dev/null
@@ -1,78 +0,0 @@
-import sys
-
-from setuptools import setup
-
-
-with open('README.md') as f:
-    long_description = f.read()
-
-install_requires = [
-    'lxml',
-    'nbconvert>=7.0',
-    'notebook>=5.0',
-    'pandas',
-    'pandocfilters',
-    'pypandoc>=1.4',
-    'requests',
-    'tabulate',
-    'tornado',
-]
-if sys.version_info.major <= 3 and sys.version_info.minor < 9:
-    install_requires += ['importlib-resources']
-
-setup(
-    author='Marco Rossi',
-    author_email='developer@marco-rossi.com',
-    classifiers=[
-        'Development Status :: 3 - Alpha',
-        'Framework :: Jupyter',
-        'License :: OSI Approved :: MIT License',
-        'Programming Language :: Python :: 3.6',
-        'Programming Language :: Python :: 3.7',
-        'Programming Language :: Python :: 3.8',
-        'Programming Language :: Python :: 3.9',
-    ],
-    description='Jupyter bundler extension to export notebook as a docx file',
-    extras_require={
-        'test': [
-            'ipython>=7.0',
-            'kaleido',
-            'matplotlib>=3.1',
-            'mock',
-            'nbformat',
-            'numpy',
-            'pillow>=6.0.0',
-            'plotly',
-            'pytest',
-            'pytest-cov',
-            'pytest-lazy-fixture',
-            'sympy',
-        ],
-    },
-    install_requires=install_requires,
-    keywords=[
-        'jupyter',
-        'docx',
-        'bundler',
-    ],
-    license='MIT',
-    long_description=long_description,
-    long_description_content_type='text/markdown',
-    name='jupyter-docx-bundler',
-    packages=[
-        'jupyter_docx_bundler',
-        'jupyter_docx_bundler.tests',
-    ],
-    python_requires='>=3.6',
-    setup_requires=[
-        'setuptools>=38.6.0',
-        'setuptools-scm',
-    ],
-    url='https://github.com/m-rossi/jupyter-docx-bundler',
-    use_scm_version=True,
-    entry_points={
-        'nbconvert.exporters': [
-            'docx = jupyter_docx_bundler:DocxExporter',
-        ],
-    }
-)


Test patch:
diff --git a/pytest.ini b/pytest.ini
deleted file mode 100644
index 6af00cf..0000000
--- a/pytest.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[pytest]
-norecursedirs = .* build dist CVS _darcs {arch} *.egg venv conda.recipe
-addopts = --cov=jupyter_docx_bundler --cov-report xml