bsb-json 4.2.2__tar.gz → 6.0.0a5__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.

Potentially problematic release.


This version of bsb-json might be problematic. Click here for more details.

File without changes
@@ -1,30 +1,29 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: bsb-json
3
- Version: 4.2.2
3
+ Version: 6.0.0a5
4
4
  Summary: JSON parser and utilities for the BSB.
5
- Author-email: Robin De Schepper <robingilbert.deschepper@unipv.it>
6
- Requires-Python: >=3.8
5
+ Author-email: Robin De Schepper <robin@alexandria.sc>, Dimitri Rodarie <dimitri.rodarie@unipv.it>
6
+ Requires-Python: >=3.10,<4
7
7
  Description-Content-Type: text/markdown
8
8
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
9
- Requires-Dist: bsb-core~=5.0
10
- Requires-Dist: bsb-json[test] ; extra == "dev"
11
- Requires-Dist: build~=1.0 ; extra == "dev"
12
- Requires-Dist: twine~=4.0 ; extra == "dev"
9
+ License-File: LICENSE
10
+ Requires-Dist: bsb-core~=6.0
11
+ Requires-Dist: bsb-json[test, docs] ; extra == "dev"
13
12
  Requires-Dist: pre-commit~=3.5 ; extra == "dev"
14
- Requires-Dist: black~=24.1.1 ; extra == "dev"
15
- Requires-Dist: isort~=5.12 ; extra == "dev"
16
- Requires-Dist: bump-my-version~=0.24 ; extra == "dev"
13
+ Requires-Dist: ruff>=0.8.2 ; extra == "dev"
14
+ Requires-Dist: furo~=2024.0 ; extra == "docs"
15
+ Requires-Dist: sphinxext-bsb~=6.0 ; extra == "docs"
17
16
  Requires-Dist: bsb-core[parallel] ; extra == "test"
18
17
  Requires-Dist: bsb-test~=4.0 ; extra == "test"
19
- Requires-Dist: coverage~=7.0 ; extra == "test"
18
+ Requires-Dist: coverage>=7.3 ; extra == "test"
20
19
  Provides-Extra: dev
20
+ Provides-Extra: docs
21
21
  Provides-Extra: test
22
22
 
23
23
  [![Build Status](https://github.com/dbbs-lab/bsb-json/actions/workflows/main.yml/badge.svg)](https://github.com/dbbs-lab/bsb-json/actions/workflows/main.yml)
24
- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
24
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
25
25
 
26
26
  # bsb-json
27
27
 
28
- `bsb-json` is a plugin of the [BSB](https://github.com/dbbs-lab/bsb) (see also
29
- [bsb-core](https://github.com/dbbs-lab/bsb-core)).
28
+ `bsb-json` is a plugin of the [BSB](https://github.com/dbbs-lab/bsb).
30
29
  It allows the user to write their models' configuration in the json format.
@@ -1,8 +1,7 @@
1
1
  [![Build Status](https://github.com/dbbs-lab/bsb-json/actions/workflows/main.yml/badge.svg)](https://github.com/dbbs-lab/bsb-json/actions/workflows/main.yml)
2
- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
2
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
3
3
 
4
4
  # bsb-json
5
5
 
6
- `bsb-json` is a plugin of the [BSB](https://github.com/dbbs-lab/bsb) (see also
7
- [bsb-core](https://github.com/dbbs-lab/bsb-core)).
6
+ `bsb-json` is a plugin of the [BSB](https://github.com/dbbs-lab/bsb).
8
7
  It allows the user to write their models' configuration in the json format.
@@ -0,0 +1,12 @@
1
+ """
2
+ JSON parser and utilities for the BSB.
3
+ """
4
+
5
+ from .parser import JsonParser
6
+ from .schema import get_json_schema, get_schema
7
+
8
+ __all__ = [
9
+ "get_json_schema",
10
+ "get_schema",
11
+ "JsonParser",
12
+ ]
@@ -1,5 +1,7 @@
1
1
  """
2
- JSON parsing module. Built on top of the Python ``json`` module. Adds JSON imports and
2
+ JSON parsing module.
3
+
4
+ Built on top of the Python ``json`` module. Adds JSON imports and
3
5
  references.
4
6
  """
5
7
 
@@ -27,7 +27,7 @@ def object_schema(obj, defs=None):
27
27
  cls = obj.__class__
28
28
  obj_hints = typing.get_type_hints(cls, localns={"Scaffold": Scaffold})
29
29
  obj_attrs = get_config_attributes(cls)
30
- for attr, descr in obj_attrs.items():
30
+ for attr, _descr in obj_attrs.items():
31
31
  hint = obj_hints.get(attr, str)
32
32
  schema["properties"][attr] = attr_schema(hint, defs)
33
33
 
@@ -62,7 +62,7 @@ def attr_schema(hint, defs=None):
62
62
  else:
63
63
  try:
64
64
  is_node = get_config_attributes(hint)
65
- except:
65
+ except Exception:
66
66
  is_node = False
67
67
  if is_node:
68
68
  key = defs_key(hint)
@@ -0,0 +1,71 @@
1
+ dependency-groups = { }
2
+
3
+ [build-system]
4
+ requires = [ "flit_core >=3.2,<4" ]
5
+ build-backend = "flit_core.buildapi"
6
+
7
+ [project]
8
+ name = "bsb-json"
9
+ version = "6.0.0-a5"
10
+ readme = "README.md"
11
+ requires-python = ">=3.10,<4"
12
+ dynamic = [ "description" ]
13
+ classifiers = [
14
+ "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)"
15
+ ]
16
+ dependencies = [ "bsb-core~=6.0" ]
17
+
18
+ [[project.authors]]
19
+ name = "Robin De Schepper"
20
+ email = "robin@alexandria.sc"
21
+
22
+ [[project.authors]]
23
+ name = "Dimitri Rodarie"
24
+ email = "dimitri.rodarie@unipv.it"
25
+
26
+ [project.license]
27
+ file = "LICENSE"
28
+
29
+ [project.optional-dependencies]
30
+ test = [ "bsb-core[parallel]", "bsb-test~=4.0", "coverage>=7.3" ]
31
+ docs = [ "furo~=2024.0", "sphinxext-bsb~=6.0" ]
32
+ dev = [ "bsb-json[test,docs]", "pre-commit~=3.5", "ruff>=0.8.2" ]
33
+
34
+ [project.entry-points."bsb.config.parsers"]
35
+ json = "bsb_json.parser"
36
+
37
+ [project.entry-points."bsb.config.templates"]
38
+ json_templates = "bsb_json.templates"
39
+
40
+ [tool.flit.module]
41
+ name = "bsb_json"
42
+
43
+ [tool.uv]
44
+ sources = { }
45
+
46
+ [tool.coverage.run]
47
+ branch = true
48
+ source = [ "bsb_json" ]
49
+
50
+ [tool.coverage.report]
51
+ exclude_lines = [ "if TYPE_CHECKING:" ]
52
+ show_missing = true
53
+
54
+ [tool.ruff]
55
+ exclude = [ ".ruff_cache", ".svn", ".tox", ".venv", "dist" ]
56
+ line-length = 90
57
+ indent-width = 4
58
+
59
+ [tool.ruff.format]
60
+ quote-style = "double"
61
+ indent-style = "space"
62
+ skip-magic-trailing-comma = false
63
+ line-ending = "auto"
64
+ docstring-code-format = true
65
+ docstring-code-line-length = 90
66
+
67
+ [tool.ruff.lint]
68
+ select = [ "E", "F", "UP", "B", "SIM", "I" ]
69
+ ignore = [ ]
70
+ fixable = [ "ALL" ]
71
+ unfixable = [ ]
@@ -1,7 +0,0 @@
1
- """
2
- JSON parser and utilities for the BSB.
3
- """
4
-
5
- from .schema import get_json_schema, get_schema
6
-
7
- __version__ = "4.2.2"
@@ -1,61 +0,0 @@
1
- [build-system]
2
- requires = ["flit_core >=3.2,<4"]
3
- build-backend = "flit_core.buildapi"
4
-
5
- [project]
6
- name = "bsb-json"
7
- authors = [{name = "Robin De Schepper", email = "robingilbert.deschepper@unipv.it"}]
8
- readme = "README.md"
9
- license = {file = "LICENSE"}
10
- classifiers = ["License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)"]
11
- dynamic = ["version", "description"]
12
- requires-python = ">=3.8"
13
- dependencies = ["bsb-core~=5.0"]
14
-
15
- [project.entry-points."bsb.config.parsers"]
16
- json = "bsb_json.parser"
17
-
18
- [project.entry-points."bsb.config.templates"]
19
- json_templates = "bsb_json.templates"
20
-
21
- [tool.flit.module]
22
- name = "bsb_json"
23
-
24
- [project.optional-dependencies]
25
- test = ["bsb-core[parallel]", "bsb-test~=4.0", "coverage~=7.0"]
26
- dev = [
27
- "bsb-json[test]",
28
- "build~=1.0",
29
- "twine~=4.0",
30
- "pre-commit~=3.5",
31
- "black~=24.1.1",
32
- "isort~=5.12",
33
- "bump-my-version~=0.24"
34
- ]
35
-
36
- [tool.isort]
37
- profile = "black"
38
-
39
- [tool.bumpversion]
40
- current_version = "4.2.2"
41
- parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
42
- serialize = ["{major}.{minor}.{patch}"]
43
- search = "{current_version}"
44
- replace = "{new_version}"
45
- regex = false
46
- ignore_missing_version = false
47
- tag = true
48
- sign_tags = false
49
- tag_name = "v{new_version}"
50
- tag_message = "Bump version: {current_version} → {new_version}"
51
- allow_dirty = false
52
- commit = true
53
- message = "Bump version: {current_version} → {new_version}"
54
- commit_args = "--no-verify"
55
-
56
- [tool.bumpversion.parts.pre_l]
57
- values = ["dev", "a", "b", "rc", "final"]
58
- optional_value = "final"
59
-
60
- [[tool.bumpversion.files]]
61
- filename = "bsb_json/__init__.py"