Skip to content

Commit

Permalink
fix: types and
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Nov 26, 2024
1 parent 790dce6 commit 893f3f4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
python-version: ${{ matrix.version }}

- name: Install dependencies and run tests
timeout-minutes: 5
timeout-minutes: 3
run: |
python -m venv python-ci-run
source python-ci-run/bin/activate
Expand Down
4 changes: 2 additions & 2 deletions algoliasearch_django/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class AlgoliaIndex(object):
tags = None

# Use to specify the index to target on Algolia.
index_name: str | None = None
index_name: Optional[str] = None

# Use to specify the settings of the index.
settings = None
Expand Down Expand Up @@ -395,7 +395,7 @@ def raw_search(self, query="", params=None):
else:
logger.warning("ERROR DURING SEARCH ON %s: %s", self.index_name, e)

def get_settings(self) -> dict | None:
def get_settings(self) -> Optional[dict]:
"""Returns the settings of the index."""
try:
logger.info("GET SETTINGS ON %s", self.index_name)
Expand Down
15 changes: 10 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ deps =
six
mock
factory_boy
ruff {[versions]ruff}
pyright {[versions]pyright}
py{38,313}: Faker>=5.0,<6.0
django40: Django>=4.0,<4.1
django41: Django>=4.1,<4.2
Expand All @@ -26,9 +24,6 @@ passenv =
ALGOLIA*
commands =
pip3 install -r requirements.txt
ruff check --fix --unsafe-fixes
ruff format .
pyright algoliasearch_django
python runtests.py

[versions]
Expand Down Expand Up @@ -70,3 +65,13 @@ commands =
python setup.py sdist bdist_wheel
twine check dist/*
twine upload -u {env:PYPI_USER} -p {env:PYPI_PASSWORD} --repository-url https://upload.pypi.org/legacy/ dist/*

[testenv:lint]
deps =
ruff {[versions]ruff}
pyright {[versions]pyright}
commands =
pip3 install -r requirements.txt
ruff check --fix --unsafe-fixes
ruff format .
pyright algoliasearch_django

0 comments on commit 893f3f4

Please sign in to comment.