Skip to content

Commit

Permalink
migrate to scikit-build-core, misc updates (#14)
Browse files Browse the repository at this point in the history
* offset

* partial sort (top k)

* push first

* clean repo

* fix

* lint code

* Removed submodules

* clean

* update makefile

* fix

* add back git ignored files...

* remove x

* fix

* good

* update CI

* fix

* c++17 for macOS

* fix CI

* fix

* fix

* fix

* fix CI

* fix

* fix windows build

* fix windows build

* not ready

* fix mode

* fix

* fix M_PI

* fix CI

* fix CI

* fix

* fix

* fix vector

* disable parallel

* move code

* lint, trigger CI

---------

Co-authored-by: TANG ZHIXIONG <[email protected]>
  • Loading branch information
district10 and zhixiong-tang authored Dec 2, 2023
1 parent b65d359 commit c24d18d
Show file tree
Hide file tree
Showing 51 changed files with 5,991 additions and 354 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@ on:

jobs:
build:
name: Build with Pip
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-20.04, windows-2019, macos-11]
python-version: ["3.8", "3.9", "3.10"]

runs-on: ${{ matrix.platform }}
platform: [windows-latest, macos-latest, ubuntu-latest]
python-version: ["3.7", "3.11"]

steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Add requirements
run: python -m pip install --upgrade wheel setuptools
- name: Set min macOS version
if: runner.os == 'macOS'
run: |
echo "MACOS_DEPLOYMENT_TARGET=10.14" >> $GITHUB_ENV
- name: Build and install
run: pip install --verbose .[test]
run: pip install --verbose .[test] && make data_pull

- name: Test
run: python -m pytest
32 changes: 16 additions & 16 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ on:
types:
- published

env:
FORCE_COLOR: 3

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -36,29 +43,22 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

# - name: Set up QEMU
# if: runner.os == 'Linux'
# uses: docker/setup-qemu-action@v2
# with:
# platforms: all

- uses: pypa/[email protected]
- uses: pypa/[email protected]
env:
# CIBW_ARCHS: auto64
CIBW_ARCHS_LINUX: x86_64 # aarch64
CIBW_ARCHS_WINDOWS: AMD64 # ARM64
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_BEFORE_BUILD: pip install numpy fire --prefer-binary
CIBW_ARCHS_MACOS: universal2
CIBW_ARCHS_WINDOWS: auto ARM64
CIBW_BEFORE_BUILD: pip install fire loguru numpy --prefer-binary && make data_pull
# https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
CIBW_SKIP: pp* *i686 *musllinux*
CIBW_TEST_SKIP: "*macosx* *-win_arm64"
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=10.14

- name: Verify clean directory
run: git diff --exit-code
Expand Down Expand Up @@ -86,6 +86,6 @@ jobs:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.6.4
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ _generate/
*.so
*.py[cod]
*.egg-info
*env*
wheelhouse
site
data/*
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

20 changes: 7 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,31 @@ exclude: '(?x)^3rdparty/(Eigen/.*|.*\..*|rapidjson/.*|spdlog/.*|tl/.*)$'
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
exclude: ^conda\.recipe/meta\.yaml$
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace

# Black, the code formatter, natively supports pre-commit
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
exclude: ^(docs)

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.254"
# Check linting and style issues
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.4"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format
exclude: ^(docs)

# Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.4.2
rev: v1.5.4
hooks:
- id: remove-tabs
exclude: ^(docs|Makefile|data/Makefile)
Expand All @@ -64,7 +59,6 @@ repos:
types: [file]
files: (\.cmake|CMakeLists.txt)(.in)?$

# Suggested hook if you add a .clang-format file
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v13.0.0
hooks:
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@
"concepts": "cpp",
"memory_resource": "cpp",
"ranges": "cpp",
"stop_token": "cpp"
"stop_token": "cpp",
"core": "cpp"
},
"workbench.colorCustomizations": {
// "activityBar.background": "#b80ae3",
Expand Down
60 changes: 60 additions & 0 deletions 3rdparty/Eigen/Eigenvalues
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef EIGEN_EIGENVALUES_MODULE_H
#define EIGEN_EIGENVALUES_MODULE_H

#include "Core"

#include "Cholesky"
#include "Jacobi"
#include "Householder"
#include "LU"
#include "Geometry"

#include "src/Core/util/DisableStupidWarnings.h"

/** \defgroup Eigenvalues_Module Eigenvalues module
*
*
*
* This module mainly provides various eigenvalue solvers.
* This module also provides some MatrixBase methods, including:
* - MatrixBase::eigenvalues(),
* - MatrixBase::operatorNorm()
*
* \code
* #include <Eigen/Eigenvalues>
* \endcode
*/

#include "src/misc/RealSvd2x2.h"
#include "src/Eigenvalues/Tridiagonalization.h"
#include "src/Eigenvalues/RealSchur.h"
#include "src/Eigenvalues/EigenSolver.h"
#include "src/Eigenvalues/SelfAdjointEigenSolver.h"
#include "src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h"
#include "src/Eigenvalues/HessenbergDecomposition.h"
#include "src/Eigenvalues/ComplexSchur.h"
#include "src/Eigenvalues/ComplexEigenSolver.h"
#include "src/Eigenvalues/RealQZ.h"
#include "src/Eigenvalues/GeneralizedEigenSolver.h"
#include "src/Eigenvalues/MatrixBaseEigenvalues.h"
#ifdef EIGEN_USE_LAPACKE
#ifdef EIGEN_USE_MKL
#include "mkl_lapacke.h"
#else
#include "src/misc/lapacke.h"
#endif
#include "src/Eigenvalues/RealSchur_LAPACKE.h"
#include "src/Eigenvalues/ComplexSchur_LAPACKE.h"
#include "src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h"
#endif

#include "src/Core/util/ReenableStupidWarnings.h"

#endif // EIGEN_EIGENVALUES_MODULE_H
Loading

0 comments on commit c24d18d

Please sign in to comment.