Skip to content

Commit

Permalink
Update Django and Python versions, switch to pyproject.toml
Browse files Browse the repository at this point in the history
Drop support for Python 3.8 and 3.9
Add support for Python 3.12
Drop support for Django 3.2 and 4.1
  • Loading branch information
Viicos committed Jul 24, 2024
1 parent f4953c8 commit adc1085
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 166 deletions.
10 changes: 0 additions & 10 deletions .bumpversion.cfg

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
38 changes: 19 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches:
- main
tags:
- "*"
- '*'
pull_request:
workflow_dispatch:

Expand All @@ -15,17 +15,14 @@ jobs:
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"
python: ['3.10', '3.11', '3.12']
django: ['4.2']

name: Run the test suite (Python ${{ matrix.python }}, Django ${{ matrix.django }})

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 @@ -39,27 +36,30 @@ jobs:
DJANGO: ${{ matrix.django }}

- name: Publish coverage report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

publish:
name: Publish package to PyPI
runs-on: ubuntu-latest
needs: tests
environment: release
permissions:
id-token: write

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.9"
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/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
uses: pypa/gh-action-pypi-publish@release/v1
12 changes: 6 additions & 6 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
branches:
- main
tags:
- "*"
- '*'
paths:
- "**.py"
- '**.py'
pull_request:
paths:
- "**.py"
- '**.py'
workflow_dispatch:

jobs:
Expand All @@ -22,10 +22,10 @@ jobs:
matrix:
toxenv: [isort, black, flake8, docs]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: '3.10'
- name: Install dependencies
run: pip install tox
- run: tox
Expand Down
119 changes: 119 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
[build-system]
requires = ["setuptools>=61.0.0"]
build-backend = "setuptools.build_meta"

[project]
name = "django-log-outgoing-requests"
version = "0.6.1"
description = "Log outgoing requests made by the requests python library"
authors = [
{name = "Maykin Media", email = "[email protected]"}
]
readme = "README.rst"
license = {file = "LICENSE"}
keywords = ["Django", "logging", "requests"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: Django",
"Framework :: Django :: 4.2",
"Intended Audience :: Developers",
"Operating System :: Unix",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
]
requires-python = ">=3.10"
dependencies = [
"django>=4.2",
"requests",
"django-appconf",
"django-solo",
]

[project.urls]
Homepage = "https://github.com/maykinmedia/django-log-outgoing-requests"
Documentation = "http://django-log-outgoing-requests.readthedocs.io/en/latest/"
"Bug Tracker" = "https://github.com/maykinmedia/django-log-outgoing-requests/issues"
"Source Code" = "https://github.com/maykinmedia/django-log-outgoing-requests"
Changelog = "https://github.com/maykinmedia/django-log-outgoing-requests/blob/main/CHANGELOG.rst"

[project.optional-dependencies]
celery = [
"celery",
]
tests = [
"pytest",
"pytest-django",
"pytest-mock",
"pyquery",
"tox",
"isort",
"black",
"flake8",
"freezegun",
"requests-mock",
]
coverage = [
"pytest-cov",
]
docs = [
"sphinx",
"sphinx-rtd-theme",
]
release = [
"bump-my-version",
]

[tool.setuptools.packages.find]
include = ["log_outgoing_requests*"]
namespaces = false

[tool.isort]
profile = "black"
combine_as_imports = true
known_django = "django"
known_first_party="log_outgoing_requests"
sections=["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
skip = ["env", ".tox", ".history"]

[tool.pytest.ini_options]
testpaths = ["tests"]
filterwarnings = [
"error:DateTimeField .* received a naive datetime:RuntimeWarning:django.db.models.fields",
]
DJANGO_SETTINGS_MODULE = "testapp.settings"

[tool.bumpversion]
current_version = "0.6.1"
files = [
{filename = "pyproject.toml"},
{filename = "README.rst"},
{filename = "log_outgoing_requests/locale/nl/LC_MESSAGES/django.po"},
{filename = "docs/conf.py"},
]

[tool.coverage.run]
branch = true
source = [
"log_outgoing_requests"
]
omit = [
"log_outgoing_requests/migrations/*",
]

[tool.coverage.report]
exclude_also = [
"if (typing\\.)?TYPE_CHECKING:",
"@(typing\\.)?overload",
"class .*\\(.*Protocol.*\\):",
"@(abc\\.)?abstractmethod",
"raise NotImplementedError",
"\\.\\.\\.",
"pass",
]
omit = [
"log_outgoing_requests/migrations/*",
]
116 changes: 0 additions & 116 deletions setup.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

Loading

0 comments on commit adc1085

Please sign in to comment.