build: split lint/check and fix pyright example

This commit is contained in:
vladkens
2026-05-21 05:57:24 +03:00
parent 6e0db145e6
commit ff67298890
4 changed files with 13 additions and 11 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- run: uv sync --frozen
- run: make lint
- run: make check
- run: make test
release:
+2 -2
View File
@@ -1,11 +1,11 @@
ARG VER=3.12
FROM python:${VER}-alpine
RUN apk add git uv
RUN apk add make git uv nodejs
WORKDIR /app
COPY pyproject.toml readme.md uv.lock /app/
RUN uv sync --frozen
COPY . /app
CMD ["sh", "-c", "uv run pytest tests/"]
CMD ["sh", "-c", "make check && make test"]
+9 -6
View File
@@ -1,6 +1,6 @@
.PHONY: prepare install update lint test test-py test-sq test-matrix-py test-matrix-sq
.PHONY: prepare install update lint check test test-py test-sq test-matrix-py test-matrix-sq
prepare: lint
prepare: lint check
install:
uv sync
@@ -9,10 +9,13 @@ update:
uv sync --upgrade --all-groups
lint:
@uv run ruff check --select I --fix .
@uv run ruff format .
@uv run ruff check .
@uv run pyright .
uv run ruff check --select I --fix .
uv run ruff format .
check:
uv run ruff format --check .
uv run ruff check .
uv run pyright .
test:
@uv run pytest -s --cov=twscrape tests/
+1 -2
View File
@@ -15,8 +15,7 @@ async def worker(api: twscrape.API, q: str):
tweets.append(doc)
except Exception as e:
print(e)
finally:
return tweets
return tweets
async def main():