From 9bf58a464054a11862ed2eee3ad671ee584ebefc Mon Sep 17 00:00:00 2001 From: Florian Wilhelm Date: Wed, 29 Nov 2023 20:00:33 +0100 Subject: [PATCH] Add pre-commit in github test --- .github/workflows/run-tests.yml | 6 +++--- README.md | 1 + src/pytanis/pretalx/utils.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 3652007..f09a4d7 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -35,10 +35,10 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install Hatch - run: pip install --upgrade --pre hatch + - name: Install Hatch & pre-commit + run: pip install --upgrade --pre hatch pre-commit - - name: Lint + - name: Linting if: matrix.python-version == '3.10' && runner.os == 'Linux' run: hatch run lint:all diff --git a/README.md b/README.md index 5765b1a..965e9fb 100644 --- a/README.md +++ b/README.md @@ -132,3 +132,4 @@ To start this project off a lot of inspiration and code was taken from [Alexande [tox]: https://tox.wiki/ [mypy]: https://mypy-lang.org/ [ruff]: https://github.com/astral-sh/ruff +[VS Code]: https://code.visualstudio.com/ diff --git a/src/pytanis/pretalx/utils.py b/src/pytanis/pretalx/utils.py index b95a1d5..39e3bc6 100644 --- a/src/pytanis/pretalx/utils.py +++ b/src/pytanis/pretalx/utils.py @@ -92,7 +92,7 @@ def speakers_as_df( def reviews_as_df(reviews: Iterable[Review]) -> pd.DataFrame: """Convert the reviews to a dataframe""" - df = pd.DataFrame([review.dict() for review in reviews]) + df = pd.DataFrame([review.model_dump() for review in reviews]) # make first letter of column upper-case in accordance with our convention df.rename(columns={col: col.title() for col in df.columns}, inplace=True) # user is the speaker name to use for joining