Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use poetry for package management. #179

Merged
merged 2 commits into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, this won't actually upload the file, @valberg! It just configures it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@valberg, we're missing a publish step:

    - 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/wagtailmenus/upload 

(I'm curious to see if building it with poetry will work. Perhaps using poetry publish instead could work too?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#195 fixed this FWIW

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.

40 changes: 21 additions & 19 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
[tox]
envlist =
py{37,38,39,310}-django{32}-backend{Basic,Allauth}
py{38,39,310}-django{40}-backend{Basic,Allauth}
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

[testenv:flake8]
description = Static code analysis and code style checker
skip_install = True
deps=flake8
commands=flake8 invitations --exclude=migrations
coverage
pytest
pytest-django
pytest-cov
freezegun
whitelist_externals=
pytest
coverage