Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: python -m pip install --prefer-binary meson-python meson ninja setuptools "cython>=3.1" "matplotlib>=3,<4" ${{ matrix.numpy-version }}
run: python -m pip install --prefer-binary meson-python meson ninja setuptools setuptools-scm "cython>=3.1" "matplotlib>=3,<4" ${{ matrix.numpy-version }}
- name: Build and install Raysect
run: dev/install_editable.sh
- name: Run tests
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ __pycache__/
# C extensions
*.so
*.c

# Distribution / packaging
.Python
env/
Expand Down Expand Up @@ -59,4 +60,5 @@ docs/build/
# PyBuilder
target/


# setuptools-scm
raysect/_version.py
5 changes: 4 additions & 1 deletion dev/root-meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
project('raysect', 'cython', default_options: ['python.install-env=auto'])
project('raysect', 'cython',
default_options: ['python.install-env=auto'],
version: run_command(['dev/update_version.sh'], check: true).stdout().strip()
)

py = import('python').find_installation(pure: false)
numpy = dependency('numpy', method: 'config-tool')
Expand Down
2 changes: 2 additions & 0 deletions dev/update_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
python -m setuptools_scm --force-write-version-files
5 changes: 4 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# WARNING: This file is automatically generated by dev/generate_meson_files.py.
# The template file used to generate this file is dev/root-meson.build.

project('raysect', 'cython', default_options: ['python.install-env=auto'])
project('raysect', 'cython',
default_options: ['python.install-env=auto'],
version: run_command(['dev/update_version.sh'], check: true).stdout().strip()
)

py = import('python').find_installation(pure: false)
numpy = dependency('numpy', method: 'config-tool')
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[project]
name = "raysect"
version = "0.9.0"
requires-python = ">=3.9"
authors = [{name = "Dr Alex Meakins et al.", email = "developers@raysect.org"}]
description = "A Ray-tracing Framework for Science and Engineering"
Expand All @@ -19,6 +18,7 @@ classifiers = [
"Topic :: Multimedia :: Graphics :: 3D Rendering",
"Topic :: Scientific/Engineering :: Physics"
]
dynamic = ["version"]

[project.urls]
Homepage = "https://www.raysect.org"
Expand All @@ -27,5 +27,8 @@ Issues = "https://github.com/raysect/source/issues"
Changelog = "https://github.com/raysect/source/blob/master/CHANGELOG.txt"

[build-system]
requires = ["meson-python", "setuptools", "wheel", "numpy", "cython>=3.1"]
requires = ["meson-python", "setuptools", "wheel", "numpy", "cython>=3.1", "setuptools-scm"]
build-backend = "mesonpy"

[tool.setuptools_scm]
version_file = "raysect/_version.py"
1 change: 0 additions & 1 deletion raysect/VERSION

This file was deleted.

6 changes: 1 addition & 5 deletions raysect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,4 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from os import path as _path

# parse the package version number
with open(_path.join(_path.dirname(__file__), 'VERSION')) as _f:
__version__ = _f.read().strip()
from ._version import *
4 changes: 2 additions & 2 deletions raysect/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
target_path = 'raysect'

# source files
py_files = ['__init__.py']
py_files = ['__init__.py', '_version.py']
pyx_files = []
pxd_files = []
data_files = ['VERSION']
data_files = []

# compile cython
foreach pyx_file: pyx_files
Expand Down