diff --git a/pyproject.toml b/pyproject.toml index ecf20b1e..94e66ff0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools>=61.0" + "setuptools>=68.0" ] build-backend = "setuptools.build_meta" @@ -14,7 +14,7 @@ maintainers = [ {name = "E. McConville", email = "emcconville@emcconville.com"}, ] description = "Ctypes-based simple MagickWand API binding for Python" -readme = "README.rst" +readme = { file = "README.rst", content-type = "text/x-rst" } requires-python = ">=3.7" keywords = ["ImageMagick", "ctypes"] license = {text = "MIT License"} @@ -31,7 +31,7 @@ classifiers = [ "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: Python :: Implementation :: Stackless", - "Topic :: Multimedia :: Graphics" + "Topic :: Multimedia :: Graphics", ] dynamic = ["version"] @@ -46,5 +46,12 @@ Repository = "https://github.com/emcconville/wand" Tracker = "https://github.com/emcconville/wand/issues" Changelog = "https://docs.wand-py.org/en/latest/changes.html" +[tools.setuptools] +packages = ["wand", "wand.cdefs"] + +[tool.setuptools.packages.find] +include = ["wand", "wand.cdefs"] +exclude = ["prof", "temp", "sample", "support"] + [tool.setuptools.dynamic] -version = {attr = "wand.version.VERSION"} \ No newline at end of file +version = { attr = "wand.VERSION" } diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index f7bd83dc..00000000 --- a/setup.cfg +++ /dev/null @@ -1,53 +0,0 @@ -[metadata] -author = Hong Minhee -author_email = hongminhee@member.fsf.org -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: Implementation :: PyPy - Programming Language :: Python :: Implementation :: Stackless - Topic :: Multimedia :: Graphics - Topic :: Multimedia :: Graphics :: Graphics Conversion -description = Ctypes-based simple MagickWand API binding for Python -keywords = ImageMagick, ctypes -license = MIT -license_files = LICENSE -long_description = file: README.rst -long_description_content_type = text/x-rst; charset=UTF-8 -maintainer = E. McConville -maintainer_email = "E. McConville" -name = Wand -platforms = unix, linux, osx, win32 -project_urls = - Documentation = https://docs.wand-py.org - Changelog=https://docs.wand-py.org/en/latest/changelog.html - Source = https://github.com/emcconville/wand - Tracker = https://github.com/emcconville/wand/issues -url = https://docs.wand-py.org/en/latest/ -version = attr: wand.version.VERSION - -[options] -packages = find: -python_requires = >=3.7 - -[options.packages.find] -include = - wand - wand.cdefs -exclude = - docs* - tests* - support* - -[options.extras_require] -test = ptest>=7.2.0 -doc = Sphinx>=5.3.0 \ No newline at end of file diff --git a/setup.py b/setup.py index d88e309b..b582bd38 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,9 @@ import os import os.path -try: - from setuptools import setup -except ImportError: - from distutils.core import setup +import sys +from setuptools import setup, find_packages + +sys.path.insert(0, '.') from wand.version import VERSION @@ -31,6 +31,18 @@ def run_tests(self): raise SystemExit(errno) cmdclass = {'test': pytest} +wand_includes = [ + "wand", + "wand.cdefs" +] + +wand_excludes = [ + "prof", # CI Memory profile. + "temp", # CI artifacts. + "sample", # Old documents. + "support", # Non-public issues. +] + test_requires = [ 'pytest >= 7.2.0', ] @@ -41,7 +53,10 @@ def run_tests(self): setup( name='Wand', - packages=['wand', 'wand.cdefs'], + packages=find_packages( + include=wand_includes, + exclude=wand_excludes, + ), version=VERSION, description='Ctypes-based simple MagickWand API binding for Python', long_description=readme(), diff --git a/wand/__init__.py b/wand/__init__.py index ef794bde..3de4da1a 100644 --- a/wand/__init__.py +++ b/wand/__init__.py @@ -4,3 +4,4 @@ .. _MagickWand API: http://www.imagemagick.org/script/magick-wand.php """ +from .version import VERSION \ No newline at end of file