Skip to content

Commit

Permalink
Fix MANIFEST.in to also include pxd files
Browse files Browse the repository at this point in the history
This is required if anyone wants to use the sdist to build this from
source.

Signed-off-by: Gus Monod <[email protected]>
  • Loading branch information
sarahmonod committed Oct 11, 2023
1 parent 5654aea commit d143b4b
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 14 deletions.
90 changes: 78 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,83 @@
name: Tests
name: Wheels

on:
push:
branches:
- main
pull_request:
branches:
- main
paths-ignore:
- "CONTRIBUTING.md"
release:
types:
- published
schedule:
# At 12:00 on every day-of-month
- cron: "0 12 */1 * *"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
COMDB2_DBNAME: mattdb
TIMEOUT: 30

jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: '
sudo apt-get install -qy
pkg-config
' # libcdb2api-dev is installed from source below
- uses: actions/checkout@v4

- name: Checkout comdb2 dependency
uses: actions/checkout@v3
with:
repository: bloomberg/comdb2
path: original_comdb2
- name: Build comdb2 from source
run: '
sudo apt-get update &&
sudo apt-get install -qy
bison
build-essential
cmake
flex
libevent-dev
liblz4-dev
libprotobuf-c-dev
libreadline-dev
libsqlite3-dev
libssl-dev
libunwind-dev
ncurses-dev
protobuf-c-compiler
tcl
uuid-dev
zlib1g-dev &&
(
mkdir original_comdb2/build &&
cd original_comdb2/build &&
cmake .. &&
make &&
sudo make install
)
'

- name: Build sdist
run: PKG_CONFIG_PATH=/opt/bb/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig pipx run build --sdist

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

test:
name: Test suite
runs-on: ubuntu-latest
needs: [build_sdist]
strategy:
matrix:
python-version:
Expand All @@ -25,12 +87,16 @@ jobs:
- '3.9'
- '3.8'
steps:
- name: Download sdist
uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Install dependencies
run: '
sudo apt-get install -qy
pkg-config
' # libcdb2api-dev is installed from source below
- uses: actions/checkout@v3
- name: Checkout comdb2 dependency
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -86,20 +152,20 @@ jobs:
'
- name: Creating tables
run: |
tables="$(cat tests/schemas/$COMDB2_DBNAME/table_constraint_order.txt)"
tables="$(cat dist/tests/schemas/$COMDB2_DBNAME/table_constraint_order.txt)"
for table_name in $tables
do
table_file="tests/schemas/$COMDB2_DBNAME/$table_name.csc2"
table_file="dist/tests/schemas/$COMDB2_DBNAME/$table_name.csc2"
echo "Creating $table_name from $table_file"
/opt/bb/bin/cdb2sql "$COMDB2_DBNAME" local "create table $table_name { $(cat $table_file) }"
done
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4 # note that this step overwrites the PKG_CONFIG_PATH variable
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python_version }}
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
PKG_CONFIG_PATH=/opt/bb/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig LDFLAGS="-Wl,-rpath,/opt/bb/lib" python -m pip install .[tests]
PKG_CONFIG_PATH=/opt/bb/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig LDFLAGS="-Wl,-rpath,/opt/bb/lib" python -m pip install --no-index --find-links=dist/ comdb2[tests]
- name: Run Tests
run: (cd tests && python -m pytest -vvv)
run: (cd dist/tests && python -m pytest -vvv)
7 changes: 5 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
include *.txt
include pyproject.toml
recursive-include comdb2 py.typed
recursive-include comdb2 *.pyi
recursive-include comdb2/ py.typed *.pyi *.pxd *.h
recursive-include docs/ *.rst *py
recursive-include tests/ *.py *.csc2 *.txt
exclude comdb2/_ccdb2.c

0 comments on commit d143b4b

Please sign in to comment.