Skip to content

Commit

Permalink
Migrate to pyproject.toml (#92)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Fixes #90
  • Loading branch information
Ce11an authored Jan 26, 2023
1 parent 5d310d0 commit 944f920
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 72 deletions.
10 changes: 7 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ repos:
hooks:
- id: yesqa

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.226
hooks:
- id: flake8
- id: ruff
args:
- "--fix"
# Respect `exclude` and `extend-exclude` settings.
- "--force-exclude"
90 changes: 90 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,100 @@
[metadata]
license_file = "LICENSE"
description-file = "README.md"

[build-system]
requires = [
"setuptools",
"wheel",
]

[tool.check-manifest]
ignore = [
"*.yml",
".github",
".github/*"
]

[tool.pytest.ini_options]
norecursedirs = [
".git",
".github",
"dist",
"build",
"docs",
]

addopts = [
"--strict-markers",
"--doctest-modules",
"--durations=25",
"--color=yes",
"--disable-pytest-warnings",
]
filterwarnings = ["error::FutureWarning", "error::DeprecationWarning"]
xfail_strict = true

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"pass",
]

[tool.coverage.run]
parallel = true
concurrency = "thread"
relative_files = true

[tool.black]
# https://github.com/psf/black
line-length = 120
exclude = "(.eggs|.git|.hg|.mypy_cache|.venv|_build|buck-out|build|dist)"

[tool.isort]
known_first_party = [
"lightning_utilities",
"tests"
]
skip_glob = []
profile = "black"
line_length = 120
order_by_type = false
multi_line_output = 3
include_trailing_comma = true

[tool.mypy]
files = [
"src/lightning_utilities",
]
disallow_untyped_defs = true
ignore_missing_imports = true

[tool.ruff]
line-length = 120
select = [
"E", "W", # see: https://pypi.org/project/pycodestyle
"F", # see: https://pypi.org/project/pyflakes
]
ignore = [
"E731",
]
exclude = [
".eggs",
".git",
".mypy_cache",
".ruff_cache",
"__pypackages__",
"_build",
"build",
"dist",
"docs"
]
ignore-init-module-imports = true

# [tool.ruff.per-file-ignores]
# "setup.py" = ["D100", "SIM115"]
# "__about__.py" = ["D100"]
# "__init__.py" = ["D100"]

[tool.ruff.mccabe]
max-complexity = 10
67 changes: 0 additions & 67 deletions setup.cfg

This file was deleted.

2 changes: 0 additions & 2 deletions src/lightning_utilities/core/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

import functools
import importlib
import operator
import os
import warnings
from functools import lru_cache
from importlib.util import find_spec
Expand Down

0 comments on commit 944f920

Please sign in to comment.