preparse 1.0.12__tar.gz → 1.0.13.post0__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 (44) hide show
  1. {preparse-1.0.12 → preparse-1.0.13.post0}/LICENSE.txt +1 -1
  2. preparse-1.0.13.post0/MANIFEST.in +1 -0
  3. preparse-1.0.13.post0/PKG-INFO +36 -0
  4. {preparse-1.0.12 → preparse-1.0.13.post0}/README.rst +1 -1
  5. {preparse-1.0.12 → preparse-1.0.13.post0}/docs/v1.0.rst +31 -31
  6. {preparse-1.0.12 → preparse-1.0.13.post0}/pyproject.toml +13 -6
  7. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/_processing/parsing.py +2 -5
  8. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/tests/data.toml +282607 -282607
  9. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/tests/test_data_toml.py +5 -1
  10. preparse-1.0.13.post0/src/preparse.egg-info/PKG-INFO +36 -0
  11. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse.egg-info/SOURCES.txt +0 -1
  12. preparse-1.0.12/MANIFEST.in +0 -1
  13. preparse-1.0.12/PKG-INFO +0 -57
  14. preparse-1.0.12/src/preparse.egg-info/PKG-INFO +0 -57
  15. {preparse-1.0.12 → preparse-1.0.13.post0}/setup.cfg +0 -0
  16. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/__init__.py +0 -0
  17. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/_items/Bundle.py +0 -0
  18. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/_items/Item.py +0 -0
  19. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/_items/Long.py +0 -0
  20. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/_items/Option.py +0 -0
  21. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/_items/Positional.py +0 -0
  22. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/_items/Special.py +0 -0
  23. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/_items/__init__.py +0 -0
  24. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/_processing/__init__.py +0 -0
  25. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/_processing/deparsing.py +0 -0
  26. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/_processing/digesting.py +0 -0
  27. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/_processing/pulling.py +0 -0
  28. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/_utils/__init__.py +0 -0
  29. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/_utils/dataprop.py +0 -0
  30. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/core/Click.py +0 -0
  31. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/core/Optdict.py +0 -0
  32. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/core/PreParser.py +0 -0
  33. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/core/__init__.py +0 -0
  34. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/core/enums.py +0 -0
  35. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/core/warnings.py +0 -0
  36. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/tests/__init__.py +0 -0
  37. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/tests/expit.toml +28 -28
  38. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/tests/test_enums.py +0 -0
  39. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/tests/test_expit_toml.py +0 -0
  40. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/tests/test_optdict.py +0 -0
  41. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse/tests/test_preparser.py +0 -0
  42. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse.egg-info/dependency_links.txt +0 -0
  43. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse.egg-info/requires.txt +0 -0
  44. {preparse-1.0.12 → preparse-1.0.13.post0}/src/preparse.egg-info/top_level.txt +0 -0
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ include src/preparse/tests/*.toml
@@ -0,0 +1,36 @@
1
+ Metadata-Version: 2.4
2
+ Name: preparse
3
+ Version: 1.0.13.post0
4
+ Summary: This project preparses args for further parsing later on.
5
+ Author-email: Johannes <johannes.programming@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Download, https://pypi.org/project/preparse/#files
8
+ Project-URL: Index, https://pypi.org/project/preparse/
9
+ Project-URL: Source, https://github.com/johannes-programming/preparse/
10
+ Project-URL: Website, https://preparse.johannes-programming.online/
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Natural Language :: English
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Typing :: Typed
18
+ Requires-Python: >=3.11
19
+ Description-Content-Type: text/x-rst
20
+ License-File: LICENSE.txt
21
+ Requires-Dist: click<9,>=8.2
22
+ Requires-Dist: cmp3<2,>=1.0
23
+ Requires-Dist: copyable<2,>=1.0
24
+ Requires-Dist: datahold<4,>=3.0
25
+ Requires-Dist: datarepr<2,>=1.1
26
+ Requires-Dist: frozendict<3,>=2.4.7
27
+ Requires-Dist: overloadable<2,>=1.1
28
+ Requires-Dist: setdoc<2,>=1.2.10
29
+ Requires-Dist: tofunc<2,>=1.0
30
+ Dynamic: license-file
31
+
32
+ ========
33
+ preparse
34
+ ========
35
+
36
+ Visit the website `https://preparse.johannes-programming.online/ <https://preparse.johannes-programming.online/>`_ for more information.
@@ -2,4 +2,4 @@
2
2
  preparse
3
3
  ========
4
4
 
5
- Visit the website `https://preparse.johannes-programming.online/ <https://preparse.johannes-programming.online/>`_ for more information.
5
+ Visit the website `https://preparse.johannes-programming.online/ <https://preparse.johannes-programming.online/>`_ for more information.
@@ -1,17 +1,9 @@
1
1
  Overview
2
2
  --------
3
3
 
4
- The preparse project allows to preparse arguments before the main parsing.
4
+ The preparse project allows to preparse arguments before the main parsing.
5
5
  Its ability to deabbreviate options is especially useful for use with ``click``.
6
6
 
7
- Links
8
- -----
9
-
10
- - Download: https://pypi.org/project/preparse/#files
11
- - Index: https://pypi.org/project/preparse/
12
- - Source: https://github.com/johannes-programming/preparse/
13
- - Website: https://preparse.johannes-programming.online/
14
-
15
7
  Installation
16
8
  ------------
17
9
 
@@ -112,43 +104,43 @@ This boolean property determines whether the order of arguments to conform to th
112
104
  ``optdict: preparse.Optdict``
113
105
  """""""""""""""""""""""""""""
114
106
 
115
- This property holds a dict-like object.
116
- Its keys are the options.
117
- Its values specify ``preparse.Nargs``.
118
- Options not found within the dictionary
119
- cause a ``preparse.PreparseInvalidOptionWarning``
107
+ This property holds a dict-like object.
108
+ Its keys are the options.
109
+ Its values specify ``preparse.Nargs``.
110
+ Options not found within the dictionary
111
+ cause a ``preparse.PreparseInvalidOptionWarning``
120
112
  and are then assumed to have no arguments.
121
113
 
122
114
  ``parse_args(args: Optional[Iterable] = None) -> list[str]``
123
115
  """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
124
116
 
125
- This method is at the core of the class.
126
- It returns a preparsed list of arguments.
127
- If ``None`` is passed as args then ``sys.argv[1:]`` is used.
117
+ This method is at the core of the class.
118
+ It returns a preparsed list of arguments.
119
+ If ``None`` is passed as args then ``sys.argv[1:]`` is used.
128
120
  If the method is applied repeatedly to a list there will be no changes after the first run.
129
121
 
130
122
  ``prog: str``
131
123
  """""""""""""
132
124
 
133
- This ``str`` property represents the name of the program.
125
+ This ``str`` property represents the name of the program.
134
126
  If the value passed to the property is ``None`` then ``str(sys.argv[0])`` is saved.
135
127
 
136
128
  ``reconcilesorders: bool``
137
129
  """"""""""""""""""""""""""
138
130
 
139
- This boolean property determines whether compatibility with both orders,
131
+ This boolean property determines whether compatibility with both orders,
140
132
  POSIX and the interleaving of options with positonal arguments, should be enforced.
141
133
 
142
134
  ``reflectClickCommand(cmd: click.Command) -> None``
143
135
  """""""""""""""""""""""""""""""""""""""""""""""""""
144
136
 
145
- This method alters the current instance to reflect a ``click.Command`` object.
137
+ This method alters the current instance to reflect a ``click.Command`` object.
146
138
  Concretely the optdict property is changed.
147
139
 
148
140
  ``reflectClickContext(ctx: click.Context) -> None``
149
141
  """""""""""""""""""""""""""""""""""""""""""""""""""
150
142
 
151
- This method alters the current instance to reflect a ``click.Context`` object.
143
+ This method alters the current instance to reflect a ``click.Context`` object.
152
144
  Concretely the prog property is changed.
153
145
 
154
146
  ``special: preparse.Tuning``
@@ -164,10 +156,10 @@ This method a dict representing the current instance.
164
156
  ``warn: types.FunctionType``
165
157
  """"""""""""""""""""""""""""
166
158
 
167
- This property holds a function that is called whenever ``parse_args`` encounters a warning.
168
- The warning is given as the only positional arguments.
169
- No keyword arguments are given.
170
- Its return value is discarded.
159
+ This property holds a function that is called whenever ``parse_args`` encounters a warning.
160
+ The warning is given as the only positional arguments.
161
+ No keyword arguments are given.
162
+ Its return value is discarded.
171
163
  Therefore, ``str`` is used to discard the warnings.
172
164
 
173
165
  The Click class
@@ -215,7 +207,7 @@ It is designed for ``preparse.PreParser.optdict``.
215
207
  The Enums
216
208
  ~~~~~~~~~
217
209
 
218
- These classes are subclasses of ``enum.IntEnum``.
210
+ These classes are subclasses of ``enum.IntEnum``.
219
211
  Any value different from ``0`` (meaning no) and ``1`` (meaning yes) is interpreted as ``2`` (meaning intermediate).
220
212
 
221
213
  ``class preparse.Tuning``
@@ -277,21 +269,29 @@ This class warns about unallowed arguments. This can only happen for long option
277
269
  The Tests
278
270
  ~~~~~~~~~
279
271
 
280
- ``preparse.test() -> unittest.TextTestResult``
281
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
272
+ ``preparse.tests.test() -> unittest.TextTestResult``
273
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
282
274
 
283
275
  This project can be tested through its test function.
284
276
 
285
277
  .. code-block:: python
286
278
 
287
- import preparse
288
- preparse.test()
279
+ import preparse.tests
280
+ preparse.tests.test()
289
281
 
290
282
  License
291
283
  -------
292
284
 
293
285
  This project is licensed under the MIT License.
294
286
 
287
+ Links
288
+ -----
289
+
290
+ - Download: https://pypi.org/project/preparse/#files
291
+ - Index: https://pypi.org/project/preparse/
292
+ - Source: https://github.com/johannes-programming/preparse/
293
+ - Website: https://preparse.johannes-programming.online/
294
+
295
295
  Impressum
296
296
  ---------
297
297
 
@@ -300,4 +300,4 @@ Impressum
300
300
  - Name: Johannes
301
301
  - Email: johannes.programming@gmail.com
302
302
  - Homepage: https://www.johannes-programming.online/
303
- - Gravatar: https://www.johannes-programming.fyi/
303
+ - Gravatar: https://www.johannes-programming.fyi/
@@ -1,7 +1,7 @@
1
1
  [build-system]
2
2
  build-backend = "setuptools.build_meta"
3
3
  requires = [
4
- "setuptools>=64.0",
4
+ "setuptools>=77.0",
5
5
  ]
6
6
 
7
7
  [project]
@@ -10,7 +10,6 @@ authors = [
10
10
  ]
11
11
  classifiers = [
12
12
  "Development Status :: 5 - Production/Stable",
13
- "License :: OSI Approved :: MIT License",
14
13
  "Natural Language :: English",
15
14
  "Operating System :: OS Independent",
16
15
  "Programming Language :: Python",
@@ -31,16 +30,24 @@ dependencies = [
31
30
  ]
32
31
  description = "This project preparses args for further parsing later on."
33
32
  keywords = []
33
+ license = "MIT"
34
+ license-files = [
35
+ "LICENSE.txt",
36
+ ]
34
37
  name = "preparse"
35
38
  readme = "README.rst"
36
39
  requires-python = ">=3.11"
37
- version = "1.0.12"
38
-
39
- [project.license]
40
- file = "LICENSE.txt"
40
+ version = "1.0.13.post0"
41
41
 
42
42
  [project.urls]
43
43
  Download = "https://pypi.org/project/preparse/#files"
44
44
  Index = "https://pypi.org/project/preparse/"
45
45
  Source = "https://github.com/johannes-programming/preparse/"
46
46
  Website = "https://preparse.johannes-programming.online/"
47
+
48
+ [tool.mypy]
49
+ files = [
50
+ ".",
51
+ ]
52
+ python_version = "3.11"
53
+ strict = true
@@ -149,11 +149,8 @@ def parse_long(
149
149
  ans.right = parts.pop()
150
150
  ans.abbrlen = len(ans.fullkey)
151
151
  if ans.fullkey in optdict.keys():
152
- ans.nargs = optdict[ans.fullkey]
153
- if (ans.nargs == Nargs.NO_ARGUMENT) and (ans.right is not None):
154
- cause(PUAW, option=ans.fullkey)
155
- return ans
156
- if expectsabbr:
152
+ parts = [ans.fullkey]
153
+ elif expectsabbr:
157
154
  parts = parse_long_startswith(ans.abbr, keys=optdict.keys())
158
155
  else:
159
156
  parts = list() # can be assumed