This section describes how to build Gel locally, how to use its internal tools, and how to contribute to it.
Code-changing pull requests without adding new tests might take longer time to be reviewed and merged.
The following instructions should be used to create a "dev" build on Linux or macOS. Windows is not currently supported.
Build RequirementsGNU make version 3.80 or newer;
C compiler (GCC or clang);
Rust compiler and Cargo 1.80 or later;
autotools;
Python 3.12 dev package;
Bison 1.875 or later;
Flex 2.5.31 or later;
Perl 5.8.3 or later;
icu4c 4.6 or later;
Zlib (zlibg1-dev on Ubuntu);
Readline dev package;
Libuuid dev package;
Node.js 14 or later;
Yarn 1
Protobuf & C bindings for Protobuf
On Ubuntu 24.04, these can be installed by running:
$
apt install make gcc rust-all autotools-dev python3.12-dev \ python3.12-venv bison flex libreadline-dev perl zlib1g-dev \ uuid-dev nodejs npm
$
corepack enable && corepack prepare yarn@stable --activate
On macOS, these can be installed by running:
$
brew install rustup autoconf libtool python@3.12 readline zlib nodejs icu4c
To build Postgres on macOS, you'll need to set PKG_CONFIG_PATH
so it can find the icu4c
libraries. This can be done manually each time you rebuild Postgres, or set in your .profile
or virtual environment.
$
export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig"
A Nix shell with all dependencies and a Python virtual environment can be built with the following shell.nix
file.
with import <nixpkgs> {}; pkgs.mkShell { name = "gel dev shell"; venvDir = "./venv"; buildInputs = with pkgs; [ python312Packages.python python312Packages.venvShellHook rustup autoconf automake bison flex perl zlib readline libuuid nodejs yarn openssl pkg-config icu protobuf protobufc ]; LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.stdenv.cc.cc ]; LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; # If you are using NixOS: # Postgres configure script uses /bin/pwd, # which does not exist on NixOS. # # I had a workaround for replacing /bin/pwd with pwd, # but it was annoying that postgres/ was dirty. # So my fix now is: # $ sudo sh -c "echo 'pwd' > /bin/pwd" # $ sudo chmod +x /bin/pwd }Instructions
The easiest way to set up a development environment is to create a Python "venv" with all dependencies and commands installed into it.
Make a new directory that will contain checkouts of gel and gel-python. The name of the directory is arbitrary, we will use "dev" in this guide:
Clone the gel repository using --recursive
to clone all submodules:
$
git clone --recursive https://github.com/geldata/gel.git
Create a Python 3.12 virtual environment and activate it:
$
python3.12 -m venv gel-dev
$
source gel-dev/bin/activate
Build gel (the build will take a while):
$
pip install -v -e ".[test]"
In addition to compiling Gel and all dependencies, this will also install the edb
and gel
command line tools into the current Python virtual environment.
It will also install libraries used during development.
Run tests:
The new virtual environment is now ready for development and can be activated at any time.
To run all Gel tests simply use the $ edb test
command without arguments.
The command also supports running a few selected tests. To run all tests in a test case file:
$
edb test tests/test_edgeql_calls.py
$
edb test tests/test_edgeql_calls.py tests/test_edgeql_for.py
To pattern-match a test by its name:
$
edb test -k test_edgeql_calls_01
# or run all tests that contain "test_edgeql_calls":
$
edb test -k test_edgeql_calls
See $ edb test --help
for more options.
Use the $ edb server
command to start the development server.
You can then use another terminal to open a REPL to the server using the gel
command, or connect to it using one of the language bindings.
Use the $ edb inittestdb
command to create and populate branches that are used by unit tests.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4