Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
spapanik committed Feb 3, 2024
1 parent 60ca62f commit 5c7a7d2
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 22 deletions.
54 changes: 35 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
extra_checks = true
ignore_missing_imports = true
no_implicit_reexport = true
show_error_codes = true
strict_concatenate = true
strict_equality = true
warn_return_any = true
warn_redundant_casts = true
Expand All @@ -31,66 +31,80 @@ warn_unreachable = true
warn_unused_configs = true

[tool.ruff]
src = [
"src",
]
target-version = "py38"

[tool.ruff.lint]
select = [
"A",
"ARG",
"ASYNC",
"B",
"BLE",
"C4",
"COM",
"DTZ",
"E",
"EM",
"ERA",
"EXE",
"F",
"FA",
"FBT",
"FLY",
"G",
"I",
"ICN",
"INP",
"ISC",
"LOG",
"N",
"PGH",
"PERF",
"PIE",
"PLC",
"PLE",
"PLW",
"PT",
"PTH",
"Q",
"RET",
"RSE",
"RUF",
"S",
"SIM",
"SLF",
"SLOT",
"T10",
"TID",
"TRY",
"UP",
"W",
"YTT",
]
ignore = [
"COM812",
"E501",
"TRY003",
]
src = [
"src",
]
target-version = "py38"

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"FBT001",
"PT011",
"S101",
]

[tool.ruff.flake8-tidy-imports]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"

[tool.ruff.flake8-tidy-imports.banned-api]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"mock".msg = "Use unittest.mock"
"pytz".msg = "Use zoneinfo"

[tool.ruff.isort]
[tool.ruff.lint.isort]
combine-as-imports = true
forced-separate = [
"tests",
Expand Down Expand Up @@ -143,19 +157,21 @@ classifiers = [
python = "^3.8"

[tool.poetry.group.dev.dependencies]
ipdb = { version = "^0.13", python = "^3.9" }
ipython = { version = "^8.12", python = "^3.9" }
pipdeptree = "^2.7"
ipdb = { version = "^0.13", python = "^3.10" }
ipython = { version = "^8.21", python = "^3.10" }
pickleshare = { version = "^0.7", python = "^3.10" }
pipdeptree = "^2.13"

[tool.poetry.group.lint.dependencies]
black = "^23.3"
mypy = "^1.2"
ruff = "^0.0"
black = "^24.1"
mypy = "^1.8"
ruff = "^0.2"
types-PyYAML = "^6.0"

[tool.poetry.group.test.dependencies]
pytest = "^7.3"
pytest-cov = "^4.0"
pytest = "^8.0"
pytest-cov = "^4.1"

[tool.poetry.group.docs.dependencies]
furo = "^2023.5"
sphinx = "^7.0"
furo = { version = "^2024.1", python = "^3.10" }
sphinx = { version = "^7.2", python = "^3.10" }
3 changes: 2 additions & 1 deletion src/mathlib/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def __call__(self, item: int) -> int:

def __getitem__(self, item: int) -> int:
if item <= 0:
raise ValueError("item must be a positive integer")
msg = "item must be a positive integer"
raise ValueError(msg)

if self._steps.get(item) is None:
self._update_value(item)
Expand Down
6 changes: 4 additions & 2 deletions src/mathlib/primes.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ def next_prime(n: int) -> int:
if is_prime(p):
return p

raise UnreachableError("A prime will be reached")
msg = "A prime will be reached"
raise UnreachableError(msg)


def primes() -> Iterator[int]:
Expand Down Expand Up @@ -238,4 +239,5 @@ def divisor_sigma(n: int, x: int = 0) -> int:
if n == 1:
return out

raise UnreachableError("At some point divisors will be exhausted")
msg = "At some point divisors will be exhausted"
raise UnreachableError(msg)

0 comments on commit 5c7a7d2

Please sign in to comment.