mirror of
https://github.com/vladkens/twscrape.git
synced 2026-10-10 15:17:19 -04:00
build: split lint/check and fix pyright example
This commit is contained in:
@@ -17,7 +17,7 @@ jobs:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- run: uv sync --frozen
|
||||
- run: make lint
|
||||
- run: make check
|
||||
- run: make test
|
||||
|
||||
release:
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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/
|
||||
|
||||
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user