Skip to content

Commit f33c6a3

Browse files
authored
Merge pull request #89 from tharropoulos/migrate-to-uv
build: modernize CI workflow with uv and improve code quality tooling
2 parents b0d477b + 8289335 commit f33c6a3

File tree

14 files changed

+674
-1029
lines changed

14 files changed

+674
-1029
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Set up Python
2222
uses: actions/setup-python@v4
2323
with:
24-
python-version: "3.8"
24+
python-version: "3.9"
2525
cache: pip
2626

2727
- name: Install build dependencies

.github/workflows/test-and-lint.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
14+
python-version: ["3.9", "3.10", "3.11", "3.12"]
1515
services:
1616
typesense:
1717
image: typesense/typesense:28.0
@@ -31,27 +31,25 @@ jobs:
3131
- name: Wait for Typesense
3232
run: |
3333
timeout 20 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8108/health)" != "200" ]]; do sleep 1; done' || false
34+
3435
- uses: actions/checkout@v4
3536

36-
- name: Set up Python ${{ matrix.python-version }}
37-
uses: actions/setup-python@v4
37+
- name: Install uv and set the python version
38+
uses: astral-sh/setup-uv@v5
3839
with:
3940
python-version: ${{ matrix.python-version }}
40-
cache: 'pip'
4141

42-
- name: Install dependencies
43-
run: |
44-
python -m pip install --upgrade pip
45-
pip install -r requirements/dev.txt
42+
- name: Install the project
43+
run: uv sync --locked --all-extras --dev
4644

47-
- name: Lint with Flake8
45+
- name: Lint with Ruff
4846
run: |
49-
flake8 src/typesense
47+
uv run ruff check src/typesense
5048
5149
- name: Check types with mypy
5250
run: |
53-
mypy src/typesense
51+
uv run mypy src/typesense
5452
5553
- name: Run tests and coverage (excluding OpenAI)
5654
run: |
57-
coverage run -m pytest -m "not open_ai"
55+
uv run coverage run -m pytest -m "not open_ai"

.python-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

Pipfile

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

Pipfile.lock

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

pyproject.toml

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
[build-system]
2-
requires = ["setuptools"]
3-
build-backend = "setuptools.build_meta"
4-
51
[project]
62
name = "typesense"
73
description = "Python client for Typesense, an open source and typo tolerant search engine."
8-
authors = [
9-
{"name" = "Typesense", "email" = "[email protected]"},
10-
]
4+
authors = [{ name = "Typesense", email = "[email protected]" }]
5+
requires-python = ">=3.9"
116
readme = "README.md"
12-
requires-python = ">=3"
13-
keywords = ["search", "typesense"]
14-
license = {"text" = "Apache 2.0"}
7+
license = { text = "Apache 2.0" }
8+
keywords = [
9+
"search",
10+
"typesense",
11+
]
1512
classifiers = [
1613
"Development Status :: 5 - Production/Stable",
1714
"Intended Audience :: Developers",
@@ -27,6 +24,31 @@ Documentation = "https://typesense.org/"
2724
Source = "https://github.com/typesense/typesense-python"
2825
Tracker = "https://github.com/typesense/typesense-python/issues"
2926

27+
[build-system]
28+
requires = ["setuptools"]
29+
build-backend = "setuptools.build_meta"
30+
31+
[dependency-groups]
32+
dev = [
33+
"mypy",
34+
"pytest",
35+
"coverage",
36+
"pytest-mock",
37+
"requests-mock",
38+
"python-dotenv",
39+
"types-requests",
40+
"faker",
41+
"ruff>=0.11.11",
42+
"isort>=6.0.1",
43+
]
44+
45+
[tool.uv]
46+
package = false
47+
48+
[[tool.uv.index]]
49+
name = "pypi"
50+
url = "https://pypi.org/simple"
51+
3052
[tool.setuptools.dynamic]
3153
version = {attr = "typesense.__version__"}
3254

requirements-dev.txt

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile pyproject.toml --group dev -o requirements-dev.txt
3+
certifi==2025.4.26
4+
# via requests
5+
charset-normalizer==3.4.2
6+
# via requests
7+
coverage==7.8.2
8+
# via typesense (pyproject.toml:dev)
9+
faker==37.3.0
10+
# via typesense (pyproject.toml:dev)
11+
idna==3.10
12+
# via requests
13+
iniconfig==2.1.0
14+
# via pytest
15+
mypy==1.15.0
16+
# via typesense (pyproject.toml:dev)
17+
mypy-extensions==1.1.0
18+
# via mypy
19+
packaging==25.0
20+
# via pytest
21+
pluggy==1.6.0
22+
# via pytest
23+
pytest==8.3.5
24+
# via
25+
# typesense (pyproject.toml:dev)
26+
# pytest-mock
27+
pytest-mock==3.14.1
28+
# via typesense (pyproject.toml:dev)
29+
python-dotenv==1.1.0
30+
# via typesense (pyproject.toml:dev)
31+
requests==2.32.3
32+
# via
33+
# typesense (pyproject.toml)
34+
# requests-mock
35+
requests-mock==1.12.1
36+
# via typesense (pyproject.toml:dev)
37+
ruff==0.11.11
38+
# via typesense (pyproject.toml:dev)
39+
types-requests==2.32.0.20250515
40+
# via typesense (pyproject.toml:dev)
41+
typing-extensions==4.13.2
42+
# via mypy
43+
tzdata==2025.2
44+
# via faker
45+
urllib3==2.4.0
46+
# via
47+
# requests
48+
# types-requests

requirements.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1-
-i https://pypi.org/simple
2-
-r requirements/common.txt
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile pyproject.toml -o requirements.txt
3+
certifi==2024.8.30
4+
# via requests
5+
charset-normalizer==3.3.2
6+
# via requests
7+
idna==3.8
8+
# via requests
9+
requests==2.32.3
10+
# via typesense (pyproject.toml)
11+
urllib3==2.2.2
12+
# via requests

requirements/common.txt

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

requirements/dev.txt

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

0 commit comments

Comments
 (0)