From 4ca9ae5e50f03df8f3834c76ea3e3ab64ae7bfcb Mon Sep 17 00:00:00 2001 From: David Smith <39445562+smithdc1@users.noreply.github.com> Date: Fri, 23 Dec 2022 17:25:13 +0000 Subject: [PATCH] Use Build to build package (#1) * Removed setup.cfg by moving settings to pyproject.toml and tox.ini * Removed setup.py and build package with "build". * Updated MANIFEST.in Used check-manifest to identify issues, and to fix. --- .github/workflows/publish.yml | 4 +-- MANIFEST.in | 8 ++++-- crispy_bootstrap3/__init__.py | 1 + pyproject.toml | 48 +++++++++++++++++++++++++++++++ setup.cfg | 8 ------ setup.py | 53 ----------------------------------- tox.ini | 3 ++ 7 files changed, 60 insertions(+), 65 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2aa3b0a..24b700d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -57,11 +57,11 @@ jobs: python-version: "3.10" - name: Install dependencies run: | - pip install setuptools wheel twine + pip install build twine - name: Publish env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | - python setup.py sdist bdist_wheel + python -m build twine upload dist/* diff --git a/MANIFEST.in b/MANIFEST.in index 74d651b..bf7e605 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,8 @@ include LICENSE include MANIFEST.in -include README.md -recursive-include crispy_bootstrap3/templates * \ No newline at end of file +recursive-include crispy_bootstrap3/templates * +include *.md +include tox.ini +recursive-include requirements *.txt +recursive-include tests *.html +recursive-include tests *.py diff --git a/crispy_bootstrap3/__init__.py b/crispy_bootstrap3/__init__.py index e69de29..f928bd9 100644 --- a/crispy_bootstrap3/__init__.py +++ b/crispy_bootstrap3/__init__.py @@ -0,0 +1 @@ +__version__ = "2022.1" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7742da9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,48 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "crispy-bootstrap3" +description = "Bootstrap3 template pack for django-crispy-forms" +authors = [ { name = "David Smith" } ] +license = {text = "MIT"} +requires-python = ">=3.7" +readme = "README.md" +dependencies = [ + "django-crispy-forms>=1.14.0", + "django>=3.2", +] +classifiers=[ + "Environment :: Web Environment", + "Framework :: Django", + "Framework :: Django :: 3.2", + "Framework :: Django :: 4.0", + "Framework :: Django :: 4.1", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Internet :: WWW/HTTP :: Dynamic Content", + "Topic :: Software Development :: Libraries :: Python Modules", +] +dynamic = ['version'] + +[project.urls] +"Homepage" = "https://github.com/django-crispy-forms/crispy-bootstrap3" +"Issues" = "https://github.com/django-crispy-forms/crispy-bootstrap3/issues" +"CI" = "https://github.com/django-crispy-forms/crispy-bootstrap3/actions" +"Changelog" = "https://github.com/django-crispy-forms/crispy-bootstrap3/releases" + +[tool.setuptools.dynamic] +version = {attr = "crispy_bootstrap3.__version__"} + +[tool.isort] +profile = "black" + +[tool.pytest.ini_options] +DJANGO_SETTINGS_MODULE = "tests.test_settings" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index cc0416b..0000000 --- a/setup.cfg +++ /dev/null @@ -1,8 +0,0 @@ -[tool:pytest] -DJANGO_SETTINGS_MODULE= tests.test_settings - -[flake8] -max-line-length = 88 - -[isort] -profile = black diff --git a/setup.py b/setup.py deleted file mode 100644 index a79a694..0000000 --- a/setup.py +++ /dev/null @@ -1,53 +0,0 @@ -import os - -from setuptools import setup - -VERSION = "2022.1" - - -def get_long_description(): - with open( - os.path.join(os.path.dirname(os.path.abspath(__file__)), "README.md"), - encoding="utf8", - ) as fp: - return fp.read() - - -setup( - name="crispy-bootstrap3", - description="Bootstrap3 template pack for django-crispy-forms", - long_description=get_long_description(), - long_description_content_type="text/markdown", - author="David Smith", - url="https://github.com/django-crispy-forms/crispy-bootstrap3", - project_urls={ - "Issues": "https://github.com/django-crispy-forms/crispy-bootstrap3/issues", - "CI": "https://github.com/django-crispy-forms/crispy-bootstrap3/actions", - "Changelog": ( - "https://github.com/django-crispy-forms/crispy-bootstrap3/releases" - ), - }, - license="MIT", - version=VERSION, - packages=["crispy_bootstrap3"], - install_requires=["django-crispy-forms>=1.14.0", "django>=3.2"], - python_requires=">=3.7", - include_package_data=True, - classifiers=[ - "Environment :: Web Environment", - "Framework :: Django", - "Framework :: Django :: 3.2", - "Framework :: Django :: 4.0", - "Framework :: Django :: 4.1", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Topic :: Internet :: WWW/HTTP", - "Topic :: Internet :: WWW/HTTP :: Dynamic Content", - "Topic :: Software Development :: Libraries :: Python Modules", - ], -) diff --git a/tox.ini b/tox.ini index 5959fce..acb7fec 100644 --- a/tox.ini +++ b/tox.ini @@ -25,3 +25,6 @@ commands = flake8 . deps = -rrequirements/lint.txt + +[flake8] +max-line-length = 88