diff --git a/.docker/Dockerfile b/.docker/Dockerfile index f5fcd51d..313f252a 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -79,7 +79,7 @@ COPY --from=builder /app/misc/webservice.py /app/ COPY --from=builder /app/misc/watcher.py /app/ # Copy minimal project files to get the test suite. -COPY --from=builder /app/setup.cfg /app/setup.py /app/README.md /app/ +COPY --from=builder /app/pyproject.toml /app/README.md /app/ COPY --from=builder /app/tests /app/tests ENTRYPOINT ["/usr/local/bin/ocrmypdf"] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9a15f41..bc02d363 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -224,9 +224,8 @@ jobs: - name: Make wheels and sdist run: | - python -m pip install --upgrade pip wheel - python setup.py sdist - python setup.py bdist_wheel + python -m pip install --upgrade pip wheel build + python -m build --sdist --wheel - uses: actions/upload-artifact@v3 with: diff --git a/docs/plugins.rst b/docs/plugins.rst index def6e444..da8df5ac 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -76,20 +76,16 @@ Setuptools plugins You can also create a plugin that OCRmyPDF will always automatically load if both are installed in the same virtual environment, using a setuptools entrypoint. -Your package's ``setup.py`` would need to contain the following, for a plugin +Your package's ``pyproject.toml`` would need to contain the following, for a plugin named ``ocrmypdf-exampleplugin``: -.. code-block:: python +.. code-block:: toml - # sample ./setup.py file - from setuptools import setup + [project] + name = "ocrmypdf-exampleplugin" - setup( - name="ocrmypdf-exampleplugin", - packages=["exampleplugin"], - # the following makes a plugin available to pytest - entry_points={"ocrmypdf": ["exampleplugin = exampleplugin.pluginmodule"]}, - ) + [project.entry-points."ocrmypdf"] + exampleplugin = "exampleplugin.pluginmodule" .. code-block:: ini diff --git a/setup.py b/setup.py deleted file mode 100644 index afa8ba3f..00000000 --- a/setup.py +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-FileCopyrightText: 2022 James R. Barlow -# SPDX-License-Identifier: MPL-2.0 - -"""setup.py to support older setuptools and pip.""" - -from __future__ import annotations - -from setuptools import setup - -setup()