Skip to content

Commit

Permalink
chore: Dependency cleanup (#122)
Browse files Browse the repository at this point in the history
* chore: Dependency cleanup

* ci: Update actions

* ci: Update actions
  • Loading branch information
chr1st1ank authored Oct 8, 2024
1 parent 40c2419 commit a38748a
Show file tree
Hide file tree
Showing 7 changed files with 642 additions and 1,178 deletions.
36 changes: 0 additions & 36 deletions .flake8

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/pre-commit-autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
name: autoupdate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.2.0
- uses: actions/checkout@v4

- name: Set up Python 3.7
uses: actions/setup-python@v4.6.0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.9

- name: Install pre-commit
run: pip install pre-commit
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Run pre-commit
run: pre-commit run --all-files

- uses: peter-evans/create-pull-request@v5.0.0
- uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: chore-update-pre-commit-hooks
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Create Github Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.2.0
- uses: actions/checkout@v4

- name: Get version from tag
id: tag_name
Expand Down Expand Up @@ -52,9 +52,9 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3.2.0
- uses: actions/checkout@v4

- uses: actions/setup-python@v4.6.0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-versions }}

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3.2.0
- uses: actions/setup-python@v4.6.0
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -89,8 +89,8 @@ jobs:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.2.0
- uses: actions/setup-python@v4.6.0
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9

Expand All @@ -110,7 +110,7 @@ jobs:
poetry build
- name: publish to Test PyPI
uses: pypa/gh-action-pypi-publish@v1.6.4
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
Expand Down
1,656 changes: 620 additions & 1,036 deletions poetry.lock

Large diffs are not rendered by default.

67 changes: 7 additions & 60 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ python = ">=3.7.1,<4.0"
[tool.poetry.extras]
test = [
"pytest",
"black",
"isort",
"flake8",
"flake8-docstrings",
"phmdoctest",
"pytest-cov",
"yamllint"
Expand All @@ -45,14 +41,12 @@ test = [
optional = true

[tool.poetry.group.dev.dependencies]
black = { version = "*" }
docutils = { version = "0.21", python = "3.9" } # Necessary to manually add because of https://github.com/pypa/twine/issues/1082
bump2version = "^1.0"
fastapi = {version = "^0.88"}
flake8 = { version = "*" }
httpcore = "^0.16.2"
httpx = "^0.23.1"
httpcore = "^0.16"
httpx = "^0.23"
invoke = "^2.0.0"
isort = { version = "*" }
mkapi = { version = "*" }
mkdocs = { version = "^1.4" }
mkdocs-autorefs = { version = "*" }
Expand All @@ -71,17 +65,16 @@ twine = { version = "*" }
uvicorn = "^0.20"
virtualenv = { version = "^20.16" }
yamllint = "*"
pylint = {version = "^2.15.5", python = "^3.9"}

[tool.poetry.group.doc]
optional = true

[tool.poetry.group.doc.dependencies]
pymdown-extensions = "^9.7"
mkdocs = "^1.4.1"
mkdocs-include-markdown-plugin = { version = "^4.0.0", python = "3.9" }
mkapi = "^1.0.14"
mkdocs-autorefs = "^0.4.1"
mkdocs = "^1.4"
mkdocs-include-markdown-plugin = { version = "^4.0", python = "3.9" }
mkapi = "^1.0"
mkdocs-autorefs = "^0.4"


[tool.poetry.group.test.dependencies]
Expand All @@ -90,49 +83,3 @@ xdoctest = "^1.1.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 100
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 100

[tool.pylint.master]
reports = false
msg-template = "{path}:{line}: {msg_id} ({symbol}) {msg} ({obj})"
load-plugins = [
"pylint.extensions.docparams", # Find parameters missing in docstrings
"pylint.extensions.docstyle", # Detect wrong docstring formatting
]
disable = [
"bad-continuation", # Creates many false positives conflicting with black
"invalid-name", # Creates warnings for local single-letter variables
"fixme", # Creates warnings for todo items
"no-else-return", # Creates refactor result for indented else block; which however might be more readable
"duplicate-code", # Unfortunately this gives alerts also for identical function signatures
"line-too-long", # Checked already by flake8
]

[tool.pylint.design]
max-args = 10 # Maximum number of arguments for functions
max-attributes = 15 # Maximum number of attributes for a class
35 changes: 2 additions & 33 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import webbrowser
from pathlib import Path

from invoke import call, task
from invoke import task
from invoke.context import Context
from invoke.runners import Result

Expand Down Expand Up @@ -100,37 +100,6 @@ def format_(c, check=False):
_run(c, f"poetry run black {' '.join(black_options)} {PYTHON_TARGETS_STR}")


@task()
def flake8(c):
# type: (Context) -> None
"""Run flake8."""
_run(c, f"poetry run flakehell lint {PYTHON_TARGETS_STR}")


@task()
def safety(c):
# type: (Context) -> None
"""Run safety."""
_run(
c,
"poetry export --dev --format=requirements.txt --without-hashes | "
"poetry run safety check --stdin --full-report",
)


@task(pre=[flake8, safety, call(format_, check=True)])
def lint(c):
# type: (Context) -> None
"""Run all linting."""


@task()
def mypy(c):
# type: (Context) -> None
"""Run mypy."""
_run(c, "poetry run mypy dike")


@task()
def tests(c):
# type: (Context) -> None
Expand Down Expand Up @@ -162,7 +131,7 @@ def docs(c):
_run(c, "poetry run mkdocs build")


@task(pre=[clean, hooks, mypy, docs, safety, tests, coverage])
@task(pre=[clean, hooks, docs, tests, coverage])
def check(c):
# type: (Context) -> None
"""Run all checks together."""
Expand Down

0 comments on commit a38748a

Please sign in to comment.