Skip to content

Commit 5b6cfe5

Browse files
Merge pull request #345 from Blosc/conda-recipe
Config for allowing a conda build
2 parents 76fcfd8 + 63af1e5 commit 5b6cfe5

File tree

7 files changed

+30
-22
lines changed

7 files changed

+30
-22
lines changed

Diff for: .github/workflows/cibuildwheels.yml

-8
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ jobs:
4343
steps:
4444
- name: Checkout repo
4545
uses: actions/checkout@v4
46-
with:
47-
# Fetch all history for all branches and tags
48-
# (important for guessing the correct version with setuptools_scm)
49-
fetch-depth: 0
5046

5147
- name: Set up Python
5248
uses: actions/setup-python@v5
@@ -91,10 +87,6 @@ jobs:
9187

9288
steps:
9389
- uses: actions/checkout@v4
94-
with:
95-
# Fetch all history for all branches and tags
96-
# (important for guessing the correct version with setuptools_scm)
97-
fetch-depth: 0
9890

9991
- uses: actions/setup-python@v5
10092
name: Setup Python ${{ matrix.python-version }}

Diff for: CMakeLists.txt

+13-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ project(python-blosc2)
77
# IMO, this would need to be solved in Fedora, so we can just use the following line:
88
find_package(Python COMPONENTS Interpreter NumPy Development.Module REQUIRED)
99

10+
# Add custom command to generate the version file
11+
add_custom_command(
12+
OUTPUT src/blosc2/version.py
13+
COMMAND ${Python_EXECUTABLE} generate_version.py
14+
DEPENDS generate_version.py pyproject.toml
15+
VERBATIM
16+
)
17+
1018
# Compile the Cython extension manually...
1119
add_custom_command(
1220
OUTPUT blosc2_ext.c
@@ -19,11 +27,15 @@ Python_add_library(blosc2_ext MODULE blosc2_ext.c WITH_SOABI)
1927
# We need to link against NumPy
2028
target_link_libraries(blosc2_ext PRIVATE Python::NumPy)
2129

30+
if(DEFINED ENV{USE_SYSTEM_BLOSC2})
31+
set(USE_SYSTEM_BLOSC2 ON)
32+
endif()
33+
2234
if(USE_SYSTEM_BLOSC2)
2335
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
2436
find_package(PkgConfig REQUIRED)
2537
pkg_check_modules(Blosc2 REQUIRED IMPORTED_TARGET blosc2)
26-
target_link_libraries(blosc2_ext PkgConfig::Blosc2)
38+
target_link_libraries(blosc2_ext PRIVATE PkgConfig::Blosc2)
2739
else()
2840
set(STATIC_LIB ON CACHE BOOL "Build a static version of the blosc library.")
2941
set(SHARED_LIB ON CACHE BOOL "Build a shared library version of the blosc library.")

Diff for: RELEASING.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ python-blosc2 release procedure
44
Preliminaries
55
-------------
66

7-
* Do not worry about the version number. setuptools_scm in scikit-build-core has machinery
8-
to figure it out based on git tags:
9-
https://scikit-build-core.readthedocs.io/en/latest/configuration.html#dynamic-metadata
7+
* Set the version number in ``pyproject.toml`` to the new version number (e.g. ``X.Y.Z``).
108

119
* Make sure that the c-blosc2 repository is updated to the latest version (or a specific
1210
version that will be documented in the ``RELEASE_NOTES.md``). In ``CMakeLists.txt`` edit::
@@ -111,6 +109,9 @@ Post-release actions
111109

112110
XXX version-specific blurb XXX
113111

112+
* Update the version number in ``pyproject.toml`` to the next version number
113+
(e.g. ``X.Y.(Z+1).dev``).
114+
114115
* Commit your changes with::
115116

116117
git commit -a -m "Post X.Y.Z release actions done"

Diff for: generate_version.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import tomllib as toml
2+
3+
with open("pyproject.toml", "rb") as f:
4+
pyproject = toml.load(f)
5+
6+
version = pyproject["project"]["version"]
7+
8+
with open("src/blosc2/version.py", "w") as f:
9+
f.write(f'__version__ = "{version}"\n')

Diff for: pyproject.toml

+2-9
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ build-backend = "scikit_build_core.build"
88

99
[project]
1010
name = "blosc2"
11-
description = "A flexible computational engine for the fast Blosc2 compression library"
11+
description = "A high-performance compressed ndarray library with a flexible computational engine"
1212
readme = {file = "README.rst", content-type = "text/x-rst"}
1313
authors = [{name = "Blosc Development Team", email = "[email protected]"}]
1414
maintainers = [{ name = "Blosc Development Team", email = "[email protected]"}]
@@ -38,7 +38,7 @@ dependencies = [
3838
"py-cpuinfo",
3939
"httpx",
4040
]
41-
dynamic = ["version"]
41+
version = "3.0.0rc3"
4242

4343

4444
[project.optional-dependencies]
@@ -86,13 +86,6 @@ test-command = "pytest {project}/tests"
8686
manylinux-x86_64-image = "manylinux2014"
8787
manylinux-aarch64-image = "manylinux2014"
8888

89-
[tool.scikit-build]
90-
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
91-
sdist.include = ["src/blosc2/_version.py"]
92-
93-
[tool.setuptools_scm]
94-
write_to = "src/blosc2/_version.py"
95-
9689
[tool.ruff]
9790
line-length = 109
9891
extend-exclude = ["bench"]

Diff for: src/blosc2/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from enum import Enum
1414

15-
from ._version import __version__
15+
from .version import __version__
1616

1717
__version__ = __version__
1818
"""

Diff for: src/blosc2/version.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "3.0.0rc3"

0 commit comments

Comments
 (0)