From 88d2949e6b94683963c3b58398be34e6b3172fef Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Thu, 4 Aug 2022 05:00:46 -0700 Subject: [PATCH] Abolish setup.cfg and migrate to pyproject.toml --- pyproject.toml | 86 +++++++++++++++++++++++++++++- setup.cfg | 115 ---------------------------------------- src/ocrmypdf/RELEASE.md | 4 +- 3 files changed, 87 insertions(+), 118 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index f6e07f29..afaa60b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,97 @@ [build-system] requires = [ - "setuptools >= 52", + "setuptools >= 61", "setuptools_scm[toml] >= 7.0.5", "wheel" ] build-backend = "setuptools.build_meta" +[project] +name = "ocrmypdf" +dynamic = ["version"] +description = "OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched" +readme = "README.md" +license = {text = "MPL-2.0"} +requires-python = ">=3.8" +dependencies = [ + "Pillow>=8.2.0", + "coloredlogs>=14.0", + "deprecation>=2.1.0", + "img2pdf>=0.3.0", # pure Python + "packaging>=20", + "pdfminer.six!=20200720,>=20191110", + "pikepdf!=5.0.0,>=4.0.0", + "pluggy>=0.13.0", + "reportlab>=3.5.66", + "tqdm>=4", + "importlib-resources>=5;python_version<'3.9'", # until Python 3.9 + "typing-extensions>=4;python_version<'3.10'", +] +authors = [{name = "James R. Barlow", email="james@purplerock.ca"}] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: End Users/Desktop", + "Intended Audience :: Science/Research", + "Intended Audience :: System Administrators", + "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows :: Windows 10", + "Operating System :: POSIX", + "Operating System :: POSIX :: BSD", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Topic :: Scientific/Engineering :: Image Recognition", + "Topic :: Text Processing :: Indexing", + "Topic :: Text Processing :: Linguistic", +] +keywords = [ + "PDF", + "OCR", + "optical character recognition", + "PDF/A", + "scanning", +] + +[project.urls] +Documentation = "https://ocrmypdf.readthedocs.io/" +Source = "https://github.com/ocrmypdf/OCRmyPDF" +Tracker = "https://github.com/ocrmypdf/OCRmyPDF/issues" + +[project.optional-dependencies] +docs = ["sphinx", "sphinx-issues", "sphinx-rtd-theme"] +extended_test = ["PyMuPDF==1.19.1"] +test = [ + "coverage[toml]>=5", + "pytest>=6.0.0", + "pytest-cov>=2.11.1", + "pytest-xdist>=2.2.0", + "python-xmp-toolkit==2.0.1", # also requires apt-get install libexempi3 + "types-Pillow", + "types-humanfriendly", +] +watcher = ["watchdog>=1.0.2"] +webservice = ["Flask>=1"] + +[project.scripts] +ocrmypdf = "ocrmypdf.__main__:run" + +[tool.setuptools.package-data] +ocrmypdf = ["data/sRGB.icc", "py.typed"] + +[tool.setuptools.packages.find] +where = ["src"] +namespaces = false + [tool.setuptools_scm] +[tool.distutils.bdist_wheel] +python-tag = "py38" + [tool.black] line-length = 88 target-version = ["py38", "py39", "py310", "py311"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 933c767f..00000000 --- a/setup.cfg +++ /dev/null @@ -1,115 +0,0 @@ -[metadata] -name = ocrmypdf -description = OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/ocrmypdf/OCRmyPDF -author = James R. Barlow -author_email = james@purplerock.ca -license = MPL-2.0 -license_file = LICENSE -license_files = - LICENSE -classifiers = - Development Status :: 5 - Production/Stable - Environment :: Console - Intended Audience :: End Users/Desktop - Intended Audience :: Science/Research - Intended Audience :: System Administrators - License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0) - Operating System :: MacOS :: MacOS X - Operating System :: Microsoft :: Windows :: Windows 10 - Operating System :: POSIX - Operating System :: POSIX :: BSD - Operating System :: POSIX :: Linux - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Topic :: Scientific/Engineering :: Image Recognition - Topic :: Text Processing :: Indexing - Topic :: Text Processing :: Linguistic -keywords = - PDF - OCR - optical character recognition - PDF/A - scanning -project_urls = - Documentation = https://ocrmypdf.readthedocs.io/ - Source = https://github.com/ocrmypdf/OCRmyPDF - Tracker = https://github.com/ocrmypdf/OCRmyPDF/issues - -[options] -packages = find: -install_requires = - Pillow>=8.2.0 - coloredlogs>=14.0 - deprecation>=2.1.0 - img2pdf>=0.3.0 # pure Python - packaging>=20 - pdfminer.six!=20200720,>=20191110 - pikepdf!=5.0.0,>=4.0.0 - pluggy>=0.13.0 - reportlab>=3.5.66 - tqdm>=4 - importlib-resources>=5;python_version<'3.9' # until Python 3.9 - typing-extensions>=4;python_version<'3.10' -python_requires = >=3.8 -include_package_data = True -package_dir = - =src -platforms = any -setup_requires = - setuptools-scm - setuptools-scm-git-archive -zip_safe = False - -[options.packages.find] -where = src - -[options.entry_points] -console_scripts = - ocrmypdf = ocrmypdf.__main__:run - -[options.extras_require] -docs = - sphinx - sphinx-issues - sphinx-rtd-theme -extended_test = - PyMuPDF==1.19.1 -test = - coverage[toml]>=5 - pytest>=6.0.0 - pytest-cov>=2.11.1 - pytest-xdist>=2.2.0 - python-xmp-toolkit==2.0.1 # also requires apt-get install libexempi3 - types-Pillow - types-humanfriendly -watcher = - watchdog>=1.0.2 -webservice = - Flask>=1 - -[options.package_data] -ocrmypdf = - data/sRGB.icc - py.typed - -[bdist_wheel] -python-tag = py38 - -[aliases] -test = pytest - -[check-manifest] -ignore = - .github - -[flake8] -ignore = D203,F401,W503,E501,E203,F841 -exclude = .git,__pycache__,docs/conf.py,build,dist,.venv,.venvpp,.eggs,tmp,src/ocrmypdf/lib/ -max-complexity = 10 -max-line-length = 100 diff --git a/src/ocrmypdf/RELEASE.md b/src/ocrmypdf/RELEASE.md index 2cb89b78..744cddd6 100644 --- a/src/ocrmypdf/RELEASE.md +++ b/src/ocrmypdf/RELEASE.md @@ -14,11 +14,11 @@ - Check README.md -- Check setup.py +- Check pyproject.toml - Are classifiers up to date? - Is `python_requires` correct? - - Python 3.6 is EOL on December 2021-12. Could drop support then. + - Is it to drop support for older Pythons? - Can we tighten any `install_requires` dependencies? - Search for old version shims we can remove