Skip to content

Commit

Permalink
Merge pull request #108 from JakobGM/lint-3-12
Browse files Browse the repository at this point in the history
Include Python 3.12 in release action
  • Loading branch information
thomasaarholt authored Oct 18, 2024
2 parents 5effdae + c9a4279 commit 07f2bda
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 70 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.9'
python-version: |
3.9
3.12
architecture: x64
- run: pip install nox==2023.4.22
- run: pip install poetry==1.8.3
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.7
rev: v0.7.0
hooks:
# Run the linter.
- id: ruff
Expand Down
155 changes: 109 additions & 46 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
from datetime import date, datetime, time, timedelta
from typing import Literal, Optional

import patito as pt
import polars as pl
from pydantic import AwareDatetime

import patito as pt


class SmallModel(pt.Model):
"""Small model for testing."""
Expand Down
18 changes: 9 additions & 9 deletions tests/test_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@

import polars as pl
import pytest
from polars.datatypes.group import (
DATETIME_DTYPES,
DURATION_DTYPES,
FLOAT_DTYPES,
INTEGER_DTYPES,
DataTypeGroup,
)
from pydantic import AwareDatetime

from patito._pydantic.dtypes.dtypes import (
DtypeResolver,
validate_annotation,
Expand All @@ -19,15 +28,6 @@
STRING_DTYPES,
TIME_DTYPES,
)
from polars.datatypes.group import (
DATETIME_DTYPES,
DURATION_DTYPES,
FLOAT_DTYPES,
INTEGER_DTYPES,
DataTypeGroup,
)
from pydantic import AwareDatetime

from tests.examples import ManyTypes


Expand Down
3 changes: 2 additions & 1 deletion tests/test_dummy_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
from datetime import date, datetime
from typing import Literal, Optional

import patito as pt
import polars as pl
import pytest

import patito as pt


def test_model_example_df() -> None:
"""Test for patito.Model.example()."""
Expand Down
12 changes: 6 additions & 6 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@
from datetime import date, datetime, time
from typing import Optional

import patito as pt
import polars as pl
import pytest
from patito._pydantic.column_info import ColumnInfo
from patito._pydantic.dtypes.utils import (
DATE_DTYPES,
TIME_DTYPES,
)
from polars.datatypes.group import (
DATETIME_DTYPES,
DURATION_DTYPES,
Expand All @@ -26,6 +20,12 @@
from polars.testing import assert_frame_equal
from pydantic import AliasChoices, AwareDatetime, ValidationError

import patito as pt
from patito._pydantic.column_info import ColumnInfo
from patito._pydantic.dtypes.utils import (
DATE_DTYPES,
TIME_DTYPES,
)
from tests.examples import CompleteModel, ManyTypes, SmallModel


Expand Down
2 changes: 1 addition & 1 deletion tests/test_polars.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from io import StringIO
from typing import Optional

import patito as pt
import polars as pl
import pytest
from pydantic import (
Expand All @@ -16,6 +15,7 @@
ValidationError,
)

import patito as pt
from tests.examples import SmallModel


Expand Down
9 changes: 5 additions & 4 deletions tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@
from typing import Literal, Optional, Union

import pandas as pd
import patito as pt
import polars as pl
import pytest
from pandas.testing import assert_frame_equal as pd_assert_frame_equal
from polars.testing import assert_frame_equal as pl_assert_frame_equal
from pydantic.aliases import AliasGenerator
from pydantic.config import ConfigDict

import patito as pt
from patito import DataFrameValidationError
from patito._pydantic.column_info import ColumnInfo
from patito._pydantic.dtypes import is_optional
from patito._pydantic.dtypes.utils import unwrap_optional
from patito.validators import validate
from polars.testing import assert_frame_equal as pl_assert_frame_equal
from pydantic.aliases import AliasGenerator
from pydantic.config import ConfigDict


def test_is_optional() -> None:
Expand Down

0 comments on commit 07f2bda

Please sign in to comment.