-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CI tools and dependencies (#24)
* Adapt to pydantic v2.4, fastapi 0.103 * Let pydantic return a SchemaError instead of InconsistentIamcType * Use pandera.DataFrameModel instead of pandera.SchemaModel * Clean up changes in API layer * Make creation information optional in iamc/variable * Make id and name required for unit * Revert bulk_* changes to use json_encoder of api.DataFrame again * NOTE: this option will be deprecated in the future, * pydantic serialization decorators should be used instead * Clean up changes in data/db to enable tests again * Revert use of Annotated in iamc/datapoint/filter * Make sqla_model a proper ClassVar (rather than private attr) * Set field.alias only when it does not equal field.name * Update version of ruff * Set field alias in Field directly * Use httpx-preferred content to send bytes/raw content/json st * Use alias for model_ fields that conflict with pydantic protected namespace * Use variable rather than unmapped class reference to resolve SAwarning * Delete unused import * Bump mypy and poetry versions * Use pre-commit over lint-GHA * Runs mypy, black, ruff * NOTE: needs to be run in the repo s.t. poetry detects the correct venv * Remove separate lint.yaml action * Bump sphinx version * Update docstrings according to new sphinx version * Delete duplicate docs files * TEMPORARY Use own fork for sphinxcontrib-openapi workaround * Bump dask,sqlalchemy,pre-commit versions * restore filter framework api * fix union types with filter subojects * fix code style * fix formatting error * Remove outdated comments * Update various things: * Bump fastapi,black,ruff,mypy versions * Update pre-commit-config accordingly * Update doc/source/openapi-v1.json * Include pre-commit, ruff, etc in DEVELOPING.md --------- Co-authored-by: Max Wolschlager <[email protected]>
- Loading branch information
1 parent
6a95fd0
commit 68a8788
Showing
76 changed files
with
1,760 additions
and
1,701 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -46,7 +46,6 @@ jobs: | |
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
#---------------------------------------------- | ||
# load cached venv if cache exists | ||
#---------------------------------------------- | ||
|
@@ -74,3 +73,46 @@ jobs: | |
run: | | ||
source .venv/bin/activate | ||
pytest --cov-report xml:.coverage.xml --cov-report term --cov=ixmp4 -rsx --benchmark-skip | ||
pre-commit: | ||
name: Code quality | ||
runs-on: ubuntu-latest | ||
steps: | ||
#---------------------------------------------- | ||
# check-out repo and set-up python | ||
#---------------------------------------------- | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
#---------------------------------------------- | ||
# ----- install & configure poetry ----- | ||
#---------------------------------------------- | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
#---------------------------------------------- | ||
# load cached venv if cache exists | ||
#---------------------------------------------- | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
#---------------------------------------------- | ||
# install dependencies if cache does not exist | ||
#---------------------------------------------- | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root --with dev,server | ||
#---------------------------------------------- | ||
# install your root project, if required | ||
#---------------------------------------------- | ||
- name: Install library | ||
run: poetry install --no-interaction | ||
#---------------------------------------------- | ||
# run pre-commit/(mypy, black, ruff) | ||
#---------------------------------------------- | ||
- uses: pre-commit/[email protected] |
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,15 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.6.1 | ||
hooks: | ||
- id: mypy | ||
entry: bash -c "poetry run mypy ." | ||
language: system | ||
- repo: https://github.com/psf/black | ||
rev: 23.10.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.0 | ||
hooks: | ||
- id: ruff |
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 |
---|---|---|
|
@@ -6,9 +6,10 @@ Core API (ixmp4.core) | |
|
||
platform | ||
run | ||
model | ||
scenario | ||
iamc | ||
meta | ||
region | ||
unit | ||
exceptions | ||
|
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,6 +1,6 @@ | ||
|
||
Scenarios | ||
======= | ||
========= | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.