Skip to content

Commit

Permalink
Use poetry for package management.
Browse files Browse the repository at this point in the history
  • Loading branch information
valberg committed Apr 4, 2022
1 parent ab92147 commit 25fb378
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 69 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}


- name: Get pip cache dir
id: pip-cache
run: |
Expand All @@ -38,7 +37,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions
python -m pip install pytest coverage
python -m pip install tox tox-gh-actions
- name: Tox tests
run: tox -v
Expand Down
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/bee-keeper>"]
license = "GPL-3.0-only"
maintainers = ["JazzBand <https://github.com/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"
8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

33 changes: 0 additions & 33 deletions setup.py

This file was deleted.

35 changes: 22 additions & 13 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,38 +1,47 @@
[tox]
envlist =
py{37,38,39,310}-django{32}-backend{Basic,Allauth}
py{38,39,310}-django{40}-backend{Basic,Allauth}
flake8
skipsdist = True
usedevelop = True

[gh-actions]
python =
3.7: py37
3.8: py38, flake8
3.9: py39
3.10: py310

[gh-actions:env]
[gh-actions:testenv]
DJANGO =
3.2: django32
4.0: django40

[tox]
envlist =
py{37,38,39,310}-django{32}-backend{Basic,Allauth}
py{38,39,310}-django{40}-backend{Basic,Allauth}
flake8

[pytest]
python_files = tests.py test_*.py

[testenv]
description = Unit tests
setenv =
PYTHONWARNINGS = all
commands =
python -V
backendBasic: pytest --cov-report term --cov=invitations --ignore=tests/allauth/ --ds=test_settings tests
backendAllauth: pytest --cov-report term --cov=invitations --ignore=tests/basic/ --ds=test_allauth_settings tests
coverage report
deps =
-r requirements.txt
django32: Django>=3.2,<3.3
django40: Django>=4.0,<4.1
backendAllauth: django-allauth
commands =
python -V
backendBasic: py.test --cov-report term --cov=invitations --ignore=tests/allauth/ --ds=test_settings tests
backendAllauth: py.test --cov-report term --cov=invitations --ignore=tests/basic/ --ds=test_allauth_settings tests
coverage report
coverage
pytest
pytest-django
pytest-cov
freezegun
whitelist_externals=
pytest
coverage

[testenv:flake8]
description = Static code analysis and code style checker
Expand Down

0 comments on commit 25fb378

Please sign in to comment.