Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
makkus committed Dec 18, 2024
1 parent 0ceaf5e commit 3dbe55a
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 47 deletions.
80 changes: 37 additions & 43 deletions kiara_plugin.{{ cookiecutter.project_slug }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -144,32 +144,9 @@ line-length = 88

src = ["src", "tests"]

select = [
"E",
"F",
"RUF",
"I001",
"YTT",
"S",
"C4",
"T10",
"ISC",
"ICN",
"T20",
"Q",
"TID",
"PD",
"PLC",
"PLE",
"PLR",
"PLW",
"PIE",
]
ignore = ["E501", "S101", "SIM118", "SIM108", "PLR2004", "PLR0913", "S110", "PLR0912", "PLR0915", "PIE810"]

fix = true
fixable = ["E", "F", "RUF100", "I001", "Q"]

# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
Expand All @@ -190,35 +167,52 @@ exclude = [
"dist",
"node_modules",
"venv",
"docs",
".venv"
]
per-file-ignores = { }

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

# Assume Python 3.10.
target-version = "py310"

[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.ruff.lint]
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
fixable = ["E", "F", "RUF100", "I001", "Q", "D"]

[tool.ruff.isort]
known-first-party = ["kiara", "kiara_plugin"]
select = [
"E",
"F",
"RUF",
"I001",
"YTT",
"S",
"C4",
"T10",
"ISC",
"ICN",
"T20",
"Q",
"TID",
"PD",
"PLC",
"PLE",
"PLR",
"PLW",
"PIE",
]

[tool.ruff.pydocstyle]
convention = "google"
ignore = ["E501", "S101", "SIM118", "SIM108", "PLR2004", "PLR0913", "S110", "PIE810", "PLR0911", "PLR0915", "PLR0912", "D", "D401", "PLW0603", "PLR5501", "PLW2901", "S603", "S608", "ISC001", "PLC0206", "RUF022"]
per-file-ignores = { }

[tool.pyright]
include = ["src"]
exclude = ["**/__pycache__"]
ignore = []
[tool.ruff.lint.isort]
known-first-party = ["kiara", "kiara_plugin"]

reportMissingImports = true
reportMissingTypeStubs = false

executionEnvironments = [
]
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.mypy]
python_version = "3.9"
Expand Down
2 changes: 1 addition & 1 deletion src/kiara_plugin/develop/pkg_build/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class PkgSpec(BaseModel):
description="The package entry point(s).", default_factory=dict
)

_environment: Environment = PrivateAttr(None)
_environment: Environment = PrivateAttr(None) # type: ignore

@model_validator(mode="before")
@classmethod
Expand Down
2 changes: 1 addition & 1 deletion src/kiara_plugin/develop/pkg_build/rattler/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class PkgSpec(BaseModel):
description="The package entry point(s).", default_factory=dict
)

_environment: Environment = PrivateAttr(None)
_environment: Environment = PrivateAttr(None) # type: ignore

@model_validator(mode="before")
@classmethod
Expand Down
4 changes: 2 additions & 2 deletions src/kiara_plugin/develop/utils/pkg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,14 @@ def extract_reqs_from_metadata(
assert pkg not in filtered_reqs.keys()
filtered_reqs[pkg] = {"version": ver, "condition": cond}

for extra_pkg, extras in extras_reqs.items():
for extra_pkg, _extras in extras_reqs.items():
# version = filtered_reqs[extra_pkg]["version"]
# TODO: figure out the right version if there's a condition
version = None
req_metadata = get_pkg_metadata_from_pypi(
pkg_name=extra_pkg, version=version
)
new_reqs = extract_reqs_from_metadata(req_metadata, extras=extras)
new_reqs = extract_reqs_from_metadata(req_metadata, extras=_extras)
for k, v in new_reqs.items():
if k in filtered_reqs.keys():
continue
Expand Down

0 comments on commit 3dbe55a

Please sign in to comment.