bsb-json 0.0.0b5__tar.gz → 4.0.0rc2__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,18 +1,18 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bsb-json
3
- Version: 0.0.0b5
3
+ Version: 4.0.0rc2
4
4
  Summary: JSON parser and utilities for the BSB.
5
5
  Author-email: Robin De Schepper <robingilbert.deschepper@unipv.it>
6
6
  Requires-Python: >=3.8
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>=4.0.0b6,<=4.0.0b9999
9
+ Requires-Dist: bsb-core==4.0.0rc2
10
10
  Requires-Dist: pre-commit~=3.5 ; extra == "dev"
11
11
  Requires-Dist: black~=23.11 ; extra == "dev"
12
12
  Requires-Dist: isort~=5.12 ; extra == "dev"
13
- Requires-Dist: bump2version~=1.0 ; extra == "dev"
13
+ Requires-Dist: bump-my-version~=0.18 ; extra == "dev"
14
14
  Requires-Dist: bsb-core[parallel] ; extra == "test"
15
- Requires-Dist: bsb-test>=0.0.0b7,<=0.0.0b9999 ; extra == "test"
15
+ Requires-Dist: bsb-test==4.0.0rc2 ; extra == "test"
16
16
  Requires-Dist: coverage~=7.0 ; extra == "test"
17
17
  Provides-Extra: dev
18
18
  Provides-Extra: test
File without changes
@@ -4,4 +4,4 @@ JSON parser and utilities for the BSB.
4
4
 
5
5
  from .schema import get_json_schema, get_schema
6
6
 
7
- __version__ = "0.0.0b5"
7
+ __version__ = "4.0.0-rc2"
@@ -7,9 +7,15 @@ import json
7
7
  import os
8
8
 
9
9
  import numpy as np
10
- from bsb.config.parsers import Parser
11
- from bsb.exceptions import ConfigurationWarning, JsonImportError, JsonReferenceError
12
- from bsb.reporting import warn
10
+ from bsb import ConfigurationParser, ConfigurationWarning, ParserError, warn
11
+
12
+
13
+ class JsonImportError(ParserError):
14
+ pass
15
+
16
+
17
+ class JsonReferenceError(ParserError):
18
+ pass
13
19
 
14
20
 
15
21
  def _json_iter(obj): # pragma: nocover
@@ -150,10 +156,10 @@ def _to_json(value):
150
156
  if isinstance(value, np.ndarray):
151
157
  return value.tolist()
152
158
  else:
153
- raise TypeError()
159
+ raise TypeError(f"Can't encode '{value}' ({type(value)})")
154
160
 
155
161
 
156
- class JsonParser(Parser):
162
+ class JsonParser(ConfigurationParser):
157
163
  """
158
164
  Parser plugin class to parse JSON configuration files.
159
165
  """
@@ -0,0 +1,70 @@
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==4.0.0rc2"]
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.0rc2", "coverage~=7.0"]
26
+ dev = [
27
+ "pre-commit~=3.5",
28
+ "black~=23.11",
29
+ "isort~=5.12",
30
+ "bump-my-version~=0.18"
31
+ ]
32
+
33
+ [tool.isort]
34
+ profile = "black"
35
+
36
+ [tool.bumpversion]
37
+ current_version = "4.0.0-rc2"
38
+ parse = """(?x)
39
+ (?P<major>0|[1-9]\\d*)\\.
40
+ (?P<minor>0|[1-9]\\d*)\\.
41
+ (?P<patch>0|[1-9]\\d*)
42
+ (?:
43
+ - # dash seperator for pre-release section
44
+ (?P<pre_l>[a-zA-Z-]+) # pre-release label
45
+ (?P<pre_n>0|[1-9]\\d*) # pre-release version number
46
+ )? # pre-release section is optional
47
+ """
48
+ serialize = [
49
+ "{major}.{minor}.{patch}-{pre_l}{pre_n}",
50
+ "{major}.{minor}.{patch}",
51
+ ]
52
+ search = "{current_version}"
53
+ replace = "{new_version}"
54
+ regex = false
55
+ ignore_missing_version = false
56
+ tag = true
57
+ sign_tags = false
58
+ tag_name = "v{new_version}"
59
+ tag_message = "Bump version: {current_version} → {new_version}"
60
+ allow_dirty = false
61
+ commit = true
62
+ message = "Bump version: {current_version} → {new_version}"
63
+ commit_args = "--no-verify"
64
+
65
+ [tool.bumpversion.parts.pre_l]
66
+ values = ["dev", "a", "b", "rc", "final"]
67
+ optional_value = "final"
68
+
69
+ [[tool.bumpversion.files]]
70
+ filename = "bsb_json/__init__.py"
@@ -1,34 +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>=4.0.0b6,<=4.0.0b9999"]
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>=0.0.0b7,<=0.0.0b9999", "coverage~=7.0"]
26
- dev = [
27
- "pre-commit~=3.5",
28
- "black~=23.11",
29
- "isort~=5.12",
30
- "bump2version~=1.0"
31
- ]
32
-
33
- [tool.isort]
34
- profile = "black"