diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml index f2abeab..51ec496 100644 --- a/.github/workflows/benchmark.yaml +++ b/.github/workflows/benchmark.yaml @@ -9,16 +9,19 @@ jobs: strategy: fail-fast: false matrix: - os: ["windows-latest", "ubuntu-latest", "macos-13"] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + os: ["windows-latest", "ubuntu-22.04", "macos-15-intel"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Install lap from source - run: pip install git+https://github.com/gatagat/lap.git + - name: Install lap from GitHub (dynamic branch) + shell: bash + run: | + BRANCH="${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}" + pip install "git+https://github.com/gatagat/lap.git@$BRANCH" - name: Install scipy run: pip install scipy - name: ๐Ÿ“Š Run benchmark_simple.py diff --git a/.github/workflows/prepublish.yaml b/.github/workflows/prepublish.yaml index afe5078..49e9900 100644 --- a/.github/workflows/prepublish.yaml +++ b/.github/workflows/prepublish.yaml @@ -4,22 +4,28 @@ on: [workflow_dispatch] jobs: - build_windows_all: - name: Build windows wheels + # # # # # # # # # # # # # # # # # # # # # + # Windows jobs + # # # # # # # # # # # # # # # # # # # # # + + build_windows: + name: Build windows (Python 3.8-3.14) runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python 3.x uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.21.3 + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==3.3.1 - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD_VERBOSITY: 1 - CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*" + CIBW_BUILD: "cp38-* cp314-*" CIBW_SKIP: "*-win32 pp*" CIBW_ARCHS_WINDOWS: "AMD64 ARM64" - name: Archive wheels @@ -27,23 +33,55 @@ jobs: with: name: windows-all-wheels path: ./wheelhouse/*.whl - + + build_windows_p37: + name: Build windows (Python 3.7) + runs-on: windows-latest + steps: + - uses: actions/checkout@v5 + - name: Set up Python 3.x + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==2.23.3 + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD_VERBOSITY: 1 + CIBW_BUILD: "cp37-*" + CIBW_SKIP: "*-win32 pp*" + CIBW_ARCHS_WINDOWS: "AMD64 ARM64" + - name: Archive wheels + uses: actions/upload-artifact@v4 + with: + name: windows-all-p37-wheels + path: ./wheelhouse/*.whl + + # # # # # # # # # # # # # # # # # # # # # + # macOS jobs + # # # # # # # # # # # # # # # # # # # # # + build_macos_intel: - name: Build macos-intel wheels - runs-on: macos-13 + name: Build macos-intel (Python 3.8-3.14) + runs-on: macos-15-intel steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python 3.x uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.21.3 + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==3.3.1 - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD_VERBOSITY: 1 - CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*" + CIBW_BUILD: "cp38-* cp314-*" CIBW_SKIP: "pp*" CIBW_ARCHS_MACOS: "x86_64" - name: Archive wheels @@ -52,22 +90,50 @@ jobs: name: macos-intel-wheels path: ./wheelhouse/*.whl + build_macos_intel_p37: + name: Build macos-intel (Python 3.7) + runs-on: macos-15-intel + steps: + - uses: actions/checkout@v5 + - name: Set up Python 3.x + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==2.23.3 + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD_VERBOSITY: 1 + CIBW_BUILD: "cp37-*" + CIBW_SKIP: "pp*" + CIBW_ARCHS_MACOS: "x86_64" + - name: Archive wheels + uses: actions/upload-artifact@v4 + with: + name: macos-intel-p37-wheels + path: ./wheelhouse/*.whl + build_macos_arm: - name: Build macos-arm wheels - runs-on: macos-14 + name: Build macos-arm (Python 3.8-3.14) + runs-on: macos-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python 3.x uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.21.3 + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==3.3.1 - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD_VERBOSITY: 1 - CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*" + CIBW_BUILD: "cp38-* cp314-*" CIBW_SKIP: "pp*" CIBW_ARCHS_MACOS: "arm64" - name: Archive wheels @@ -76,22 +142,28 @@ jobs: name: macos-arm-wheels path: ./wheelhouse/*.whl + # # # # # # # # # # # # # # # # # # # # # + # Linux jobs + # # # # # # # # # # # # # # # # # # # # # + build_linux_intel: - name: Build linux-intel wheels + name: Build linux-intel (Python 3.8-3.14) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python 3.x uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.21.3 + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==3.3.1 - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD_VERBOSITY: 1 - CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*" + CIBW_BUILD: "cp38-* cp314-*" CIBW_SKIP: "*-manylinux_i686 pp*" CIBW_ARCHS_LINUX: "x86_64" - name: Archive wheels @@ -100,20 +172,51 @@ jobs: name: linux-intel-wheels path: ./wheelhouse/*.whl - build_linux_arm: - name: Build linux-arm wheels + build_linux_intel_p37: + name: Build linux-intel (Python 3.7) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + - uses: actions/checkout@v5 + - name: Set up Python 3.x + uses: actions/setup-python@v5 with: - platforms: arm64 + python-version: '3.x' + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==2.23.3 - name: Build wheels - uses: pypa/cibuildwheel@v2.21.3 + run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD_VERBOSITY: 1 - CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*" + CIBW_BUILD: "cp37-*" + CIBW_SKIP: "*-manylinux_i686 pp*" + CIBW_ARCHS_LINUX: "x86_64" + - name: Archive wheels + uses: actions/upload-artifact@v4 + with: + name: linux-intel-p37-wheels + path: ./wheelhouse/*.whl + + build_linux_arm: + name: Build linux-arm (Python 3.8-3.14) + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v5 + - name: Set up Python 3.x + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==3.3.1 + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD_VERBOSITY: 1 + CIBW_BUILD: "cp38-* cp314-*" + CIBW_SKIP: "pp*" CIBW_ARCHS_LINUX: "aarch64" - name: Archive wheels uses: actions/upload-artifact@v4 @@ -121,18 +224,49 @@ jobs: name: linux-arm-wheels path: ./wheelhouse/*.whl + build_linux_arm_p37: + name: Build linux-arm (Python 3.7) + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v5 + - name: Set up Python 3.x + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==2.23.3 + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD_VERBOSITY: 1 + CIBW_BUILD: "cp37-*" + CIBW_SKIP: "pp*" + CIBW_ARCHS_LINUX: "aarch64" + - name: Archive wheels + uses: actions/upload-artifact@v4 + with: + name: linux-arm-p37-wheels + path: ./wheelhouse/*.whl + + # # # # # # # # # # # # # # # # # # # # # + # Source dist job + # # # # # # # # # # # # # # # # # # # # # + build_source: - name: Build source distribution + name: Build source dist runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python 3.x uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install requirements run: | - pip install "setuptools>=67.2.0" + python -m pip install --upgrade pip + pip install "setuptools>=67.8.0" pip install wheel build - name: Build .tar.gz run: python -m build --sdist diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index ea71364..b549bfd 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -7,46 +7,84 @@ on: jobs: - build_windows_all: - name: Build windows wheels + # # # # # # # # # # # # # # # # # # # # # + # Windows jobs + # # # # # # # # # # # # # # # # # # # # # + + build_windows: + name: Build windows (Python 3.8-3.14) runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python 3.x uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.21.3 + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==3.3.1 - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD_VERBOSITY: 1 - CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*" + CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*" CIBW_SKIP: "*-win32 pp*" CIBW_ARCHS_WINDOWS: "AMD64 ARM64" - name: Archive wheels uses: actions/upload-artifact@v4 with: - name: pypi-windows-all-wheels + name: pypi-windows-wheels path: ./wheelhouse/*.whl - + + build_windows_p37: + name: Build windows (Python 3.7) + runs-on: windows-latest + steps: + - uses: actions/checkout@v5 + - name: Set up Python 3.x + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==2.23.3 + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD_VERBOSITY: 1 + CIBW_BUILD: "cp37-*" + CIBW_SKIP: "*-win32 pp*" + CIBW_ARCHS_WINDOWS: "AMD64 ARM64" + - name: Archive wheels + uses: actions/upload-artifact@v4 + with: + name: pypi-windows-all-p37-wheels + path: ./wheelhouse/*.whl + + # # # # # # # # # # # # # # # # # # # # # + # macOS jobs + # # # # # # # # # # # # # # # # # # # # # + build_macos_intel: - name: Build macos-intel wheels - runs-on: macos-13 + name: Build macos-intel (Python 3.8-3.14) + runs-on: macos-15-intel steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python 3.x uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.21.3 + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==3.3.1 - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD_VERBOSITY: 1 - CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*" + CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*" CIBW_SKIP: "pp*" CIBW_ARCHS_MACOS: "x86_64" - name: Archive wheels @@ -55,22 +93,50 @@ jobs: name: pypi-macos-intel-wheels path: ./wheelhouse/*.whl + build_macos_intel_p37: + name: Build macos-intel (Python 3.7) + runs-on: macos-15-intel + steps: + - uses: actions/checkout@v5 + - name: Set up Python 3.x + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==2.23.3 + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD_VERBOSITY: 1 + CIBW_BUILD: "cp37-*" + CIBW_SKIP: "pp*" + CIBW_ARCHS_MACOS: "x86_64" + - name: Archive wheels + uses: actions/upload-artifact@v4 + with: + name: pypi-macos-intel-p37-wheels + path: ./wheelhouse/*.whl + build_macos_arm: - name: Build macos-arm wheels - runs-on: macos-14 + name: Build macos-arm (Python 3.8-3.14) + runs-on: macos-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python 3.x uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.21.3 + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==3.3.1 - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD_VERBOSITY: 1 - CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*" + CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*" CIBW_SKIP: "pp*" CIBW_ARCHS_MACOS: "arm64" - name: Archive wheels @@ -79,22 +145,28 @@ jobs: name: pypi-macos-arm-wheels path: ./wheelhouse/*.whl + # # # # # # # # # # # # # # # # # # # # # + # Linux jobs + # # # # # # # # # # # # # # # # # # # # # + build_linux_intel: - name: Build linux-intel wheels + name: Build linux-intel (Python 3.8-3.14) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python 3.x uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.21.3 + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==3.3.1 - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD_VERBOSITY: 1 - CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*" + CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*" CIBW_SKIP: "*-manylinux_i686 pp*" CIBW_ARCHS_LINUX: "x86_64" - name: Archive wheels @@ -103,20 +175,51 @@ jobs: name: pypi-linux-intel-wheels path: ./wheelhouse/*.whl - build_linux_arm: - name: Build linux-arm wheels + build_linux_intel_p37: + name: Build linux-intel (Python 3.7) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + - uses: actions/checkout@v5 + - name: Set up Python 3.x + uses: actions/setup-python@v5 with: - platforms: arm64 + python-version: '3.x' + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==2.23.3 + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD_VERBOSITY: 1 + CIBW_BUILD: "cp37-*" + CIBW_SKIP: "*-manylinux_i686 pp*" + CIBW_ARCHS_LINUX: "x86_64" + - name: Archive wheels + uses: actions/upload-artifact@v4 + with: + name: pypi-linux-intel-p37-wheels + path: ./wheelhouse/*.whl + + build_linux_arm: + name: Build linux-arm (Python 3.8-3.14) + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v5 + - name: Set up Python 3.x + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==3.3.1 - name: Build wheels - uses: pypa/cibuildwheel@v2.21.3 + run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD_VERBOSITY: 1 - CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*" + CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*" + CIBW_SKIP: "pp*" CIBW_ARCHS_LINUX: "aarch64" - name: Archive wheels uses: actions/upload-artifact@v4 @@ -124,18 +227,49 @@ jobs: name: pypi-linux-arm-wheels path: ./wheelhouse/*.whl + build_linux_arm_p37: + name: Build linux-arm (Python 3.7) + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v5 + - name: Set up Python 3.x + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel==2.23.3 + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD_VERBOSITY: 1 + CIBW_BUILD: "cp37-*" + CIBW_SKIP: "pp*" + CIBW_ARCHS_LINUX: "aarch64" + - name: Archive wheels + uses: actions/upload-artifact@v4 + with: + name: pypi-linux-arm-p37-wheels + path: ./wheelhouse/*.whl + + # # # # # # # # # # # # # # # # # # # # # + # Source dist job + # # # # # # # # # # # # # # # # # # # # # + build_source: - name: Build source distribution + name: Build source dist runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python 3.x uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install requirements run: | - pip install "setuptools>=67.2.0" + python -m pip install --upgrade pip + pip install "setuptools>=67.8.0" pip install wheel build - name: Build .tar.gz run: python -m build --sdist @@ -145,9 +279,23 @@ jobs: name: pypi-source-dist path: dist/*.tar.gz + # # # # # # # # # # # # # # # # # # # # # + # Publish job + # # # # # # # # # # # # # # # # # # # # # + publish_pypi: name: Publish to PyPI - needs: [build_windows_all, build_macos_intel, build_macos_arm, build_linux_intel, build_linux_arm, build_source] + needs: + - build_windows + - build_windows_p37 + - build_macos_intel + - build_macos_intel_p37 + - build_macos_arm + - build_linux_intel + - build_linux_intel_p37 + - build_linux_arm + - build_linux_arm_p37 + - build_source runs-on: ubuntu-latest environment: pypi permissions: diff --git a/.github/workflows/test_simple.yaml b/.github/workflows/test_simple.yaml index ac233f0..dbbdac5 100644 --- a/.github/workflows/test_simple.yaml +++ b/.github/workflows/test_simple.yaml @@ -9,10 +9,10 @@ jobs: strategy: fail-fast: false matrix: - os: ["windows-latest", "ubuntu-latest", "macos-13"] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + os: ["windows-latest", "ubuntu-22.04", "macos-15-intel"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: @@ -20,12 +20,15 @@ jobs: - name: Install requirements run: | python -m pip install --upgrade pip - pip install "setuptools>=67.2.0" + pip install "setuptools>=67.8.0" pip install wheel build - name: Test build from source run: python -m build --wheel - - name: Test direct install from GitHub main - run: pip install git+https://github.com/gatagat/lap.git + - name: Test direct install from GitHub (dynamic branch) + shell: bash + run: | + BRANCH="${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}" + pip install "git+https://github.com/gatagat/lap.git@$BRANCH" - name: ๐Ÿงช Run test_simple.py run: | cd lap/tests/ diff --git a/README.md b/README.md index 145159c..b43be50 100644 --- a/README.md +++ b/README.md @@ -33,13 +33,13 @@ http://www.assignmentproblems.com/LAPJV.htm | pip install lap ``` -| **Pre-built Wheels** ๐Ÿ›ž | **Windows** โœ… | **Linux** โœ… | **macOS** โœ… | +| [**PyPI Wheels**](https://pypi.org/project/lap/#files) ๐Ÿ›ž | **Windows** โœ… | **Linux** โœ… | **macOS** โœ… | |:---:|:---:|:---:|:---:| | Python 3.7 | AMD64 | x86_64/aarch64 | x86_64 | | Python 3.8 | AMD64 | x86_64/aarch64 | x86_64/arm64 | -| Python 3.9-3.13 ยน | AMD64/ARM64 ยฒ | x86_64/aarch64 | x86_64/arm64 | +| Python 3.9-3.14 ยน | AMD64/ARM64 ยฒ | x86_64/aarch64 | x86_64/arm64 | -ยน v0.5.12 supports both numpy 1.x and 2.x for Python 3.8-3.13. ๐Ÿ†•
+ยน v0.5.13 supports both numpy 1.x and 2.x for Python 3.8-3.14. ๐Ÿ†•
ยฒ Windows ARM64 is experimental.
Other options diff --git a/lap/__init__.py b/lap/__init__.py index f3b27d8..257418d 100644 --- a/lap/__init__.py +++ b/lap/__init__.py @@ -11,7 +11,7 @@ Find optimal (minimum-cost) assignment for a sparse cost matrix. """ -__version__ = '0.5.12' +__version__ = '0.5.13' from ._lapjv import ( lapjv, diff --git a/lap/lapmod.py b/lap/lapmod.py index c3efc6c..90f2c05 100644 --- a/lap/lapmod.py +++ b/lap/lapmod.py @@ -274,7 +274,7 @@ def lapmod(n, cc, ii, kk, fast=True, return_cost=True, fp_version=FP_DYNAMIC): """Solve sparse linear assignment problem using Jonker-Volgenant algorithm. n: number of rows of the assignment cost matrix - cc: 1D array of all finite elements of the assignement cost matrix + cc: 1D array of all finite elements of the assignment cost matrix ii: 1D array of indices of the row starts in cc. The following must hold: ii[0] = 0 and ii[n+1] = len(cc). kk: 1D array of the column indices so that: diff --git a/pyproject.toml b/pyproject.toml index c8f1b4e..b97ad9f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools>=67.8.0", "Cython>=0.29.32", "numpy>=1.23.0"] +requires = ["setuptools>=67.8.0", "Cython>=0.29.32", "numpy>=1.21.6"] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index efaa678..e7c2503 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,12 @@ -from setuptools import Extension, Command, setup +from setuptools import Extension, setup, find_packages LICENSE = "BSD-2-Clause" DESCRIPTION = "Linear Assignment Problem solver (LAPJV/LAPMOD)." LONG_DESCRIPTION = open("README.md", encoding="utf-8").read() -package_name = "lap" -package_path = "lap" -_lapjv_src = "_lapjv_cpp" +PACKAGE_NAME = "lap" +PACKAGE_PATH = "lap" +SRC_DIR = "_lapjv_cpp" def get_version_string(): with open("lap/__init__.py") as version_file: @@ -14,68 +14,32 @@ def get_version_string(): if line.startswith('__version__'): delim = '"' if '"' in line else "'" return line.split(delim)[1] + raise RuntimeError('[!] Unable to find version string.') def include_numpy(): import numpy as np - try: - numpy_include = np.get_include() - except AttributeError: - numpy_include = np.get_numpy_include() - return numpy_include - -def compile_cpp(cython_file): - """Compile a C++ file from Cython's pyx or py. - """ - import os - import subprocess - cpp_file = os.path.splitext(cython_file)[0] + ".cpp" - flags = ['--fast-fail', '--cplus'] - rc = subprocess.call(['cython'] + flags + ['-o', cpp_file, cython_file]) - if rc != 0: - raise Exception('Cythonizing %s failed' % cython_file) - else: - return cpp_file - -class ExportCythonCommand(Command): - description = "Export _lapjv binary from source." - def run(self): - super().run() - import os - import shutil - this_dir = os.path.dirname(os.path.realpath(__file__)) - lap = os.path.join(this_dir, package_path) - _lapjv_src = os.path.join(this_dir, _lapjv_src) - for file in os.listdir(_lapjv_src): - if file[-2:].lower() in "soyd": - print(f"Moving {_lapjv_src}/{file} to {lap}/") - shutil.copy2(os.path.join(_lapjv_src, file), lap) - break + return np.get_include() def main_setup(): """Use modern setup() by setuptools. """ import os from Cython.Build import cythonize - _lapjvpyx = os.path.join(_lapjv_src, "_lapjv.pyx") - _lapjvcpp = compile_cpp(_lapjvpyx) - lapjvcpp = os.path.join(_lapjv_src, "lapjv.cpp") - lapmodcpp = os.path.join(_lapjv_src, "lapmod.cpp") + _lapjvpyx = os.path.join(SRC_DIR, "_lapjv.pyx") + lapjvcpp = os.path.join(SRC_DIR, "lapjv.cpp") + lapmodcpp = os.path.join(SRC_DIR, "lapmod.cpp") ext_modules = [ Extension( name='lap._lapjv', - sources=[_lapjvcpp, lapjvcpp, lapmodcpp], - include_dirs=[include_numpy(), _lapjv_src, package_path], + sources=[_lapjvpyx, lapjvcpp, lapmodcpp], + include_dirs=[include_numpy(), SRC_DIR, PACKAGE_PATH], + language="c++", ) ] - package_data = {} - tests_package = package_path + ".tests" - packages = [package_path, tests_package] - for p in packages: package_data.update({p: ["*"]}) - setup( - name=package_name, + name=PACKAGE_NAME, version=get_version_string(), description=DESCRIPTION, license=LICENSE, @@ -84,8 +48,7 @@ def main_setup(): keywords=['Linear Assignment', 'LAPJV', 'LAPMOD', 'lap', 'lapx'], url="https://github.com/gatagat/lap", author="gatagat, rathaROG, and co.", - packages=packages, - package_data=package_data, + packages=find_packages(include=[PACKAGE_PATH, f"{PACKAGE_PATH}.*"]), include_package_data=True, install_requires=['numpy>=1.21.6',], python_requires=">=3.7", @@ -102,6 +65,7 @@ def main_setup(): 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.13', + 'Programming Language :: Python :: 3.14', 'Topic :: Education', 'Topic :: Education :: Testing', 'Topic :: Scientific/Engineering', @@ -115,7 +79,6 @@ def main_setup(): 'Operating System :: Unix', 'Operating System :: MacOS',], ext_modules=cythonize(ext_modules), - cmdclass={'cmdexport': ExportCythonCommand,}, ) if __name__ == "__main__":