Skip to content

Commit 48ed9c5

Browse files
authored
Modernize package files (#267)
* Update project configuration to pyproject.toml * Update tox config, migrate circleci => github actions * Appease linter, remove unneeded test migrations * Update readme badges, remove version support section * Update changelog * Update test settings * Update readme tox example * Remove unused pathways in complex encoder tests
1 parent c93a1f4 commit 48ed9c5

14 files changed

Lines changed: 187 additions & 312 deletions

File tree

.circleci/config.yml

Lines changed: 0 additions & 102 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
10+
jobs:
11+
checks:
12+
name: Run ${{ matrix.toxenv }} check
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version: ["3.13"]
17+
toxenv: ["dist", "lint", "warnings"]
18+
continue-on-error: ${{ matrix.toxenv == 'warnings' }}
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Setup Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
cache: 'pip'
28+
29+
- name: Install tox
30+
run: python -m pip install tox
31+
32+
- name: Run check (${{ matrix.toxenv }})
33+
run: tox -e ${{ matrix.toxenv }}
34+
35+
36+
tests:
37+
name: Test on Python ${{ matrix.python-version }}
38+
runs-on: ubuntu-latest
39+
strategy:
40+
matrix:
41+
python-version: ["3.10", "3.11", "3.12", "3.13"]
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: Setup Python ${{ matrix.python-version }}
47+
uses: actions/setup-python@v5
48+
with:
49+
python-version: ${{ matrix.python-version }}
50+
cache: 'pip'
51+
52+
- name: Install job dependencies
53+
run: python -m pip install tox "coverage[toml]"
54+
55+
- name: Run tests (${{ matrix.python-version }})
56+
run: tox run-parallel -f $(echo py${{ matrix.python-version }} | tr -d .)
57+
58+
- name: Combine coverage
59+
run: coverage combine
60+
61+
- name: Report coverage
62+
run: coverage report
63+
64+
- name: Upload coverage
65+
uses: codecov/codecov-action@v5
66+
with:
67+
token: ${{ secrets.CODECOV_TOKEN }}

CHANGES.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changes
22
-------
33

4+
Unreleased
5+
^^^^^^^^^^
6+
7+
- Set Python version support to 3.10 through 3.13
8+
- Set Django version support to 4.2 through 5.2
9+
- Modernize packaging to use `pyproject.toml`
10+
411
v3.1.0 02/22/2020
512
^^^^^^^^^^^^^^^^^
613
- Handle loading invalid JSON from db

README.rst

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
jsonfield
22
=========
33

4-
.. image:: https://circleci.com/gh/rpkilby/jsonfield.svg?style=shield
5-
:target: https://circleci.com/gh/rpkilby/jsonfield
6-
.. image:: https://codecov.io/gh/rpkilby/jsonfield/branch/master/graph/badge.svg
4+
.. image:: https://github.com/rpkilby/jsonfield/actions/workflows/main.yml/badge.svg
5+
:target: https://github.com/rpkilby/jsonfield/actions/workflows/main.yml
6+
.. image:: https://codecov.io/gh/rpkilby/jsonfield/graph/badge.svg
77
:target: https://codecov.io/gh/rpkilby/jsonfield
8+
.. image:: https://img.shields.io/pypi/l/jsonfield.svg
9+
:target: https://pypi.org/project/jsonfield
810
.. image:: https://img.shields.io/pypi/v/jsonfield.svg
911
:target: https://pypi.org/project/jsonfield
10-
.. image:: https://img.shields.io/pypi/l/jsonfield.svg
12+
.. image:: https://img.shields.io/pypi/pyversions/jsonfield.svg
1113
:target: https://pypi.org/project/jsonfield
1214

1315
**jsonfield** is a reusable model field that allows you to store validated JSON, automatically handling
@@ -21,17 +23,6 @@ serialization to and from the database. To use, add ``jsonfield.JSONField`` to o
2123
.. _introduced: https://docs.djangoproject.com/en/stable/releases/3.1/#jsonfield-for-all-supported-database-backends
2224

2325

24-
Requirements
25-
------------
26-
27-
**jsonfield** aims to support all current `versions of Django`_, however the explicitly tested versions are:
28-
29-
* **Python:** 3.6, 3.7, 3.8
30-
* **Django:** 2.2, 3.0
31-
32-
.. _versions of Django: https://www.djangoproject.com/download/#supported-versions
33-
34-
3526
Installation
3627
------------
3728

@@ -128,11 +119,11 @@ Then, run the ``tox`` command, which will run all test jobs.
128119
129120
$ tox
130121
131-
Or, to test just one job (for example Django 2.0 on Python 3.6):
122+
Or, to test just one job (for example Django 5.2 on Python 3.13):
132123

133124
.. code-block:: shell
134125
135-
$ tox -e py36-django20
126+
$ tox -e py313-django52
136127
137128
138129
Release Process

pyproject.toml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[build-system]
2+
requires = ["setuptools>=77"]
3+
build-backend = "setuptools.build_meta"
4+
5+
6+
[project]
7+
name = "jsonfield"
8+
version = "3.1.0"
9+
10+
dependencies = ["django >= 4.2"]
11+
requires-python = ">=3.10"
12+
13+
authors = [{name = "Brad Jasper", email = "contact@bradjasper.com"}]
14+
maintainers = [{name = "Ryan P Kilby", email = "kilbyr@gmail.com"}]
15+
description = "A reusable Django field that allows you to store validated JSON in your model."
16+
readme = "README.rst"
17+
license = "MIT"
18+
classifiers = [
19+
"Development Status :: 5 - Production/Stable",
20+
"Environment :: Web Environment",
21+
"Framework :: Django",
22+
"Framework :: Django :: 4.2",
23+
"Framework :: Django :: 5.0",
24+
"Framework :: Django :: 5.1",
25+
"Framework :: Django :: 5.2",
26+
"Intended Audience :: Developers",
27+
"Operating System :: OS Independent",
28+
"Programming Language :: Python :: 3 :: Only",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
"Programming Language :: Python :: 3.12",
32+
"Programming Language :: Python :: 3.13",
33+
]
34+
35+
[project.urls]
36+
Repository = "https://github.com/rpkilby/jsonfield"
37+
Issues = "https://github.com/rpkilby/jsonfield/issues"
38+
Changelog = "https://github.com/rpkilby/jsonfield/blob/master/CHANGELOG"
39+
40+
41+
[tool.setuptools.packages.find]
42+
where = ["src"]
43+
44+
[tool.coverage.run]
45+
branch = true
46+
include = ["src/*", "tests/*"]
47+
omit = ["src/jsonfield/encoder.py"]
48+
49+
[tool.coverage.report]
50+
show_missing = true
51+
52+
[tool.flake8]
53+
max-line-length = 120
54+
max-complexity = 10
55+
56+
[tool.isort]
57+
profile = "black"
58+
atomic = true
59+
line_length = 120
60+
combine_as_imports = true
61+
lines_after_imports = 2
62+
known_first_party = ["jsonfield", "tests"]
63+
known_third_party = ["django"]
64+
src_paths = ["src", "tests"]

setup.cfg

Lines changed: 0 additions & 20 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/jsonfield/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
from .fields import JSONCharField, JSONField
22

3+
34
__all__ = ['JSONCharField', 'JSONField']

src/jsonfield/fields.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .encoder import JSONEncoder
1111
from .json import JSONString, checked_loads
1212

13+
1314
DEFAULT_DUMP_KWARGS = {
1415
'cls': JSONEncoder,
1516
}

0 commit comments

Comments
 (0)