Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #33

Merged
merged 3 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Run tests
run: poetry run pytest tests --junitxml=junit.xml -n auto
- name: Test reporter
uses: phoenix-actions/test-reporting@v12
uses: phoenix-actions/test-reporting@v15
if: success() || failure()
with:
name: Secret Santa tests on ${{ matrix.os }} (Python ${{ matrix.python-version }}) Report
Expand Down
22 changes: 11 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,23 @@ repository = "https://github.com/faboshka/secret-santa.git"

[tool.poetry.dependencies]
python = "^3.12"
python-dotenv = "^1.0.0"
twilio = "^8.11.0"
python-dotenv = "^1.0.1"
twilio = "^9.2.3"
pyfiglet = "^1.0.2"

[tool.poetry.group.dev.dependencies]
taskipy = "^1.12.2"
mypy = "^1.5.1"
ruff = "^0.1.11"
types-pytest-lazy-fixture = "^0.6.3.4"
taskipy = "^1.13.0"
mypy = "^1.11.1"
ruff = "^0.5.5"

[tool.poetry.group.test.dependencies]
pytest = "^7.4.4"
pytest-lazy-fixture = "^0.6.3"
pytest-mock = "^3.12.0"
pytest-xdist = "^3.5.0"
pytest = "^8.3.2"
pytest-mock = "^3.14.0"
pytest-xdist = "^3.6.1"
pytest-lazy-fixtures = "^1.1.1"

[build-system]
requires = ["poetry-core>=1.5.0"]
requires = ["poetry-core>=1.8.0"]
build-backend = "poetry.core.masonry.api"

[tool.ruff]
Expand All @@ -49,6 +48,7 @@ select = [
fixable = ["ALL"]
unfixable = []


[tool.ruff.lint.per-file-ignores]
"**/{tests}/*.py" = ["D"]

Expand Down
2 changes: 1 addition & 1 deletion secret_santa/util/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def is_derangement(list_a: list[T], list_b: list[T]) -> bool:
f"The two lists must be of the same size to qualify for a derangement check: " f"{len(list_a)} != {len(list_b)}"
)
# Assert the two lists contain items of the same type
assert not any([True if type(x) != type(y) else False for x, y in zip(list_a, list_b)]), (
assert not any([True if type(x) != type(y) else False for x, y in zip(list_a, list_b)]), ( # noqa: E721
f"The two lists' elements must be of the same type to qualify for a derangement check: "
f"{type(list_a[0])} != {type(list_b[0])}"
)
Expand Down
10 changes: 3 additions & 7 deletions tests/model/test_participant.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from pytest_lazyfixture import lazy_fixture
from pytest_lazy_fixtures import lf

from secret_santa.model.participant import Participant

Expand All @@ -18,12 +18,8 @@ def participant_john_nicknamed_johnny() -> Participant:
@pytest.mark.parametrize(
("participant1", "participant2", "same"),
[
(lazy_fixture("participant_john"), lazy_fixture("participant_john"), True),
(
lazy_fixture("participant_john"),
lazy_fixture("participant_john_nicknamed_johnny"),
False,
),
(lf("participant_john"), lf("participant_john"), True),
(lf("participant_john"), lf("participant_john_nicknamed_johnny"), False),
],
)
def test_participant_eq(participant1: Participant, participant2: Participant, same: bool) -> None:
Expand Down
18 changes: 9 additions & 9 deletions tests/test_secret_santa.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest
from _pytest.capture import CaptureFixture
from _pytest.monkeypatch import MonkeyPatch
from pytest_lazyfixture import lazy_fixture
from pytest_lazy_fixtures import lf
from pytest_mock import MockerFixture

import secret_santa.secret_santa_module
Expand Down Expand Up @@ -317,10 +317,10 @@ def test_load_participants(
@pytest.mark.parametrize(
("participant", "expected_message_name"),
[
(lazy_fixture("participant_john_jd_doe"), "J.D."),
(lazy_fixture("participant_jane_doe"), "Jane"),
(lazy_fixture("participant_richard_rich_roe"), "Rich"),
(lazy_fixture("participant_howard"), "Howard"),
(lf("participant_john_jd_doe"), "J.D."),
(lf("participant_jane_doe"), "Jane"),
(lf("participant_richard_rich_roe"), "Rich"),
(lf("participant_howard"), "Howard"),
],
)
def test_get_participant_message_name(
Expand Down Expand Up @@ -350,13 +350,13 @@ def test_participants_derangement(
("participant", "recipient", "expected_message"),
[
(
lazy_fixture("participant_john_jd_doe"),
lazy_fixture("participant_jane_doe"),
lf("participant_john_jd_doe"),
lf("participant_jane_doe"),
"Hello J.D.,\nYou'll be Jane's Secret Santa!",
),
(
lazy_fixture("participant_howard"),
lazy_fixture("participant_richard_rich_roe"),
lf("participant_howard"),
lf("participant_richard_rich_roe"),
"Hello Howard,\nYou'll be Rich's Secret Santa!",
),
],
Expand Down
6 changes: 3 additions & 3 deletions tests/test_twilio_messaging_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest
from _pytest.monkeypatch import MonkeyPatch
from pytest_lazyfixture import lazy_fixture
from pytest_lazy_fixtures import lf
from pytest_mock import MockerFixture

from secret_santa.const import TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_NUMBER
Expand Down Expand Up @@ -116,8 +116,8 @@ def test_invalid_twilio_messaging_service_alphanumeric_id(
("twilio_messaging_service_", "dry_run"),
itertools.product(
[
lazy_fixture("twilio_messaging_service"),
lazy_fixture("twilio_messaging_service_alphanumeric_id_secret_santa"),
lf("twilio_messaging_service"),
lf("twilio_messaging_service_alphanumeric_id_secret_santa"),
],
[False, True],
),
Expand Down
4 changes: 2 additions & 2 deletions tests/util/test_arg_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Sequence

import pytest
from pytest_lazyfixture import lazy_fixture
from pytest_lazy_fixtures import lf

from secret_santa.util import arg_parser

Expand Down Expand Up @@ -48,7 +48,7 @@ def default_namespace() -> Namespace:
env_path="dummy_env_path",
),
),
("", lazy_fixture("default_namespace")), # No arguments provided
("", lf("default_namespace")), # No arguments provided
],
)
def test_arg_parser(
Expand Down