mirror of
https://github.com/Paillat-dev/pycord-reactive-views.git
synced 2026-01-02 01:06:18 +00:00
🏗️ Move from pdm to uv and add pre commit and other useful things
This commit is contained in:
238
pyproject.toml
238
pyproject.toml
@@ -1,6 +1,4 @@
|
||||
[build-system]
|
||||
requires = ["pdm-backend"]
|
||||
build-backend = "pdm.backend"
|
||||
packages = ["src/pycord_rest"]
|
||||
|
||||
[project]
|
||||
name = "pycord-reactive-views"
|
||||
@@ -22,166 +20,96 @@ dependencies = [
|
||||
"py-cord>=2.6.0",
|
||||
"typing-extensions<5,>=4.4.0",
|
||||
]
|
||||
version = "1.0.1"
|
||||
license = {text = "MIT"}
|
||||
dynamic = ["version", "urls"]
|
||||
|
||||
[project.urls]
|
||||
Source = "https://github.com/Paillat-dev/pycord-reactive-views"
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"basedpyright>=1.28.1",
|
||||
"python-dotenv>=1.0.1",
|
||||
"ruff>=0.9.9",
|
||||
]
|
||||
|
||||
[project.module]
|
||||
name = "pycord_reactive_views"
|
||||
[tool.hatch.version]
|
||||
source = "vcs"
|
||||
|
||||
[tool.hatch.build.hooks.vcs]
|
||||
version-file = "src/pycord_reactve_views/_version.py"
|
||||
|
||||
[tool.hatch.metadata.hooks.vcs.urls]
|
||||
Homepage = "https://github.com/Paillat-dev/pycord-rest"
|
||||
source_archive = "https://github.com/Paillat-dev/pycord-rest/archive/{commit_hash}.zip"
|
||||
|
||||
[tool.hatchling]
|
||||
name = "pycord-rest-bot"
|
||||
|
||||
[tool.hatch.build]
|
||||
include = [
|
||||
"src/pycord_reactve_views/",
|
||||
]
|
||||
exclude = [
|
||||
".copywrite.hcl",
|
||||
".github",
|
||||
".python-version",
|
||||
"uv.lock",
|
||||
]
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/pycord_reactve_views"]
|
||||
|
||||
[tool.pyright]
|
||||
pythonVersion = "3.11"
|
||||
typeCheckingMode = "all"
|
||||
reportUnusedCallResult = false
|
||||
reportAny = false
|
||||
executionEnvironments = [
|
||||
{ root = "src/pycord_reactve_views/_version.py", reportDeprecated = false },
|
||||
{ root = "examples", reportExplicitAny = false, reportUnknownMemberType = false, reportUnusedParameter = false, reportImplicitOverride = false, reportArgumentType = false }
|
||||
]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 120
|
||||
target-version = "py311"
|
||||
fix = true
|
||||
line-length = 120
|
||||
indent-width = 4
|
||||
|
||||
[tool.ruff.per-file-ignores]
|
||||
"__init__.py" = ["F401"]
|
||||
[tool.ruff.format]
|
||||
quote-style = "double"
|
||||
indent-style = "space"
|
||||
skip-magic-trailing-comma = false
|
||||
line-ending = "auto"
|
||||
docstring-code-format = false
|
||||
docstring-code-line-length = "dynamic"
|
||||
exclude = [
|
||||
"src/pycord_reactve_views/_version.py"
|
||||
]
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["ALL"]
|
||||
|
||||
ignore = [
|
||||
"C90", # mccabe
|
||||
"CPY", # flake8-copyright
|
||||
"EM", # flake8-errmsg
|
||||
"SLF", # flake8-self
|
||||
"ARG", # flake8-unused-arguments
|
||||
"TD", # flake8-todos
|
||||
"FIX", # flake8-fixme
|
||||
"PD", # pandas-vet
|
||||
|
||||
"D100", # Missing docstring in public module
|
||||
"D104", # Missing docstring in public package
|
||||
"D105", # Missing docstring in magic method
|
||||
"D106", # Missing docstring in public nested class
|
||||
"D107", # Missing docstring in __init__
|
||||
"D203", # Blank line required before class docstring
|
||||
"D213", # Multi-line summary should start at the second line (incompatible with D212)
|
||||
"D301", # Use r""" if any backslashes in a docstring
|
||||
"D401", # First line of docstring should be in imperative mood
|
||||
"D404", # First word of the docstring should not be "This"
|
||||
"D405", # Section name should be properly capitalized
|
||||
"D406", # Section name should end with a newline
|
||||
"D407", # Missing dashed underline after section
|
||||
"D408", # Section underline should be in the line following the section's name
|
||||
"D409", # Section underline should match the length of its name
|
||||
"D410", # Missing blank line after section
|
||||
"D411", # Missing blank line before section
|
||||
"D412", # No blank lines allowed between a section header and its content
|
||||
"D413", # Missing blank line after last section
|
||||
"D414", # Section has no content
|
||||
"D416", # Section name should end with a colon
|
||||
"D417", # Missing argument description in the docstring
|
||||
|
||||
"ANN101", # Missing type annotation for self in method
|
||||
"ANN102", # Missing type annotation for cls in classmethod
|
||||
"ANN204", # Missing return type annotation for special method
|
||||
"ANN401", # Dynamically typed expressions (typing.Any) disallowed
|
||||
|
||||
"SIM102", # use a single if statement instead of nested if statements
|
||||
"SIM108", # Use ternary operator {contents} instead of if-else-block
|
||||
|
||||
"G001", # Logging statement uses str.format
|
||||
"G004", # Logging statement uses f-string
|
||||
"G003", # Logging statement uses +
|
||||
|
||||
"B904", # Raise without `from` within an `except` clause
|
||||
|
||||
"UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)`
|
||||
"PLR2004", # Using unnamed numerical constants
|
||||
"PGH003", # Using specific rule codes in type ignores
|
||||
"E731", # Don't asign a lambda expression, use a def
|
||||
"S311", # Use `secrets` for random number generation, not `random`
|
||||
"TRY003", # Avoid specifying long messages outside the exception class
|
||||
|
||||
# Redundant rules with ruff-format:
|
||||
"E111", # Indentation of a non-multiple of 4 spaces
|
||||
"E114", # Comment with indentation of a non-multiple of 4 spaces
|
||||
"E117", # Cheks for over-indented code
|
||||
"D206", # Checks for docstrings indented with tabs
|
||||
"D300", # Checks for docstring that use ''' instead of """
|
||||
"Q000", # Checks of inline strings that use wrong quotes (' instead of ")
|
||||
"Q001", # Multiline string that use wrong quotes (''' instead of """)
|
||||
"Q002", # Checks for docstrings that use wrong quotes (''' instead of """)
|
||||
"Q003", # Checks for avoidable escaped quotes ("\"" -> '"')
|
||||
"COM812", # Missing trailing comma (in multi-line lists/tuples/...)
|
||||
"COM819", # Prohibited trailing comma (in single-line lists/tuples/...)
|
||||
"ISC001", # Single line implicit string concatenation ("hi" "hey" -> "hihey")
|
||||
"ISC002", # Multi line implicit string concatenation
|
||||
|
||||
"DOC501",
|
||||
"DOC201",
|
||||
"PLR6301"
|
||||
per-file-ignores = { "examples/**/*" = ["INP001", "ARG002"] }
|
||||
extend-ignore = [
|
||||
"N999",
|
||||
"D104",
|
||||
"D100",
|
||||
"D103",
|
||||
"D102",
|
||||
"D101",
|
||||
"D107",
|
||||
"D105",
|
||||
"D106",
|
||||
"ANN401",
|
||||
"TRY003",
|
||||
"EM101",
|
||||
"EM102",
|
||||
"G004",
|
||||
"PTH",
|
||||
"D211",
|
||||
"D213",
|
||||
"COM812",
|
||||
"ISC001",
|
||||
"D203",
|
||||
"FBT001",
|
||||
"FBT002",
|
||||
"PLR2004",
|
||||
"PLR0913",
|
||||
"C901"
|
||||
]
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
order-by-type = false
|
||||
case-sensitive = true
|
||||
combine-as-imports = true
|
||||
|
||||
# Redundant rules with ruff-format
|
||||
force-single-line = false # forces all imports to appear on their own line
|
||||
force-wrap-aliases = false # Split imports with multiple members and at least one alias
|
||||
lines-after-imports = -1 # The number of blank lines to place after imports
|
||||
lines-between-types = 0 # Number of lines to place between "direct" and import from imports
|
||||
split-on-trailing-comma = false # if last member of multiline import has a comma, don't fold it to single line
|
||||
|
||||
[tool.ruff.lint.pylint]
|
||||
max-args = 15
|
||||
max-branches = 15
|
||||
max-locals = 15
|
||||
max-nested-blocks = 5
|
||||
max-returns = 8
|
||||
max-statements = 75
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"tests/**.py" = [
|
||||
"ANN", # annotations
|
||||
"D", # docstrings
|
||||
"S101", # Use of assert
|
||||
]
|
||||
".github/scripts/**.py" = [
|
||||
"INP001", # Implicit namespace package
|
||||
]
|
||||
"alembic-migrations/env.py" = [
|
||||
"INP001", # Implicit namespace package
|
||||
]
|
||||
"alembic-migrations/versions/*" = [
|
||||
"INP001", # Implicit namespace package
|
||||
"D103", # Missing docstring in public function
|
||||
"D400", # First line should end with a period
|
||||
"D415", # First line should end with a period, question mark, or exclamation point
|
||||
]
|
||||
|
||||
[tool.ruff.format]
|
||||
line-ending = "lf"
|
||||
|
||||
[tool.basedpyright]
|
||||
include = ["src"]
|
||||
exclude = ["**/__pycache__"]
|
||||
venv = "env311"
|
||||
pythonPlatform = "All"
|
||||
pythonVersion = "3.11"
|
||||
typeCheckingMode = "all"
|
||||
|
||||
reportAny = false
|
||||
reportUnusedCallResult = false
|
||||
|
||||
reportUnknownArgumentType = false
|
||||
reportUnknownVariableType = false
|
||||
reportUnknownMemberType = false
|
||||
reportUnknownParameterType = false
|
||||
reportUnknownLambdaType = false
|
||||
|
||||
[tool.pdm]
|
||||
distribution = true
|
||||
[tool.pdm.dev-dependencies]
|
||||
dev = [
|
||||
"basedpyright>=1.15.0",
|
||||
"ruff>=0.5.5",
|
||||
"python-dotenv>=1.0.1",
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user