Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #743 +/- ##
========================================
Coverage 62.25% 62.25%
========================================
Files 702 702
Lines 40598 40598
Branches 5763 5763
========================================
Hits 25273 25273
Misses 14544 14544
Partials 781 781 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0ef6c88 to
e8fe520
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the Python packaging/build setup to support producing distributable wheels (including Windows), aligns Cython header includes with the C++ exported include layout, and adds CI workflows to build wheels across platforms.
Changes:
- Reworked
python/setup.pyto package C++ headers/libs fromcpp/target/buildand to support Windows wheel builds (including DLL preloading support). - Added
python/pyproject.toml(PEP 517/518) and updated version-sync logic to keep it aligned with Maven. - Added a multi-platform wheel build workflow and adjusted existing CI to install uuid system deps where needed.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| python/tsfile/tsfile_cpp.pxd | Switches Cython extern from includes to match exported include tree (cwrapper/..., common/...). |
| python/tsfile/init.py | Updates Windows DLL loading strategy using os.add_dll_directory + absolute-path preload. |
| python/setup.py | Refactors build to copy headers/libs from cpp/target/build, set rpaths, and handle Windows artifacts. |
| python/requirements.txt | Updates NumPy constraint to >=2,<3. |
| python/pyproject.toml | Introduces PEP 621/517 metadata and package-data configuration for wheels. |
| python/VersionUpdater.groovy | Extends version sync to also update pyproject.toml. |
| pom.xml | Adds RAT/formatter excludes and alters Windows Python execution properties. |
| cpp/third_party/zlib-1.3.1/zlib-1.3.1/treebuild.xml | Removes unused third-party build metadata file. |
| cpp/third_party/zlib-1.3.1/treebuild.xml | Removes unused third-party build metadata file. |
| cpp/pom.xml | Removes the linux-install-uuid-dev profile. |
| cpp/CMakeLists.txt | Removes a BOM/encoding artifact at the file start. |
| .gitignore | Updates ignores related to bundled zlib. |
| .github/workflows/wheels.yml | Adds CI workflow to build wheels for Linux/macOS and a Windows wheel pipeline. |
| .github/workflows/unit-test-python.yml | Adds Python setup + extra dependency installation. |
| .github/workflows/unit-test-cpp.yml | Adds conditional uuid install logic on Linux. |
Comments suppressed due to low confidence (1)
.github/workflows/unit-test-cpp.yml:122
- This Linux dependency logic is internally inconsistent: even if the
yumbranch runs, the script still unconditionally executesapt-getlater in the same block. That defeats the intent of addingyumsupport and would fail on a yum-based Linux runner. Either fully gate theapt-getcommands behind theapt-getcheck, or factor theuuidinstall andclang-formatsetup so only the correct package manager is used.
if [[ "$RUNNER_OS" == "Linux" ]]; then
if command -v apt-get >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y uuid-dev
elif command -v yum >/dev/null 2>&1; then
sudo yum install -y libuuid-devel
fi
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-17 100
sudo update-alternatives --set clang-format /usr/bin/clang-format-17
sudo apt-get update
sudo apt-get install -y uuid-dev
elif [[ "$RUNNER_OS" == "Windows" ]]; then
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <exclude>**/**venv-py**/**</exclude> | ||
| <exclude>**/.python-version</exclude> | ||
| <exclude>python/.python-version</exclude> |
| <cmake.generator>MinGW Makefiles</cmake.generator> | ||
| <python.venv.bin>venv/Scripts/</python.venv.bin> | ||
| <python.exe.bin>python</python.exe.bin> | ||
| <python.venv.bin/> |
| - name: Install dependencies | ||
| shell: bash | ||
| run: | | ||
| if [[ "$RUNNER_OS" == "Linux" ]]; then | ||
| if command -v apt-get >/dev/null 2>&1; then | ||
| sudo apt-get update | ||
| sudo apt-get install -y uuid-dev | ||
| elif command -v yum >/dev/null 2>&1; then | ||
| sudo yum install -y libuuid-devel | ||
| fi | ||
| fi |
| @@ -19,9 +19,16 @@ | |||
| import ctypes | |||
| import os | |||
| import platform | |||
| (PKG / "include").mkdir(exist_ok=True) | ||
| if (PKG / "include").exists() and CPP_INC.exists(): | ||
| shutil.rmtree(PKG / "include") | ||
| shutil.copytree(CPP_INC, PKG / "include") |
| extra_compile_args += ["-O3", "-std=c++11", "-fvisibility=hidden", "-fPIC"] | ||
| extra_link_args += ["-Wl,-rpath,@loader_path", "-stdlib=libc++"] | ||
| elif sys.platform == "win32": | ||
| libraries = ["Tsfile"] |
| import os | ||
| import platform | ||
| import shutil | ||
|
|
||
| import sys | ||
| import numpy as np | ||
|
|
||
| from pathlib import Path | ||
| from Cython.Build import cythonize | ||
| from setuptools import setup, Extension | ||
| from setuptools.command.build_ext import build_ext | ||
|
|
||
| ROOT = Path(__file__).parent.resolve() | ||
| PKG = ROOT / "tsfile" | ||
| CPP_OUT = ROOT / ".." / "cpp" / "target" / "build" | ||
| CPP_LIB = CPP_OUT / "lib" | ||
| CPP_INC = CPP_OUT / "include" | ||
|
|
||
| version = "2.2.1.dev" | ||
| system = platform.system() | ||
|
|
|
I don't have additional comments. LGTM. |
| - name: Install dependencies | ||
| shell: bash | ||
| run: | | ||
| if [[ "$RUNNER_OS" == "Linux" ]]; then | ||
| if command -v apt-get >/dev/null 2>&1; then | ||
| sudo apt-get update | ||
| sudo apt-get install -y uuid-dev | ||
| elif command -v yum >/dev/null 2>&1; then | ||
| sudo yum install -y libuuid-devel | ||
| fi | ||
| fi |
| mkdir -p /opt/java | ||
| if [ "$ARCH" = "x86_64" ]; then | ||
| JDK_URL="https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-x64_bin.tar.gz" | ||
| else | ||
| # aarch64 | ||
| JDK_URL="https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-aarch64_bin.tar.gz" | ||
| fi | ||
| curl -L -o /tmp/jdk17.tar.gz "$JDK_URL" | ||
| tar -xzf /tmp/jdk17.tar.gz -C /opt/java | ||
| export JAVA_HOME=$(echo /opt/java/jdk-17.0.12*) | ||
| export PATH="$JAVA_HOME/bin:$PATH" | ||
| java -version |
There was a problem hiding this comment.
Is this redundant with setup-java before?
| <profile> | ||
| <id>linux-install-uuid-dev</id> | ||
| <activation> | ||
| <os> | ||
| <family>unix</family> | ||
| <name>Linux</name> | ||
| </os> | ||
| </activation> | ||
| </profile> | ||
| <!-- When running on jenkins, download the sonar build-wrapper, so we can do a code analysis --> |
There was a problem hiding this comment.
Add something in the ReadMe to remind the user to install manually.

I refined setup.py in this pr and enabled compiling wheels for win-py on ci.
For detailed action workflow: https://github.com/ColinLeeo/tsfile/actions/runs/23084354062.
UUID installation is removed from pom.xml.