Skip to content

Commit

Permalink
Update python to 3.10, some ruff fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzbrand committed Oct 24, 2024
1 parent bd68c17 commit f44cdff
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/settings/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
TEMPLATE_DEBUG = True

ENV_HOSTS = [host for host in env.str("ALLOWED_HOSTS", "").split(",") if host]
ALLOWED_HOSTS = ENV_HOSTS + ["localhost", ".localhost", "127.0.0.1", "0.0.0.0"]
ALLOWED_HOSTS = [*ENV_HOSTS, "localhost", ".localhost", "127.0.0.1", "0.0.0.0"]
CELERY_ALWAYS_EAGER = True
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@



[tool.poetry]
name = "reminder-scheduler"
version = "1.1.0"
Expand All @@ -18,7 +15,7 @@ packages = [
]

[tool.poetry.dependencies]
python = "^3.9"
python = "^3.10"
celery = "5.2.7"
django = "^3.1.0"
django-celery-beat = "2.5.0"
Expand All @@ -44,6 +41,7 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.ruff]
target-version = "py310"
extend-exclude = [
"*/migrations/*.py",
"docs/conf.py",
Expand All @@ -63,7 +61,7 @@ select = [
# "PT", # flake8-pytest-style
"SIM", # flake8-simplify
"PTH", # flake8-use-pathlib
# "RUF", # ruff-specific rules
"RUF", # ruff-specific rules
]

ignore = [
Expand All @@ -72,6 +70,7 @@ ignore = [
"PTH118", # TODO: Switch to pathlib
"PTH100", # TODO: `os.path.abspath()` should be replaced by `Path.resolve()` maybe use pathlib?
"PTH120", # TODO: `os.path.dirname()` should be replaced by `Path.parent` maybe use pathlib?
"RUF012", # We usually want immutable instance attributes

]

Expand Down
7 changes: 4 additions & 3 deletions scheduler/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,10 @@ def test_save_param_true_raises_error_if_patch_fails(self):
match=[json_params_matcher({"timezone": "Australia/Adelaide"})],
)

with self.assertRaises(HTTPError), patch(
"scheduler.views.datetime"
) as mock_datetime:
with (
self.assertRaises(HTTPError),
patch("scheduler.views.datetime") as mock_datetime,
):
mock_datetime.utcnow.return_value = datetime(2022, 8, 8)
self.client.post(
"/scheduler/timezone/turn?save=true",
Expand Down

0 comments on commit f44cdff

Please sign in to comment.