-
Notifications
You must be signed in to change notification settings - Fork 107
chore: modernize Python tooling #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
76a0ab0
e5ad6a8
262145a
d66abca
90d8eba
dfde216
86f774a
402597b
d1fc926
b8e9850
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| pre-commit: | ||
| commands: | ||
| ruff-check: | ||
| glob: "*.py" | ||
| stage_fixed: true | ||
| run: ruff check {staged_files} --fix --exit-non-zero-on-fix | ||
| ruff-fmt: | ||
| glob: "*.py" | ||
| stage_fixed: true | ||
| run: ruff format --exit-non-zero-on-format {staged_files} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| [tool.poetry] | ||
| name = "slowapi" | ||
| version = "0.1.9" | ||
| description = "A rate limiting extension for Starlette and Fastapi" | ||
| authors = ["Laurent Savaete <laurent@where.tf>"] | ||
| license = "MIT" | ||
|
|
||
| readme = "README.md" | ||
|
|
||
| repository = "https://github.com/laurents/slowapi" | ||
| homepage = "https://github.com/laurents/slowapi" | ||
| documentation = "https://slowapi.readthedocs.io/en/latest/" | ||
|
|
||
| include = ["slowapi/py.typed"] | ||
|
|
||
| [tool.poetry.dependencies] | ||
| python = ">=3.7,<4.0" | ||
| limits = ">=2.3" | ||
| redis = {version = "^3.4.1", optional = true} | ||
|
|
||
| [tool.poetry.dev-dependencies] | ||
| isort = "^4.3.21" | ||
| mypy = "^0.910" | ||
| black = "^23.0.0" | ||
| fastapi = "^0.89.0" | ||
| lxml = "^4.9.1" | ||
| starlette = "^0.22.0" | ||
| mock = "^4.0.1" | ||
| hiro = "^0.5.1" | ||
| requests = "^2.22.0" | ||
| pytest = "~=6.2.5" | ||
| mkdocs = "^1.2.3" | ||
| mkautodoc = "^0.1.0" | ||
| types-redis = "^3.5.6" | ||
| coverage = "^6.3" | ||
| flake8 = "^4.0.1" | ||
| setuptools = "^65.5.0" | ||
| httpx = "^0.23.3" | ||
|
|
||
| [tool.black] | ||
| line-length = 88 | ||
|
|
||
| [tool.isort] | ||
| multi_line_output = 3 | ||
| include_trailing_comma = true | ||
| force_grid_wrap = 0 | ||
| use_parentheses = true | ||
| ensure_newline_before_comments = true | ||
| line_length = 88 | ||
|
|
||
| [build-system] | ||
| requires = ["poetry-core>=1.0.0"] | ||
| build-backend = "poetry.core.masonry.api" | ||
|
|
||
| [tool.poetry.extras] | ||
| redis = ["redis"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,56 +1,103 @@ | ||
| [tool.poetry] | ||
| [project] | ||
| name = "slowapi" | ||
| version = "0.1.9" | ||
| description = "A rate limiting extension for Starlette and Fastapi" | ||
| authors = ["Laurent Savaete <laurent@where.tf>"] | ||
| license = "MIT" | ||
|
|
||
| version = "0.2.0" | ||
| description = "A rate limiting extension for Starlette and FastAPI" | ||
| readme = "README.md" | ||
| authors = [ | ||
| { name = "Laurent Savaete", email = "laurent@where.tf"}, | ||
| { name = "Noelle Wang", email = "73260931+No767@users.noreply.github.com" } | ||
| ] | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to add all the people who actually contributed, what do you think? Or just have something like "slowapi contributors" with a link to the github repo?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. depending on if we have a list, then sure we can go for it |
||
| requires-python = ">=3.10,<4" | ||
No767 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| dependencies = [ | ||
| "fastapi>=0.116.1,<1", | ||
No767 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "limits>=5.5.0,<6", | ||
| ] | ||
|
|
||
| [project.optional-dependencies] | ||
| redis = [ | ||
| "redis[hiredis]>=6.3.0,<7", | ||
| ] | ||
| valkey = [ | ||
| "valkey[libvalkey]>=6.1.0,<7", | ||
| ] | ||
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "ruff>=0.12.7,<1", | ||
| "pyright[nodejs]>=1.1.403,<2", | ||
| "lefthook>=1.12.2,<2", | ||
| {include-group = "docs"}, | ||
| {include-group = "test"} | ||
| ] | ||
|
|
||
| docs = [ | ||
| "mkdocs>=1.6.1,<2", | ||
| "mkdocstrings[python]>=0.30.0,<1" | ||
| ] | ||
| test = [ | ||
| "pytest>=8.4.1,<9", | ||
| "pytest-asyncio>=1.1.0,<2", | ||
| "coverage>=7.10.2,<8", | ||
| "httpx>=0.28.1,<1", | ||
| "hiro>=1.1.1,<2" | ||
| ] | ||
|
|
||
| [tool.pyright] | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I use As a side note, I just discovered https://github.com/astral-sh/ty which looks promising!
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently, the version of |
||
| include = ["slowapi", "tests"] | ||
| exclude = ["**/__pycache__", "docs",] | ||
| reportMissingImports = "error" | ||
| typeCheckingMode = "standard" | ||
| reportUnnecessaryTypeIgnoreComment = "warning" | ||
|
|
||
| repository = "https://github.com/laurents/slowapi" | ||
| homepage = "https://github.com/laurents/slowapi" | ||
| documentation = "https://slowapi.readthedocs.io/en/latest/" | ||
|
|
||
| include = ["slowapi/py.typed"] | ||
No767 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [tool.poetry.dependencies] | ||
| python = ">=3.7,<4.0" | ||
| limits = ">=2.3" | ||
| redis = {version = "^3.4.1", optional = true} | ||
|
|
||
| [tool.poetry.dev-dependencies] | ||
| isort = "^4.3.21" | ||
| mypy = "^0.910" | ||
| black = "^23.0.0" | ||
| fastapi = "^0.89.0" | ||
| lxml = "^4.9.1" | ||
| starlette = "^0.22.0" | ||
| mock = "^4.0.1" | ||
| hiro = "^0.5.1" | ||
| requests = "^2.22.0" | ||
| pytest = "~=6.2.5" | ||
| mkdocs = "^1.2.3" | ||
| mkautodoc = "^0.1.0" | ||
| types-redis = "^3.5.6" | ||
| coverage = "^6.3" | ||
| flake8 = "^4.0.1" | ||
| setuptools = "^65.5.0" | ||
| httpx = "^0.23.3" | ||
|
|
||
| [tool.black] | ||
| [tool.ruff] | ||
| line-length = 88 | ||
| extend-include = ["slowapi", "tests"] | ||
| extend-exclude = ["**/__pycache__", "docs"] | ||
|
|
||
| [tool.isort] | ||
| multi_line_output = 3 | ||
| include_trailing_comma = true | ||
| force_grid_wrap = 0 | ||
| use_parentheses = true | ||
| ensure_newline_before_comments = true | ||
| line_length = 88 | ||
| [tool.ruff.lint] | ||
| ignore = [ | ||
| "E501", | ||
| "N999", | ||
| "E402", | ||
| "S311", | ||
| "ASYNC109", | ||
| "S101", | ||
|
|
||
| # These are recommended by Ruff if the formatter is to be used: https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules | ||
| "W191", | ||
| "E111", | ||
| "E114", | ||
| "E117", | ||
| "D206", | ||
| "D300", | ||
| "Q000", | ||
| "Q001", | ||
| "Q002", | ||
| "Q003", | ||
| "COM812", | ||
| "COM819", | ||
| "ISC001", | ||
| "ISC002" | ||
| ] | ||
| select = ["E", "F", "N", "ASYNC", "S", "ERA", "I"] | ||
| fixable = ["ALL"] | ||
|
|
||
| [build-system] | ||
| requires = ["poetry-core>=1.0.0"] | ||
| build-backend = "poetry.core.masonry.api" | ||
| [tool.ruff.lint.isort] | ||
| combine-as-imports = true | ||
| force-wrap-aliases = true | ||
|
|
||
| [tool.ruff.format] | ||
| docstring-code-format = true | ||
|
|
||
| [tool.pytest.ini_options] | ||
| minversion = "8.0" | ||
| addopts = "-ra" | ||
| testpaths = ["tests"] | ||
| asyncio_default_fixture_loop_scope = "function" | ||
|
|
||
| [tool.poetry.extras] | ||
| redis = ["redis"] | ||
| [tool.uv.build-backend] | ||
| module-root = "" | ||
|
|
||
| [build-system] | ||
| requires = ["uv_build>=0.8.5,<0.9.0"] | ||
| build-backend = "uv_build" | ||
Uh oh!
There was an error while loading. Please reload this page.