From d53418a82df4f158194c0d87e9118b5da7bde6f1 Mon Sep 17 00:00:00 2001 From: Hameer Abbasi <2190658+hameerabbasi@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:22:33 +0100 Subject: [PATCH] Automatic installation of build/install requirements. --- .github/workflows/ci.yml | 4 ++++ .gitignore | 2 ++ pyproject.toml | 11 ++--------- requirements/requirements.txt | 8 -------- setup.py | 1 + 5 files changed, 9 insertions(+), 17 deletions(-) delete mode 100644 requirements/requirements.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25949f9..80ef4a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,9 @@ on: schedule: # At 09:00 on Monday. (see https://crontab.guru) - cron: '0 9 * * 1' + pull_request: + branches: + - main defaults: run: @@ -124,6 +127,7 @@ jobs: release-wheel: runs-on: 'ubuntu-latest' needs: build-wheel + if: github.ref_name == 'main' permissions: id-token: write contents: write diff --git a/.gitignore b/.gitignore index e524d79..f37f84e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .vscode/ build/ +*.egg_info +dist/ diff --git a/pyproject.toml b/pyproject.toml index 24f89fe..e2e288e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,9 +5,10 @@ requires = [ "ninja", "cmake>=3.12", "pybind11>=2.10.4", - "numpy", + "numpy >= 2", "PyYAML", "nanobind", + "delvewheel; platform_system=='Windows'", ] [tool.cibuildwheel] @@ -21,23 +22,15 @@ test-command = "python -m pytest --pyargs sparse.mlir_backend" skip = ["*-manylinux_i686", "*-musllinux*"] environment = { PATH = "/usr/lib/ccache:/usr/lib64/ccache:/usr/lib/ccache/bin:$PATH" } before-build = [ - "pip install -r {project}/Finch-mlir/requirements/requirements.txt", "{project}/Finch-mlir/scripts/docker_prepare_ccache.sh" ] environment-pass = ["HOST_CCACHE_DIR", "SPARSE_BACKEND"] [tool.cibuildwheel.macos] environment = { PATH = "/usr/local/opt/ccache/libexec:$PATH" } -before-build = [ - "pip install -r {project}/Finch-mlir/requirements/requirements.txt", -] repair-wheel-command = [ "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} --ignore-missing-dependencies" ] [tool.cibuildwheel.windows] build = "cp310-win_amd64 cp311-win_amd64 cp312-win_amd64 cp313-win_amd64" -before-build = [ - "pip install delvewheel", - "pip install -r {project}\\Finch-mlir\\requirements\\requirements.txt", -] diff --git a/requirements/requirements.txt b/requirements/requirements.txt deleted file mode 100644 index d81173c..0000000 --- a/requirements/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -setuptools>=42 -wheel -ninja -cmake>=3.12 -pybind11>=2.10.4 -numpy -PyYAML -nanobind diff --git a/setup.py b/setup.py index ed087d9..4eaec31 100644 --- a/setup.py +++ b/setup.py @@ -169,6 +169,7 @@ def create_dir(name: str) -> Path: llvm_source_dir=f"./llvm-project/llvm", finch_source_dir="./Finch-mlir", )], + install_requires=["PyYAML >=6", "numpy >=1.17"], cmdclass={"build_ext": CMakeBuild}, zip_safe=False, )