Skip to content

Commit 6a2beaf

Browse files
committed
chore: Migrate from pip/setuptools to uv package manager
Switch to uv for Python package management with exclude-newer=1week to prevent supply chain attacks.
1 parent 977b3e2 commit 6a2beaf

File tree

11 files changed

+667
-114
lines changed

11 files changed

+667
-114
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182 # v5
1719
- name: Set up Python
1820
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
1921
with:
2022
python-version: "3.13"
2123
- name: Install dependencies
22-
run: |
23-
pip install --upgrade pip
24-
pip install -r requirements.txt
24+
run: uv sync
2525
- name: Check formatting
2626
run: make fmt-check

.github/workflows/publish.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@ jobs:
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182 # v5
2022
- name: Set up Python
2123
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
2224
with:
2325
python-version: "3.13"
24-
- name: Install dependencies
25-
run: |
26-
pip install -r requirements.txt
27-
pip install build
2826
- name: Build package
29-
run: python -m build
27+
run: uv build
3028
- name: Publish package distributions to PyPI
3129
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/regen.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ jobs:
1919
permission-pull-requests: write
2020
- name: Checkout
2121
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182 # v5
2224
- name: Set up Python
2325
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
2426
with:
2527
python-version: '3.13'
2628
- name: Install dependencies
27-
run: |
28-
pip install --upgrade pip
29-
pip install -r requirements.txt
29+
run: uv sync
3030
- name: Generate code
3131
run: |
3232
make clone-proto

.github/workflows/unittest.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ jobs:
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182 # v5
1921
- name: Set up Python
2022
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
2123
with:
2224
python-version: "3.13"
2325
- name: Install dependencies
24-
run: |
25-
pip install --upgrade pip
26-
pip install -r requirements.txt
26+
run: uv sync
2727
- name: Run tests
2828
run: make test

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
test:
2-
pytest .
2+
uv run pytest .
33

44
fmt:
5-
black . --exclude=cloudquery
5+
uv run black . --exclude=cloudquery
66

77
fmt-check:
8-
black --check . --exclude=cloudquery
8+
uv run black --check . --exclude=cloudquery
99

1010
clone-proto:
1111
git clone https://github.com/cloudquery/plugin-pb
@@ -15,8 +15,8 @@ gen-proto:
1515

1616
mkdir -p ./protos/cloudquery/plugin_v3
1717
cp ./plugin-pb/plugin/v3/*.proto ./protos/cloudquery/plugin_v3/.
18-
python -m grpc_tools.protoc -I./protos --python_out=. --pyi_out=. --grpc_python_out=. ./protos/cloudquery/plugin_v3/*.proto
18+
uv run python -m grpc_tools.protoc -I./protos --python_out=. --pyi_out=. --grpc_python_out=. ./protos/cloudquery/plugin_v3/*.proto
1919

2020
mkdir -p ./protos/cloudquery/discovery_v1
2121
cp ./plugin-pb/discovery/v1/*.proto ./protos/cloudquery/discovery_v1/.
22-
python -m grpc_tools.protoc -I./protos --python_out=. --pyi_out=. --grpc_python_out=. ./protos/cloudquery/discovery_v1/*.proto
22+
uv run python -m grpc_tools.protoc -I./protos --python_out=. --pyi_out=. --grpc_python_out=. ./protos/cloudquery/discovery_v1/*.proto

README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,13 @@ This is a low-level auto-generated gRPC client and server for CloudQuery plugin
66

77
### Prerequisites
88

9-
- [Python 3.7+](https://www.python.org/downloads/)
10-
11-
we recommend using virtualenv to manage your python environment.
12-
13-
```bash
14-
virtualenv -p python3.7 venv # or any python >= 3.7
15-
source venv/bin/activate
16-
```
9+
- [Python 3.9+](https://www.python.org/downloads/)
10+
- [uv](https://docs.astral.sh/uv/)
1711

1812
### Install dependencies
1913

2014
```bash
21-
pip install -r requirements.txt
15+
uv sync
2216
```
2317

2418
### Regenerate gRPC code
@@ -27,4 +21,3 @@ pip install -r requirements.txt
2721
make clone-proto # This is needed only once
2822
make gen
2923
```
30-

pyproject.toml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
[build-system]
2+
requires = ["setuptools>=75.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "cloudquery-plugin-pb"
7+
version = "0.0.54"
8+
description = "CloudQuery Plugin client and server library"
9+
readme = "README.md"
10+
license = "MPL-2.0"
11+
requires-python = ">=3.9"
12+
authors = [
13+
{ name = "CloudQuery LTD", email = "pypi-packages@cloudquery.io" },
14+
]
15+
classifiers = [
16+
"Intended Audience :: Developers",
17+
"License :: OSI Approved :: Apache Software License",
18+
"Programming Language :: Python",
19+
"Programming Language :: Python :: 3",
20+
"Programming Language :: Python :: 3.9",
21+
"Programming Language :: Python :: 3.10",
22+
"Programming Language :: Python :: 3.11",
23+
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
25+
"Operating System :: OS Independent",
26+
"Topic :: Internet",
27+
]
28+
dependencies = [
29+
"grpcio>=1.56.0",
30+
"grpcio-tools>=1.56.0",
31+
"protobuf>=6.30.0",
32+
"pyarrow>=13.0.0",
33+
]
34+
35+
[project.urls]
36+
Homepage = "https://github.com/cloudquery/plugin-pb-python"
37+
38+
[dependency-groups]
39+
dev = [
40+
"black>=26.3.1; python_version >= '3.10'",
41+
"pytest>=9.0.2; python_version >= '3.10'",
42+
]
43+
44+
[tool.setuptools.packages.find]
45+
include = ["cloudquery*"]
46+
47+
[tool.setuptools.package-data]
48+
cloudquery = [
49+
"plugin_v3/py.typed",
50+
"plugin_v3/*.pyi",
51+
"discovery_v1/py.typed",
52+
"discovery_v1/*.pyi",
53+
]
54+
55+
[tool.uv]
56+
exclude-newer = "1 week"

requirements.txt

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

setup.cfg

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

setup.py

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

0 commit comments

Comments
 (0)