File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
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 }}
Original file line number Diff line number Diff 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:
88find_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...
1119add_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
2028target_link_libraries (blosc2_ext PRIVATE Python::NumPy )
2129
30+ if (DEFINED ENV{USE_SYSTEM_BLOSC2})
31+ set (USE_SYSTEM_BLOSC2 ON )
32+ endif ()
33+
2234if (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 )
2739else ()
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." )
Original file line number Diff line number Diff line change @@ -4,9 +4,7 @@ python-blosc2 release procedure
44Preliminaries
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"
Original file line number Diff line number Diff line change 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 ' )
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ build-backend = "scikit_build_core.build"
88
99[project ]
1010name = " 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 "
1212readme = {file = " README.rst" , content-type = " text/x-rst" }
1313authors = [{name = " Blosc Development Team" , email = " blosc@blosc.org" }]
1414maintainers = [{ name = " Blosc Development Team" , email = " blosc@blosc.org" }]
@@ -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"
8686manylinux-x86_64-image = " manylinux2014"
8787manylinux-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 ]
9790line-length = 109
9891extend-exclude = [" bench" ]
Original file line number Diff line number Diff line change 1212
1313from enum import Enum
1414
15- from ._version import __version__
15+ from .version import __version__
1616
1717__version__ = __version__
1818"""
Original file line number Diff line number Diff line change 1+ __version__ = "3.0.0rc3"
You can’t perform that action at this time.
0 commit comments