Skip to content
Merged
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
102 changes: 0 additions & 102 deletions .circleci/config.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI

on:
push:
branches:
- master
pull_request:


jobs:
checks:
name: Run ${{ matrix.toxenv }} check
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.13"]
toxenv: ["dist", "lint", "warnings"]
continue-on-error: ${{ matrix.toxenv == 'warnings' }}

steps:
- uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install tox
run: python -m pip install tox

- name: Run check (${{ matrix.toxenv }})
run: tox -e ${{ matrix.toxenv }}


tests:
name: Test on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install job dependencies
run: python -m pip install tox "coverage[toml]"

- name: Run tests (${{ matrix.python-version }})
run: tox run-parallel -f $(echo py${{ matrix.python-version }} | tr -d .)

- name: Combine coverage
run: coverage combine

- name: Report coverage
run: coverage report

- name: Upload coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changes
-------

Unreleased
^^^^^^^^^^

- Set Python version support to 3.10 through 3.13
- Set Django version support to 4.2 through 5.2
- Modernize packaging to use `pyproject.toml`

v3.1.0 02/22/2020
^^^^^^^^^^^^^^^^^
- Handle loading invalid JSON from db
Expand Down
25 changes: 8 additions & 17 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
jsonfield
=========

.. image:: https://circleci.com/gh/rpkilby/jsonfield.svg?style=shield
:target: https://circleci.com/gh/rpkilby/jsonfield
.. image:: https://codecov.io/gh/rpkilby/jsonfield/branch/master/graph/badge.svg
.. image:: https://github.com/rpkilby/jsonfield/actions/workflows/main.yml/badge.svg
:target: https://github.com/rpkilby/jsonfield/actions/workflows/main.yml
.. image:: https://codecov.io/gh/rpkilby/jsonfield/graph/badge.svg
:target: https://codecov.io/gh/rpkilby/jsonfield
.. image:: https://img.shields.io/pypi/l/jsonfield.svg
:target: https://pypi.org/project/jsonfield
.. image:: https://img.shields.io/pypi/v/jsonfield.svg
:target: https://pypi.org/project/jsonfield
.. image:: https://img.shields.io/pypi/l/jsonfield.svg
.. image:: https://img.shields.io/pypi/pyversions/jsonfield.svg
:target: https://pypi.org/project/jsonfield

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


Requirements
------------

**jsonfield** aims to support all current `versions of Django`_, however the explicitly tested versions are:

* **Python:** 3.6, 3.7, 3.8
* **Django:** 2.2, 3.0

.. _versions of Django: https://www.djangoproject.com/download/#supported-versions


Installation
------------

Expand Down Expand Up @@ -128,11 +119,11 @@ Then, run the ``tox`` command, which will run all test jobs.

$ tox

Or, to test just one job (for example Django 2.0 on Python 3.6):
Or, to test just one job (for example Django 5.2 on Python 3.13):

.. code-block:: shell

$ tox -e py36-django20
$ tox -e py313-django52


Release Process
Expand Down
64 changes: 64 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[build-system]
requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"


[project]
name = "jsonfield"
version = "3.1.0"

dependencies = ["django >= 4.2"]
requires-python = ">=3.10"

authors = [{name = "Brad Jasper", email = "contact@bradjasper.com"}]
maintainers = [{name = "Ryan P Kilby", email = "kilbyr@gmail.com"}]
description = "A reusable Django field that allows you to store validated JSON in your model."
readme = "README.rst"
license = "MIT"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"Framework :: Django :: 5.2",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]

[project.urls]
Repository = "https://github.com/rpkilby/jsonfield"
Issues = "https://github.com/rpkilby/jsonfield/issues"
Changelog = "https://github.com/rpkilby/jsonfield/blob/master/CHANGELOG"


[tool.setuptools.packages.find]
where = ["src"]

[tool.coverage.run]
branch = true
include = ["src/*", "tests/*"]
omit = ["src/jsonfield/encoder.py"]

[tool.coverage.report]
show_missing = true

[tool.flake8]
max-line-length = 120
max-complexity = 10

[tool.isort]
profile = "black"
atomic = true
line_length = 120
combine_as_imports = true
lines_after_imports = 2
known_first_party = ["jsonfield", "tests"]
known_third_party = ["django"]
src_paths = ["src", "tests"]
20 changes: 0 additions & 20 deletions setup.cfg

This file was deleted.

33 changes: 0 additions & 33 deletions setup.py

This file was deleted.

1 change: 1 addition & 0 deletions src/jsonfield/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .fields import JSONCharField, JSONField


__all__ = ['JSONCharField', 'JSONField']
1 change: 1 addition & 0 deletions src/jsonfield/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .encoder import JSONEncoder
from .json import JSONString, checked_loads


DEFAULT_DUMP_KWARGS = {
'cls': JSONEncoder,
}
Expand Down
Loading