Skip to content

Commit

Permalink
Merge pull request #38 from robberwick/isort
Browse files Browse the repository at this point in the history
Add Isort to dev dependencies
  • Loading branch information
robberwick authored Nov 16, 2024
2 parents b69b3ae + 7940468 commit 41aa138
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 19 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/isort.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Run isort
on:
- push

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: isort/isort-action@v1
with:
sort-paths: "src, tests"
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies = [
requires-python = ">=3.11"

[project.optional-dependencies]
dev = ["black"]
dev = ["black", "isort"]
test = ["pytest", "pytest-cov", "pytest-mock", "polyfactory", "responses"]

[project.urls]
Expand All @@ -51,3 +51,6 @@ where = ["src"]

[tool.black]
target_version = ['py311']

[tool.isort]
profile = "black"
3 changes: 1 addition & 2 deletions src/pylibrelinkup/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from .pylibrelinkup import *
from .api_url import *
from .exceptions import *

from .models import *
from .pylibrelinkup import *
2 changes: 1 addition & 1 deletion src/pylibrelinkup/models/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pydantic import BaseModel, ConfigDict, Field
from pydantic.alias_generators import to_camel

from pylibrelinkup.models.data import H, F, Nd, Std, L
from pylibrelinkup.models.data import F, H, L, Nd, Std

__all__ = ["AlarmRules", "FixedLowAlarmValues"]

Expand Down
8 changes: 2 additions & 6 deletions src/pylibrelinkup/models/connection.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import json
from uuid import UUID

from pydantic import (
BaseModel,
ConfigDict,
Field,
)
from pydantic import BaseModel, ConfigDict, Field
from pydantic.alias_generators import to_camel

from .config import AlarmRules
from .data import GlucoseMeasurement
from .hardware import Sensor, PatientDevice, ActiveSensor
from .hardware import ActiveSensor, PatientDevice, Sensor

__all__ = ["GraphResponse", "LogbookResponse"]

Expand Down
2 changes: 1 addition & 1 deletion src/pylibrelinkup/models/data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime, UTC
from datetime import UTC, datetime
from enum import IntEnum
from uuid import UUID

Expand Down
6 changes: 3 additions & 3 deletions src/pylibrelinkup/pylibrelinkup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
from .decorators import authenticated
from .exceptions import (
AuthenticationError,
EmailVerificationError,
PrivacyPolicyError,
RedirectError,
TermsOfUseError,
PrivacyPolicyError,
EmailVerificationError,
)
from .models.connection import GraphResponse, LogbookResponse
from .models.data import Patient, GlucoseMeasurement
from .models.data import GlucoseMeasurement, Patient
from .models.login import LoginArgs
from .utilities import coerce_patient_id

Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
import responses

from pylibrelinkup import PyLibreLinkUp, APIUrl
from pylibrelinkup import APIUrl, PyLibreLinkUp


@pytest.fixture
Expand Down
8 changes: 4 additions & 4 deletions tests/test_client_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import responses

from pylibrelinkup import (
PyLibreLinkUp,
APIUrl,
AuthenticationError,
TermsOfUseError,
PyLibreLinkUp,
RedirectError,
TermsOfUseError,
)
from pylibrelinkup.exceptions import PrivacyPolicyError, EmailVerificationError
from tests.conftest import mocked_responses, pylibrelinkup_client, get_response_json
from pylibrelinkup.exceptions import EmailVerificationError, PrivacyPolicyError
from tests.conftest import get_response_json, mocked_responses, pylibrelinkup_client


def test_client_uses_correct_api_url_default():
Expand Down

0 comments on commit 41aa138

Please sign in to comment.