Skip to content
This repository was archived by the owner on Dec 17, 2025. It is now read-only.
Merged
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
5 changes: 5 additions & 0 deletions .github/workflows/CI_PublishTestPyPI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ jobs:
shell: bash
run: |
rm -f python/.gitignore
- name: prepare build
shell: bash
run: |
cd python
python prepare_build.py
- uses: pypa/cibuildwheel@v3.1.4
env:
CIBW_DEPENDENCY_VERSIONS: "latest"
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/PublishPyPI.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Python Build & Publish (Trusted)
name: Build & Publish

on:
push:
tags: ["v*"] # Example: triggers on push of v0.1.0
workflow_dispatch:
workflow_run:
workflows: ["Create Tag & Release from Version Header"]
types:
- completed

jobs:
build-wheels:
Expand Down Expand Up @@ -80,6 +81,11 @@ jobs:
shell: bash
run: |
rm -f python/.gitignore
- name: prepare build
shell: bash
run: |
cd python
python prepare_build.py
- uses: pypa/cibuildwheel@v3.1.4
env:
CIBW_DEPENDENCY_VERSIONS: "latest"
Expand Down
10 changes: 5 additions & 5 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ endif()
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME sparseir)

# Check if source files exist and provide helpful error message
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/utils.cpp")
message(FATAL_ERROR "Source files not found. Please run: python3 prepare_build.py")
endif()
#if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../src/utils.cpp")
#message(FATAL_ERROR "Source files not found. Please run: python3 prepare_build.py")
#endif()

# Explicitly list source files from copied directories
file(GLOB SPARSEIR_SOURCES "src/*.cpp")
file(GLOB SPARSEIR_SOURCES "../src/*.cpp")
add_library(sparseir SHARED ${SPARSEIR_SOURCES})
if(NOT MSVC)
target_compile_options(sparseir PRIVATE -Wall -Wextra -pedantic)
Expand All @@ -125,7 +125,7 @@ endif()

target_include_directories(sparseir
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
$<INSTALL_INTERFACE:include>
PRIVATE
$<BUILD_INTERFACE:${xprec_SOURCE_DIR}/include>
Expand Down
13 changes: 13 additions & 0 deletions python/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.PHONY: test clean build

test:
rm -rf src && python prepare_build.py && uv run pytest

clean:
rm -rf src build dist *.egg-info __pycache__ .pytest_cache

build:
rm -rf src && python prepare_build.py && uv build

sync:
rm -rf src && python prepare_build.py && uv sync
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ classifiers = [
]
requires-python = ">=3.10"
dependencies = [
"numpy",
"numpy>=2.0.0",
"scipy",
]

Expand Down
Loading