Skip to content

Commit

Permalink
fix(pyproject): update tool configs
Browse files Browse the repository at this point in the history
coverage
poe
ruff
Signed-off-by: Cameron Smith <cameron.ray.smith@gmail.com>
  • Loading branch information
cameronraysmith committed Jan 1, 2024
1 parent d1d1bb3 commit 27f16e9
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 14 deletions.
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

110 changes: 99 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ docformatter = { version = ">=1.7.5", extras = ["tomli"] }
optional = true

[tool.poetry.group.test.dependencies]
hypothesis = "6.72.1"
poethepoet = "0.19.0"
pytest = "7.3.1"
pytest-asyncio = "0.21.1"
Expand Down Expand Up @@ -226,17 +227,25 @@ cmd = """
"""
help = "Runs conda-lock to generate a conda environment lock file derived from package dependencies."

# WORKAROUND: see EOF
# only on Linux and Windows
# https://github.com/python-poetry/poetry/issues/2613#issuecomment-799693903
[tool.poe.tasks.force-cuda11]
cmd = """
python -m \
pip install \
torch==1.13.1+cu111 \
--extra-index-url https://download.pytorch.org/whl/cu111
"""
help = "Force install torch 1.13.1+cu111 on Linux and Windows."

[tool.poetry.scripts]
pyrovelocity = "pyrovelocity.pyrovelocity:main"

# WORKAROUND: see EOF
# only on Linux and Windows
# https://github.com/python-poetry/poetry/issues/2613#issuecomment-799693903
# $ poetry install
# $ poetry run poe force-cuda11
[tool.poe.tasks]
force-cuda11 = "python -m pip install torch==1.13.1+cu111 --extra-index-url https://download.pytorch.org/whl/cu111"
[tool.pytest.ini_options]
# addopts = "-rA --xdoc --cov=src/flytezen/ --cov-report=term-missing"
addopts = "-rA --cov=src/flytezen/ --cov-report=term-missing"
asyncio_mode = "strict"

[tool.coverage.paths]
source = ["src/pyrovelocity", "*/pyrovelocity/src/pyrovelocity"]
Expand All @@ -254,21 +263,100 @@ omit = [

[tool.coverage.report]
show_missing = true
#fail_under = 100
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]

[tool.ruff]
target-version = "py37"
line-length = 80
select = []
# select = [
# "A",
# # "ARG",
# # "B",
# "C",
# "DTZ",
# # "E",
# "EM",
# # "F",
# # "FBT",
# "F401",
# "I",
# "ICN",
# "ISC",
# # "N",
# "PLC",
# "PLE",
# "PLR",
# "PLW",
# "Q",
# "RUF",
# # "S",
# # "T",
# "TID",
# "UP",
# "W",
# "YTT",
# ]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
# Allow implicitly concatenated strings on a single line
"ISC001",
# Ignore checks for possible passwords
"S105", "S106", "S107",
# Ignore complexity
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
]
unfixable = [
# Don't modify unused imports
# "F401",
]

[tool.ruff.isort]
known-first-party = ["flytezen"]

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

[tool.ruff.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]

[tool.pyright]
include = ["src"]
exclude = [
"**/node_modules",
"**/__pycache__",
"**/.hypothesis",
"**/docs",
]
reportUnnecessaryTypeIgnoreComment = true
reportUnnecessaryIsInstance = false

[tool.isort]
profile = "black"
force_single_line = true
lines_after_imports = 2

[tool.mypy]
strict = true
python_version = "3.10"

[[tool.mypy.overrides]]
module = [
""
]
ignore_missing_imports = true
warn_unreachable = true
pretty = true
show_column_numbers = true
show_error_codes = true
# show_error_codes = true
show_error_context = true
ignore_missing_imports = true

[build-system]
requires = ["poetry-core>=1.6.0"]
Expand Down

0 comments on commit 27f16e9

Please sign in to comment.