Skip to content

Commit

Permalink
Merge pull request #64 from ewanwm/feature_dynamic_python_module_vers…
Browse files Browse the repository at this point in the history
…ions

Feature dynamic python module versions
  • Loading branch information
ewanwm authored Sep 25, 2024
2 parents 9592bd6 + 8e0973c commit 9f959b6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/pypi-distribution.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Publish to PyPi

on:
release:
types: [published]
push:
tags:
- '*'
workflow_dispatch:

jobs:
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES 75)
endif()

project(nuTens)
# set the project name and version
project(nuTens VERSION 0.1.0)

# Changes default install path to be a subdirectory of the build dir.
# Can set build dir at configure time with -DCMAKE_INSTALL_PREFIX=/install/path
Expand Down
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

[project]
name = "nuTens"
version = "0.0.3"
description="Library to calculate neutrino oscillation probabilities using tensors"
readme = "README.md"
authors = [
Expand All @@ -24,6 +23,7 @@ classifiers = [
dependencies = [
"torch"
]
dynamic = ["version"]

[project.urls]
Repository = "https://github.com/ewanwm/nuTens"
Expand All @@ -39,3 +39,12 @@ build-frontend = "build[uv]"

[tool.scikit-build.cmake]
args = ["-DNT_ENABLE_PYTHON=ON"]

[tool.scikit-build.metadata.version]
provider = "scikit_build_core.metadata.setuptools_scm"

[tool.scikit-build.sdist]
include = ["src/package/_version.py"]

[tool.setuptools_scm] # Section required
write_to = "_version.py"
2 changes: 1 addition & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ endif()
target_link_libraries( _pyNuTens PUBLIC nuTens )

# This is passing in the version as a define just as an example
target_compile_definitions( _pyNuTens PRIVATE VERSION_INFO=${PROJECT_VERSION} )
target_compile_definitions( _pyNuTens PRIVATE VERSION_INFO=${CMAKE_PROJECT_VERSION} )

install( TARGETS _pyNuTens DESTINATION nuTens/ )

0 comments on commit 9f959b6

Please sign in to comment.