Drop setup.py - use pyproject.toml exclusively

This commit is contained in:
James R. Barlow
2022-09-20 23:47:40 -07:00
parent f37decf3b3
commit 16fc52079d
4 changed files with 9 additions and 24 deletions
+1 -1
View File
@@ -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"]
+2 -3
View File
@@ -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:
+6 -10
View File
@@ -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
-10
View File
@@ -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()