Skip to content

support python release.#743

Open
ColinLeeo wants to merge 2 commits intodevelopfrom
support_release_ci
Open

support python release.#743
ColinLeeo wants to merge 2 commits intodevelopfrom
support_release_ci

Conversation

@ColinLeeo
Copy link
Contributor

@ColinLeeo ColinLeeo commented Mar 12, 2026

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.

@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.25%. Comparing base (b171c5e) to head (a5007d1).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ColinLeeo ColinLeeo force-pushed the support_release_ci branch from 0ef6c88 to e8fe520 Compare March 14, 2026 08:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py to package C++ headers/libs from cpp/target/build and 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 yum branch runs, the script still unconditionally executes apt-get later in the same block. That defeats the intent of adding yum support and would fail on a yum-based Linux runner. Either fully gate the apt-get commands behind the apt-get check, or factor the uuid install and clang-format setup 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.

Comment on lines +139 to +141
<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/>
Comment on lines +68 to +78
- 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

@@ -19,9 +19,16 @@
import ctypes
import os
import platform
Comment on lines +39 to +42
(PKG / "include").mkdir(exist_ok=True)
if (PKG / "include").exists() and CPP_INC.exists():
shutil.rmtree(PKG / "include")
shutil.copytree(CPP_INC, PKG / "include")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

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"]
Comment on lines 19 to 38
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()

@hongzhi-gao
Copy link
Contributor

I don't have additional comments. LGTM.

Comment on lines +68 to +78
- 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Comment on lines +124 to +135
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this redundant with setup-java before?

Comment on lines -166 to -175
<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 -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add something in the ReadMe to remind the user to install manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants