Skip to content

Commit

Permalink
Merge GitHub actions setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tharen committed Jan 22, 2024
1 parent e49dbd2 commit 3e973ac
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 8 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Build with Python

on:
push:
branches: ["main","dev"]

pull_request:
branches: ["main","dev"]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10","3.11"]
os: [ubuntu-latest, windows-latest] #, macos-latest]
toolchain:
- {compiler: gcc, version: 13}
# - {compiler: gcc, version: 12}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Fortran Setup
uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
cache: 'pip'

- name: show-versions
run: |
gcc --version
gfortran --version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install click 'numpy<1.26' cython build wheel setuptools setuptools_scm meson-python pytest ninja
- name: Install Patchelf
if: runner.os == 'Linux'
run: |
python -m pip install patchelf
- name: Build and package
run: |
python -m build --no-isolation
- name: Store Wheel
uses: actions/upload-artifact@v3
with:
name: pyfvs-${{ runner.os }}-py${{ matrix.python-version }}-wheels
path: dist/*.whl
if-no-files-found: warn

- name: Store Sdist
uses: actions/upload-artifact@v3
with:
name: pyfvs-sdist
path: dist/*.tar.gz
if-no-files-found: warn
# - name: Test with pytest
# run: |
# pytest
1 change: 0 additions & 1 deletion pynvel/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ fs.copyfile('_vollib.pxd')
python_sources = [
'__init__.py',
'__main__.py',
'_version.py',
'volume_height.py',
'behres.py',
# 'config.py',
Expand Down
20 changes: 13 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
[build-system]
# AVOID CHANGING REQUIRES: IT WILL BE UPDATED BY PYSCAFFOLD!
requires = [
"setuptools>=45",
"setuptools_scm[toml]>=6.2",
"numpy",
"cython",
"setuptools>=64",
"setuptools_scm[toml]>=8",
"wheel",
"meson",
"meson-python>=0.13.2",
# "ninja"
"meson-python>=0.15",
"ninja",
"patchelf ; platform_system != 'Windows'", ## Only linux???
]
build-backend = "mesonpy"

[project]
name = "pynvel"
description = "A Python wrapper package for the National Volume Estimator library."
description = "Python wrapper and extension package for the National Volume Estimator library."
authors = [
{name="Tod Haren", email="[email protected]"},
]
license = {file="LICENSE.txt"}
readme = {file="README.md", content-type="text/markdown"}
keywords = ["Forest Modeling", "Tree Volume", "NVEL"]
keywords = ["Forest Modeling", "Forest Biometrics", "Tree Volume", "NVEL"]

dynamic = ["version"]

Expand All @@ -34,9 +37,12 @@ repository = "https://github.com/forest-modeling/PyNVEL"
[project.scripts]
pynvel = "pynvel.__main__:cli"

[tool.setuptools]
packages = ["pynvel",]

[tool.setuptools_scm]
# For smarter version schemes and other configuration options,
# check out https://github.com/pypa/setuptools_scm
version_scheme = "post-release"
# version_scheme = "guess-next-dev"
write_to = "pynvel/_version.py"
version_file = "pynvel/_version.py"

0 comments on commit 3e973ac

Please sign in to comment.