Skip to content
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

Fix tox lint stage #6

Merged
merged 10 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/python_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ jobs:
test:
runs-on: ubuntu-latest

env:
ACTIONS_RUNNER_DEBUG: true
ACTIONS_STEP_DEBUG: true

strategy:
matrix:
python-version: ["3.10", "3.11"]
Expand Down Expand Up @@ -33,4 +37,7 @@ jobs:
pip install tox

- name: Run tests
run: tox
run: tox -e ${{ matrix.python-version }} -v

- name: Run lint checks
run: tox -e lint -v
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ dev = [
"ruff==0.4.8",
"pre-commit==3.7.1",
"mypy==1.10.0",
"twine==5.1.0",
]
docs = [
"mkdocs==1.6.0",
Expand Down
2 changes: 1 addition & 1 deletion src/otf_api/classes_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async def get_classes(
UUIDs are provided, it will default to the user's home studio.

Args:
studio_uuids (list[str] | None): The studio UUIDs to get the classes for. Default is None, which will
studio_uuids (list[str] | None): The studio UUIDs to get the classes for. Default is None, which will\
default to the user's home studio only.
include_home_studio (bool): Whether to include the home studio in the classes. Default is True.

Expand Down
2 changes: 1 addition & 1 deletion src/otf_api/dna_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def get_telemetry(self, class_history_uuid: str, max_data_points: int = 0)

Args:
class_history_uuid (str): The class history UUID.
max_data_points (int): The max data points to use for the telemetry. Default is 0, which will attempt to
max_data_points (int): The max data points to use for the telemetry. Default is 0, which will attempt to\
get the max data points from the workout. If the workout is not found, it will default to 120 data points.

Returns:
Expand Down
4 changes: 2 additions & 2 deletions src/otf_api/member_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async def get_bookings(
Args:
start_date (date | str | None): The start date for the bookings. Default is None.
end_date (date | str | None): The end date for the bookings. Default is None.
status (BookingStatus | None): The status of the bookings to get. Default is None, which includes
status (BookingStatus | None): The status of the bookings to get. Default is None, which includes\
all statuses. Only a single status can be provided.

Note: Looking at the code in the app, it appears that this endpoint accepts multiple statuses. Indeed,
Expand Down Expand Up @@ -307,7 +307,7 @@ async def get_studio_services(self, studio_uuid: str | None = None) -> StudioSer
will be used.

Args:
studio_uuid (str): The studio UUID to get services for. Default is None, which will use the member's home
studio_uuid (str): The studio UUID to get services for. Default is None, which will use the member's home\
studio.

Returns:
Expand Down
2 changes: 1 addition & 1 deletion src/otf_api/studio_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async def get_studio_detail(self, studio_uuid: str | None = None) -> StudioDetai
user's home studio.

Args:
studio_uuid (str): Studio UUID to get details for. Defaults to None, which will default to the user's home
studio_uuid (str): Studio UUID to get details for. Defaults to None, which will default to the user's home\
studio.

Returns:
Expand Down
25 changes: 14 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
[tox]
skipsdist = true
isolated_build = true
envlist = py310, py311, lint
envlist = py310, py311, lint, build

[gh-actions]
python =
3.11: py311
3.10: py310

[testenv:lint]
extras =
dev
doc
deps =
.[dev,doc]
.[dev,docs]
commands =
ruff format src
ruff check src
mypy -m src --exclude ^tests
mypy src
mkdocs build -v

[testenv:build]
deps =
build
twine
commands =
python -m build
mkdocs build
twine check dist/*

[testenv]
allowlist_externals = ruff,mypy
recreate = False
passenv = *
allowlist_externals = ruff, mypy, mkdocs, twine
passenv =
HOME
USER
setenv =
PYTHONPATH = {toxinidir}
PYTHONWARNINGS = ignore
Expand Down