Skip to content

Commit 3eefba1

Browse files
authored
Merge pull request #45 from edelooff/release-0.6.0
Release 0.6.0
2 parents 97c3ca8 + 00e3742 commit 3eefba1

File tree

5 files changed

+32
-4
lines changed

5 files changed

+32
-4
lines changed

.github/workflows/tests.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
python-version: [3.6, "pypy-3.6", 3.7, 3.8, 3.9, "pypy-3.9", "3.10", "3.11.0-rc.2"]
11+
python-version: ["pypy-3.6", "3.7", "3.8", "3.9", "pypy-3.9", "3.10", "3.11"]
1212

1313
steps:
1414
- uses: actions/checkout@v2
@@ -25,4 +25,3 @@ jobs:
2525
- name: Run test suite
2626
run: |
2727
pytest
28-

README.rst

+7
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ Dependencies
105105
Changelog
106106
=========
107107

108+
0.6.0
109+
-----
110+
111+
* Fixes pickling support (https://github.com/edelooff/sqlalchemy-json/issues/36)
112+
* Drops python 2.x support (previously claimed, but already broken for some time)
113+
* Removes test runners for CPython 3.6 since Github actions support has been dropped
114+
108115
0.5.0
109116
-----
110117
* Fixes a lingering Python 3 compatibility issue (``cmp`` parameter for ``TrackedList.sort``)

setup.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ def contents(filename):
1010

1111
setup(
1212
name="sqlalchemy-json",
13-
version="0.5.0",
13+
version="0.6.0",
1414
author="Elmer de Looff",
1515
author_email="[email protected]",
1616
description="JSON type with nested change tracking for SQLAlchemy",
1717
long_description=contents("README.rst"),
18+
long_description_content_type="text/x-rst",
1819
keywords="sqlalchemy json mutable",
1920
license="BSD",
2021
url="https://github.com/edelooff/sqlalchemy-json",
@@ -28,4 +29,6 @@ def contents(filename):
2829
"License :: OSI Approved :: BSD License",
2930
"Programming Language :: Python",
3031
"Programming Language :: Python :: 3",
31-
"Topic :: Database"])
32+
"Topic :: Database",
33+
],
34+
)

sqlalchemy_json/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from .track import TrackedDict, TrackedList
55

66
__all__ = "MutableJson", "NestedMutableJson", "mutable_json_type"
7+
__version__ = "0.6.0"
78

89

910
class _PickleMixin:

test/test_sqlalchemy_json.py

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import copy
12
import pickle
23
import sys
34

@@ -127,6 +128,23 @@ def test_nested_pickling():
127128
assert two_reloaded[3]["numbers"].parent is two_reloaded[3]
128129

129130

131+
def test_deepcopy(session, article):
132+
"""Modifying a copy of a MutableJSON instance does not affect the source."""
133+
new_repo = "someone/newrepo"
134+
assert new_repo not in article.references["github.com"]
135+
136+
article_copy = Article(
137+
author=article.author,
138+
content=article.content,
139+
references=copy.deepcopy(article.references),
140+
)
141+
article_copy.references["github.com"][new_repo] = 10
142+
article_copy.references["modified"] = True
143+
144+
assert new_repo not in article.references["github.com"]
145+
assert not session.dirty
146+
147+
130148
@pytest.mark.skipif(sys.version_info < (3, 9), reason="Python 3.9+ required")
131149
def test_dict_merging(session, article):
132150
article.references["github.com"] |= {"someone/somerepo": 10}

0 commit comments

Comments
 (0)