stencila_types 2.0.0b2__tar.gz → 2.16.0__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,9 +1,10 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: stencila_types
3
- Version: 2.0.0b2
3
+ Version: 2.16.0
4
4
  Summary: Python types for Stencila
5
5
  Keywords: programmable,reproducible,interactive,documents,python,SDK
6
- Author-Email: Nokome Bentley <nokome@stencila.io>
6
+ Author: Nokome Bentley
7
+ Author-email: Nokome Bentley <nokome@stencila.io>
7
8
  License: Apache-2.0
8
9
  Classifier: Development Status :: 3 - Alpha
9
10
  Classifier: Intended Audience :: Developers
@@ -11,12 +12,12 @@ Classifier: Intended Audience :: Science/Research
11
12
  Classifier: Intended Audience :: Education
12
13
  Classifier: Topic :: Software Development
13
14
  Classifier: License :: OSI Approved :: Apache Software License
14
- Project-URL: Homepage, https://github.com/stencila/stencila/tree/main/python#readme
15
- Project-URL: Repository, https://github.com/stencila/stencila
16
- Requires-Python: >=3.10
17
15
  Requires-Dist: cattrs>=23.2.3
18
16
  Requires-Dist: beartype>=0.17.2
19
- Requires-Dist: strenum>=0.4.15; python_version < "3.11"
17
+ Requires-Dist: strenum>=0.4.15 ; python_full_version < '3.11'
18
+ Requires-Python: >=3.10
19
+ Project-URL: Homepage, https://github.com/stencila/stencila/tree/main/python#readme
20
+ Project-URL: Repository, https://github.com/stencila/stencila
20
21
  Description-Content-Type: text/markdown
21
22
 
22
23
  # Stencila Types for Python
@@ -0,0 +1,115 @@
1
+ [project]
2
+ name = "stencila_types"
3
+ version = "2.16.0"
4
+ description = "Python types for Stencila"
5
+ readme = "README.md"
6
+ dependencies = [
7
+ "cattrs>=23.2.3",
8
+ "beartype>=0.17.2",
9
+ 'strenum>=0.4.15; python_version < "3.11"',
10
+ ]
11
+ requires-python = ">=3.10"
12
+ keywords = [
13
+ "programmable",
14
+ "reproducible",
15
+ "interactive",
16
+ "documents",
17
+ "python",
18
+ "SDK",
19
+ ]
20
+ classifiers = [
21
+ "Development Status :: 3 - Alpha",
22
+ "Intended Audience :: Developers",
23
+ "Intended Audience :: Science/Research",
24
+ "Intended Audience :: Education",
25
+ "Topic :: Software Development",
26
+ "License :: OSI Approved :: Apache Software License",
27
+ ]
28
+
29
+ [[project.authors]]
30
+ name = "Nokome Bentley"
31
+ email = "nokome@stencila.io"
32
+
33
+ [project.license]
34
+ text = "Apache-2.0"
35
+
36
+ [project.urls]
37
+ Homepage = "https://github.com/stencila/stencila/tree/main/python#readme"
38
+ Repository = "https://github.com/stencila/stencila"
39
+
40
+ [build-system]
41
+ requires = ["uv_build>=0.9.8,<0.10.0"]
42
+ build-backend = "uv_build"
43
+
44
+ [dependency-groups]
45
+ dev = [
46
+ "pytest>=8.1.1",
47
+ "pytest-regressions>=2.5.0",
48
+ "pytest-coverage>=0.0",
49
+ "pip-audit>=2.7.2",
50
+ ]
51
+
52
+ [tool.pytest.ini_options]
53
+ addopts = ["-s"]
54
+ markers = ["skip_relaxed_json: avoid testing JSON that is not strict"]
55
+
56
+ [tool.ruff]
57
+ target-version = "py310"
58
+ line-length = 88
59
+ src = [
60
+ "src",
61
+ "tests",
62
+ ]
63
+
64
+ [tool.ruff.lint]
65
+ select = [
66
+ "F",
67
+ "E",
68
+ "W",
69
+ "C90",
70
+ "N",
71
+ "UP",
72
+ "S",
73
+ "B",
74
+ "A",
75
+ "C4",
76
+ "PIE",
77
+ "ISC",
78
+ "T20",
79
+ "PT",
80
+ "RET",
81
+ "SIM",
82
+ "PTH",
83
+ "Q",
84
+ "PLR",
85
+ "PLE",
86
+ "I001",
87
+ ]
88
+ ignore = [
89
+ "N812",
90
+ "RET504",
91
+ "ISC001",
92
+ ]
93
+ unfixable = [
94
+ "T20",
95
+ "F841",
96
+ ]
97
+
98
+ [tool.ruff.lint.per-file-ignores]
99
+ "src/stencila_types/types.py" = [
100
+ "E501",
101
+ "UP007",
102
+ ]
103
+ "tests/**" = ["S101"]
104
+
105
+ [tool.ruff.format]
106
+ exclude = ["src/stencila_types/types.py"]
107
+
108
+ [tool.pyright]
109
+ include = [
110
+ "src",
111
+ "tests",
112
+ ]
113
+ pythonVersion = "3.10"
114
+ venvPath = "."
115
+ venv = ".venv"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stencila_types"
3
- version = "2.0.0b2"
3
+ version = "2.16.0"
4
4
  description = "Python types for Stencila"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -37,15 +37,10 @@ Homepage = "https://github.com/stencila/stencila/tree/main/python#readme"
37
37
  Repository = "https://github.com/stencila/stencila"
38
38
 
39
39
  [build-system]
40
- requires = [
41
- "pdm-backend",
42
- ]
43
- build-backend = "pdm.backend"
44
-
45
- [tool.pdm]
46
- distribution = true
40
+ requires = ["uv_build>=0.9.8,<0.10.0"]
41
+ build-backend = "uv_build"
47
42
 
48
- [tool.pdm.dev-dependencies]
43
+ [dependency-groups]
49
44
  dev = [
50
45
  "pytest>=8.1.1",
51
46
  "pytest-regressions>=2.5.0",
@@ -47,12 +47,12 @@ def btn(*, name: str, code: str) -> T.Button:
47
47
 
48
48
  @beartype
49
49
  def ct(target: str):
50
- return T.Cite(target=target, citation_mode=T.CitationMode.Parenthetical)
50
+ return T.Citation(target=target, citation_mode=T.CitationMode.Parenthetical)
51
51
 
52
52
 
53
53
  @beartype
54
54
  def ctg(targets: Iterable[str]):
55
- return T.CiteGroup(items=[ct(t) for t in targets])
55
+ return T.CitationGroup(items=[ct(t) for t in targets])
56
56
 
57
57
 
58
58
  @beartype
@@ -65,11 +65,6 @@ def ci(code: str):
65
65
  return T.CodeInline(code=code)
66
66
 
67
67
 
68
- @beartype
69
- def dei(content: ConvertibleToInline) -> T.DeleteInline:
70
- return T.DeleteInline(content=convert_to_inlines(content))
71
-
72
-
73
68
  @beartype
74
69
  def em(content: str | T.Text) -> T.Emphasis:
75
70
  # Emphasis actually takes a list, but if these are shortcuts...
@@ -83,11 +78,6 @@ def img(url: str) -> T.ImageObject:
83
78
  return T.ImageObject(content_url=url)
84
79
 
85
80
 
86
- @beartype
87
- def isi(content: ConvertibleToInline) -> T.InsertInline:
88
- return T.InsertInline(content=convert_to_inlines(content))
89
-
90
-
91
81
  @beartype
92
82
  def lnk(content: ConvertibleToInline, target: str) -> T.Link:
93
83
  return T.Link(content=convert_to_inlines(content), target=target)
@@ -108,16 +98,6 @@ def par(name: str) -> T.Parameter:
108
98
  return T.Parameter(name=name)
109
99
 
110
100
 
111
- @beartype
112
- def rei(
113
- content: ConvertibleToInline, replacement: ConvertibleToInline
114
- ) -> T.ReplaceInline:
115
- return T.ReplaceInline(
116
- content=convert_to_inlines(content),
117
- replacement=convert_to_inlines(replacement),
118
- )
119
-
120
-
121
101
  @beartype
122
102
  def qi(content: ConvertibleToInline) -> T.QuoteInline:
123
103
  return T.QuoteInline(content=convert_to_inlines(content))
@@ -183,7 +163,10 @@ def arg(name: str, code: str) -> T.CallArgument:
183
163
 
184
164
 
185
165
  @beartype
186
- def clm(claim_type: T.ClaimType, content: ConvertibleToBlocks) -> T.Claim:
166
+ def clm(
167
+ content: ConvertibleToBlocks,
168
+ claim_type: T.ClaimType | None = None,
169
+ ) -> T.Claim:
187
170
  return T.Claim(
188
171
  claim_type=claim_type,
189
172
  content=convert_to_blocks(content),
@@ -200,11 +183,6 @@ def cc(code: str, *, lang: str | None = None) -> T.CodeChunk:
200
183
  return T.CodeChunk(code=code, programming_language=lang)
201
184
 
202
185
 
203
- @beartype
204
- def deb(content: ConvertibleToBlocks) -> T.DeleteBlock:
205
- return T.DeleteBlock(content=convert_to_blocks(content))
206
-
207
-
208
186
  @beartype
209
187
  def fig(content: ConvertibleToBlocks) -> T.Figure:
210
188
  return T.Figure(content=convert_to_blocks(content))
@@ -269,11 +247,6 @@ def inb(source: str) -> T.IncludeBlock:
269
247
  return T.IncludeBlock(source=source)
270
248
 
271
249
 
272
- @beartype
273
- def isb(content: ConvertibleToBlocks) -> T.InsertBlock:
274
- return T.InsertBlock(content=convert_to_blocks(content))
275
-
276
-
277
250
  @beartype
278
251
  def ol(items: list[T.ListItem]) -> T.List:
279
252
  return T.List(items=items, order=T.ListOrder.Ascending)
@@ -304,16 +277,6 @@ def qb(content: ConvertibleToBlocks) -> T.QuoteBlock:
304
277
  return T.QuoteBlock(content=convert_to_blocks(content))
305
278
 
306
279
 
307
- @beartype
308
- def reb(
309
- content: ConvertibleToBlocks, replacement: ConvertibleToBlocks
310
- ) -> T.ReplaceBlock:
311
- return T.ReplaceBlock(
312
- content=convert_to_blocks(content),
313
- replacement=convert_to_blocks(replacement),
314
- )
315
-
316
-
317
280
  @beartype
318
281
  def sec(content: ConvertibleToBlocks) -> T.Section:
319
282
  return T.Section(content=convert_to_blocks(content))