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
194 changes: 94 additions & 100 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,73 +7,70 @@ on:
workflow_dispatch:

jobs:
# wheels-windows:
# runs-on: windows-latest
# strategy:
# fail-fast: false
# matrix:
# include:
# - python-version: "3.10"
# python-tag: "310"
# architecture: "AMD64"
# - python-version: "3.11"
# python-tag: "311"
# architecture: "AMD64"
# - python-version: "3.12"
# python-tag: "312"
# architecture: "AMD64"
# - python-version: "3.13"
# python-tag: "313"
# architecture: "AMD64"
# - python-version: "3.14"
# python-tag: "314"
# architecture: "AMD64"
wheels-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.11"
python-tag: "311"
architecture: "AMD64"
- python-version: "3.12"
python-tag: "312"
architecture: "AMD64"
- python-version: "3.13"
python-tag: "313"
architecture: "AMD64"
- python-version: "3.14"
python-tag: "314"
architecture: "AMD64"



# steps:
# - uses: actions/checkout@v4
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}
# - uses: bus1/cabuild/action/msdevshell@v1
# with:
# architecture: x64
# if: matrix.architecture == 'AMD64'
# - uses: bus1/cabuild/action/msdevshell@v1
# with:
# architecture: x86
# if: matrix.architecture == 'x86'
# - name: Generate meson files
# run: |
# python scripts/generate_meson.py ./src/dbzero/ core
# python scripts/generate_meson_tests.py tests/
# python scripts/generate_meson_dbzero.py dbzero/
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: bus1/cabuild/action/msdevshell@v1
with:
architecture: x64
if: matrix.architecture == 'AMD64'
- uses: bus1/cabuild/action/msdevshell@v1
with:
architecture: x86
if: matrix.architecture == 'x86'
- name: Generate meson files
run: |
python scripts/generate_meson.py ./src/dbzero/ core
python scripts/generate_meson_tests.py tests/
python scripts/generate_meson_dbzero.py dbzero/

# - name: Configure git
# run: |
# git config --global user.email "ci@example.com"
# git config --global user.name "CI Builder"
# rm .gitignore
# git add . && git commit -m "Update meson files for build"
- name: Configure git
run: |
git config --global user.email "ci@example.com"
git config --global user.name "CI Builder"
rm .gitignore
git add . && git commit -m "Update meson files for build"

# - run: pip3 install pipx
# - run: pipx run cibuildwheel
# env:
# CIBW_BUILD: cp${{ matrix.python-tag }}-*
# CIBW_ARCHS_WINDOWS: ${{ matrix.architecture }}
# - uses: actions/upload-artifact@v4
# with:
# name: wheels-windows-${{ matrix.python-version }}
# path: wheelhouse/*.whl
- run: pip3 install pipx
- run: pipx run cibuildwheel
env:
CIBW_BUILD: cp${{ matrix.python-tag }}-*
CIBW_ARCHS_WINDOWS: ${{ matrix.architecture }}
- uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.python-version }}
path: wheelhouse/*.whl

wheels-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -101,56 +98,53 @@ jobs:
name: wheels-linux-${{ matrix.python-version }}
path: dist/*.whl

# test-wheels-windows:
# runs-on: windows-latest
# needs: wheels-windows
# strategy:
# fail-fast: false
# matrix:
# include:
# - python-version: "3.10"
# python-tag: "310"
# architecture: "AMD64"
# - python-version: "3.11"
# python-tag: "311"
# architecture: "AMD64"
# - python-version: "3.12"
# python-tag: "312"
# architecture: "AMD64"
# - python-version: "3.13"
# python-tag: "313"
# architecture: "AMD64"
# - python-version: "3.14"
# python-tag: "314"
# architecture: "AMD64"
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}
# - name: Download wheel artifact
# uses: actions/download-artifact@v4
# with:
# name: wheels-windows-${{ matrix.python-version }}
# path: ./wheels/
# - name: Install wheel and dependencies
# run: |
# pip install pytest
# pip install -r requirements.txt
# Get-ChildItem -Path "./wheels/*.whl" | ForEach-Object { pip install $_.FullName }
# shell: powershell
# - name: Run tests
# run: |
# python -m pytest -m 'not integration_test' -m 'not stress_test' -c pytest.ini --capture=no -vv
test-wheels-windows:
runs-on: windows-latest
needs: wheels-windows
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.11"
python-tag: "311"
architecture: "AMD64"
- python-version: "3.12"
python-tag: "312"
architecture: "AMD64"
- python-version: "3.13"
python-tag: "313"
architecture: "AMD64"
- python-version: "3.14"
python-tag: "314"
architecture: "AMD64"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download wheel artifact
uses: actions/download-artifact@v4
with:
name: wheels-windows-${{ matrix.python-version }}
path: ./wheels/
- name: Install wheel and dependencies
run: |
pip install pytest
pip install -r requirements.txt
Get-ChildItem -Path "./wheels/*.whl" | ForEach-Object { pip install $_.FullName }
shell: powershell
- name: Run tests
run: |
python -m pytest -m 'not integration_test' -m 'not stress_test' -c pytest.ini --capture=no -vv

test-wheels-linux:
runs-on: ubuntu-latest
needs: wheels-linux
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -198,7 +192,7 @@ jobs:
deploy-to-pypi:
name: Deploy to PyPI (Manual)
runs-on: ubuntu-latest
needs: [sdist, test-wheels-linux]
needs: [sdist, test-wheels-linux, test-wheels-windows]
if: github.event_name == 'workflow_dispatch'
environment: pypi-deployment
permissions:
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/build-and-test-with-asan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and Deploy Packages
on:
workflow_dispatch:

jobs:
build-linux:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v3
- run: python3 scripts/generate_meson.py ./src/dbzero/ core
- run: python3 scripts/generate_meson_tests.py tests/
- run: python3 scripts/generate_meson_dbzero.py dbzero/
- run: git config --global user.email "you@example.com"
- run: git config --global user.name "Your Name"
- run: rm .gitignore
- run: git add . && git commit -m "Update meson files"
- run: pip install build
- run: python3 -m build --config-setting=setup-args=-Denable_sanitizers=true
env:
CIBW_SKIP: pp* cp36-* *-musllinux*
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_ARCHS_LINUX: x86_64 aarch64
CIBW_ARCHS_WINDOWS: ${{ matrix.architecture }}

- uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.python-version }}
path: dist/*.whl

test-wheels-linux:
runs-on: ubuntu-latest
timeout-minutes: 15
needs: build-linux
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download wheel artifact
uses: actions/download-artifact@v4
with:
name: wheels-linux-${{ matrix.python-version }}
path: ./wheels/
- name: Install wheel and dependencies
run: |
pip install pytest
pip install -r requirements.txt
pip install ./wheels/*.whl
- name: Run tests
run: |
LD_PRELOAD=$(gcc -print-file-name=libasan.so) python -m pytest -m 'not integration_test' -m 'not stress_test' -c pytest.ini --capture=no -vv

13 changes: 10 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ export build_type="debug"
install_dir=""
sanitizer="false"
enable_debug_exceptions="true"
build_tests="false"

TEMP=`getopt -o hj:rsie --long help,jobs:,release,sanitize,install,debug_exceptions -n 'build.sh' -- "$@"`
TEMP=`getopt -o hj:rtsie --long help,jobs:,release,tests,sanitize,install,debug_exceptions -n 'build.sh' -- "$@"`
if [ ! $? -eq 0 ]; then
exit
fi
Expand All @@ -33,6 +34,7 @@ while true ; do
-h|--help) show_help ; shift ;;
-s|--sanitize) sanitizer="true" ; shift ;;
-r|--release) build_type="release" ; shift ;;
-t|--tests) build_tests="true" ; shift ;;
-e|--disable_debug_exceptions) enable_debug_exceptions="false" ; shift ;;
-j|--jobs)
case "$2" in
Expand All @@ -59,11 +61,16 @@ python3 scripts/generate_meson_dbzero.py dbzero/

mkdir -p build

options=""
options+=" -Denable_debug_exceptions=$enable_debug_exceptions"
options+=" -Denable_sanitizers=$sanitizer"
options+=" -Dbuild_tests=$build_tests"

if [ "$build_type" == "debug" ]; then
meson setup --buildtype="debug" -Denable_debug_exceptions=$enable_debug_exceptions -Denable_sanitizers=$sanitizer build/debug
meson setup --buildtype="debug" $options build/debug
cd build/debug
else
meson setup --buildtype="release" -Denable_debug_exceptions=$enable_debug_exceptions -Denable_sanitizers=$sanitizer build/release
meson setup --buildtype="release" $options build/release
cd build/release
fi

Expand Down
4 changes: 2 additions & 2 deletions dbzero/build_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ python3 setup.py sdist
PYTHON3_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info.minor}")')
if [ "${INSTALL}" ] ; then
if [ "$PYTHON3_VERSION" -ge 11 ]; then
pip3 install ./dist/dbzero-0.0.1.tar.gz --break-system-packages
pip3 install ./dist/dbzero-0.1.0.tar.gz --break-system-packages
else
pip3 install ./dist/dbzero-0.0.1.tar.gz
pip3 install ./dist/dbzero-0.1.0.tar.gz
fi
fi

Expand Down
5 changes: 3 additions & 2 deletions dbzero/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

setup(
name='dbzero',
version='0.0.1',
version='0.1.0',
description='DBZero community edition',
packages=['dbzero']
packages=['dbzero'],
python_requires='>=3.11',
)
16 changes: 10 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ else
endif

enable_sanitizers = get_option('enable_sanitizers')

if enable_sanitizers
message('Enabling address and undefined behavior sanitizers')
add_project_arguments('-fsanitize=address', language: 'cpp')
Expand Down Expand Up @@ -98,12 +97,17 @@ gtest_dep = dependency('gtest', main : true, required : false)
gmock_dep = dependency('gmock', main : true, required : false)

dbzero_lib = static_library('pyzero', [all_srcs], include_directories:include_dirs, dependencies: [deps], install : true, install_dir: install_dir)
subdir('tests')

e = executable('tests' + build_suffix + '.x', [all_srcs,tests_sources], dependencies: [deps, gtest_dep, gmock_dep],
link_with: [dbzero_lib, link_with], include_directories:include_dirs_test, link_language : 'cpp',)

test('gtest tests', e)
build_tests = get_option('build_tests')
if build_tests
message('Building C++ tests')
subdir('tests')
e = executable('tests' + build_suffix + '.x', [all_srcs,tests_sources], dependencies: [deps, gtest_dep, gmock_dep],
link_with: [dbzero_lib, link_with], include_directories:include_dirs_test, link_language : 'cpp',)
test('gtest tests', e)
else
message('Skipping C++ tests build')
endif

py3avlw = py3_inst.extension_module('dbzero',
sources: ['src/dbzero/bindings/python/dbzero.cpp'],
Expand Down
Loading
Loading