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

Switch to pyproject.toml #41

Closed
wants to merge 2 commits into from
Closed
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
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
28 changes: 14 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ 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"]
Comment on lines +18 to +19
Copy link
Member

Choose a reason for hiding this comment

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

we can drop support for < py 3.10 and django < 4.2

exclude:
- python: "3.11"
django: "3.2"
- python: "3.12"
django: "3.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 @@ -49,17 +51,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.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
Copy link
Member

Choose a reason for hiding this comment

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

we need the release environment for this workflow and set up verified publishers on PyPI before this can be merged/used

6 changes: 3 additions & 3 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ django-log-outgoing-requests
:Version: 0.6.1
:Source: https://github.com/maykinmedia/django-log-outgoing-requests
:Keywords: logging, django, requests
:PythonVersion: 3.8+

|build-status| |code-quality| |black| |coverage| |docs|

Expand Down
2 changes: 1 addition & 1 deletion log_outgoing_requests/locale/nl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 0.2.0\n"
"Project-Id-Version: 0.6.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-09 05:11-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
Expand Down
125 changes: 125 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
[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 :: 3.2",
"Framework :: Django :: 4.2",
"Intended Audience :: Developers",
"Operating System :: Unix",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
]
requires-python = ">=3.8"
dependencies = [
"django>=3.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/*",
]

[tool.coverage.html]
directory = "cover"
116 changes: 0 additions & 116 deletions setup.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

15 changes: 7 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
envlist =
py{38,39,310}-django{32,41,42}
py{38,39,310}-django{32,41,42}-celery
py{311}-django{41,42}
py{38,39,310}-django{32,42}
py{38,39,310}-django{32,42}-celery
py{311,312}-django42
celery
isort
black
Expand All @@ -16,11 +16,11 @@ python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[gh-actions:env]
DJANGO =
3.2: django32
4.1: django41
4.2: django42

[testenv]
Expand All @@ -38,11 +38,10 @@ extras =
coverage
deps =
django32: Django~=3.2.0
django41: Django~=4.1.0
django42: Django~=4.2.0
celery: celery
commands =
py.test tests \
pytest tests \
--cov --cov-report xml:reports/coverage-{envname}.xml \
{posargs}

Expand All @@ -54,7 +53,7 @@ commands = isort --check-only --diff .
[testenv:black]
extras = tests
skipsdist = True
commands = black --check log_outgoing_requests docs testapp tests setup.py
commands = black --check log_outgoing_requests docs testapp tests

[testenv:flake8]
extras = tests
Expand All @@ -70,6 +69,6 @@ extras =
tests
docs
commands=
py.test check_sphinx.py -v \
pytest check_sphinx.py -v \
--tb=auto \
{posargs}
Loading