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
5 changes: 2 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ COPY --from=ghcr.io/astral-sh/uv:0.6.4 /uv /uvx /bin/
ARG USERNAME=vscode

RUN apt-get update && \
apt-get install -y --no-install-recommends libgdal-dev && \
apt-get install -y --no-install-recommends libgdal-dev python3-dev && \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required to avoid issues with psycopg2 when installing all dependencies - see https://stackoverflow.com/questions/19843945/psycopg-python-h-no-such-file-or-directory

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to see this as an inline comment in the dockerfile, IDK what @cpcloud thinks though

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that'd be nice, but not a blocker!

rm -rf /var/lib/apt/lists/*

RUN python3 -m pip install pipx --no-cache-dir
Expand All @@ -24,8 +24,7 @@ COPY . /app
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv venv && uv sync --group dev --group tests \
--extra duckdb --extra clickhouse --extra examples --extra geospatial
uv venv && just sync duckdb

ENV VENV_DIR=.venv
RUN chown -R $USERNAME $VENV_DIR && chmod -R 755 $VENV_DIR
Expand Down
41 changes: 41 additions & 0 deletions docs/contribute/01_environment.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,47 @@ for manager, params in managers.items():
* `Rebuild Container` to copy files from the local Git repo and have the build
run `uv sync`.

## uv

::: {.callout-warning}
## `uv` will not handle installation of system dependencies

`uv` will not install system dependencies needed for some packages such as `psycopg2` and `kerberos`.

For a better development experience see the `conda/mamba` or `nix` setup instructions.
:::

1. [Install `uv`](https://docs.astral.sh/uv/getting-started/installation/)

1. [Install `gh`](https://cli.github.com/manual/installation)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is gh only needed for the gh repo fork --clone call below? Or do the other justfile recipes require it? If it is only for this first step, I could see it being nice to removing this as a dependency: only instructing people to install uv, and then providing the raw git commands (would also need to instruct them to fork the repo, probably in the github web ui).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would we want to replace a one liner with clicking on a web page?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't mean to sound like a jerk there. After rereading what I wrote I realized it probably didn't come off exactly as I meant.

The original reason I chose gh is because it's the tool that lets you stay in one mode while setting everything up, whereas having people click to fork requires context switching. I don't see what we gain here by removing the gh dependency.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah no worrie! Sounds good to me, just wanted to throw it out there


1. Fork and clone the ibis repository:

```sh
gh repo fork --clone --remote ibis-project/ibis
```

1. Change directory into `ibis`:

```sh
cd ibis
```

1. Install development dependencies

This will create a virtual environment at `.venv` and install all dependencies inside.
It will also install Ibis in development mode as `ibis-framework`.

```sh
just sync
```

1. Activate the virtual environment

```sh
source .venv/bin/activate
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can't unfortunately be a just recipe - see https://byabbe.se/2024/02/21/using-python-virtual-environments-through-just

```

## pip

::: {.callout-warning}
Expand Down
9 changes: 9 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ default:
clean:
git clean -fdx -e 'ci/ibis-testing-data'

# install dependencies for a given backend, or all dependencies if none is given
sync backend="":
#!/usr/bin/env bash
if [ ! "{{ backend }}" ]; then
uv sync --all-groups --all-extras
else
uv sync --group dev --group tests --extra {{ backend }} --extra examples --extra geospatial
fi

# lock dependencies without updating existing versions
lock:
#!/usr/bin/env bash
Expand Down
Loading