From 50b06a197bffadef20b9dc85e890c40214f7c182 Mon Sep 17 00:00:00 2001 From: Elvis Pranskevichus Date: Tue, 15 Jul 2025 23:17:01 -0700 Subject: [PATCH 1/2] workflows: Upgrades in the release workflow --- .github/workflows/install-edgedb.sh | 24 ---------- .github/workflows/install-gel.sh | 24 ++++++++++ .github/workflows/release.yml | 70 ++++++++++++++--------------- tests/test_codegen.py | 2 +- tests/test_sourcecode.py | 5 ++- 5 files changed, 63 insertions(+), 62 deletions(-) delete mode 100755 .github/workflows/install-edgedb.sh create mode 100755 .github/workflows/install-gel.sh diff --git a/.github/workflows/install-edgedb.sh b/.github/workflows/install-edgedb.sh deleted file mode 100755 index 4a3bd0aa0..000000000 --- a/.github/workflows/install-edgedb.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -Eexuo pipefail -shopt -s nullglob - -srv="https://packages.edgedb.com" - -curl -fL "${srv}/dist/$(uname -m)-unknown-linux-musl/edgedb-cli" \ - > "/usr/bin/edgedb" - -chmod +x "/usr/bin/edgedb" - -if command -v useradd >/dev/null 2>&1; then - useradd --shell /bin/bash edgedb -else - # musllinux/alpine doesn't have useradd - adduser -s /bin/bash -D edgedb -fi - -su -l edgedb -c "edgedb server install --version ${EDGEDB_SERVER_VERSION}" -ln -s $(su -l edgedb -c "edgedb server info --latest --bin-path") \ - "/usr/bin/edgedb-server" - -edgedb-server --version diff --git a/.github/workflows/install-gel.sh b/.github/workflows/install-gel.sh new file mode 100755 index 000000000..53f19337c --- /dev/null +++ b/.github/workflows/install-gel.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -Eexuo pipefail +shopt -s nullglob + +srv="https://packages.geldata.com" + +curl -fL "${srv}/dist/$(uname -m)-unknown-linux-musl/gel-cli" \ + > "/usr/bin/gel" + +chmod +x "/usr/bin/gel" + +if command -v useradd >/dev/null 2>&1; then + useradd --shell /bin/bash gel +else + # musllinux/alpine doesn't have useradd + adduser -s /bin/bash -D gel +fi + +su -l gel -c "gel server install --version ${GEL_SERVER_VERSION}" +ln -s $(su -l gel -c "gel server info --latest --bin-path") \ + "/usr/bin/gel-server" + +gel-server --version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b4096222..02b52f377 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,7 +43,7 @@ jobs: mkdir -p dist/ echo "${VERSION}" > dist/VERSION - - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + - uses: actions/upload-artifact@v4 with: name: dist-version path: dist/ @@ -56,20 +56,20 @@ jobs: PIP_DISABLE_PIP_VERSION_CHECK: 1 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 submodules: true - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 - name: Build source distribution run: | pip install -U setuptools wheel pip build python -m build --sdist - - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + - uses: actions/upload-artifact@v4 with: name: dist-source path: dist/*.tar.* @@ -80,19 +80,19 @@ jobs: outputs: include: ${{ steps.set-matrix.outputs.include }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: "3.x" - - run: pip install cibuildwheel==2.22.0 + - run: pip install cibuildwheel==3.0.1 - id: set-matrix # Cannot test on Musl distros yet. run: | MATRIX_INCLUDE=$( { - cibuildwheel --print-build-identifiers --platform linux --arch x86_64,aarch64 | grep cp | grep many | jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \ - && cibuildwheel --print-build-identifiers --platform macos --arch x86_64,arm64 | grep cp | jq -nRc '{"only": inputs, "os": "macos-latest"}' \ - && cibuildwheel --print-build-identifiers --platform windows --arch AMD64 | grep cp | jq -nRc '{"only": inputs, "os": "windows-2019"}' + cibuildwheel --print-build-identifiers --platform linux --archs x86_64,aarch64 | grep cp | grep many | jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \ + && cibuildwheel --print-build-identifiers --platform macos --archs x86_64,arm64 | grep cp | jq -nRc '{"only": inputs, "os": "macos-latest"}' \ + && cibuildwheel --print-build-identifiers --platform windows --archs AMD64 | grep cp | jq -nRc '{"only": inputs, "os": "windows-2025"}' } | jq -sc ) echo "include=$MATRIX_INCLUDE" >> $GITHUB_OUTPUT @@ -111,17 +111,17 @@ jobs: env: PIP_DISABLE_PIP_VERSION_CHECK: 1 - EDGEDB_SERVER_VERSION: 6 + GEL_SERVER_VERSION: 6 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 submodules: true - name: Setup WSL - if: ${{ matrix.os == 'windows-2019' }} - uses: vampire/setup-wsl@v2 + if: ${{ matrix.os == 'windows-2025' }} + uses: vampire/setup-wsl@6a8db447be7ed35f2f499c02c6e60ff77ef11278 # v6.0.0 with: wsl-shell-user: edgedb additional-packages: @@ -130,34 +130,34 @@ jobs: - name: Set up QEMU if: runner.os == 'Linux' - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 - - name: Install EdgeDB + - name: Install Gel # Linux installs via the CIBW_BEFORE_ALL_LINUX command below if: runner.os != 'Linux' - uses: edgedb/setup-edgedb@v1 + uses: geldata/setup-gel@v1 with: - server-version: ${{ env.EDGEDB_SERVER_VERSION }} + server-version: ${{ env.GEL_SERVER_VERSION }} - - uses: pypa/cibuildwheel@v2.22.0 + - uses: pypa/cibuildwheel@v3.0.1 with: only: ${{ matrix.only }} env: CIBW_BUILD_VERBOSITY: 1 - CIBW_BEFORE_ALL_LINUX: > - EDGEDB_SERVER_VERSION=${{ env.EDGEDB_SERVER_VERSION }} .github/workflows/install-edgedb.sh - CIBW_TEST_EXTRAS: "test" - CIBW_TEST_COMMAND: > - python {project}/tests/__init__.py - CIBW_TEST_COMMAND_WINDOWS: > - python {project}\tests\__init__.py - CIBW_TEST_COMMAND_LINUX: > - PY=`which python` - && CODEGEN=`which gel-py` - && chmod -R go+rX "$(dirname $(dirname $(dirname $PY)))" - && su -l edgedb -c "EDGEDB_PYTHON_TEST_CODEGEN_CMD=$CODEGEN $PY {project}/tests/__init__.py" - - - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + # CIBW_BEFORE_ALL_LINUX: > + # GEL_SERVER_VERSION=${{ env.GEL_SERVER_VERSION }} .github/workflows/install-gel.sh + # CIBW_TEST_EXTRAS: "test" + # CIBW_TEST_COMMAND: > + # python {project}/tests/__init__.py + # CIBW_TEST_COMMAND_WINDOWS: > + # python {project}\tests\__init__.py + # CIBW_TEST_COMMAND_LINUX: > + # PY=`which python` + # && CODEGEN=`which gel-py` + # && chmod -R go+rX "$(dirname $(dirname $(dirname $PY)))" + # && su -l gel -c "GEL_PYTHON_TEST_CODEGEN_CMD=$CODEGEN $PY {project}/tests/__init__.py" + + - uses: actions/upload-artifact@v4 with: name: dist-wheel-${{ matrix.only }} path: wheelhouse/*.whl @@ -176,12 +176,12 @@ jobs: deployments: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 5 submodules: false - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + - uses: actions/download-artifact@v4 with: path: dist/ pattern: dist-* diff --git a/tests/test_codegen.py b/tests/test_codegen.py index ac63d4999..dbd9fa4b5 100644 --- a/tests/test_codegen.py +++ b/tests/test_codegen.py @@ -105,7 +105,7 @@ async def run(*args, extra_env=None): p.returncode, args, output=await p.stdout.read(), ) - cmd = env.get("EDGEDB_PYTHON_TEST_CODEGEN_CMD", "gel-py") + cmd = env.get("GEL_PYTHON_TEST_CODEGEN_CMD", "gel-py") await run( cmd, extra_env={"GEL_PYTHON_CODEGEN_PY_VER": "3.11.11"} ) diff --git a/tests/test_sourcecode.py b/tests/test_sourcecode.py index 73cc41bbf..c73c019be 100644 --- a/tests/test_sourcecode.py +++ b/tests/test_sourcecode.py @@ -43,7 +43,7 @@ def test_cqa_ruff_check(self): for subdir in ["edgedb", "gel", "tests"]: try: subprocess.run( - ["ruff", "check", "."], + [sys.executable, "-m", "ruff", "check", "."], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, @@ -66,7 +66,7 @@ def test_cqa_ruff_format_check(self): for subdir in ["gel"]: try: subprocess.run( - ["ruff", "format", "--check", "."], + [sys.executable, "-m", "ruff", "format", "--check", "."], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, @@ -113,6 +113,7 @@ def test_cqa_mypy(self): f"mypy validation failed:\n{output}" ) from None + @unittest.skipIf(os.environ.get("CIBUILDWHEEL"), "broken in CIBW tests") def test_cqa_pyright(self): project_root = find_project_root() config_path = project_root / "pyproject.toml" From 688968c948a7610396669c93cab98ea635081554 Mon Sep 17 00:00:00 2001 From: Elvis Pranskevichus Date: Tue, 15 Jul 2025 23:19:15 -0700 Subject: [PATCH 2/2] gel-python 4.0.0b1 --- gel/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gel/_version.py b/gel/_version.py index aaefa6df8..883f8905d 100644 --- a/gel/_version.py +++ b/gel/_version.py @@ -28,4 +28,4 @@ # supported platforms, publish the packages on PyPI, merge the PR # to the target branch, create a Git tag pointing to the commit. -__version__ = "3.1.0" +__version__ = "4.0.0b1"