From 62eb21027fb70a591c7d8ed0562385a47cc8e5a8 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Fri, 8 Nov 2024 08:46:31 +0100 Subject: [PATCH] Move to pyproject.toml --- pyproject.toml | 92 +++++++++++++++++++++++++++++++++++++ setup.cfg | 29 ------------ setup.py | 56 +--------------------- tests/requirements/base.txt | 1 + tox.ini | 6 ++- 5 files changed, 99 insertions(+), 85 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..cabb7b24 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,92 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "djangocms-link" +dynamic = ["version"] +description = "Adds a link plugin to django CMS" +readme = "README.rst" +license = "BSD-3-Clause" +authors = [ + { name = "Divio AG", email = "info@divio.ch" }, +] +maintainers = [ + { name = "Django CMS Association and contributors", email = "info@django-cms.org" }, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Web Environment", + "Framework :: Django", + "Framework :: Django :: 4.2", + "Framework :: Django :: 5.0", + "Framework :: Django :: 5.1", + "Framework :: Django CMS", + "Framework :: Django CMS :: 3.11", + "Framework :: Django CMS :: 4.0", + "Framework :: Django CMS :: 4.1", + "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", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Internet :: WWW/HTTP :: Dynamic Content", + "Topic :: Software Development", + "Topic :: Software Development :: Libraries", +] +dependencies = [ + "django-cms>=3.7,!=4.1.0,!=4.1.1,!=4.1.2", + "djangocms-attributes-field>=1", +] + +[project.urls] +Homepage = "https://github.com/django-cms/djangocms-link" + +[tool.hatch.version] +path = "djangocms_link/__init__.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/djangocms_link", +] + +[tool.flake8] +max-line-length = 119 +exclude = [ + "*.egg-info", + ".eggs", + ".env", + ".git", + ".settings", + ".tox", + ".venv", + "build", + "data", + "dist", + "docs", + "*migrations*", + "requirements", + "tmp" +] + +[tool.isort] +line_length = 119 +skip = [ + "manage.py", "*migrations*", ".tox", ".eggs", ".env", ".venv", "data" +] +include_trailing_comma = true +multi_line_output = 5 +lines_after_imports = 2 +default_section = "THIRDPARTY" +sections = [ + "FUTURE", "STDLIB", "DJANGO", "CMS", + "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER" +] +known_first_party = "djangocms_link" +known_cms = ["cms", "menus"] +known_django = "django" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 6b26cc22..00000000 --- a/setup.cfg +++ /dev/null @@ -1,29 +0,0 @@ -[flake8] -max-line-length = 119 -exclude = - *.egg-info, - .eggs, - .env, - .git, - .settings, - .tox, - .venv, - build, - data, - dist, - docs, - *migrations*, - requirements, - tmp - -[isort] -line_length = 119 -skip = manage.py, *migrations*, .tox, .eggs, .env, .venv, data -include_trailing_comma = true -multi_line_output = 5 -lines_after_imports = 2 -default_section = THIRDPARTY -sections = FUTURE, STDLIB, DJANGO, CMS, THIRDPARTY, FIRSTPARTY, LOCALFOLDER -known_first_party = djangocms_link -known_cms = cms, menus -known_django = django diff --git a/setup.py b/setup.py index ca9a3e6c..25980616 100644 --- a/setup.py +++ b/setup.py @@ -1,57 +1,5 @@ #!/usr/bin/env python -from setuptools import find_packages, setup +from setuptools import setup -from djangocms_link import __version__ - -REQUIREMENTS = [ - 'django-cms>=3.7,!=4.1.0,!=4.1.1,!=4.1.2', - 'djangocms-attributes-field>=1', -] - - -CLASSIFIERS = [ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Web Environment', - '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', - 'Framework :: Django', - 'Framework :: Django :: 4.2', - 'Framework :: Django :: 5.0', - 'Framework :: Django :: 5.1', - 'Framework :: Django CMS', - 'Framework :: Django CMS :: 3.11', - 'Framework :: Django CMS :: 4.0', - 'Framework :: Django CMS :: 4.1', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', - 'Topic :: Software Development', - 'Topic :: Software Development :: Libraries', -] - - -setup( - name='djangocms-link', - version=__version__, - author='Divio AG', - author_email='info@divio.ch', - maintainer='Django CMS Association and contributors', - maintainer_email='info@django-cms.org', - url='https://github.com/django-cms/djangocms-link', - license='BSD-3-Clause', - description='Adds a link plugin to django CMS', - long_description=open('README.rst').read(), - packages=find_packages(), - include_package_data=True, - zip_safe=False, - install_requires=REQUIREMENTS, - classifiers=CLASSIFIERS, - test_suite='tests.settings.run', -) +setup() diff --git a/tests/requirements/base.txt b/tests/requirements/base.txt index 5d4e21ba..44d1718f 100644 --- a/tests/requirements/base.txt +++ b/tests/requirements/base.txt @@ -4,6 +4,7 @@ tox coverage isort flake8 +flake8-pyproject pyflakes>=2.1 django-test-migrations pytest diff --git a/tox.ini b/tox.ini index 03ccdc3e..53e4833b 100644 --- a/tox.ini +++ b/tox.ini @@ -18,11 +18,13 @@ deps = commands = {envpython} --version {env:COMMAND:coverage} erase - {env:COMMAND:coverage} run {toxinidir}/tests/settings.py + {env:COMMAND:coverage} run -m pytest {env:COMMAND:coverage} report [testenv:flake8] -deps = flake8 +deps = + flake8 + flake8-pyproject commands = flake8 [testenv:isort]