Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update release CI #436

Merged
merged 2 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
15 changes: 10 additions & 5 deletions .github/workflows/install-edgedb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ shopt -s nullglob

srv="https://packages.edgedb.com"

curl -fL "${srv}/dist/x86_64-unknown-linux-musl/edgedb-cli" \
> "/usr/local/bin/edgedb"
curl -fL "${srv}/dist/$(uname -m)-unknown-linux-musl/edgedb-cli" \
> "/usr/bin/edgedb"

chmod +x "/usr/local/bin/edgedb"
chmod +x "/usr/bin/edgedb"

useradd --shell /bin/bash 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"
ln -s $(su -l edgedb -c "edgedb server info --latest --bin-path") \
"/usr/local/bin/edgedb-server"
"/usr/bin/edgedb-server"

edgedb-server --version
58 changes: 40 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
mkdir -p dist/
echo "${VERSION}" > dist/VERSION

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
Expand All @@ -52,7 +52,7 @@ jobs:
PIP_DISABLE_PIP_VERSION_CHECK: 1

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 50
submodules: true
Expand All @@ -65,19 +65,41 @@ jobs:
pip install -U setuptools wheel pip
python setup.py sdist

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*.tar.*

build-wheels:
build-wheels-matrix:
needs: validate-release-request
runs-on: ubuntu-latest
outputs:
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- run: pip install cibuildwheel==2.12.3
- 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"}'
} | jq -sc
)
echo "include=$MATRIX_INCLUDE" >> $GITHUB_OUTPUT
build-wheels:
needs: build-wheels-matrix
runs-on: ${{ matrix.os }}
name: Build ${{ matrix.only }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
cibw_python: ["cp37-*", "cp38-*", "cp39-*", "cp310-*"]
cibw_arch: ["auto64"]
include: ${{ fromJson(needs.build-wheels-matrix.outputs.include) }}

defaults:
run:
Expand All @@ -87,7 +109,7 @@ jobs:
PIP_DISABLE_PIP_VERSION_CHECK: 1

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 50
submodules: true
Expand All @@ -101,18 +123,18 @@ jobs:
ca-certificates
curl

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2

- name: Install EdgeDB
uses: edgedb/setup-edgedb@v1

- uses: pypa/[email protected]
- uses: pypa/[email protected]
with:
only: ${{ matrix.only }}
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_BUILD: ${{ matrix.cibw_python }}
# Cannot test on Musl distros yet.
CIBW_SKIP: "*-musllinux*"
CIBW_ARCHS: ${{ matrix.cibw_arch }}
# EdgeDB doesn't run on CentOS 6, so use 2014 as baseline
CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux2014_x86_64"
CIBW_BEFORE_ALL_LINUX: >
.github/workflows/install-edgedb.sh
CIBW_TEST_EXTRAS: "test"
Expand All @@ -126,7 +148,7 @@ jobs:
&& 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@v2
- uses: actions/upload-artifact@v3
with:
name: dist
path: wheelhouse/*.whl
Expand All @@ -136,12 +158,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: false

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: dist
path: dist/
Expand Down
7 changes: 6 additions & 1 deletion edgedb/_testbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def _start_cluster(*, cleanup_atexit=True):
stderr=subprocess.STDOUT,
)

for _ in range(250):
for _ in range(600):
try:
with open(status_file, 'rb') as f:
for line in f:
Expand Down Expand Up @@ -171,6 +171,11 @@ def _start_cluster(*, cleanup_atexit=True):

client = edgedb.create_client(password='test', **con_args)
client.ensure_connected()
client.execute("""
# Set session_idle_transaction_timeout to 5 minutes.
CONFIGURE INSTANCE SET session_idle_transaction_timeout :=
<duration>'5 minutes';
""")
_default_cluster = {
'proc': p,
'client': client,
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def finalize_options(self):
author_email='[email protected]',
url='https://github.com/edgedb/edgedb-python',
license='Apache License, Version 2.0',
packages=['edgedb'],
packages=setuptools.find_packages(),
provides=['edgedb'],
zip_safe=False,
include_package_data=True,
Expand Down Expand Up @@ -337,6 +337,7 @@ def finalize_options(self):
],
cmdclass={'build_ext': build_ext},
test_suite='tests.suite',
python_requires=">=3.7",
install_requires=[
'typing-extensions>=3.10.0; python_version < "3.8.0"',
'certifi>=2021.5.30; platform_system == "Windows"',
Expand Down