vcorelib 3.2.2__tar.gz → 3.2.4__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 (89) hide show
  1. {vcorelib-3.2.2/vcorelib.egg-info → vcorelib-3.2.4}/PKG-INFO +6 -6
  2. {vcorelib-3.2.2 → vcorelib-3.2.4}/README.md +2 -2
  3. {vcorelib-3.2.2 → vcorelib-3.2.4}/pyproject.toml +1 -1
  4. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/__init__.py +2 -2
  5. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/asyncio/__init__.py +12 -4
  6. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/file_writer.py +9 -6
  7. {vcorelib-3.2.2 → vcorelib-3.2.4/vcorelib.egg-info}/PKG-INFO +6 -6
  8. {vcorelib-3.2.2 → vcorelib-3.2.4}/LICENSE +0 -0
  9. {vcorelib-3.2.2 → vcorelib-3.2.4}/setup.cfg +0 -0
  10. {vcorelib-3.2.2 → vcorelib-3.2.4}/setup.py +0 -0
  11. {vcorelib-3.2.2 → vcorelib-3.2.4}/tests/test_names.py +0 -0
  12. {vcorelib-3.2.2 → vcorelib-3.2.4}/tests/test_python.py +0 -0
  13. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/args/__init__.py +0 -0
  14. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/args/newline.py +0 -0
  15. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/asyncio/cli.py +0 -0
  16. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/asyncio/subprocess.py +0 -0
  17. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/dev_requirements.txt +0 -0
  18. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/dict/__init__.py +0 -0
  19. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/dict/cache.py +0 -0
  20. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/dict/codec.py +0 -0
  21. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/dict/config.py +0 -0
  22. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/dict/env.py +0 -0
  23. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/graph/__init__.py +0 -0
  24. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/graph/abc.py +0 -0
  25. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/graph/edge.py +0 -0
  26. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/graph/node.py +0 -0
  27. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/graph/port.py +0 -0
  28. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/__init__.py +0 -0
  29. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/abc.py +0 -0
  30. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/arbiter/__init__.py +0 -0
  31. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/arbiter/base.py +0 -0
  32. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/arbiter/context.py +0 -0
  33. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/arbiter/directory.py +0 -0
  34. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/archive/__init__.py +0 -0
  35. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/cache.py +0 -0
  36. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/decode.py +0 -0
  37. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/encode.py +0 -0
  38. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/fifo.py +0 -0
  39. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/mapping.py +0 -0
  40. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/types.py +0 -0
  41. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/logging/__init__.py +0 -0
  42. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/logging/args.py +0 -0
  43. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/logging/time.py +0 -0
  44. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/__init__.py +0 -0
  45. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/analysis/__init__.py +0 -0
  46. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/analysis/average.py +0 -0
  47. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/analysis/buffer.py +0 -0
  48. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/analysis/rate/__init__.py +0 -0
  49. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/analysis/rate/limiter.py +0 -0
  50. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/analysis/weighted.py +0 -0
  51. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/constants.py +0 -0
  52. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/time.py +0 -0
  53. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/unit.py +0 -0
  54. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/names.py +0 -0
  55. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/namespace/__init__.py +0 -0
  56. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/namespace/base.py +0 -0
  57. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/namespace/mixin.py +0 -0
  58. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/paths/__init__.py +0 -0
  59. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/paths/base.py +0 -0
  60. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/paths/context.py +0 -0
  61. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/paths/find.py +0 -0
  62. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/paths/hashing.py +0 -0
  63. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/paths/info.py +0 -0
  64. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/paths/info_cache.py +0 -0
  65. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/platform/__init__.py +0 -0
  66. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/py.typed +0 -0
  67. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/python.py +0 -0
  68. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/requirements.txt +0 -0
  69. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/schemas/__init__.py +0 -0
  70. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/schemas/base.py +0 -0
  71. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/schemas/json.py +0 -0
  72. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/schemas/mixins.py +0 -0
  73. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/script/__init__.py +0 -0
  74. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/target/__init__.py +0 -0
  75. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/target/evaluation.py +0 -0
  76. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/target/expression.py +0 -0
  77. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/target/resolver.py +0 -0
  78. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/__init__.py +0 -0
  79. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/dict/__init__.py +0 -0
  80. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/dict/melder.py +0 -0
  81. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/manager.py +0 -0
  82. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/subprocess/__init__.py +0 -0
  83. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/subprocess/run.py +0 -0
  84. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/time/__init__.py +0 -0
  85. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/time/sleep.py +0 -0
  86. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib.egg-info/SOURCES.txt +0 -0
  87. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib.egg-info/dependency_links.txt +0 -0
  88. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib.egg-info/requires.txt +3 -3
  89. {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vcorelib
3
- Version: 3.2.2
3
+ Version: 3.2.4
4
4
  Summary: A collection of core Python utilities.
5
5
  Home-page: https://github.com/vkottler/vcorelib
6
6
  Author: Vaughn Kottler
@@ -17,11 +17,11 @@ Classifier: License :: OSI Approved :: MIT License
17
17
  Requires-Python: >=3.11
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
- Requires-Dist: ruamel.yaml
21
- Requires-Dist: tomli-w
20
+ Requires-Dist: tomli
22
21
  Requires-Dist: cerberus
23
22
  Requires-Dist: fastjsonschema
24
- Requires-Dist: tomli
23
+ Requires-Dist: ruamel.yaml
24
+ Requires-Dist: tomli-w
25
25
  Requires-Dist: importlib-resources
26
26
  Provides-Extra: test
27
27
  Requires-Dist: pylint; extra == "test"
@@ -44,11 +44,11 @@ Requires-Dist: uvloop; (sys_platform != "win32" and sys_platform != "cygwin") an
44
44
  =====================================
45
45
  generator=datazen
46
46
  version=3.1.4
47
- hash=a2a4ea5abcd1abefc7a1528728ba2500
47
+ hash=bc0b27e02d365bc98f792016fb5c40a1
48
48
  =====================================
49
49
  -->
50
50
 
51
- # vcorelib ([3.2.2](https://pypi.org/project/vcorelib/))
51
+ # vcorelib ([3.2.4](https://pypi.org/project/vcorelib/))
52
52
 
53
53
  [![python](https://img.shields.io/pypi/pyversions/vcorelib.svg)](https://pypi.org/project/vcorelib/)
54
54
  ![Build Status](https://github.com/vkottler/vcorelib/workflows/Python%20Package/badge.svg)
@@ -2,11 +2,11 @@
2
2
  =====================================
3
3
  generator=datazen
4
4
  version=3.1.4
5
- hash=a2a4ea5abcd1abefc7a1528728ba2500
5
+ hash=bc0b27e02d365bc98f792016fb5c40a1
6
6
  =====================================
7
7
  -->
8
8
 
9
- # vcorelib ([3.2.2](https://pypi.org/project/vcorelib/))
9
+ # vcorelib ([3.2.4](https://pypi.org/project/vcorelib/))
10
10
 
11
11
  [![python](https://img.shields.io/pypi/pyversions/vcorelib.svg)](https://pypi.org/project/vcorelib/)
12
12
  ![Build Status](https://github.com/vkottler/vcorelib/workflows/Python%20Package/badge.svg)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__"
4
4
 
5
5
  [project]
6
6
  name = "vcorelib"
7
- version = "3.2.2"
7
+ version = "3.2.4"
8
8
  description = "A collection of core Python utilities."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -1,7 +1,7 @@
1
1
  # =====================================
2
2
  # generator=datazen
3
3
  # version=3.1.4
4
- # hash=a57b01f6e0ce3490014765c9a7325320
4
+ # hash=72f33cb7eb34d1a8b0e94f5741c13762
5
5
  # =====================================
6
6
 
7
7
  """
@@ -10,7 +10,7 @@ Useful defaults and other package metadata.
10
10
 
11
11
  DESCRIPTION = "A collection of core Python utilities."
12
12
  PKG_NAME = "vcorelib"
13
- VERSION = "3.2.2"
13
+ VERSION = "3.2.4"
14
14
 
15
15
  # vcorelib-specific content.
16
16
  DEFAULT_INDENT = 2
@@ -58,6 +58,15 @@ def log_exceptions(
58
58
  return [x for x in tasks if not x.done()]
59
59
 
60
60
 
61
+ def new_eloop(set_current: bool = True) -> _asyncio.AbstractEventLoop:
62
+ """Get a new event loop."""
63
+
64
+ eloop = _asyncio.new_event_loop()
65
+ if set_current:
66
+ _asyncio.set_event_loop(eloop)
67
+ return eloop
68
+
69
+
61
70
  def normalize_eloop(
62
71
  eloop: _asyncio.AbstractEventLoop = None,
63
72
  ) -> _asyncio.AbstractEventLoop:
@@ -67,8 +76,7 @@ def normalize_eloop(
67
76
  try:
68
77
  eloop = _asyncio.get_running_loop()
69
78
  except RuntimeError:
70
- eloop = _asyncio.new_event_loop()
71
- _asyncio.set_event_loop(eloop)
79
+ eloop = new_eloop()
72
80
  return eloop
73
81
 
74
82
 
@@ -93,10 +101,10 @@ def shutdown_loop(
93
101
 
94
102
 
95
103
  def run_handle_interrupt(
96
- to_run: _Awaitable[_Any],
104
+ to_run: _Awaitable[T],
97
105
  eloop: _asyncio.AbstractEventLoop = None,
98
106
  enable_uvloop: bool = True,
99
- ) -> _Optional[_Any]:
107
+ ) -> _Optional[T]:
100
108
  """
101
109
  Run a task in an event loop and gracefully handle keyboard interrupts.
102
110
 
@@ -6,7 +6,7 @@ A module implementing an interface for writing to variably indented files.
6
6
  from contextlib import contextmanager
7
7
  from enum import Enum, auto
8
8
  from io import StringIO
9
- from os import linesep
9
+ import os
10
10
  from pathlib import Path
11
11
  from typing import Iterator, List, Optional, TextIO, Tuple
12
12
 
@@ -49,6 +49,7 @@ class IndentedFileWriter:
49
49
  per_indent: int = 1,
50
50
  prefix: str = "",
51
51
  suffix: str = "",
52
+ linesep: str = os.linesep,
52
53
  ) -> None:
53
54
  """Initialize this instance."""
54
55
 
@@ -61,6 +62,8 @@ class IndentedFileWriter:
61
62
  self._prefix = prefix
62
63
  self._suffix = suffix
63
64
 
65
+ self.linesep = linesep
66
+
64
67
  @contextmanager
65
68
  def prefix(self, prefix: str) -> Iterator[None]:
66
69
  """Set a new line prefix as a managed context."""
@@ -93,13 +96,13 @@ class IndentedFileWriter:
93
96
  @staticmethod
94
97
  @contextmanager
95
98
  def from_path(
96
- path: Path, space: str = " ", per_indent: int = 1
99
+ path: Path, space: str = " ", per_indent: int = 1, **kwargs
97
100
  ) -> Iterator["IndentedFileWriter"]:
98
101
  """Create an instance from a path as a managed context."""
99
102
 
100
103
  with path.open("w", encoding=DEFAULT_ENCODING) as stream:
101
104
  yield IndentedFileWriter(
102
- stream, space=space, per_indent=per_indent
105
+ stream, space=space, per_indent=per_indent, **kwargs
103
106
  )
104
107
 
105
108
  @staticmethod
@@ -117,13 +120,13 @@ class IndentedFileWriter:
117
120
  @staticmethod
118
121
  @contextmanager
119
122
  def temporary(
120
- space: str = " ", per_indent: int = 1
123
+ space: str = " ", per_indent: int = 1, **kwargs
121
124
  ) -> Iterator["IndentedFileWriter"]:
122
125
  """Create an instance from a temporary file as a managed context."""
123
126
 
124
127
  with tempfile() as tmp:
125
128
  with IndentedFileWriter.from_path(
126
- tmp, space=space, per_indent=per_indent
129
+ tmp, space=space, per_indent=per_indent, **kwargs
127
130
  ) as writer:
128
131
  yield writer
129
132
 
@@ -144,7 +147,7 @@ class IndentedFileWriter:
144
147
  self.space * self.depth * self.per_indent if line_data else ""
145
148
  )
146
149
 
147
- line = (indent + line_data).rstrip() + linesep
150
+ line = (indent + line_data).rstrip() + self.linesep
148
151
 
149
152
  self.stream.write(line)
150
153
  count += len(line)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vcorelib
3
- Version: 3.2.2
3
+ Version: 3.2.4
4
4
  Summary: A collection of core Python utilities.
5
5
  Home-page: https://github.com/vkottler/vcorelib
6
6
  Author: Vaughn Kottler
@@ -17,11 +17,11 @@ Classifier: License :: OSI Approved :: MIT License
17
17
  Requires-Python: >=3.11
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
- Requires-Dist: ruamel.yaml
21
- Requires-Dist: tomli-w
20
+ Requires-Dist: tomli
22
21
  Requires-Dist: cerberus
23
22
  Requires-Dist: fastjsonschema
24
- Requires-Dist: tomli
23
+ Requires-Dist: ruamel.yaml
24
+ Requires-Dist: tomli-w
25
25
  Requires-Dist: importlib-resources
26
26
  Provides-Extra: test
27
27
  Requires-Dist: pylint; extra == "test"
@@ -44,11 +44,11 @@ Requires-Dist: uvloop; (sys_platform != "win32" and sys_platform != "cygwin") an
44
44
  =====================================
45
45
  generator=datazen
46
46
  version=3.1.4
47
- hash=a2a4ea5abcd1abefc7a1528728ba2500
47
+ hash=bc0b27e02d365bc98f792016fb5c40a1
48
48
  =====================================
49
49
  -->
50
50
 
51
- # vcorelib ([3.2.2](https://pypi.org/project/vcorelib/))
51
+ # vcorelib ([3.2.4](https://pypi.org/project/vcorelib/))
52
52
 
53
53
  [![python](https://img.shields.io/pypi/pyversions/vcorelib.svg)](https://pypi.org/project/vcorelib/)
54
54
  ![Build Status](https://github.com/vkottler/vcorelib/workflows/Python%20Package/badge.svg)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,8 +1,8 @@
1
- ruamel.yaml
2
- tomli-w
1
+ tomli
3
2
  cerberus
4
3
  fastjsonschema
5
- tomli
4
+ ruamel.yaml
5
+ tomli-w
6
6
  importlib-resources
7
7
 
8
8
  [test]