Skip to content

Commit

Permalink
rework setup
Browse files Browse the repository at this point in the history
  • Loading branch information
MiXaiLL76 committed Oct 30, 2024
1 parent 22fc671 commit ff8b14d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

build_wheels:
needs: test_source
name: Build wheels
name: Build wheels on ${{ matrix.os }}-${{ matrix.cibw_archs }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -36,22 +36,30 @@ jobs:
cibw_skip: "pp*"
steps:
- uses: actions/checkout@v4


- name: Set up QEMU
if: runner.os == 'Linux' && matrix.cibw_archs == 'aarch64'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- name: Build wheels for ${{ matrix.os }}
uses: pypa/[email protected]
env:
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7"
CIBW_BUILD_FRONTEND: build
CIBW_FREE_THREADED_SUPPORT: true
CIBW_SKIP: ${{ matrix.cibw_skip }}
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_TEST_REQUIRES: "pytest parameterized"
CIBW_TEST_COMMAND: "cd {project}/tests && pytest ."
CIBW_TEST_SKIP: "*-win_arm64 *-musllinux_aarch64"
with:
package-dir: ./

- uses: actions/upload-artifact@v4
with:
name: wheels
name: faster-coco-eval-${{ matrix.os }}-${{ matrix.cibw_archs }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_sdist:
Expand Down
11 changes: 8 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import glob
import os
from importlib.util import module_from_spec, spec_from_file_location

import setuptools
from pybind11.setup_helpers import ParallelCompile, Pybind11Extension, build_ext
Expand All @@ -20,9 +21,10 @@ def readme():


def get_version():
with open(version_file) as f:
exec(compile(f.read(), version_file, "exec"))
return locals()["__version__"], locals()["__author__"]
spec = spec_from_file_location("version", version_file)
py = module_from_spec(spec)
spec.loader.exec_module(py)
return py.__version__, py.__author__


def parse_requirements(fname="requirements/runtime.txt", with_version=True):
Expand Down Expand Up @@ -172,6 +174,9 @@ def get_extensions(version_info):
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
python_requires=">=3.7",
Expand Down

0 comments on commit ff8b14d

Please sign in to comment.