Skip to content

Commit

Permalink
update pre-commit;
Browse files Browse the repository at this point in the history
  • Loading branch information
m-wrzr committed Oct 28, 2024
1 parent bdf91cd commit eb53a95
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup_backend/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ runs:
python-version: ${{ inputs.python-version }}

- name: Display Python version
shell: bash --login -eo pipefail {0}
run: python -c "import sys; print(sys.version)"
shell: bash --login -eo pipefail {0}

- name: Install Streamlit
run: |
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,11 @@ jobs:
- run: playwright install

- run: python -m pytest tests/

# run playwright tests & save screenshots
- run: python -m pytest tests/playwright.py --verbose

- uses: actions/upload-artifact@v4
with:
name: screenshots
path: tests/screenshots/
31 changes: 14 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.291'
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.1
hooks:
- id: ruff
- id: ruff
name: lint with ruff
- id: ruff
name: sort imports with ruff
args: [--select, I, --fix]
- id: ruff-format
name: format with ruff
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ exclude = [
line-length = 88
target-version = "py311"

[tool.ruff.lint]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

Expand Down
16 changes: 8 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
],
extras_require={
"tests": [
"wikipedia",
"pytest",
"pytest-playwright",
"wikipedia==1.4.0",
"pytest==8.3.2",
# NOTE: run `playwright install` to install the browser drivers
"playwright==1.46.0",
"pytest-playwright==0.5.1",
],
"dev": [
"pre-commit",
"black",
"isort",
"ruff",
"pyright",
"pre-commit==4.0.1",
"ruff==0.7.1",
"pyright==1.1.377",
],
},
)
4 changes: 2 additions & 2 deletions streamlit_searchbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _list_to_options_py(options: list[Any] | list[tuple[str, Any]]) -> list[Any]


def _list_to_options_js(
options: list[Any] | list[tuple[str, Any]]
options: list[Any] | list[tuple[str, Any]],
) -> list[dict[str, Any]]:
"""
unpack search options for use in react component
Expand Down Expand Up @@ -180,7 +180,7 @@ def _set_defaults(
{
"color": str,
"backgroundColor": str,
"highlightColor": str | None,
"highlightColor": str,
},
total=False,
)
Expand Down

0 comments on commit eb53a95

Please sign in to comment.