From 1c64793fcc22654032ef9af32e8628288c1499e3 Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Wed, 3 Jul 2024 11:02:26 +0200 Subject: [PATCH] Migrate to pyproject.toml --- Makefile | 3 +-- pyproject.toml | 55 ++++++++++++++++++++++++++++++++++++++++++++ requirements-dev.txt | 5 ---- requirements.txt | 1 - setup.py | 37 ----------------------------- 5 files changed, 56 insertions(+), 45 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements-dev.txt delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/Makefile b/Makefile index 77c178f..1051a90 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,7 @@ htmlcov: pytest --cov=pdf417gen --cov-report=html dist: - python setup.py sdist - python setup.py bdist_wheel + python -m build clean: rm -rf build dist *.egg-info MANIFEST htmlcov diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..16f2bb4 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,55 @@ +[build-system] +requires = ["setuptools>=64", "setuptools_scm>=8"] +build-backend = "setuptools.build_meta" + +[project] +name = "pdf417gen" +authors = [{ name="Ivan Habunek", email="ivan@habunek.com" }] +description = "PDF417 2D barcode generator for Python" +keywords=["pdf417", "2d", "barcode", "generator"] +readme = "README.rst" +license = { file="LICENSE" } +requires-python = ">=3.6" +dynamic = ["version"] + +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Environment :: Console", +] + +dependencies = [ + "Pillow>=3.3.0" +] + +[tool.setuptools] +packages = [ + "pdf417gen", + "pdf417gen.compaction" +] + +[tool.setuptools_scm] + +[project.optional-dependencies] +dev = [ + "build", + "mock", + "pytest", + "pytest-cov", + "twine", + "vermin", +] + +[project.urls] +"Homepage" = "https://github.com/ihabunek/pdf417-py/" + +[project.scripts] +pdf417gen = "pdf417gen.console:main" + +[tool.pyright] +include = ["pdf417gen"] +typeCheckingMode = "strict" + +[tool.ruff] +line-length = 100 diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 5559dbb..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,5 +0,0 @@ -pytest-cov -pytest -twine -wheel -mock diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 079af0f..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -Pillow>=3.3.0 diff --git a/setup.py b/setup.py deleted file mode 100644 index 9dcb594..0000000 --- a/setup.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python - -from setuptools import setup - -with open("README.rst") as readme: - long_description = readme.read() - -setup( - name='pdf417gen', - version='0.7.1', - description='PDF417 2D barcode generator for Python', - long_description=long_description, - author='Ivan Habunek', - author_email='ivan.habunek@gmail.com', - url='https://github.com/ihabunek/pdf417-py/', - keywords='pdf417 2d barcode generator', - license='MIT', - classifiers=[ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3', - ], - packages=[ - 'pdf417gen', - 'pdf417gen.compaction' - ], - python_requires=">=3.6", - install_requires=[ - 'Pillow>=3.3.0', - ], - entry_points={ - 'console_scripts': [ - 'pdf417gen=pdf417gen.console:main', - ], - } -)