Skip to content

Commit

Permalink
Merge pull request #132 from kddubey/union-code-coverage
Browse files Browse the repository at this point in the history
Union code coverage
  • Loading branch information
swansonk14 authored Apr 9, 2024
2 parents 8147f75 + b975ebf commit 1d2f4b2
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 43 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/code-coverage.yml

This file was deleted.

15 changes: 10 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install -e .
python -m pip install -e ".[dev-no-pydantic]"
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand All @@ -45,12 +44,18 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test without pydantic
run: |
pytest
pytest --cov=tap
- name: Test with pydantic v1
run: |
python -m pip install "pydantic < 2"
pytest
pytest --cov=tap --cov-append
- name: Test with pydantic v2
run: |
python -m pip install "pydantic >= 2"
pytest
pytest --cov=tap --cov-append
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,42 @@ Running `python square.py --num 2` will print `The square of your number is 4.0.
Tap requires Python 3.8+

To install Tap from PyPI run:

```
pip install typed-argument-parser
```

To install Tap from source, run the following commands:
<details>
<summary>To install Tap from source, run the following commands:</summary>

```
git clone https://github.com/swansonk14/typed-argument-parser.git
cd typed-argument-parser
pip install -e .
```

</details>

<details>
<summary>To develop this package, install development requirements (in a virtual environment):</summary>

```
python -m pip install -e ".[dev]"
```

Style:
- Please use [`black`](https://github.com/psf/black) formatting
- Set your vertical line ruler to 121
- Use [`flake8`](https://github.com/PyCQA/flake8) linting.

To run tests, run:

```
pytest
```

</details>

## Table of Contents

* [Installation](#installation)
Expand Down Expand Up @@ -81,6 +105,10 @@ pip install -e .
+ [tapify help](#tapify-help)
+ [Command line vs explicit arguments](#command-line-vs-explicit-arguments)
+ [Known args](#known-args)
* [Convert to a `Tap` class](#convert-to-a-tap-class)
+ [`to_tap_class` examples](#to_tap_class-examples)
- [Simple](#simple)
- [Complex](#complex)

## Tap is Python-native

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

### Examples
### `to_tap_class` examples

#### Simple

Expand Down
9 changes: 7 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
long_description = f.read()

test_requirements = [
"pydantic >= 2.5.0",
"pytest",
"pytest-cov",
"flake8",
]
test_requirements_with_pydantic_v2 = test_requirements + ["pydantic >= 2.5.0"]

setup(
name="typed-argument-parser",
Expand All @@ -32,7 +34,10 @@
package_data={"tap": ["py.typed"]},
install_requires=["typing-inspect >= 0.7.1", "docstring-parser >= 0.15"],
tests_require=test_requirements,
extras_require={"dev": test_requirements},
extras_require={
"dev-no-pydantic": test_requirements,
"dev": test_requirements_with_pydantic_v2,
},
python_requires=">=3.8",
classifiers=[
"Programming Language :: Python :: 3",
Expand Down

0 comments on commit 1d2f4b2

Please sign in to comment.