Skip to content

Commit 9ae5339

Browse files
committed
chore: use rye scripts instead of makefile
1 parent c11a51e commit 9ae5339

File tree

3 files changed

+34
-65
lines changed

3 files changed

+34
-65
lines changed

.github/workflows/python.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,33 @@ jobs:
1313
python-version: ["3.9", "3.10", "3.11", "3.12"]
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717

1818
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222

23+
- name: Install the latest version of rye
24+
uses: eifinger/setup-rye@v4
25+
id: setup-rye
26+
with:
27+
enable-cache: true
28+
cache-prefix: ${{ matrix.python-version }}
29+
30+
- name: Pin python-version ${{ matrix.python-version }}
31+
if: steps.setup-rye.outputs.cache-hit != 'true'
32+
run: rye pin ${{ matrix.python-version }}
33+
2334
- name: Install dependencies
35+
if: steps.setup-rye.outputs.cache-hit != 'true'
2436
run: |
25-
python -m pip install --upgrade pip
26-
pip install tox
37+
rye sync --no-lock
2738
2839
- name: Generate API
2940
run: |
30-
make venv
31-
make api
41+
rye run api
3242
3343
- name: Run tests
3444
run: |
35-
tox
45+
rye run python -m pytest

Makefile

Lines changed: 0 additions & 58 deletions
This file was deleted.

pyproject.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,20 @@ showcontent = true
178178
directory = "misc"
179179
name = "Misc"
180180
showcontent = true
181+
182+
[tool.rye.scripts]
183+
clean = { chain = ["clean:docs", "clean:api"] }
184+
"clean:api" = { cmd = "rm -rf hydrogram/errors/exceptions hydrogram/raw/all.py hydrogram/raw/base hydrogram/raw/functions hydrogram/raw/types" }
185+
"clean:docs" = { cmd = "rm -rf docs/build docs/source/api/bound-methods docs/source/api/methods docs/source/api/types docs/source/telegram" }
186+
187+
api = { chain = ["api:raw", "api:errors"] }
188+
"api:raw" = { call = "compiler.api.compiler:start" }
189+
"api:errors" = { call = "compiler.errors.compiler:start" }
190+
191+
docs = { chain = ["docs:compile", "docs:serve"] }
192+
"docs:compile" = { cmd = "python compiler/docs/compiler.py" }
193+
"docs:serve" = { cmd = "sphinx-build -b html docs/source docs/build/html -j auto" }
194+
live-docs = { cmd = "sphinx-autobuild docs/source docs/build/html -j auto --watch src" }
195+
196+
towncrier = { cmd = "towncrier build --yes" }
197+
towncrier-draft = { cmd = "towncrier build --draft" }

0 commit comments

Comments
 (0)