From 9077cba71af4b98a5d31c940e35d11dd1d96de76 Mon Sep 17 00:00:00 2001 From: Ben Konrath Date: Sat, 4 Oct 2025 21:09:43 +0200 Subject: [PATCH 1/2] Port setup.py to pyproject.toml --- easy_thumbnails/__init__.py | 3 ++ pyproject.toml | 58 ++++++++++++++++++++++++++++++++ setup.cfg | 2 -- setup.py | 66 ------------------------------------- 4 files changed, 61 insertions(+), 68 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/easy_thumbnails/__init__.py b/easy_thumbnails/__init__.py index b46490dc..2d105868 100644 --- a/easy_thumbnails/__init__.py +++ b/easy_thumbnails/__init__.py @@ -6,3 +6,6 @@ def get_version(*args, **kwargs): # Only import if it's actually called. from .version_utils import get_version return get_version(*args, **kwargs) + + +__version__ = get_version() diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..d5d8da78 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,58 @@ +[build-system] +requires = ["setuptools>=77.0.3"] +build-backend = "setuptools.build_meta" + +[project] +name = "easy-thumbnails" +dynamic = ["version"] +description = "Easy thumbnails for Django" +readme = "README.rst" +authors = [ + {name="Chris Beaven", email="smileychris@gmail.com"}, +] +license = "BSD-3-Clause" +license-files = ["LICENSE"] +requires-python = ">=3.9" +dependencies = [ + "django>=4.2", + "pillow", +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Web Environment", + "Framework :: Django", + "Framework :: Django :: 4.2", + "Framework :: Django :: 5.1", + "Framework :: Django :: 5.2", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Topic :: Software Development :: Libraries :: Application Frameworks", + "Topic :: Software Development :: Libraries :: Python Modules", +] + +[project.optional-dependencies] +svg = [ + "svglib", + "reportlab", +] + +[project.urls] +Homepage = "http://github.com/SmileyChris/easy-thumbnails" + +[tool.setuptools] +packages = ["easy_thumbnails"] +include-package-data = true +zip-safe = false + +[tool.setuptools.dynamic] +version = {attr="easy_thumbnails.__version__"} + +[tool.pytest.ini_options] +DJANGO_SETTINGS_MODULE = "easy_thumbnails.tests.settings" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index b647c37a..00000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[tool:pytest] -DJANGO_SETTINGS_MODULE = easy_thumbnails.tests.settings diff --git a/setup.py b/setup.py deleted file mode 100644 index 17ca62fc..00000000 --- a/setup.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python -import codecs - -from setuptools import find_packages, setup - -import easy_thumbnails - - -def read_files(*filenames): - """ - Output the contents of one or more files to a single concatenated string. - """ - output = [] - for filename in filenames: - f = codecs.open(filename, encoding="utf-8") - try: - output.append(f.read()) - finally: - f.close() - return "\n\n".join(output) - - -setup( - name="easy-thumbnails", - version=easy_thumbnails.get_version(), - url="http://github.com/SmileyChris/easy-thumbnails", - description="Easy thumbnails for Django", - long_description=read_files("README.rst", "CHANGES.rst"), - author="Chris Beaven", - author_email="smileychris@gmail.com", - platforms=["any"], - packages=find_packages(), - include_package_data=True, - install_requires=[ - "django>=4.2", - "pillow", - ], - extras_require={ - "svg": [ - "svglib", - "reportlab", - ], - }, - python_requires=">=3.9", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Environment :: Web Environment", - "Framework :: Django", - "Framework :: Django :: 4.2", - "Framework :: Django :: 5.1", - "Framework :: Django :: 5.2", - "Intended Audience :: Developers", - "License :: OSI Approved :: BSD License", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Topic :: Software Development :: Libraries :: Application Frameworks", - "Topic :: Software Development :: Libraries :: Python Modules", - ], - zip_safe=False, -) From 79ae72c62ffffd47b568e7530036aa8adb3cb9fc Mon Sep 17 00:00:00 2001 From: Ben Konrath Date: Sun, 5 Oct 2025 13:12:54 +0200 Subject: [PATCH 2/2] Include all dirs in easy-thumbnail package --- pyproject.toml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d5d8da78..874852ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=77.0.3"] +requires = ["setuptools>=80"] build-backend = "setuptools.build_meta" [project] @@ -51,6 +51,16 @@ packages = ["easy_thumbnails"] include-package-data = true zip-safe = false +[tool.setuptools.package-data] +easy_thumbnails = [ + "management/**/*", + "mirgrations/**/*", + "optimize/**/*", + "templatetags/**/*", + "tests/**/*", + "VIL/**/*", +] + [tool.setuptools.dynamic] version = {attr="easy_thumbnails.__version__"}