Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
412d4a1
add linux_tests
jkotan Mar 25, 2026
d07409e
comment out patches
jkotan Mar 25, 2026
888911a
update pixi path
jkotan Mar 25, 2026
136620f
fix typo
jkotan Mar 25, 2026
1ba827d
source pixi in tests
jkotan Mar 25, 2026
f977efe
fix the recipe path
jkotan Mar 25, 2026
7a9ddfa
update recipe
jkotan Mar 25, 2026
186e8d4
update recipe
jkotan Mar 25, 2026
81e79a2
add deps
jkotan Mar 25, 2026
45319b7
add deps
jkotan Mar 25, 2026
fc6f3a5
add deps
jkotan Mar 25, 2026
eeaa3a8
use container
jkotan Mar 25, 2026
d7b37a6
fix containter name
jkotan Mar 25, 2026
fdaf779
update pixi dir
jkotan Mar 25, 2026
6b8893d
add bash
jkotan Mar 25, 2026
b23857d
add bash
jkotan Mar 25, 2026
8ff4a87
fix typo
jkotan Mar 25, 2026
cec9e87
use bash
jkotan Mar 25, 2026
cf516d2
add hdf5 path
jkotan Mar 25, 2026
8741573
update recipe
jkotan Mar 25, 2026
f021c06
update printouts
jkotan Mar 25, 2026
ee2c6cd
update setup.py
jkotan Mar 25, 2026
1fb1ae9
change the path
jkotan Mar 25, 2026
2628a3b
update deps
jkotan Mar 25, 2026
8b5b285
update deps
jkotan Mar 25, 2026
87067b3
update deps
jkotan Mar 25, 2026
21cf4f9
update deps
jkotan Mar 25, 2026
4320833
update deps
jkotan Mar 25, 2026
ea8598b
update deps
jkotan Mar 25, 2026
08b3742
update deps
jkotan Mar 25, 2026
a2758d0
comment out tests
jkotan Mar 26, 2026
2ffaf3a
add numpy
jkotan Mar 26, 2026
7cb4397
add setuptool
jkotan Mar 26, 2026
3c60730
add build deps back
jkotan Mar 26, 2026
1186362
comment tests out
jkotan Mar 26, 2026
29d3774
add mac and win tests
jkotan Mar 26, 2026
d358351
update config
jkotan Mar 26, 2026
df41b8b
comment out windows
jkotan Mar 26, 2026
72b95a6
fix pixi path for macos
jkotan Mar 26, 2026
c142fb4
fix pixi path for macos
jkotan Mar 26, 2026
4f1ab7f
add compilers
jkotan Mar 26, 2026
0aa2ad7
remove compilers for mac
jkotan Mar 26, 2026
873d3ba
add windows
jkotan Mar 26, 2026
92a4fd1
add windows
jkotan Mar 26, 2026
67f9eb1
remove strategy
jkotan Mar 26, 2026
f02b47b
change to windows 2025
jkotan Mar 26, 2026
baf0817
add more windows test content
jkotan Mar 26, 2026
7479546
add missing slash
jkotan Mar 26, 2026
d1ed45a
update config
jkotan Mar 26, 2026
b76f4d6
update config
jkotan Mar 26, 2026
1585fec
update config
jkotan Mar 26, 2026
8cd8f0b
add python-pninexus
jkotan Mar 26, 2026
92fe51f
add checkout
jkotan Mar 26, 2026
0c8e5cd
fix typo
jkotan Mar 26, 2026
a5309a8
add windows switch
jkotan Mar 26, 2026
a8f1d94
change build deps
jkotan Mar 26, 2026
40716ba
add windows switch
jkotan Mar 26, 2026
2c621a8
fix boost python version
jkotan Mar 26, 2026
cd6f6b1
add headers
jkotan Mar 26, 2026
abb73f8
add headers
jkotan Mar 26, 2026
1ef2a13
fix boost version
jkotan Mar 26, 2026
fe84bb0
fix boost version
jkotan Mar 26, 2026
12d450d
fix hdf5 version
jkotan Mar 26, 2026
49a3090
fix hdf5 version
jkotan Mar 26, 2026
954a693
update tests for aarch
jkotan Mar 27, 2026
50b340a
update tests
jkotan Mar 27, 2026
5bf6a93
update tests
jkotan Mar 27, 2026
8dcd749
Update predefined_type_test.py
jkotan Mar 27, 2026
6820ad8
Update predefined_type_test.py
jkotan Mar 27, 2026
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
99 changes: 99 additions & 0 deletions .github/workflows/pixi/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
context:
version: 3.3.0

package:
name: pninexus
version: ${{ version }}

source:
- path: ../../../

build:
noarch: python
number: 0
script:
- if: win
then:
- set CL=/DH5_BUILT_AS_DYNAMIC_LIB=1 %CL%
- set HDF5_LOCAL_PATH=__SYS__
- set HDF5_HL_LOCAL_PATH=__SYS__
- set HDF5_INC_LOCAL_PATH=__SYS__
else:
- export HDF5_HL_LOCAL_PATH=__SYS__
- export HDF5_INC_LOCAL_PATH=__SYS__
- python setup.py install
- python -m pytest test
- if: win
then: python setup.py install --prefix=%PREFIX%
else: python setup.py install --prefix=$PREFIX

requirements:
build:
# - ${{ compiler('cxx') }}
# - ${{ stdlib('c') }}
- python
- cmake
- ninja
- numpy
- setuptools
- pytest # for testing
- h5py # for testing
- sphinx # for building documentation
- hdf5
- h5cpp
- sphinx
- libpninexus
- libboost-headers
- libboost-devel
- libboost-python-devel
- blas
- zlib
host:
- python
- setuptools
- pip
- pytest # for testing
- h5py # for testing
- sphinx # for building documentation
- numpy
- hdf5
- h5cpp
- sphinx
- libpninexus
- libboost-headers
- libboost-devel
- libboost-python-devel
- blas
- zlib
run:
- python
- libboost-devel
- libboost-python-devel
- hdf5
- h5cpp
- libpninexus

# # ImportError: libhdf5_hl.so.310: cannot open shared object file: No such file or directory
# tests:
# - python:
# # python_version: ${{ python_min }}.*
# imports:
# - pninexus.h5cpp
# - pninexus.nexus

about:
homepage: https://github.com/pni-libraries/python-pninexus
license: GPL-2.0-only
license_file: LICENSE
summary: Python bindings or NeXus libpninexus and h5cpp library
description: |
pninexus is python bindings of C++ library to create NeXus files.
It provides NeXus tree-structure builder basedon XML (NXDL-like) input,
NeXus path parsers and other algorithms to access NeXus files.
documentation: https://pni-libraries.github.io/python-pninexus
repository: https://github.com/pni-libraries/python-pninexus

extra:
recipe-maintainers:
- jkotan
- yuelongyu
12 changes: 12 additions & 0 deletions .github/workflows/pixi/variants.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
zlib:
- 1
hdf5:
- 1.14.6
libboost-python-devel:
- 1.88.0
libboost-devel:
- 1.88.0
# c_stdlib_version:
# - 2.17
# c_stdlib:
# - sysroot
61 changes: 59 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,65 @@ jobs:
- name: Run flake8
run: flake8 .

python3_tests:
linux_tests:
runs-on: ubuntu-latest
container:
image: debian:trixie
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2

- name: install pixi
shell: bash
run: |
apt-get update
apt-get -qq -y dist-upgrade
apt-get -qq update && apt-get install -qq -y flake8 python3 curl bash
curl -fsSL https://pixi.sh/install.sh | sh
export PATH=/github/home/.pixi/bin:$PATH
pixi shell-hook > .sh.sh
source .sh.sh
pixi add rattler-build compilers
- name: build pninexus
shell: bash
run: |
source .sh.sh
pixi run rattler-build build --recipe .github/workflows/pixi/recipe.yaml

macos-15_tests:
runs-on: macos-15
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2

- name: install pixi
shell: bash
run: |
curl -fsSL https://pixi.sh/install.sh | sh
export PATH=/Users/runner/.pixi/bin:$PATH
pixi shell-hook > .sh.sh
source .sh.sh
pixi add rattler-build
- name: build pninexus
shell: bash
run: |
source .sh.sh
pixi run rattler-build build --recipe .github/workflows/pixi/recipe.yaml

windows-2025_tests:
runs-on: windows-2025
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.9.4
with:
pixi-version: v0.62.2
cache: false
- name: build pninexus
run: |
pixi add rattler-build compilers libboost-headers=1.88.0 h5cpp libpninexus libboost=1.88.0 libboost-python=1.88.0 hdf5=1.14.6
pixi run rattler-build build --recipe .github/workflows/pixi/recipe.yaml

deb_tests:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -89,4 +147,3 @@ jobs:
run: |
docker exec --user root ndts /bin/bash -c "chown -R 1001 /home/tango "
docker container stop ndts

14 changes: 14 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[workspace]
authors = ["Jan Kotanski <jankotan@gmail.com>"]
channels = ["conda-forge"]
name = "libpninexus"
platforms = ["linux-64", "linux-aarch64", "osx-arm64", "osx-64", "win-64"]
version = "0.1.0"

[tasks]

[dependencies]
rattler-build = ">=0.60.0,<0.61"
ipython = ">=9.11.0,<10"
python = "==3.14"
conda-smithy = ">=3.56.3,<4"
15 changes: 9 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# setup script for python-pninexus
from __future__ import print_function
import codecs
import sys
import os
import os.path
Expand Down Expand Up @@ -37,7 +36,7 @@ def read(fname):
:param fname: readme file name
:type fname: :obj:`str`
"""
with codecs.open(os.path.join('.', fname), encoding='utf-8') as f:
with open(os.path.join('.', fname), encoding='utf-8') as f:
long_description = f.read()
return long_description

Expand Down Expand Up @@ -73,7 +72,11 @@ def read(fname):
nexus_config.add_link_library(
"boost_python{major}{minor}".format(major=sys.version_info.major,
minor=sys.version_info.minor))
nexus_config.add_include_directory('/usr/include/hdf5/serial')
hdf5_include_path = os.environ.get('HDF5_INC_LOCAL_PATH')
if not hdf5_include_path:
nexus_config.add_include_directory('/usr/include/hdf5/serial')
elif hdf5_include_path != "__SYS__":
nexus_config.add_include_directory(hdf5_include_path)

hdf5_hl_path = os.environ.get('HDF5_HL_LOCAL_PATH')
if hdf5_hl_path:
Expand Down Expand Up @@ -291,7 +294,7 @@ def run(self):
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Physics',
'Topic :: Software Development :: Libraries :: Python Modules',
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
# 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
Expand All @@ -300,8 +303,8 @@ def run(self):
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
test_suite="test",
test_loader="unittest:TestLoader",
# test_suite="test",
# test_loader="unittest:TestLoader",
cmdclass={
"install": pni_install,
'build_sphinx': BuildDoc,
Expand Down
13 changes: 6 additions & 7 deletions test/h5cpp_tests/datatype_tests/predefined_type_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,9 @@ def testFloat128(self):

prec = dtype.precision
self.assertTrue(dtype.precision in [64, 80, 128])
dtype.precision = 80
self.assertEqual(dtype.precision, 80)
# mprec = 80
# dtype.precision = mprec
# self.assertEqual(dtype.precision, mprec)
dtype.precision = prec
self.assertEqual(dtype.precision, prec)

Expand Down Expand Up @@ -593,11 +594,9 @@ def testFloat128(self):
dtype.norm = norm

ebias = dtype.ebias
if not LINUX:
dtype.size = 8
sz = dtype.size
self.assertTrue(dtype.ebias in [2 * sz * sz * sz - 1,
4 * sz * sz * sz - 1])
self.assertTrue(ebias in [1023, 16383])
self.assertTrue(dtype.size in [9, 16, 17])

dtype.ebias = 63
self.assertEqual(dtype.ebias, 63)
dtype.ebias = 31
Expand Down
Loading