Updated CI and package import system

Refactored the CI workflows to include package installation and import
testing. Ensured package is importable after installation by creating a
new '__main__.py' module to check imports. This adds an extra validation
step to the CI process, catching potential import issues early. Import
statements in '__init__.py' have also been updated to use 'as' for
clarity and namespace control.
This commit is contained in:
Kumi 2024-02-10 16:32:58 +01:00
parent fb296e1ecd
commit 853457de78
Signed by: kumi
GPG key ID: ECBCC9082395383F
4 changed files with 18 additions and 5 deletions

View file

@ -33,6 +33,10 @@ jobs:
run: |
sudo apt-get install -y libhdf5-dev limesuite liblimesuite-dev automake gcc pkg-config build-essential python-is-python3
- name: Build the package
- name: Install the package
run: |
python -m build
pip install .
- name: Test if the package can be imported
run: |
python -m limedriver

View file

@ -24,6 +24,14 @@ jobs:
run: |
yes | pacman -S python python-pip hdf5 limesuite python-build automake gcc pkgconf base-devel
- name: Install the package
run: |
pip install .
- name: Test if the package can be imported
run: |
python -m limedriver
- name: Build the package
run: |
python -m build
@ -32,4 +40,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: built-package
path: dist/
path: dist/

View file

@ -1,2 +1,2 @@
import limedriver.binding
import limedriver.hdf_reader
import limedriver.binding as binding
import limedriver.hdf_reader as hdf_reader

View file

@ -0,0 +1 @@
from limedriver import binding, hdf_reader