Skip to content

Commit

Permalink
Merge pull request #21 from maykinmedia/pyproject
Browse files Browse the repository at this point in the history
Switch to `pyproject.toml`, add support for Python 3.12
  • Loading branch information
alextreme authored Mar 10, 2024
2 parents 121eda2 + ba89d4a commit 6fba262
Show file tree
Hide file tree
Showing 26 changed files with 549 additions and 341 deletions.
11 changes: 0 additions & 11 deletions .coveragerc

This file was deleted.

4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length=88
exclude=env,.tox,doc
ignore=E203,W503,E501
29 changes: 14 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.8', '3.9', '3.10', '3.11']
django: ['3.2', '4.1', '4.2']
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
django: ["3.2", "4.2"]
exclude:
- python: '3.11'
django: '3.2'
- python: "3.11"
django: "3.2"
- python: "3.12"
django: "3.2"

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand All @@ -48,18 +50,15 @@ jobs:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: "3.10"

- name: Build sdist and wheel
- name: Build wheel
run: |
pip install pip setuptools wheel --upgrade
python setup.py sdist bdist_wheel
pip install build --upgrade
python -m build
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
10 changes: 6 additions & 4 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ jobs:
matrix:
toxenv:
- isort
- black
- flake8
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: "3.10"
- name: Install dependencies
run: pip install tox
- run: tox
env:
TOXENV: ${{ matrix.toxenv }}
TOXENV: ${{ matrix.toxenv }}
108 changes: 104 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,106 @@
*.log
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
reports/

# Translations
# *.mo -> we want to package these along
*.pot
*.pyc

# Django stuff:
*.log
local_settings.py
.tox
.coverage
db.sqlite3
testapp/log_outgoing_requests.db

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
django-regex-redirects [![Build Status](https://travis-ci.org/maykinmedia/django-regex-redirects.svg?branch=master)](https://travis-ci.org/maykinmedia/django-regex-redirects)
django-regex-redirects
======================

Django redirects, with regular expressions. It is a modified version of django.contrib.redirects.
Expand All @@ -10,34 +10,30 @@ Features
* Configurable via the admin
* Redirects are exportable as .csv

https://pypi.python.org/pypi/django-regex-redirects
https://pypi.org/pypi/django-regex-redirects

Install
=======

```pip install django-regex-redirects``` or ```python setup.py install```
`pip install django-regex-redirects`

Add regex_redirects to your INSTALLED_APPS:
Add `regex_redirects` to your `INSTALLED_APPS`:

```
```python
INSTALLED_APPS = (
...
'regex_redirects',
"regex_redirects",
...
)
```

Add the middleware to your MIDDLEWARE:
Add the middleware to your `MIDDLEWARE`:

```
```python
MIDDLEWARE = [
'regex_redirects.middleware.RedirectFallbackMiddleware'
"regex_redirects.middleware.RedirectFallbackMiddleware"
...
]
```

Run manage.py migrate and you're good to go!




Run `manage.py migrate` and you're good to go!
9 changes: 0 additions & 9 deletions django_regex_redirects.egg-info/PKG-INFO

This file was deleted.

19 changes: 0 additions & 19 deletions django_regex_redirects.egg-info/SOURCES.txt

This file was deleted.

1 change: 0 additions & 1 deletion django_regex_redirects.egg-info/dependency_links.txt

This file was deleted.

1 change: 0 additions & 1 deletion django_regex_redirects.egg-info/top_level.txt

This file was deleted.

4 changes: 2 additions & 2 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import os
import sys

if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'testsettings')
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testsettings")

from django.core.management import execute_from_command_line

Expand Down
Loading

0 comments on commit 6fba262

Please sign in to comment.