Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
easyblock = 'CMakeMake'

name = 'pod5-file-format'
version = '0.3.10'

homepage = 'https://github.com/nanoporetech/pod5-file-format'
description = """POD5 is a file format for storing nanopore dna data in an easily accessible way.
The format is able to be written in a streaming manner which allows a sequencing
instrument to directly write the format."""

toolchain = {'name': 'foss', 'version': '2023a'}

source_urls = ['https://github.com/nanoporetech/%(name)s/archive/']
sources = [{'download_filename': '%(version)s.tar.gz', 'filename': SOURCE_TAR_GZ}]
patches = [
'%(name)s-%(version)s_dep_fix.patch',
]
checksums = [
{'pod5-file-format-0.3.10.tar.gz': 'eb177018b310e508f7ad6b5d486cc29166404dd5f82879d0c26aceaff51d3768'},
{'pod5-file-format-0.3.10_dep_fix.patch': 'c74ddc35f78807705940b983301ca0e1fffd2774535892c7bc85e1ec47f550ff'},
]

builddependencies = [
('binutils', '2.40'),
('CMake', '3.26.3'),
('pkgconfig', '1.5.5', '-python'),
('hatchling', '1.18.0'),
('poetry', '1.5.1'),
]

dependencies = [
('Python', '3.11.3'),
('Arrow', '14.0.1'),
('SciPy-bundle', '2023.07'),
('zstd', '1.5.5'),
('flatbuffers', '23.5.26'),
('pybind11', '2.11.1'),
('Boost', '1.82.0'),
('build', '1.0.3'),
('HDF5', '1.14.0'),
('h5py', '3.9.0'),
('tqdm', '4.66.1'),
('polars', '0.20.2'),
]

exts_defaultclass = 'PythonPackage'
exts_default_options = {
'source_urls': [PYPI_SOURCE],
'download_dep_fail': True,
'use_pip': True,
'sanity_pip_check': True,
'installopts': '',
}

exts_list = [
('attrs', '23.2.0', {
'checksums': ['935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30'],
}),
('vbz_h5py_plugin', '1.0.1', {
'checksums': ['c784458bb0aad6303474cb2f10956179116b35555803fd1154eb4ef362519341'],
}),
('iso8601', '2.1.0', {
'checksums': ['6b1d3829ee8921c4301998c909f7829fa9ed3cbdac0d3b16af2d743aed1ba8df'],
}),
('pod5', version, {
'patches': ['pod5-file-format-%(version)s_fix_version_in_pyproject.patch'],
'preinstallopts': "sed -i 's/h5py~=[0-9.]*/h5py/' pyproject.toml && ",
'source_urls': ['https://github.com/nanoporetech/%(name)s/archive/'],
'sources': [{'download_filename': '%(version)s.tar.gz', 'filename': '%(name)s-%(version)s.tar.gz'}],
'start_dir': 'python/pod5',
'checksums': [
{'pod5-0.3.10.tar.gz': 'eb177018b310e508f7ad6b5d486cc29166404dd5f82879d0c26aceaff51d3768'},
{'pod5-file-format-0.3.10_fix_version_in_pyproject.patch':
'720a48a0cacca5e3f78371115070ab077ebce471ac0bbb142581f006e11db5ff'},
],
}),
]

# Must create the _version.py file first of all
_vtuple = ','.join(version.split('.'))
_vertxt = [
"__version__=version='%(version)s'",
"__version_tuple__=version_tuple=(%s)" % _vtuple
]
_vstr = '\n'.join(_vertxt)

_precopts = [
"cd %(start_dir)s",
'echo "%s" > _version.py' % _vstr,
"python -m pod5_make_version",
"cd -",
]
preconfigopts = " && ".join(_precopts) + " && "

# The code uses BUILD_SHARED_LIB and not the standard BUILD_SHARED_LIBS, so set explicitly
configopts = '-DBUILD_SHARED_LIB=ON -DBUILD_PYTHON_WHEEL=ON -DZSTD_ROOT=$EBROOTZSTD '

installopts = ' && export XDG_CACHE_HOME=%(builddir)s && cd %(installdir)s'
installopts += ' && pip install --no-deps --ignore-installed --prefix %(installdir)s lib_pod5-%(version)s-*.whl'

postinstallcmds = ['rm %(installdir)s/lib_pod5-%(version)s-*.whl']

sanity_check_paths = {
'files': ['bin/pod5', 'lib/libpod5_format.%s' % SHLIB_EXT],
'dirs': ['include/pod5_format', 'lib/python%(pyshortver)s/site-packages'],
}

sanity_check_commands = [
"pod5 subset --help",
"python -c 'import lib_pod5'",
]

modextrapaths = {'PYTHONPATH': 'lib/python%(pyshortver)s/site-packages'}

moduleclass = 'bio'
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Flatbuffers 2.0.7 uses capital 'B' in 'FlatBuffersConfig.cmake'
We want to use our pybind11 instead of the one in git submodules
Author: Petr Král (INUITS)

Updated for 0.3.10 by Åke Sandgren, 2024-04-03
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ea58278..c3bf295 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,7 +87,6 @@ if (BUILD_PYTHON_WHEEL)
set(PYTHON_VERSION "")
endif()
find_package (Python ${PYTHON_VERSION} EXACT COMPONENTS Interpreter Development)
- add_subdirectory(third_party/pybind11)
endif()

add_subdirectory(c++)
diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt
index 05c1c1b..6efb894 100644
--- a/c++/CMakeLists.txt
+++ b/c++/CMakeLists.txt
@@ -17,7 +17,7 @@ else()
COMPONENTS
headers
)
- find_package(Flatbuffers REQUIRED)
+ find_package(FlatBuffers REQUIRED)
find_package(zstd REQUIRED)
find_package(ZLIB REQUIRED)

@@ -27,6 +27,7 @@ else()
endif()

find_package(Threads REQUIRED)
+find_package(pybind11 REQUIRED)

find_program(
FLATBUFFERS_FLATC_EXECUTABLE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Set version explicitly
There is some problem with their pyproject.toml and the version of Python

Åke Sandgren, 2024-04-03
diff --git a/python/pod5/pyproject.toml b/python/pod5/pyproject.toml
index e00f9f9..84c7970 100644
--- a/python/pod5/pyproject.toml
+++ b/python/pod5/pyproject.toml
@@ -9,7 +9,7 @@ authors = [{name="Oxford Nanopore Technologies plc", email="support@nanoporetech
readme = "README.md"
requires-python = "~= 3.8"
description="Oxford Nanopore Technologies Pod5 File Format Python API and Tools"
-dynamic = ["version"]
+version = '0.3.10'
keywords = ['nanopore']
classifiers=[
'Environment :: Console',
@@ -62,8 +62,5 @@ Documentation = "https://pod5-file-format.readthedocs.io/en/latest/"
where = ["src"]
exclude = ["test*"]

-[tool.setuptools.dynamic]
-version = {attr = "pod5._version.__version__"}
-
[tool.black]
target-version = ["py37"]