From 088338da022c4e6a3625c4471ec919095122080e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Mon, 4 Apr 2022 11:05:53 +0200 Subject: [PATCH] Use poetry for package management. --- .github/workflows/release.yml | 16 +++++------ MANIFEST.in | 4 --- pyproject.toml | 52 +++++++++++++++++++++++++++++++++++ setup.py | 33 ---------------------- 4 files changed, 59 insertions(+), 46 deletions(-) delete mode 100644 MANIFEST.in create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c52985f..9f9792b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,16 +23,14 @@ jobs: - name: Install dependencies run: | python -m pip install -U pip - python -m pip install -U setuptools twine wheel + python -m pip install -U poetry + - name: Build package run: | - python setup.py --version - python setup.py sdist --format=gztar bdist_wheel - twine check dist/* + poetry build + - name: Upload packages to Jazzband if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@master - with: - user: jazzband - password: ${{ secrets.JAZZBAND_RELEASE_KEY }} - repository_url: https://jazzband.co/projects/django-invitations/upload + run: | + poetry config repositories.jazzband https://jazzband.co/projects/django-invitations/upload + poetry config http-basic.jazzband jazzband ${{ secrets.JAZZBAND_RELEASE_KEY }} diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 5e73c45..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,4 +0,0 @@ -include LICENSE ChangeLog README.md requirements.txt manage.py tox.ini -recursive-include invitations/templates * -include test_*.py -recursive-include tests *.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e65ebdf --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,52 @@ +[tool.poetry] +name = "django-invitations" +version = "1.9.3" +description = "Generic invitations app with support for django-allauth" +authors = ["bee-keeper "] +license = "GPL-3.0-only" +maintainers = ["JazzBand "] +readme = "README.md" +keywords=['django', 'invitation', 'django-allauth', 'invite'] +classifiers=[ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Topic :: Software Development :: Libraries :: Python Modules", + "Environment :: Web Environment", + "Topic :: Internet", + "Framework :: Django", + "Framework :: Django:: 3.2", + "Framework :: Django:: 4.0", + "Programming Language :: Python", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: GPL-3.0-only", +] +packages = [ + { include= "invitations"}, + { include= "invitations/management/**/*.py"}, +] + +[tool.poetry.dependencies] +python = "^3.7" +django = ">=3.2,<4.1" + +[tool.poetry.dev-dependencies] +coverage = "^6.3.2" +flake8 = "^8.4.0" +freezegun = "^1.2.1" +pytest = "^7.1.1" +pytest-django = "^4.5.2" +pytest-cov = "^3.0.0" +tox = "3.14.0" +black = "^22.1.0" + +[tool.black] +line-length = 88 +target-version = ["py310"] +extend-exclude = "/migrations/" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" diff --git a/setup.py b/setup.py deleted file mode 100644 index b9cff5e..0000000 --- a/setup.py +++ /dev/null @@ -1,33 +0,0 @@ -from setuptools import find_packages -from setuptools import setup - -setup( - name="django-invitations", - packages=find_packages(), - package_data={"invitations": ["templates/*.*"]}, - include_package_data=True, - zip_safe=False, - version="1.9.3", - description="Generic invitations app with support for django-allauth", - author="https://github.com/bee-keeper", - author_email="none@none.com", - url="https://github.com/jazzband/django-invitations.git", - keywords=["django", "invitation", "django-allauth", "invite"], - license="GPL-3.0-only", - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "Topic :: Software Development :: Libraries :: Python Modules", - "Environment :: Web Environment", - "Topic :: Internet", - "Framework :: Django", - "Framework :: Django:: 3.2", - "Framework :: Django:: 4.0", - "Programming Language :: Python", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "License :: OSI Approved :: GPL-3.0-only", - ], -)