links-notation 0.26.0__tar.gz → 0.27.1__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.
Files changed (46) hide show
  1. {links_notation-0.26.0/links_notation.egg-info → links_notation-0.27.1}/PKG-INFO +5 -9
  2. {links_notation-0.26.0 → links_notation-0.27.1}/links_notation/__init__.py +5 -9
  3. {links_notation-0.26.0 → links_notation-0.27.1/links_notation.egg-info}/PKG-INFO +5 -9
  4. {links_notation-0.26.0 → links_notation-0.27.1}/links_notation.egg-info/SOURCES.txt +2 -1
  5. {links_notation-0.26.0 → links_notation-0.27.1}/links_notation.egg-info/requires.txt +1 -5
  6. {links_notation-0.26.0 → links_notation-0.27.1}/pyproject.toml +7 -14
  7. links_notation-0.27.1/tests/test_version.py +27 -0
  8. {links_notation-0.26.0 → links_notation-0.27.1}/LICENSE +0 -0
  9. {links_notation-0.26.0 → links_notation-0.27.1}/MANIFEST.in +0 -0
  10. {links_notation-0.26.0 → links_notation-0.27.1}/README.md +0 -0
  11. {links_notation-0.26.0 → links_notation-0.27.1}/README.ru.md +0 -0
  12. {links_notation-0.26.0 → links_notation-0.27.1}/links_notation/binary.py +0 -0
  13. {links_notation-0.26.0 → links_notation-0.27.1}/links_notation/comments.py +0 -0
  14. {links_notation-0.26.0 → links_notation-0.27.1}/links_notation/format_config.py +0 -0
  15. {links_notation-0.26.0 → links_notation-0.27.1}/links_notation/formatter.py +0 -0
  16. {links_notation-0.26.0 → links_notation-0.27.1}/links_notation/link.py +0 -0
  17. {links_notation-0.26.0 → links_notation-0.27.1}/links_notation/parser.py +0 -0
  18. {links_notation-0.26.0 → links_notation-0.27.1}/links_notation/quotes.py +0 -0
  19. {links_notation-0.26.0 → links_notation-0.27.1}/links_notation/reference_literal.py +0 -0
  20. {links_notation-0.26.0 → links_notation-0.27.1}/links_notation/stream_parser.py +0 -0
  21. {links_notation-0.26.0 → links_notation-0.27.1}/links_notation.egg-info/dependency_links.txt +0 -0
  22. {links_notation-0.26.0 → links_notation-0.27.1}/links_notation.egg-info/top_level.txt +0 -0
  23. {links_notation-0.26.0 → links_notation-0.27.1}/setup.cfg +0 -0
  24. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_api.py +0 -0
  25. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_binary.py +0 -0
  26. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_comments.py +0 -0
  27. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_edge_case_parser.py +0 -0
  28. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_empty_reference.py +0 -0
  29. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_format_config.py +0 -0
  30. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_indentation_consistency.py +0 -0
  31. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_indented_id_nested_values.py +0 -0
  32. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_indented_id_syntax.py +0 -0
  33. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_link.py +0 -0
  34. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_links_group.py +0 -0
  35. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_mixed_indentation_modes.py +0 -0
  36. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_multi_quote_parser.py +0 -0
  37. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_multiline_parser.py +0 -0
  38. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_multiline_quoted_string.py +0 -0
  39. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_nested_indentation.py +0 -0
  40. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_nested_parser.py +0 -0
  41. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_nested_self_reference.py +0 -0
  42. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_nesting_limit.py +0 -0
  43. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_reference_fidelity.py +0 -0
  44. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_shared_text_parity.py +0 -0
  45. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_single_line_parser.py +0 -0
  46. {links_notation-0.26.0 → links_notation-0.27.1}/tests/test_stream_parser.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: links-notation
3
- Version: 0.26.0
3
+ Version: 0.27.1
4
4
  Summary: Python implementation of the Links Notation parser
5
5
  Author-email: "Link.Foundation" <drakonard@gmail.com>
6
6
  License-Expression: Unlicense
@@ -11,14 +11,14 @@ Keywords: lino,parser,links,notation,protocol
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
14
  Classifier: Programming Language :: Python :: 3.11
17
15
  Classifier: Programming Language :: Python :: 3.12
18
16
  Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Programming Language :: Python :: 3.15
19
19
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
20
  Classifier: Topic :: Text Processing
21
- Requires-Python: >=3.9
21
+ Requires-Python: >=3.11
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
  Provides-Extra: test
@@ -29,11 +29,7 @@ Requires-Dist: black>=26.10.1; extra == "lint"
29
29
  Requires-Dist: isort>=9.0.2; extra == "lint"
30
30
  Requires-Dist: flake8>=7.4.1; extra == "lint"
31
31
  Provides-Extra: dev
32
- Requires-Dist: pytest>=9.1.1; extra == "dev"
33
- Requires-Dist: pytest-timeout>=2.4.0; extra == "dev"
34
- Requires-Dist: black>=26.10.1; extra == "dev"
35
- Requires-Dist: isort>=9.0.2; extra == "dev"
36
- Requires-Dist: flake8>=7.4.1; extra == "dev"
32
+ Requires-Dist: links-notation[lint,test]; extra == "dev"
37
33
  Dynamic: license-file
38
34
 
39
35
  # Links Notation Parser for Python
@@ -5,7 +5,7 @@ Lino (Links Notation) is a simple, intuitive format for representing
5
5
  structured data as links between references.
6
6
  """
7
7
 
8
- import re
8
+ import tomllib
9
9
  from importlib.metadata import PackageNotFoundError
10
10
  from importlib.metadata import version as _distribution_version
11
11
  from pathlib import Path
@@ -37,9 +37,7 @@ def _read_version() -> str:
37
37
  released 0.16.1, so ``links_notation.__version__`` answered for a release
38
38
  nine minor versions old. pyproject.toml is the one place the version is
39
39
  written; when the package is imported from a source checkout that was never
40
- installed, that file is still next to us, so read it there. The read is a
41
- regex rather than tomllib because this package supports Python 3.9, and
42
- tomllib arrived in 3.11.
40
+ installed, that file is still next to us, so read it there.
43
41
  """
44
42
  try:
45
43
  return _distribution_version("links-notation")
@@ -48,13 +46,11 @@ def _read_version() -> str:
48
46
 
49
47
  pyproject = Path(__file__).resolve().parent.parent / "pyproject.toml"
50
48
  try:
51
- text = pyproject.read_text(encoding="utf-8")
52
- except OSError:
49
+ with pyproject.open("rb") as file:
50
+ return tomllib.load(file)["project"]["version"]
51
+ except (OSError, tomllib.TOMLDecodeError, KeyError):
53
52
  return "unknown"
54
53
 
55
- found = re.search(r'^version\s*=\s*"([^"]+)"', text, re.MULTILINE)
56
- return found.group(1) if found else "unknown"
57
-
58
54
 
59
55
  __version__ = _read_version()
60
56
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: links-notation
3
- Version: 0.26.0
3
+ Version: 0.27.1
4
4
  Summary: Python implementation of the Links Notation parser
5
5
  Author-email: "Link.Foundation" <drakonard@gmail.com>
6
6
  License-Expression: Unlicense
@@ -11,14 +11,14 @@ Keywords: lino,parser,links,notation,protocol
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
14
  Classifier: Programming Language :: Python :: 3.11
17
15
  Classifier: Programming Language :: Python :: 3.12
18
16
  Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Programming Language :: Python :: 3.15
19
19
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
20
  Classifier: Topic :: Text Processing
21
- Requires-Python: >=3.9
21
+ Requires-Python: >=3.11
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
  Provides-Extra: test
@@ -29,11 +29,7 @@ Requires-Dist: black>=26.10.1; extra == "lint"
29
29
  Requires-Dist: isort>=9.0.2; extra == "lint"
30
30
  Requires-Dist: flake8>=7.4.1; extra == "lint"
31
31
  Provides-Extra: dev
32
- Requires-Dist: pytest>=9.1.1; extra == "dev"
33
- Requires-Dist: pytest-timeout>=2.4.0; extra == "dev"
34
- Requires-Dist: black>=26.10.1; extra == "dev"
35
- Requires-Dist: isort>=9.0.2; extra == "dev"
36
- Requires-Dist: flake8>=7.4.1; extra == "dev"
32
+ Requires-Dist: links-notation[lint,test]; extra == "dev"
37
33
  Dynamic: license-file
38
34
 
39
35
  # Links Notation Parser for Python
@@ -41,4 +41,5 @@ tests/test_nesting_limit.py
41
41
  tests/test_reference_fidelity.py
42
42
  tests/test_shared_text_parity.py
43
43
  tests/test_single_line_parser.py
44
- tests/test_stream_parser.py
44
+ tests/test_stream_parser.py
45
+ tests/test_version.py
@@ -1,10 +1,6 @@
1
1
 
2
2
  [dev]
3
- pytest>=9.1.1
4
- pytest-timeout>=2.4.0
5
- black>=26.10.1
6
- isort>=9.0.2
7
- flake8>=7.4.1
3
+ links-notation[lint,test]
8
4
 
9
5
  [lint]
10
6
  black>=26.10.1
@@ -1,13 +1,10 @@
1
1
  [build-system]
2
- requires = [
3
- "setuptools>=84.0.0; python_version >= '3.10'",
4
- "setuptools>=82.0.1; python_version < '3.10'",
5
- ]
2
+ requires = ["setuptools>=84.0.0"]
6
3
  build-backend = "setuptools.build_meta"
7
4
 
8
5
  [project]
9
6
  name = "links-notation"
10
- version = "0.26.0"
7
+ version = "0.27.1"
11
8
  description = "Python implementation of the Links Notation parser"
12
9
  readme = "README.md"
13
10
  license = "Unlicense"
@@ -20,21 +17,21 @@ classifiers = [
20
17
  "Development Status :: 4 - Beta",
21
18
  "Intended Audience :: Developers",
22
19
  "Programming Language :: Python :: 3",
23
- "Programming Language :: Python :: 3.9",
24
- "Programming Language :: Python :: 3.10",
25
20
  "Programming Language :: Python :: 3.11",
26
21
  "Programming Language :: Python :: 3.12",
27
22
  "Programming Language :: Python :: 3.13",
23
+ "Programming Language :: Python :: 3.14",
24
+ "Programming Language :: Python :: 3.15",
28
25
  "Topic :: Software Development :: Libraries :: Python Modules",
29
26
  "Topic :: Text Processing",
30
27
  ]
31
- requires-python = ">=3.9"
28
+ requires-python = ">=3.11"
32
29
  dependencies = []
33
30
 
34
31
  [project.optional-dependencies]
35
32
  test = ["pytest>=9.1.1", "pytest-timeout>=2.4.0"]
36
33
  lint = ["black>=26.10.1", "isort>=9.0.2", "flake8>=7.4.1"]
37
- dev = ["pytest>=9.1.1", "pytest-timeout>=2.4.0", "black>=26.10.1", "isort>=9.0.2", "flake8>=7.4.1"]
34
+ dev = ["links-notation[test,lint]"]
38
35
 
39
36
  [project.urls]
40
37
  Homepage = "https://github.com/link-foundation/links-notation"
@@ -54,12 +51,8 @@ timeout_func_only = true
54
51
 
55
52
  [tool.black]
56
53
  line-length = 120
57
- target-version = ["py39", "py310", "py311", "py312", "py313"]
54
+ target-version = ["py311", "py312", "py313", "py314", "py315"]
58
55
 
59
56
  [tool.isort]
60
57
  profile = "black"
61
58
  line_length = 120
62
-
63
- [tool.flake8]
64
- max-line-length = 120
65
- extend-ignore = ["E203", "W503"]
@@ -0,0 +1,27 @@
1
+ """The reported version must match pyproject.toml, installed or not."""
2
+
3
+ import tomllib
4
+ from importlib.metadata import PackageNotFoundError
5
+ from pathlib import Path
6
+ from unittest.mock import patch
7
+
8
+ import links_notation
9
+
10
+ PYPROJECT = Path(__file__).resolve().parent.parent / "pyproject.toml"
11
+
12
+
13
+ def declared_version():
14
+ with PYPROJECT.open("rb") as file:
15
+ return tomllib.load(file)["project"]["version"]
16
+
17
+
18
+ def test_version_matches_pyproject():
19
+ assert links_notation.__version__ == declared_version()
20
+
21
+
22
+ def test_uninstalled_checkout_reads_pyproject():
23
+ def missing(name):
24
+ raise PackageNotFoundError(name)
25
+
26
+ with patch("links_notation._distribution_version", side_effect=missing):
27
+ assert links_notation._read_version() == declared_version()
File without changes