diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ab14533 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: Tests and PyPI publishing + +on: + push: + branches: + - main + tags: + - '*' + pull_request: + workflow_dispatch: + +jobs: + tests: + name: Run tests Python ${{ matrix.python }}, Django ${{ matrix.django }}) + runs-on: ubuntu-latest + strategy: + matrix: + python: ['3.8', '3.9', '3.10', '3.11'] + django: ['3.2', '4.1', '4.2'] + exclude: + - python: '3.11' + django: '3.2' + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + + - name: Install dependencies + run: pip install tox tox-gh-actions + + - name: Run tests + run: tox + env: + PYTHON_VERSION: ${{ matrix.python }} + DJANGO: ${{ matrix.django }} + + - name: Publish coverage report + uses: codecov/codecov-action@v3 + + publish: + name: Publish package to PyPI + runs-on: ubuntu-latest + needs: + - tests + + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Build sdist and wheel + run: | + pip install pip setuptools wheel --upgrade + python setup.py sdist bdist_wheel + + - name: Publish a Python distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml new file mode 100644 index 0000000..f8aa87e --- /dev/null +++ b/.github/workflows/code-quality.yml @@ -0,0 +1,34 @@ +name: Linting and code quality + +on: + push: + branches: + - main + tags: + paths: + - '**.py' + - .github/workflows/code_quality.yml + pull_request: + paths: + - '**.py' + - .github/workflows/code_quality.yml + workflow_dispatch: + +jobs: + linting: + name: Code-quality checks + runs-on: ubuntu-latest + strategy: + matrix: + toxenv: + - isort + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install dependencies + run: pip install tox + - run: tox + env: + TOXENV: ${{ matrix.toxenv }} \ No newline at end of file diff --git a/django_regex_redirects.egg-info/PKG-INFO b/django_regex_redirects.egg-info/PKG-INFO new file mode 100644 index 0000000..bf75e98 --- /dev/null +++ b/django_regex_redirects.egg-info/PKG-INFO @@ -0,0 +1,9 @@ +Metadata-Version: 2.1 +Name: django-regex-redirects +Version: 0.4.0 +Summary: Django redirects, with regular expressions +Home-page: https://github.com/maykinmedia/django-regex-redirects +Author: Alex de Landgraaf +Author-email: alex@maykinmedia.nl +License: BSD licence, see LICENCE.txt +License-File: LICENSE diff --git a/django_regex_redirects.egg-info/SOURCES.txt b/django_regex_redirects.egg-info/SOURCES.txt new file mode 100644 index 0000000..964adfc --- /dev/null +++ b/django_regex_redirects.egg-info/SOURCES.txt @@ -0,0 +1,19 @@ +LICENSE +README.md +setup.py +django_regex_redirects.egg-info/PKG-INFO +django_regex_redirects.egg-info/SOURCES.txt +django_regex_redirects.egg-info/dependency_links.txt +django_regex_redirects.egg-info/top_level.txt +regex_redirects/__init__.py +regex_redirects/actions.py +regex_redirects/admin.py +regex_redirects/apps.py +regex_redirects/middleware.py +regex_redirects/models.py +regex_redirects/tests.py +regex_redirects/migrations/0001_initial.py +regex_redirects/migrations/0002_auto_20151217_1938.py +regex_redirects/migrations/0004_auto_20170512_1349.py +regex_redirects/migrations/0005_auto_20210425_1321.py +regex_redirects/migrations/__init__.py \ No newline at end of file diff --git a/django_regex_redirects.egg-info/dependency_links.txt b/django_regex_redirects.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/django_regex_redirects.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/django_regex_redirects.egg-info/top_level.txt b/django_regex_redirects.egg-info/top_level.txt new file mode 100644 index 0000000..69193c5 --- /dev/null +++ b/django_regex_redirects.egg-info/top_level.txt @@ -0,0 +1 @@ +regex_redirects diff --git a/regex_redirects/models.py b/regex_redirects/models.py index 5a836a3..2971493 100644 --- a/regex_redirects/models.py +++ b/regex_redirects/models.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class Redirect(models.Model): diff --git a/tox.ini b/tox.ini index 4e77f80..bd3b59c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,26 @@ [tox] -envlist = - {py39}-django-2.2 - {py39}-django-3.2 +envlist = + py{38,39,310}-django{32,41,42} + py311-django{41,42} + isort skip_missing_interpreters = true +[gh-actions] +python = + 3.8: py38 + 3.9: py39 + 3.10: py310 + 3.11: py311 + +[gh-actions:env] +DJANGO = + 3.2: django32 + 4.1: django41 + 4.2: django42 + [testenv] deps= - django-2.2: Django>=2.0,<2.3 - django-3.2: Django>=3.0,<3.3 + django32: Django~=3.2.0 + django41: Django~=4.1.0 + django42: Django~=4.2.0 master: https://github.com/django/django/archive/master.tar.gz - coverage - coveralls -commands=coverage run --rcfile={toxinidir}/.coveragerc manage.py test