From 1e8ff8684d9356d37d495012fe3e00a5af0cd775 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sat, 10 Feb 2024 20:00:27 +0100 Subject: [PATCH 1/2] Updated CXX env var and removed redundant library_dirs in setup Enhanced the 'CXX' environment variable assignment in setup.py to include the '-shlib' flag for shared library support. Also, streamlined the Extension configuration by eliminating the now unnecessary specification of default library directories, simplifying the build process. Refactors setup configuration for efficiency and compatibility with shared libraries. --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index dbd5afb..18cb936 100644 --- a/setup.py +++ b/setup.py @@ -6,14 +6,13 @@ import os from Cython.Build import cythonize -os.environ['CXX'] = 'h5c++' +os.environ['CXX'] = 'h5c++ -shlib' ext_modules = [ Extension( 'limedriver.binding', sources=['src/limedriver/limedriver.pyx', 'extern/limedriver/src/limedriver.cpp'], include_dirs=["extern/limedriver/src/", "/usr/include/hdf5/serial/"], # TODO: This is REALLY ugly. - library_dirs=["/usr/lib/"], libraries=["LimeSuite", "hdf5_cpp", "hdf5"], language="c++", ), From 13fe781396f08c9b3506fdb469c1579cea343d9d Mon Sep 17 00:00:00 2001 From: Kumi Date: Sat, 10 Feb 2024 20:03:23 +0100 Subject: [PATCH 2/2] Add GitHub Action for Ubuntu package build Introduced a new GitHub workflow to automate the build process for a Python package on Ubuntu. The workflow triggers on push and pull requests and includes steps for updating the package list, installing essentials like git, setting up Python 3.10, and handling dependencies. It also includes the package installation and a post-install test to confirm successful import. This automation ensures code integrity with each update and simplifies the integration process for contributors. --- .github/workflows/python-package-ubuntu.yml | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/python-package-ubuntu.yml diff --git a/.github/workflows/python-package-ubuntu.yml b/.github/workflows/python-package-ubuntu.yml new file mode 100644 index 0000000..180823d --- /dev/null +++ b/.github/workflows/python-package-ubuntu.yml @@ -0,0 +1,42 @@ +name: Python package build on Ubuntu + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Update package list + run: | + sudo apt-get update + + - name: Install git + run: | + sudo apt-get install -y git + + - name: Checkout repository + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Set up Python 3.10 + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Prepare Python environment + run: | + pip install --upgrade pip h5py setuptools wheel build + + - name: Install dependencies + run: | + sudo apt-get install -y libhdf5-dev limesuite liblimesuite-dev automake gcc pkg-config build-essential python-is-python3 + + - name: Install the package + run: | + pip install . + + - name: Test if the package can be imported + run: | + python -m limedriver \ No newline at end of file