diff --git a/.github/codeowners b/.github/codeowners new file mode 100644 index 0000000..5010e67 --- /dev/null +++ b/.github/codeowners @@ -0,0 +1 @@ +* @vladkens diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7aaf834..ee3a7a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,16 +5,20 @@ on: branches: [main] tags: ["v*"] +permissions: + contents: read + jobs: test: runs-on: ubuntu-latest + continue-on-error: ${{ matrix.python-version == '3.15' }} strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] steps: - - uses: actions/checkout@v6 - - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 + - uses: actions/checkout@v7 + - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 with: python-version: ${{ matrix.python-version }} @@ -30,8 +34,8 @@ jobs: contents: write id-token: write steps: - - uses: actions/checkout@v6 - - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 + - uses: actions/checkout@v7 + - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 - name: Check pyproject.toml version matches tag run: | diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c7cbc07..c0b8810 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -2,22 +2,21 @@ name: pr on: pull_request: - pull_request_target: - types: [opened, reopened] -permissions: read-all +permissions: + contents: read jobs: test: - if: github.event_name == 'pull_request' runs-on: ubuntu-latest + continue-on-error: ${{ matrix.python-version == '3.15' }} strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] steps: - - uses: actions/checkout@v6 - - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 + - uses: actions/checkout@v7 + - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 with: python-version: ${{ matrix.python-version }} diff --git a/readme.md b/readme.md index 8a5c1fe..88d707c 100644 --- a/readme.md +++ b/readme.md @@ -111,6 +111,14 @@ async for tweet in api.search("open source lang:en", limit=100): print(tweet.id, tweet.rawContent) ``` +Configure what happens when no account is immediately available: + +```python +api = API(raise_when_no_account=True, wait_timeout=30, wait_interval=1) +``` + +`wait_timeout` limits how long to wait for a locked account, `wait_interval` controls how often the pool checks again, and `raise_when_no_account` raises `NoAccountError` instead of ending the operation. By default, twscrape waits indefinitely while active accounts are locked. + Search defaults to the Latest tab. Pass `kv={"product": "Top"}` or `kv={"product": "Media"}` to use another search product: ```python