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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ uv sync --dev
> [!TIP]
>
> - If sync fails with `missing field 'version'`, you may need to delete lockfile and rerun `rm uv.lock && uv sync --dev`.
> - If sync fails with failed compilation, you may need to install clang and rerun `uv sync --dev`.
> - If sync fails with failed compilation, you may need to install dependencies (see [install-deps.sh](scripts/install-deps.sh)) and rerun `uv sync --dev`.

### Running Tests

Expand Down
9 changes: 9 additions & 0 deletions hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version-file = "src/codegen/sdk/__init__.py"
allow-direct-references = true
[envs.hatch-build]
installer = "uv"

[[envs.hatch-build.matrix]]
tool = ["uv", "pip"]

Expand Down Expand Up @@ -36,6 +37,14 @@ compile_args = [
"darwin",
], arch = "arm64", arg = "-mcpu=apple-m1" },
]
env = [
{ env = "CC", arg = "cc", platforms = [
"linux",
] },
{ env = "CC", arg = "clang", platforms = [
"darwin",
] },
]
cythonize_kwargs = { annotate = true, nthreads = 16, exclude_failures = false, cache = true }
compiled_sdist = true
compile_py = false
Expand Down
7 changes: 7 additions & 0 deletions scripts/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ if command -v sudo &> /dev/null; then
fi

if command -v apt &> /dev/null; then
if ! (command -v clang &> /dev/null || command -v gcc &> /dev/null); then
echo "Neither clang nor gcc found. Installing gcc..."
$SUDO apt update && $SUDO apt install -y gcc build-essential python3-dev
fi

$SUDO apt update && $SUDO apt install -y jq \
build-essential \
python3-dev \
libpixman-1-dev \
libcairo2-dev \
libpango1.0-dev \
Expand Down