Skip to content

Commit 1d2f4b2

Browse files
authored
Merge pull request #132 from kddubey/union-code-coverage
Union code coverage
2 parents 8147f75 + b975ebf commit 1d2f4b2

File tree

4 files changed

+47
-43
lines changed

4 files changed

+47
-43
lines changed

.github/workflows/code-coverage.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ jobs:
3535
git config --global user.email "[email protected]"
3636
git config --global user.name "Your Name"
3737
python -m pip install --upgrade pip
38-
python -m pip install flake8 pytest
39-
python -m pip install -e .
38+
python -m pip install -e ".[dev-no-pydantic]"
4039
- name: Lint with flake8
4140
run: |
4241
# stop the build if there are Python syntax errors or undefined names
@@ -45,12 +44,18 @@ jobs:
4544
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
4645
- name: Test without pydantic
4746
run: |
48-
pytest
47+
pytest --cov=tap
4948
- name: Test with pydantic v1
5049
run: |
5150
python -m pip install "pydantic < 2"
52-
pytest
51+
pytest --cov=tap --cov-append
5352
- name: Test with pydantic v2
5453
run: |
5554
python -m pip install "pydantic >= 2"
56-
pytest
55+
pytest --cov=tap --cov-append
56+
57+
- name: Upload coverage reports to Codecov
58+
uses: codecov/codecov-action@v4
59+
with:
60+
token: ${{ secrets.CODECOV_TOKEN }}
61+
verbose: true

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,42 @@ Running `python square.py --num 2` will print `The square of your number is 4.0.
4242
Tap requires Python 3.8+
4343

4444
To install Tap from PyPI run:
45+
4546
```
4647
pip install typed-argument-parser
4748
```
4849

49-
To install Tap from source, run the following commands:
50+
<details>
51+
<summary>To install Tap from source, run the following commands:</summary>
5052

5153
```
5254
git clone https://github.com/swansonk14/typed-argument-parser.git
5355
cd typed-argument-parser
5456
pip install -e .
5557
```
5658

59+
</details>
60+
61+
<details>
62+
<summary>To develop this package, install development requirements (in a virtual environment):</summary>
63+
64+
```
65+
python -m pip install -e ".[dev]"
66+
```
67+
68+
Style:
69+
- Please use [`black`](https://github.com/psf/black) formatting
70+
- Set your vertical line ruler to 121
71+
- Use [`flake8`](https://github.com/PyCQA/flake8) linting.
72+
73+
To run tests, run:
74+
75+
```
76+
pytest
77+
```
78+
79+
</details>
80+
5781
## Table of Contents
5882

5983
* [Installation](#installation)
@@ -81,6 +105,10 @@ pip install -e .
81105
+ [tapify help](#tapify-help)
82106
+ [Command line vs explicit arguments](#command-line-vs-explicit-arguments)
83107
+ [Known args](#known-args)
108+
* [Convert to a `Tap` class](#convert-to-a-tap-class)
109+
+ [`to_tap_class` examples](#to_tap_class-examples)
110+
- [Simple](#simple)
111+
- [Complex](#complex)
84112

85113
## Tap is Python-native
86114

@@ -851,7 +879,7 @@ special argument behavior. For example, you can override [`configure`](#configur
851879
If the object can be `tapify`d, then it can be `to_tap_class`d, and vice-versa. `to_tap_class` provides full control
852880
over argument parsing.
853881

854-
### Examples
882+
### `to_tap_class` examples
855883

856884
#### Simple
857885

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
long_description = f.read()
1414

1515
test_requirements = [
16-
"pydantic >= 2.5.0",
1716
"pytest",
17+
"pytest-cov",
18+
"flake8",
1819
]
20+
test_requirements_with_pydantic_v2 = test_requirements + ["pydantic >= 2.5.0"]
1921

2022
setup(
2123
name="typed-argument-parser",
@@ -32,7 +34,10 @@
3234
package_data={"tap": ["py.typed"]},
3335
install_requires=["typing-inspect >= 0.7.1", "docstring-parser >= 0.15"],
3436
tests_require=test_requirements,
35-
extras_require={"dev": test_requirements},
37+
extras_require={
38+
"dev-no-pydantic": test_requirements,
39+
"dev": test_requirements_with_pydantic_v2,
40+
},
3641
python_requires=">=3.8",
3742
classifiers=[
3843
"Programming Language :: Python :: 3",

0 commit comments

Comments
 (0)