json-store 4.5__tar.gz → 4.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: json-store
3
- Version: 4.5
3
+ Version: 4.6
4
4
  Summary: A shelve-like store using JSON serialization.
5
5
  Project-URL: Homepage, https://github.com/brainsik/json-store
6
6
  Project-URL: Repository, https://github.com/brainsik/json-store.git
@@ -33,15 +33,15 @@ Classifier: Intended Audience :: Developers
33
33
  Classifier: License :: OSI Approved :: MIT License
34
34
  Classifier: Operating System :: OS Independent
35
35
  Classifier: Programming Language :: Python :: 3
36
- Classifier: Programming Language :: Python :: 3.10
37
36
  Classifier: Programming Language :: Python :: 3.11
38
37
  Classifier: Programming Language :: Python :: 3.12
39
38
  Classifier: Programming Language :: Python :: 3.13
40
39
  Classifier: Programming Language :: Python :: 3.14
40
+ Classifier: Programming Language :: Python :: 3.15
41
41
  Classifier: Programming Language :: Python :: Implementation :: CPython
42
42
  Classifier: Programming Language :: Python :: Implementation :: PyPy
43
43
  Classifier: Topic :: Software Development :: Libraries
44
- Requires-Python: >=3.10
44
+ Requires-Python: >=3.11
45
45
  Description-Content-Type: text/markdown
46
46
 
47
47
  # json-store
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  dynamic = ["version"]
3
3
  name = "json-store"
4
- requires-python = ">=3.10"
4
+ requires-python = ">=3.11"
5
5
  dependencies = []
6
6
 
7
7
  authors = [{name = "jeremy avnet", email = "json-store@theory.org"}]
@@ -20,11 +20,11 @@ classifiers = [
20
20
 
21
21
  "Operating System :: OS Independent",
22
22
  "Programming Language :: Python :: 3",
23
- "Programming Language :: Python :: 3.10",
24
23
  "Programming Language :: Python :: 3.11",
25
24
  "Programming Language :: Python :: 3.12",
26
25
  "Programming Language :: Python :: 3.13",
27
26
  "Programming Language :: Python :: 3.14",
27
+ "Programming Language :: Python :: 3.15",
28
28
  "Programming Language :: Python :: Implementation :: CPython",
29
29
  "Programming Language :: Python :: Implementation :: PyPy",
30
30
  ]
@@ -39,7 +39,7 @@ Changelog = "https://github.com/brainsik/json-store/releases"
39
39
  shelve2json = "json_store.shelve2json:main"
40
40
 
41
41
  [build-system]
42
- requires = ["hatchling==1.29.0"]
42
+ requires = ["hatchling==1.32.4"]
43
43
  build-backend = "hatchling.build"
44
44
 
45
45
  [tool.hatch.build.targets.sdist]
@@ -54,4 +54,4 @@ include = [
54
54
  path = "src/json_store/__init__.py"
55
55
 
56
56
  [dependency-groups]
57
- dev = ["pytest >=8.3"]
57
+ dev = ["pytest >=9.1"]
@@ -1,5 +1,5 @@
1
1
  from .json_store import JSONStore
2
2
 
3
- __version__ = "4.5"
3
+ __version__ = "4.6"
4
4
 
5
5
  open = JSONStore
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  """A JSON store to use in place of shelve. Unicode keys, FTW!
3
2
 
4
3
  This is for small stores. Everything is in memory and sync() always writes
@@ -1,7 +1,7 @@
1
1
  #! /usr/bin/env python
2
- # encoding: utf-8
3
2
  """Naïvely create a json_store file from a shelve DB."""
4
3
 
4
+ import dbm
5
5
  import os
6
6
  import shelve
7
7
  import sys
@@ -11,7 +11,7 @@ import json_store
11
11
 
12
12
  def convert(oldfile: str):
13
13
  if not os.path.isfile(oldfile):
14
- raise ValueError("No such file: {}".format(oldfile))
14
+ raise ValueError(f"No such file: {oldfile}")
15
15
 
16
16
  name = oldfile
17
17
  # remove extensions that are implicitly added by the underlying DBM module
@@ -29,12 +29,12 @@ def convert(oldfile: str):
29
29
 
30
30
  def main(argv=sys.argv):
31
31
  if len(argv) < 2:
32
- print("Usage: {0[0]} <shelve_db>".format(argv))
32
+ print(f"Usage: {argv[0]} <shelve_db>")
33
33
  return 1
34
34
 
35
35
  try:
36
36
  convert(argv[1])
37
- except Exception as e:
37
+ except (*dbm.error, TypeError, ValueError) as e:
38
38
  print(str(e), file=sys.stderr)
39
39
  return 1
40
40
  return 0
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  import json
3
2
  import os
4
3
  import platform
@@ -13,7 +12,7 @@ def get_new_store(json_kw=None, mode=None):
13
12
  # get a random filename to use
14
13
  with NamedTemporaryFile(prefix=__name__ + ".") as f:
15
14
  path = f.name
16
- assert not os.path.exists(path), "Tempfile was not deleted: %s" % path
15
+ assert not os.path.exists(path), f"Tempfile was not deleted: {path}"
17
16
 
18
17
  kwargs = {}
19
18
 
@@ -151,7 +150,6 @@ def test_unchanged_store_doesnt_write_new_file():
151
150
  new_store.sync()
152
151
 
153
152
  store = json_store.open(new_store.path)
154
- print("Test: ", store._needs_sync)
155
153
  try:
156
154
  inode1 = os.stat(store.path).st_ino
157
155
  assert not store.sync(), "File was written?"
File without changes
File without changes
File without changes