-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop python 3.7 + Setup Poetry + CodeCov + Pre-Commit (#300)
* Setup Poetry + Code Coverage Signed-off-by: Fabrice Normandin <normandf@mila.quebec> * Update pre-commit config Signed-off-by: Fabrice Normandin <normandf@mila.quebec> * Apply pre-commit hooks to almost all files Signed-off-by: Fabrice Normandin <normandf@mila.quebec> * Add a linting step with pre-commit in the CI Signed-off-by: Fabrice Normandin <normandf@mila.quebec> * Reduce number of CI runners used for PRs Signed-off-by: Fabrice Normandin <normandf@mila.quebec> * Don't test against py3.7 in CI Signed-off-by: Fabrice Normandin <normandf@mila.quebec> * Slightly adjust regression files (test moved a bit) Signed-off-by: Fabrice Normandin <normandf@mila.quebec> * Add codecov.yml file Signed-off-by: Fabrice Normandin <normandf@mila.quebec> * Don't exclude examples and tests for ruff hook Signed-off-by: Fabrice Normandin <normandf@mila.quebec> * Run tests with and without extra dependencies Signed-off-by: Fabrice Normandin <normandf@mila.quebec> * Add poetry check hook in pre-commit config Signed-off-by: Fabrice Normandin <normandf@mila.quebec> --------- Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
- Loading branch information
Showing
121 changed files
with
1,282 additions
and
3,529 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,67 @@ | ||
name: Python package | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
linting: | ||
name: Run linting/pre-commit checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
- run: pip install pre-commit | ||
- run: pre-commit --version | ||
- run: pre-commit install | ||
- run: pre-commit run --all-files | ||
|
||
build: | ||
needs: [linting] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Install poetry | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
- name: Install dependencies | ||
cache: poetry | ||
|
||
- name: Install base dependencies | ||
run: poetry install | ||
|
||
- name: Unit tests with Pytest (no extras) | ||
timeout-minutes: 3 | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[all] | ||
- name: Unit tests with Pytest | ||
poetry run pytest --benchmark-disable --cov=simple_parsing --cov-report=xml --cov-append | ||
- name: Install extra dependencies | ||
run: poetry install --all-extras | ||
|
||
- name: Unit tests with Pytest (with extra dependencies) | ||
timeout-minutes: 3 | ||
run: | | ||
pytest --benchmark-disable | ||
poetry run pytest --benchmark-disable --cov=simple_parsing --cov-report=xml --cov-append | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
with: | ||
env_vars: PLATFORM,PYTHON | ||
name: codecov-umbrella | ||
fail_ci_if_error: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
coverage: | ||
status: | ||
project: | ||
default: | ||
target: auto # auto compares coverage to the previous base commit | ||
informational: true | ||
patch: | ||
default: | ||
target: 100% | ||
informational: true | ||
|
||
|
||
# When modifying this file, please validate using | ||
# curl -X POST --data-binary @codecov.yml https://codecov.io/validate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
## Currently supported features: | ||
* Parsing of attributes of built-in types: | ||
* `int`, `float`, `str` attributes | ||
* `bool` attributes (using either the `--<arg-name>` or the `--<arg-name> <value>` syntax) | ||
* `list` attributes | ||
* `tuple` attributes | ||
* Parsing of multiple instances of a given dataclass, for the above-mentioned attribute types | ||
* Nested parsing of instances (dataclasses within dataclasses) | ||
|
||
- Parsing of attributes of built-in types: | ||
- `int`, `float`, `str` attributes | ||
- `bool` attributes (using either the `--<arg-name>` or the `--<arg-name> <value>` syntax) | ||
- `list` attributes | ||
- `tuple` attributes | ||
- Parsing of multiple instances of a given dataclass, for the above-mentioned attribute types | ||
- Nested parsing of instances (dataclasses within dataclasses) | ||
|
||
## Possible Future Enhancements: | ||
* Parsing two different dataclasses which share a base class (this currently would cause a conflict for the base class arguments. | ||
|
||
- Parsing two different dataclasses which share a base class (this currently would cause a conflict for the base class arguments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.