-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from ewanwm/feature_build_with_pip
Feature build with pip
- Loading branch information
Showing
9 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: "Pip" | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Build with Pip | ||
runs-on: ${{ matrix.platform }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ubuntu-latest] | ||
python-version: ["3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Protoc Ubuntu | ||
run: sudo apt install protobuf-compiler | ||
|
||
- name: Install Python dependencies | ||
uses: py-actions/py-dependency-install@v4 | ||
with: | ||
path: "PyTorch_requirements.txt" | ||
|
||
- name: Build and install | ||
run: pip install --verbose . | ||
|
||
#- name: Test | ||
# run: pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[build-system] | ||
requires = ["scikit-build-core", "pybind11", "torch"] | ||
build-backend = "scikit_build_core.build" | ||
|
||
[project] | ||
name = "pyNuTens" | ||
version = "0.0.1" | ||
description="Library to calculate neutrino oscillation probabilities using tensors" | ||
readme = "README.md" | ||
authors = [ | ||
{ name = "Ewan Miller", email = "[email protected]" }, | ||
] | ||
|
||
[tool.scikit-build] | ||
cmake.args = ["-DNT_ENABLE_PYTHON=ON"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
|
||
pybind11_add_module( | ||
pyNuTens MODULE | ||
pyNuTens.cpp | ||
binding.cpp | ||
) | ||
|
||
if(NT_USE_PCH) | ||
target_precompile_headers(pyNuTens REUSE_FROM nuTens-pch) | ||
target_precompile_headers( pyNuTens REUSE_FROM nuTens-pch ) | ||
endif() | ||
target_link_libraries( pyNuTens PUBLIC nuTens ) | ||
|
||
install( TARGETS pyNuTens DESTINATION pyNuTens/) | ||
# This is passing in the version as a define just as an example | ||
target_compile_definitions( pyNuTens PRIVATE VERSION_INFO=${PROJECT_VERSION} ) | ||
|
||
install( TARGETS pyNuTens DESTINATION pyNuTens/ ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
from .pyNuTens import __doc__, __version__ | ||
|
||
__all__ = ["__doc__", "__version__", "tensor", "propagator"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .pyNuTens import propagator | ||
from .pyNuTens.propagator import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .pyNuTens import tensor | ||
from .pyNuTens.tensor import * |
File renamed without changes.