Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ jobs:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8
with:
version: "0.11.2"
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.14"
python-version: "3.13"
- name: Install dependencies
run: |
pip3 install --no-cache-dir poetry==2.1.4
poetry install --no-interaction --no-ansi --no-root
run: uv sync --frozen
- name: Check formatting
run: make fmt-check
10 changes: 6 additions & 4 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ jobs:
- # Required for the package command tests to work
name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8
with:
version: "0.11.2"
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.14"
python-version: "3.13"
- name: Install dependencies
run: |
pip3 install --no-cache-dir poetry==2.1.4
poetry install --no-interaction --no-ansi --no-root
run: uv sync --frozen
- name: Run tests
run: make test
19 changes: 8 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
# Start from a base image
FROM python:3.13-slim

# (Optional) Set a working directory
COPY --from=ghcr.io/astral-sh/uv:0.11.2 /uv /uvx /bin/

WORKDIR /app

# Copy requirements.txt and install the Python dependencies
COPY pyproject.toml .
COPY poetry.lock .
RUN pip3 install --no-cache-dir poetry==2.1.4
RUN poetry install --no-interaction --no-ansi --no-root
# Copy dependency files and install
COPY pyproject.toml uv.lock README.md ./
RUN uv sync --frozen --no-dev --no-install-project

# Copy the rest of the code
COPY plugin plugin
COPY main.py .
RUN uv sync --frozen --no-dev

# (Optional) Expose any ports your app uses
EXPOSE 7777

ENTRYPOINT ["poetry", "run", "main"]
ENTRYPOINT ["uv", "run", "main"]

# Specify the command to run when the container starts
CMD ["serve", "--address", "[::]:7777", "--log-format", "json", "--log-level", "info"]
CMD ["serve", "--address", "[::]:7777", "--log-format", "json", "--log-level", "info"]
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
test:
poetry run pytest . -vv
uv run pytest . -vv

fmt:
poetry run black .
uv run black .

fmt-check:
poetry run black --check .
uv run black --check .
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ Finally, you need to edit the `plugin.py` file to set the plugin name and versio

To test your plugin you can run it locally.

To automatically manage your virtual environment and install the dependencies listed in the `pyproject.toml` you can use `poetry`.
Poetry is an improved package & environment manager for Python that uses the standardised `pyproject.toml`, if you don't have it installed you can pull it with `pip install poetry`.
To automatically manage your virtual environment and install the dependencies listed in the `pyproject.toml` you can use `uv`.
uv is a fast Python package and project manager. To install it, see the [uv installation docs](https://docs.astral.sh/uv/getting-started/installation/).

To install the dependencies into a new virtual environment run `poetry install`.
If you have additional dependencies you can add them with `poetry add {package_name}` which will add them to the `pyproject.toml` and install them into the virtual environment.
To install the dependencies into a new virtual environment run `uv sync`.
If you have additional dependencies you can add them with `uv add {package_name}` which will add them to the `pyproject.toml` and install them into the virtual environment.

Then to run the plugin `poetry run main serve`, which will launch the plugin manually as a GRPC service.
Then to run the plugin `uv run main serve`, which will launch the plugin manually as a GRPC service.

With that running you can adjust the `TestConfig.yaml` to match your plugin and run `cloudquery sync`.
This should result in the creation of a sqlite database `db.sqlite` where you can validate your tables are as expected.
Expand Down
1,349 changes: 0 additions & 1,349 deletions poetry.lock

This file was deleted.

40 changes: 26 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
[tool.poetry]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "example"
version = "0.1.0"
description = ""
authors = ["Plaintextnerds <tim@plaintextnerds.com>"]
readme = "README.md"
packages = [{ include = "plugin" }]

[tool.poetry.dependencies]
python = ">=3.11,<3.14"
cloudquery-plugin-sdk = ">=0.1.47"
pydantic = "^2.11.7"
pyarrow = "^23.0.0"
requests = "^2.32.5"
requires-python = ">=3.11,<3.14"
authors = [
{ name = "Plaintextnerds", email = "tim@plaintextnerds.com" },
]
dependencies = [
"cloudquery-plugin-sdk>=0.1.47",
"pydantic>=2.11.7",
"pyarrow>=23.0.0",
"requests>=2.32.5",
]

[tool.poetry.scripts]
[project.scripts]
main = "main:main"

[dependency-groups]
dev = [
"black>=24.0.0",
"pytest>=8.0.0",
]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.hatch.build.targets.wheel]
packages = ["plugin"]

[tool.uv]
exclude-newer = "1 week"
Loading
Loading