Skip to content

Commit ef93c85

Browse files
authored
Maintenance (#61)
1 parent 9267564 commit ef93c85

File tree

4 files changed

+44
-17
lines changed

4 files changed

+44
-17
lines changed

CHANGELOG.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Generic-Parser Changelog
22

3+
## Version 1.1.2
4+
* Dropped support for `Python 3.9`.
5+
36
## Version 1.1.1
47
* add a dictionary to the eval in DictFromString to allow reading in *.ini with nans
5-
8+
69

710
## Version 1.0.8
811
* revamp of the documentation
@@ -11,7 +14,7 @@
1114

1215
## Version 1.0.7
1316
* fixed crash before proper error message for invalid choice of non-string
14-
objects.
17+
objects.
1518
* fixed: Paths can be handled by `save_options_to_config` (converted to strings)
1619
* fixed: Quotes around Paths are stripped from config files on reading
1720
* fixes: Strings with linebreaks are now written properly with `save_options_to_config`
@@ -20,7 +23,7 @@
2023
* improved `create_parameter_help` function.
2124
* some documentation fixed/additions.
2225
* switched to github actions for CI.
23-
26+
2427

2528
## Version 1.0.6
2629
* Fix KeyError for unknown flags
@@ -36,7 +39,7 @@
3639
* pep8 errors and warnings
3740
* typo in logging
3841
* Enhancement:
39-
* Flags default to name if not set
42+
* Flags default to name if not set
4043

4144
## Version 1.0.2
4245
- Fixed:

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Generic Parser
2-
[![Cron Testing](https://github.com/pylhc/generic_parser/workflows/Cron%20Testing/badge.svg)](https://github.com/pylhc/generic_parser/actions?query=workflow%3A%22Cron+Testing%22)
3-
[![Code Climate coverage](https://img.shields.io/codeclimate/coverage/pylhc/generic_parser.svg?style=popout)](https://codeclimate.com/github/pylhc/generic_parser)
4-
[![Code Climate maintainability (percentage)](https://img.shields.io/codeclimate/maintainability-percentage/pylhc/generic_parser.svg?style=popout)](https://codeclimate.com/github/pylhc/generic_parser)
5-
<!-- [![GitHub last commit](https://img.shields.io/github/last-commit/pylhc/generic_parser.svg?style=popout)](https://github.com/pylhc/generic_parser/) -->
2+
3+
[![Tests](https://github.com/pylhc/generic_parser/actions/workflows/coverage.yml/badge.svg?branch=master)](https://github.com/pylhc/generic_parser/actions/workflows/coverage.yml)
4+
[![GitHub last commit](https://img.shields.io/github/last-commit/pylhc/generic_parser.svg?style=popout)](https://github.com/pylhc/generic_parser/)
65
[![PyPI Version](https://img.shields.io/pypi/v/generic_parser?label=PyPI&logo=pypi)](https://pypi.org/project/generic_parser/)
76
[![GitHub release](https://img.shields.io/github/v/release/pylhc/generic_parser?logo=github)](https://github.com/pylhc/generic_parser/)
87
[![Conda-forge Version](https://img.shields.io/conda/vn/conda-forge/generic_parser?color=orange&logo=anaconda)](https://anaconda.org/conda-forge/generic_parser)
@@ -16,18 +15,21 @@ See the [API documentation](https://pylhc.github.io/generic_parser/) for details
1615
## Installing
1716

1817
Installation is easily done via `pip`. The package is then used as `generic_parser`.
18+
1919
```bash
2020
python -m pip install generic-parser
2121
```
2222

2323
One can also install in a `conda` environment via the `conda-forge` channel with:
24+
2425
```bash
2526
conda install -c conda-forge generic_parser
2627
```
2728

28-
## Example Usage:
29+
## Example
2930

3031
Content of `myscript.py`
32+
3133
```python
3234
from generic_parser import entrypoint, EntryPointParameters
3335

@@ -64,7 +66,8 @@ if __name__ == '__main__':
6466
### Commandline
6567

6668
Calling that script with ``python myscript.py -f 1 -s "test"`` will result in:
67-
```
69+
70+
```bash
6871
True
6972
False
7073
```
@@ -74,14 +77,16 @@ It is assumed, that this is the standard mode of operation for your functions.
7477
#### Config File
7578

7679
Further, one can also use a config file `config.ini` containing:
77-
```
80+
81+
```ini
7882
[Section]
7983
first = 2
8084
second = "Hello"
8185
```
8286

8387
and run the script with `python myscript.py --entry_cfg config.ini` leading to
84-
```
88+
89+
```bash
8590
False
8691
False
8792
```
@@ -91,13 +96,15 @@ Especially the declaration of a `[DEFAULT]` section can be helpful.
9196
For further information about config files, check the python [Config Parser](https://docs.python.org/3/library/configparser.html).
9297

9398
### Python
99+
94100
Or call the function directly from python code:
101+
95102
```python
96103
if __name__ == '__main__':
97104
main(first=1, second="World")
98105
```
99106

100-
```
107+
```python
101108
True
102109
False
103110
```
@@ -111,4 +118,4 @@ which is not used in the `Entrypoint`, but can be handy in other use-cases.
111118

112119
## License
113120

114-
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
121+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

generic_parser/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
__title__ = "generic_parser"
66
__description__ = "A parser for arguments and config-files that also allows direct python input."
77
__url__ = "https://github.com/pylhc/generic_parser"
8-
__version__ = "1.1.1"
8+
__version__ = "1.1.2"
99
__author__ = "pylhc"
1010
__author_email__ = "[email protected]"
1111
__license__ = "MIT"

pyproject.toml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,18 @@ authors = [
2424
]
2525
license = "MIT"
2626
dynamic = ["version"]
27-
requires-python = ">=3.9"
27+
requires-python = ">=3.10"
2828

2929
classifiers = [
3030
"License :: OSI Approved :: MIT License",
3131
"Natural Language :: English",
3232
"Operating System :: OS Independent",
3333
"Programming Language :: Python :: 3 :: Only",
34-
"Programming Language :: Python :: 3.9",
3534
"Programming Language :: Python :: 3.10",
3635
"Programming Language :: Python :: 3.11",
3736
"Programming Language :: Python :: 3.12",
37+
"Programming Language :: Python :: 3.13",
38+
"Programming Language :: Python :: 3.14",
3839
"Programming Language :: Python :: Implementation :: CPython",
3940
"Topic :: Software Development :: Libraries :: Python Modules",
4041
"Typing :: Typed",
@@ -63,6 +64,22 @@ repository = "https://github.com/pylhc/generic_parser"
6364
documentation = "https://pylhc.github.io/generic_parser/"
6465
changelog = "https://github.com/pylhc/generic_parser/blob/master/CHANGELOG.md"
6566

67+
# ----- Testing ----- #
68+
69+
[tool.pytest.ini_options]
70+
addopts = [
71+
"--import-mode=importlib",
72+
]
73+
74+
[tool.coverage.run]
75+
relative_files = true
76+
77+
[tool.coverage.report]
78+
exclude_also = [
79+
"if TYPE_CHECKING:", # do not count if TYPE_CHECKING block imports (ignored at runtime) for coverage
80+
"except ImportError:", # do not count missing optional dependencies set to None, we monkeypatch and test that
81+
]
82+
6683
# ----- Dev Tools Configuration ----- #
6784

6885
[tool.ruff]

0 commit comments

Comments
 (0)