From a658c81d92149e7cb33379432ecffbf80d89bb1a Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Mon, 16 Mar 2026 09:54:48 -0700 Subject: [PATCH 01/29] Upgrade GitHub Actions for Python setup and artifact upload --- .github/workflows/python-package.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 41df41fe1..61f057bf8 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -40,7 +40,7 @@ jobs: submodules: recursive - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} architecture: 'x64' @@ -66,20 +66,23 @@ jobs: python -m build --no-isolation - name: Store Wheel - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: pyfvs-${{ runner.os }}-py${{ matrix.python-version }}-wheels path: dist/*.whl if-no-files-found: warn overwrite: true - + + store-artifacts: + runs-on: ubuntu-latest + needs: build + steps: + # TODO: Add steps to gather wheels and publish to PyPI + # Store the source distribution one time per build - name: Store Sdist - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: pyfvs-sdist path: dist/*.tar.gz if-no-files-found: warn overwrite: true -# - name: Test with pytest -# run: | -# pytest From 4989a099bf876de4092758763b30527a48426c60 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Mon, 16 Mar 2026 10:55:43 -0700 Subject: [PATCH 02/29] Update build step separate wheel and sdist packaging --- .github/workflows/python-package.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 61f057bf8..8a861975e 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -63,7 +63,7 @@ jobs: - name: Build and package run: | - python -m build --no-isolation + python -m build --wheel --no-isolation - name: Store Wheel uses: actions/upload-artifact@v7 @@ -78,7 +78,12 @@ jobs: needs: build steps: # TODO: Add steps to gather wheels and publish to PyPI + # TODO: Merge artifacts, uses: [actions/upload-artifact/merge@v4](https://github.com) # Store the source distribution one time per build + - name: Create sdist + run: | + python -m build --sdist --no-isolation + - name: Store Sdist uses: actions/upload-artifact@v7 with: From 550df45a0e642695ff736074811edf82cc9c540e Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Mon, 16 Mar 2026 11:38:08 -0700 Subject: [PATCH 03/29] Install build package in Python workflow Install build package before creating source distribution. --- .github/workflows/python-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 8a861975e..6e43ad83d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -82,6 +82,7 @@ jobs: # Store the source distribution one time per build - name: Create sdist run: | + python -m pip install build python -m build --sdist --no-isolation - name: Store Sdist From 3eb9c56e18167869b42aa1c391cd55243cfbe944 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Mon, 16 Mar 2026 12:14:06 -0700 Subject: [PATCH 04/29] Refactor GitHub Actions workflow for Python package --- .github/workflows/python-package.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 6e43ad83d..a6df4ba30 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -10,7 +10,7 @@ on: branches: [ "main" ] jobs: - build: + make-wheels: runs-on: ${{ matrix.os }} strategy: @@ -73,10 +73,22 @@ jobs: if-no-files-found: warn overwrite: true - store-artifacts: + make-sdist: runs-on: ubuntu-latest - needs: build + needs: make-wheels steps: + - name: Checkout + uses: actions/checkout@v5 + with: + submodules: recursive + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + architecture: 'x64' + cache: 'pip' + # TODO: Add steps to gather wheels and publish to PyPI # TODO: Merge artifacts, uses: [actions/upload-artifact/merge@v4](https://github.com) # Store the source distribution one time per build From 80228476eb449e864c9f758eb00aee2a4cf75280 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Mon, 16 Mar 2026 12:59:25 -0700 Subject: [PATCH 05/29] Install additional packages for sdist creation Updated dependencies for building source distribution. --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index a6df4ba30..17c11e83d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -94,7 +94,7 @@ jobs: # Store the source distribution one time per build - name: Create sdist run: | - python -m pip install build + python -m pip install click numpy pandas matplotlib build wheel setuptools setuptools_scm meson-python pytest ninja python -m build --sdist --no-isolation - name: Store Sdist From e3b5cb6879d788e14cc678fe8de4715367106a6a Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Wed, 18 Mar 2026 09:41:38 -0700 Subject: [PATCH 06/29] Update Python setup step in workflow file --- .github/workflows/python-package.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 17c11e83d..367870c75 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -82,19 +82,27 @@ jobs: with: submodules: recursive - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v6 with: - python-version: ${{ matrix.python-version }} + python-version: 3.13 architecture: 'x64' cache: 'pip' # TODO: Add steps to gather wheels and publish to PyPI # TODO: Merge artifacts, uses: [actions/upload-artifact/merge@v4](https://github.com) # Store the source distribution one time per build - - name: Create sdist + - name: Install dependencies run: | python -m pip install click numpy pandas matplotlib build wheel setuptools setuptools_scm meson-python pytest ninja + + - name: Install Patchelf + if: runner.os == 'Linux' + run: | + python -m pip install patchelf + + - name: Create sdist + run: | python -m build --sdist --no-isolation - name: Store Sdist From 619c90805ac274788c67f68e5b461c4eafe35b06 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Wed, 18 Mar 2026 10:14:05 -0700 Subject: [PATCH 07/29] Comment out dependency on make-wheels for make-sdist Commented out the 'needs' directive for the make-sdist job. --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 367870c75..9cffb45c2 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -75,7 +75,7 @@ jobs: make-sdist: runs-on: ubuntu-latest - needs: make-wheels + # needs: make-wheels steps: - name: Checkout uses: actions/checkout@v5 From 34eee9df46ea939c306f76e7eedf13e6cdf47b59 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Sat, 23 May 2026 18:02:14 +0000 Subject: [PATCH 08/29] Debugging actions --- .github/workflows/python-package.yml | 6 +++--- meson_options.txt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 563807425..08b75772c 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10","3.11","3.12","3.13"] + python-version: ["3.10","3.11","3.12","3.13","3.14"] os: [ubuntu-latest, windows-latest] #, macos-latest] compiler: [gcc] compiler-version: [13, 15] @@ -54,7 +54,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install click numpy pandas matplotlib build wheel setuptools setuptools_scm meson-python pytest ninja + python -m pip install numpy build wheel setuptools setuptools_scm meson-python pytest ninja - name: Install Patchelf if: runner.os == 'Linux' @@ -84,6 +84,6 @@ jobs: - name: Test with pytest working-directory: . run: | - pip install confuse typing-extensions openpyxl + pip install confuse typing-extensions openpyxl click pandas matplotlib pip install dist/*.whl pytest diff --git a/meson_options.txt b/meson_options.txt index 1bb80dc6c..575929a96 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,9 +1,9 @@ option('fvsvariants', type: 'array', choices: ['pn','wc','so','op','oc','ec','ca','nc','bm','ie','ci','ak','ws'], #,'em','tt','cr','ut','ls','cs','sn','ne'], - value: ['pn','wc','so','op','oc','ec','ca','nc','bm','ie','ci','ak','ws'], #,'em','tt','cr','ut','ls','cs','sn','ne'], + # value: ['pn','wc','so','op','oc','ec','ca','nc','bm','ie','ci','ak','ws'], #,'em','tt','cr','ut','ls','cs','sn','ne'], # value: ['pn','wc','so','op','oc','ec','ca','nc','bm'], # value: ['ie','ci','ak',], - # value: ['pn',], + value: ['pn',], # value: ['ws',], description: 'FVS variants to build' ) \ No newline at end of file From 2dbbf510ce134b728c75c2218375140455e1a43d Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Sat, 23 May 2026 18:13:45 +0000 Subject: [PATCH 09/29] debugging actions --- .github/workflows/python-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 08b75772c..8d7894803 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -84,6 +84,7 @@ jobs: - name: Test with pytest working-directory: . run: | + ls dist pip install confuse typing-extensions openpyxl click pandas matplotlib pip install dist/*.whl pytest From 3aca047e6b3996ffbd38f7c9e6e5feb728ab760d Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Sat, 23 May 2026 19:56:55 +0000 Subject: [PATCH 10/29] debugging actions --- .github/workflows/python-package.yml | 1 + pyproject.toml | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 8d7894803..fbcc999b3 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -83,6 +83,7 @@ jobs: - name: Test with pytest working-directory: . + shell: bash run: | ls dist pip install confuse typing-extensions openpyxl click pandas matplotlib diff --git a/pyproject.toml b/pyproject.toml index d12f48a06..62d881de6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,9 +30,8 @@ dynamic = ["version"] dependencies = [ "confuse>=2.0.0,<3", "click>=8.0.0,<9", - "pandas>=2.2.2", + "pandas>=2.2.2,<4", "numpy>=2.1.0,<3", - "pandas>=3.0.2,<4", "typing-extensions" # required by confuse ] From 42da5742e50cc060f64c317be12510322508d8ad Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Sun, 24 May 2026 05:09:31 +0000 Subject: [PATCH 11/29] Add TestPyPi publishing after clean build and tests --- .github/workflows/publish-testpypi.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/publish-testpypi.yml diff --git a/.github/workflows/publish-testpypi.yml b/.github/workflows/publish-testpypi.yml new file mode 100644 index 000000000..d16f43e17 --- /dev/null +++ b/.github/workflows/publish-testpypi.yml @@ -0,0 +1,24 @@ +name: Publish to TestPyPI + +on: + workflow_run: + workflows: ["Main Build Workflow"] # Must match the 'name' of your primary build workflow + types: + - completed + +jobs: + publish: + runs-on: ubuntu-latest + # Only run if the main build succeeded and the branch is 'dev' + if: > + github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.head_branch == 'dev' + + permissions: + id-token: write # Required for Trusted Publishing + + steps: + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ # Directs upload to TestPyPI \ No newline at end of file From 8fb47d90b849e7f95be440df9e883c7a01e7cfb0 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Sat, 23 May 2026 23:07:05 -0700 Subject: [PATCH 12/29] Update publish-testpypi.yml --- .github/workflows/publish-testpypi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-testpypi.yml b/.github/workflows/publish-testpypi.yml index d16f43e17..0d9d4c37d 100644 --- a/.github/workflows/publish-testpypi.yml +++ b/.github/workflows/publish-testpypi.yml @@ -2,7 +2,7 @@ name: Publish to TestPyPI on: workflow_run: - workflows: ["Main Build Workflow"] # Must match the 'name' of your primary build workflow + workflows: ["Build Packages"] # Must match the 'name' of your primary build workflow types: - completed @@ -21,4 +21,4 @@ jobs: - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - repository-url: https://test.pypi.org/legacy/ # Directs upload to TestPyPI \ No newline at end of file + repository-url: https://test.pypi.org/legacy/ # Directs upload to TestPyPI From 781b16bbc69663d051cab568b04e310822c2efa4 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Sat, 23 May 2026 23:29:38 -0700 Subject: [PATCH 13/29] Update python-package.yml --- .github/workflows/python-package.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index fbcc999b3..534bb1e0e 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -89,3 +89,24 @@ jobs: pip install confuse typing-extensions openpyxl click pandas matplotlib pip install dist/*.whl pytest + + publish: + name: Publish to TestPyPI + needs: build + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + - name: Publish to TestPyPI + if: github.ref == 'refs/heads/dev' + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ # Directs upload to TestPyPI + From bbf992365988e95a0b768e0a7a7fa81a88fca76d Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Sat, 23 May 2026 23:30:15 -0700 Subject: [PATCH 14/29] Delete .github/workflows/publish-testpypi.yml --- .github/workflows/publish-testpypi.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .github/workflows/publish-testpypi.yml diff --git a/.github/workflows/publish-testpypi.yml b/.github/workflows/publish-testpypi.yml deleted file mode 100644 index 0d9d4c37d..000000000 --- a/.github/workflows/publish-testpypi.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Publish to TestPyPI - -on: - workflow_run: - workflows: ["Build Packages"] # Must match the 'name' of your primary build workflow - types: - - completed - -jobs: - publish: - runs-on: ubuntu-latest - # Only run if the main build succeeded and the branch is 'dev' - if: > - github.event.workflow_run.conclusion == 'success' && - github.event.workflow_run.head_branch == 'dev' - - permissions: - id-token: write # Required for Trusted Publishing - - steps: - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ # Directs upload to TestPyPI From 90a16de3712b38090dda5056ab8cb47979e33487 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Sat, 23 May 2026 23:50:36 -0700 Subject: [PATCH 15/29] Update python-package.yml --- .github/workflows/python-package.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 534bb1e0e..a431e71fd 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -101,8 +101,9 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - name: python-package-distributions - path: dist/ + pattern: pyfvs-* + path: dist + merge-multiple: true - name: Publish to TestPyPI if: github.ref == 'refs/heads/dev' From e3eeccf602cefacd3043446ec7676c5c2f1d1dd0 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Mon, 25 May 2026 06:53:43 +0000 Subject: [PATCH 16/29] Update action workflow to use cibuildwheels --- .github/workflows/python-package.yml | 136 ++++++++++++--------------- pyproject.toml | 2 +- 2 files changed, 62 insertions(+), 76 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index a431e71fd..da6899bd2 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -10,98 +10,85 @@ on: branches: [ "main", "dev" ] jobs: - build: - + build_wheels: + name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - python-version: ["3.10","3.11","3.12","3.13","3.14"] - os: [ubuntu-latest, windows-latest] #, macos-latest] - compiler: [gcc] - compiler-version: [13, 15] - exclude: - - os: windows-latest - compiler-version: 15 - - os: ubuntu-latest - compiler-version: 13 + os: [ubuntu-latest, windows-latest] steps: - - name: Fortran Setup - uses: fortran-lang/setup-fortran@v1 - id: setup-fortran - with: - compiler: ${{ matrix.toolchain.compiler }} - version: ${{ matrix.toolchain.version }} + - name: Checkout + uses: actions/checkout@v5 + with: + submodules: recursive + + - name: Fortran Setup + if: runner.os == 'Windows' + uses: fortran-lang/setup-fortran@v1 + with: + compiler: gcc + version: 13 - - name: Checkout - uses: actions/checkout@v5 - with: - submodules: recursive - - - 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 numpy build wheel setuptools setuptools_scm meson-python pytest ninja + - name: Build wheels + uses: pypa/cibuildwheel@v2.22.0 + env: + # Build for Python 3.10 to 3.13. 3.14 may not yet be supported by cibuildwheel. + CIBW_BUILD: cp310-* cp311-* cp312-* cp313-* + CIBW_SKIP: "*-win32 *_i686" + + # Linux specific: install gfortran in the manylinux container + CIBW_BEFORE_ALL_LINUX: > + yum install -y gcc-gfortran || + dnf install -y gcc-gfortran || + (apt-get update && apt-get install -y gfortran) + + CIBW_ENVIRONMENT_LINUX: "FC=gfortran CC=gcc CXX=g++" + + # Windows specific: use delvewheel to bundle DLLs + CIBW_BEFORE_BUILD_WINDOWS: pip install delvewheel ninja + CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -v -w {dest_dir} {wheel}" + CIBW_ENVIRONMENT_WINDOWS: "FC=gfortran CC=gcc" - - 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@v4 - with: - name: pyfvs-${{ runner.os }}-py${{ matrix.python-version }}-wheels - path: dist/*.whl - if-no-files-found: warn - overwrite: true - - - name: Store Sdist - uses: actions/upload-artifact@v4 - with: - name: pyfvs-sdist - path: dist/*.tar.gz - if-no-files-found: warn - overwrite: true + # Testing + CIBW_TEST_REQUIRES: pytest confuse typing-extensions openpyxl click pandas matplotlib + CIBW_TEST_COMMAND: pytest {project}/tests - - name: Test with pytest - working-directory: . - shell: bash - run: | - ls dist - pip install confuse typing-extensions openpyxl click pandas matplotlib - pip install dist/*.whl - pytest + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + submodules: recursive + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz publish: name: Publish to TestPyPI - needs: build + needs: [build_wheels, build_sdist] runs-on: ubuntu-latest environment: pypi permissions: id-token: write steps: - - name: Download artifact + - name: Download artifacts uses: actions/download-artifact@v4 with: - pattern: pyfvs-* + pattern: cibw-* path: dist merge-multiple: true @@ -109,5 +96,4 @@ jobs: if: github.ref == 'refs/heads/dev' uses: pypa/gh-action-pypi-publish@release/v1 with: - repository-url: https://test.pypi.org/legacy/ # Directs upload to TestPyPI - + repository-url: https://test.pypi.org/legacy/ diff --git a/pyproject.toml b/pyproject.toml index 62d881de6..03e6312bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ requires = [ "meson", "meson-python>=0.15", "numpy", -# "ninja", + "ninja", "patchelf ; platform_system != 'Windows'", ## Only linux??? # "cython", "build>=1.5.0,<2" From e0b04636855c1c70556dc4ea786d5406fd24356c Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Mon, 25 May 2026 07:10:07 +0000 Subject: [PATCH 17/29] Update build version requirement --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 03e6312bb..093e21835 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ requires = [ "ninja", "patchelf ; platform_system != 'Windows'", ## Only linux??? # "cython", - "build>=1.5.0,<2" + "build" ] build-backend = "mesonpy" From 8b889b1296b3b37920209f8b2015a05ac8408b0a Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Mon, 25 May 2026 07:45:20 +0000 Subject: [PATCH 18/29] Update actions cibuildwheel config --- .github/workflows/python-package.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index da6899bd2..c172b8709 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -37,6 +37,8 @@ jobs: # Build for Python 3.10 to 3.13. 3.14 may not yet be supported by cibuildwheel. CIBW_BUILD: cp310-* cp311-* cp312-* cp313-* CIBW_SKIP: "*-win32 *_i686" + #CIBW_CONFIG_SETTINGS: "-Dfvsvariants=pn,op,wc,ca,so,oc,ec,nc,bm" # Pass variants to meson build + CIBW_CONFIG_SETTINGS: "-Dfvsvariants=pn" # Linux specific: install gfortran in the manylinux container CIBW_BEFORE_ALL_LINUX: > @@ -53,7 +55,7 @@ jobs: # Testing CIBW_TEST_REQUIRES: pytest confuse typing-extensions openpyxl click pandas matplotlib - CIBW_TEST_COMMAND: pytest {project}/tests + CIBW_TEST_COMMAND: pytest tests - uses: actions/upload-artifact@v4 with: From 2095583d1a457519cc926c74a6bc8b84028625a2 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Mon, 25 May 2026 07:56:03 +0000 Subject: [PATCH 19/29] revert --- .github/workflows/python-package.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index c172b8709..da6899bd2 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -37,8 +37,6 @@ jobs: # Build for Python 3.10 to 3.13. 3.14 may not yet be supported by cibuildwheel. CIBW_BUILD: cp310-* cp311-* cp312-* cp313-* CIBW_SKIP: "*-win32 *_i686" - #CIBW_CONFIG_SETTINGS: "-Dfvsvariants=pn,op,wc,ca,so,oc,ec,nc,bm" # Pass variants to meson build - CIBW_CONFIG_SETTINGS: "-Dfvsvariants=pn" # Linux specific: install gfortran in the manylinux container CIBW_BEFORE_ALL_LINUX: > @@ -55,7 +53,7 @@ jobs: # Testing CIBW_TEST_REQUIRES: pytest confuse typing-extensions openpyxl click pandas matplotlib - CIBW_TEST_COMMAND: pytest tests + CIBW_TEST_COMMAND: pytest {project}/tests - uses: actions/upload-artifact@v4 with: From d068cc0f2cae7cba5900c0c44ae52266f876c230 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Mon, 25 May 2026 22:25:52 +0000 Subject: [PATCH 20/29] Testing alternate CI build and publish workflow --- .github/workflows/python-package.yml | 230 ++++++++++++++++++--------- 1 file changed, 153 insertions(+), 77 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index da6899bd2..793398060 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -1,5 +1,6 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python +# This workflow builds binary wheels using cibuildwheel and a source distribution. +# cibuildwheel handles manylinux and Windows wheel building across Python versions. +# Publishes to TestPyPI on pushes to dev, and PyPI on pushes to main. name: Build Packages @@ -10,90 +11,165 @@ on: branches: [ "main", "dev" ] jobs: - build_wheels: - name: Build wheels on ${{ matrix.os }} + make-wheels: + name: Build wheels on ${{ matrix.os }} (compiler ${{ matrix.compiler-version }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest] + include: + - os: ubuntu-latest + compiler: gcc + compiler-version: 15 + - os: windows-latest + compiler: gcc + compiler-version: 13 steps: - - name: Checkout - uses: actions/checkout@v5 - with: - submodules: recursive - - - name: Fortran Setup - if: runner.os == 'Windows' - uses: fortran-lang/setup-fortran@v1 - with: - compiler: gcc - version: 13 - - - name: Build wheels - uses: pypa/cibuildwheel@v2.22.0 - env: - # Build for Python 3.10 to 3.13. 3.14 may not yet be supported by cibuildwheel. - CIBW_BUILD: cp310-* cp311-* cp312-* cp313-* - CIBW_SKIP: "*-win32 *_i686" - - # Linux specific: install gfortran in the manylinux container - CIBW_BEFORE_ALL_LINUX: > - yum install -y gcc-gfortran || - dnf install -y gcc-gfortran || - (apt-get update && apt-get install -y gfortran) - - CIBW_ENVIRONMENT_LINUX: "FC=gfortran CC=gcc CXX=g++" - - # Windows specific: use delvewheel to bundle DLLs - CIBW_BEFORE_BUILD_WINDOWS: pip install delvewheel ninja - CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -v -w {dest_dir} {wheel}" - CIBW_ENVIRONMENT_WINDOWS: "FC=gfortran CC=gcc" - - # Testing - CIBW_TEST_REQUIRES: pytest confuse typing-extensions openpyxl click pandas matplotlib - CIBW_TEST_COMMAND: pytest {project}/tests - - - uses: actions/upload-artifact@v4 - with: - name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} - path: ./wheelhouse/*.whl - - build_sdist: + - name: Fortran Setup + uses: fortran-lang/setup-fortran@v1 + id: setup-fortran + with: + compiler: ${{ matrix.compiler }} + version: ${{ matrix.compiler-version }} + + - name: Checkout + uses: actions/checkout@v6 + with: + submodules: recursive + + - name: Show compiler versions + run: | + gcc --version + gfortran --version + + - name: Build wheels + uses: pypa/cibuildwheel@v3.4.1 + env: + # Build for Python 3.10–3.13, 64-bit only + CIBW_BUILD: cp310-* cp311-* cp312-* cp313-* cp314-* + CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*" + CIBW_ARCHS_LINUX: x86_64 + CIBW_ARCHS_WINDOWS: AMD64 + + # Use manylinux_2_28 to get a gfortran-15-capable image + CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64 + + # Install build dependencies inside the wheel-build environment + CIBW_BEFORE_BUILD_LINUX: | + dnf install -y gcc-gfortran ninja-build && + pip install click numpy pandas matplotlib build wheel setuptools setuptools_scm meson-python pytest ninja patchelf + + CIBW_BEFORE_BUILD_WINDOWS: | + pip install click numpy pandas matplotlib build wheel setuptools setuptools_scm meson-python pytest ninja + + CIBW_BUILD_FRONTEND: "build" + CIBW_BUILD_VERBOSITY: 1 + + with: + output-dir: dist + + - name: Store wheels + uses: actions/upload-artifact@v7 + with: + name: pyfvs-${{ matrix.os }}-wheels + path: dist/*.whl + if-no-files-found: warn + overwrite: true + + make-sdist: name: Build source distribution runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + submodules: recursive + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.13" + architecture: x64 + cache: pip + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + python -m pip install click numpy pandas matplotlib build wheel \ + setuptools setuptools_scm meson-python pytest ninja patchelf + + - name: Create sdist + run: python -m build --sdist --no-isolation + + - name: Store sdist + uses: actions/upload-artifact@v7 + with: + name: pyfvs-sdist + path: dist/*.tar.gz + if-no-files-found: warn + overwrite: true + + publish-testpypi: + name: Publish to TestPyPI (dev branch) + if: github.event_name == 'push' && github.ref == 'refs/heads/dev' + needs: [ make-wheels, make-sdist ] + runs-on: ubuntu-latest + environment: + name: testpypi + url: https://test.pypi.org/p/pyfvs + permissions: + id-token: write # Required for OIDC trusted publishing + steps: - - name: Checkout - uses: actions/checkout@v5 - with: - submodules: recursive - - - name: Build sdist - run: pipx run build --sdist - - - uses: actions/upload-artifact@v4 - with: - name: cibw-sdist - path: dist/*.tar.gz - - publish: - name: Publish to TestPyPI - needs: [build_wheels, build_sdist] + - name: Download all wheels + uses: actions/download-artifact@v4 + with: + pattern: pyfvs-*-wheels + path: dist + merge-multiple: true + + - name: Download sdist + uses: actions/download-artifact@v4 + with: + name: pyfvs-sdist + path: dist + + - name: Publish to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + skip-existing: true + verbose: true + + publish-pypi: + name: Publish to PyPI (main branch) + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + needs: [ make-wheels, make-sdist ] runs-on: ubuntu-latest - environment: pypi + environment: + name: pypi + url: https://pypi.org/p/pyfvs permissions: - id-token: write + id-token: write # Required for OIDC trusted publishing + steps: - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - pattern: cibw-* - path: dist - merge-multiple: true - - - name: Publish to TestPyPI - if: github.ref == 'refs/heads/dev' - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ + - name: Download all wheels + uses: actions/download-artifact@v4 + with: + pattern: pyfvs-*-wheels + path: dist + merge-multiple: true + + - name: Download sdist + uses: actions/download-artifact@v4 + with: + name: pyfvs-sdist + path: dist + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true + verbose: true \ No newline at end of file From b2a0bd5d650b4ad46435b7562c4869332c8838ac Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Tue, 26 May 2026 03:32:04 +0000 Subject: [PATCH 21/29] Add testing to the cibuildwheel workflow --- .github/workflows/python-package.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 793398060..4644b8e3a 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -58,14 +58,17 @@ jobs: # Install build dependencies inside the wheel-build environment CIBW_BEFORE_BUILD_LINUX: | dnf install -y gcc-gfortran ninja-build && - pip install click numpy pandas matplotlib build wheel setuptools setuptools_scm meson-python pytest ninja patchelf + pip install click numpy pandas build wheel setuptools setuptools_scm meson-python ninja patchelf CIBW_BEFORE_BUILD_WINDOWS: | - pip install click numpy pandas matplotlib build wheel setuptools setuptools_scm meson-python pytest ninja + pip install click numpy pandas build wheel setuptools setuptools_scm meson-python ninja CIBW_BUILD_FRONTEND: "build" CIBW_BUILD_VERBOSITY: 1 + CIBW_TEST_REQUIRES: pytest openpyxl + CIBW_TEST_COMMAND: pytest {project}/tests + with: output-dir: dist @@ -97,8 +100,8 @@ jobs: - name: Install build dependencies run: | python -m pip install --upgrade pip - python -m pip install click numpy pandas matplotlib build wheel \ - setuptools setuptools_scm meson-python pytest ninja patchelf + python -m pip install click numpy pandas build wheel \ + setuptools setuptools_scm meson-python ninja patchelf - name: Create sdist run: python -m build --sdist --no-isolation From 9e1220c22f213cc5308d8e70bbbf97f22d9b2fcd Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Tue, 26 May 2026 03:53:56 +0000 Subject: [PATCH 22/29] Towards dev version assignment cleanup. --- .github/workflows/python-package.yml | 2 ++ pyproject.toml | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4644b8e3a..4609ba0e4 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -37,6 +37,7 @@ jobs: uses: actions/checkout@v6 with: submodules: recursive + fetch-depth: 0 - name: Show compiler versions run: | @@ -89,6 +90,7 @@ jobs: uses: actions/checkout@v6 with: submodules: recursive + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v6 diff --git a/pyproject.toml b/pyproject.toml index 093e21835..d2ed4d1fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,6 +58,7 @@ packages = ["pyfvs",] # check out https://github.com/pypa/setuptools_scm version_scheme = "post-release" # version_scheme = "guess-next-dev" +local_scheme = "no-local-version" version_file = "pyfvs/_version.py" [tool.devpy] From 20894147f3f1c9f1f3c0aeaaa0b6e69f29193db9 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Tue, 26 May 2026 04:14:17 +0000 Subject: [PATCH 23/29] Update test run location --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4609ba0e4..e8035bb44 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -68,7 +68,7 @@ jobs: CIBW_BUILD_VERBOSITY: 1 CIBW_TEST_REQUIRES: pytest openpyxl - CIBW_TEST_COMMAND: pytest {project}/tests + CIBW_TEST_COMMAND: cd {project}/tests && pytest . with: output-dir: dist From 8469d9181345be567d5c53755818ca2b91502c5c Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Tue, 26 May 2026 04:34:38 +0000 Subject: [PATCH 24/29] Skip tests to verify versioning --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 472ae8718..3a71f3620 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -67,8 +67,8 @@ jobs: CIBW_BUILD_FRONTEND: "build" CIBW_BUILD_VERBOSITY: 1 - CIBW_TEST_REQUIRES: pytest openpyxl - CIBW_TEST_COMMAND: cd {project}/tests && pytest . + # CIBW_TEST_REQUIRES: pytest openpyxl + # CIBW_TEST_COMMAND: cd {project}/tests && pytest . with: output-dir: dist From e3181c02fbf080c168be12895c3da13ea56add82 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Tue, 26 May 2026 07:03:09 +0000 Subject: [PATCH 25/29] Reconfigure as a "src" project structure --- .github/workflows/python-package.yml | 4 +- README.md | 9 +++++ meson.build | 2 +- pyfvs/pyfvs.cfg | 39 ------------------- pyproject.toml | 2 +- {pyfvs => src/pyfvs}/README.md | 0 {pyfvs => src/pyfvs}/README.txt | 0 {pyfvs => src/pyfvs}/__init__.py | 0 {pyfvs => src/pyfvs}/__main__.py | 0 {pyfvs => src/pyfvs}/config_default.yaml | 0 {pyfvs => src/pyfvs}/fvs.py | 0 {pyfvs => src/pyfvs}/keywords/__init__.py | 0 {pyfvs => src/pyfvs}/keywords/_fields.py | 0 {pyfvs => src/pyfvs}/keywords/_utils.py | 0 {pyfvs => src/pyfvs}/keywords/eventmonitor.py | 0 {pyfvs => src/pyfvs}/keywords/keywords.py | 0 {pyfvs => src/pyfvs}/meson.build | 16 ++++---- {pyfvs => src/pyfvs}/variants.py.in | 0 18 files changed, 22 insertions(+), 50 deletions(-) delete mode 100644 pyfvs/pyfvs.cfg rename {pyfvs => src/pyfvs}/README.md (100%) rename {pyfvs => src/pyfvs}/README.txt (100%) rename {pyfvs => src/pyfvs}/__init__.py (100%) rename {pyfvs => src/pyfvs}/__main__.py (100%) rename {pyfvs => src/pyfvs}/config_default.yaml (100%) rename {pyfvs => src/pyfvs}/fvs.py (100%) rename {pyfvs => src/pyfvs}/keywords/__init__.py (100%) rename {pyfvs => src/pyfvs}/keywords/_fields.py (100%) rename {pyfvs => src/pyfvs}/keywords/_utils.py (100%) rename {pyfvs => src/pyfvs}/keywords/eventmonitor.py (100%) rename {pyfvs => src/pyfvs}/keywords/keywords.py (100%) rename {pyfvs => src/pyfvs}/meson.build (66%) rename {pyfvs => src/pyfvs}/variants.py.in (100%) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 3a71f3620..472ae8718 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -67,8 +67,8 @@ jobs: CIBW_BUILD_FRONTEND: "build" CIBW_BUILD_VERBOSITY: 1 - # CIBW_TEST_REQUIRES: pytest openpyxl - # CIBW_TEST_COMMAND: cd {project}/tests && pytest . + CIBW_TEST_REQUIRES: pytest openpyxl + CIBW_TEST_COMMAND: cd {project}/tests && pytest . with: output-dir: dist diff --git a/README.md b/README.md index c517aebe7..39e996026 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,15 @@ Python wrappers and utilities for using the Forest Vegetation Simulator The PyFVS [FVS source code](https://github.com/forest-modeling/ForestVegetationSimulator/tree/open-dev) is forked from the [USFS FVS GitHub](https://github.com/USDAForestService/ForestVegetationSimulator) repository, [open-dev](https://github.com/USDAForestService/ForestVegetationSimulator/tree/open-dev) branch + _____ ______ __ __ _____ + | __ \ | ____|\ \ / / / ____| + | |__) | _ _ | |__ \ \ / / | (____ + | ___/ | | | | | __| \ \/ / \___ \ + | | | |__| | | | \ / ____) | + |_| \____ | |_| \/ |______/ + __/ | + |___/ + ## Documentation Check out the new AI generated documentation [wiki](https://deepwiki.com/forest-modeling/PyFVS). diff --git a/meson.build b/meson.build index c60dbfb45..3dd7a9362 100644 --- a/meson.build +++ b/meson.build @@ -537,4 +537,4 @@ foreach variant : variants # End variant loop endforeach -subdir('pyfvs') +subdir('src/pyfvs') diff --git a/pyfvs/pyfvs.cfg b/pyfvs/pyfvs.cfg deleted file mode 100644 index 718b70ab1..000000000 --- a/pyfvs/pyfvs.cfg +++ /dev/null @@ -1,39 +0,0 @@ -{ - 'fvs_lib':{ - 'fvslib_path':'../../bin/build/Open-FVS/python/lib' - } - - ,'logging':{ - 'version':1 - ,'disable_existing_loggers':True - ,'incremental':False - ,'formatters':{ - 'file':{ - 'format' : '%(asctime)s %(levelname)-8s %(name)-15s %(message)s' - ,'datefmt' : '%Y-%m-%d %H:%M:%S' - } - } - - ,'handlers':{ - 'console':{ - 'class':'logging.StreamHandler' - ,'level':'NOTSET' - ,'stream':'ext://sys.stdout' - } - ,'file':{ - 'class':'logging.FileHandler' - ,'filename':'./pyfvs.log' - ,'mode':'w' - ,'level':'NOTSET' - ,'formatter':'file' - } - } - ,'loggers':{ - 'pyfvs':{ - 'level':'INFO' - ,'handlers':['console','file',] - ,'propagate':False - } - } - } - } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d2ed4d1fa..5ae205993 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ packages = ["pyfvs",] version_scheme = "post-release" # version_scheme = "guess-next-dev" local_scheme = "no-local-version" -version_file = "pyfvs/_version.py" +version_file = "src/pyfvs/_version.py" [tool.devpy] package = 'pyfvs' # used by pytest diff --git a/pyfvs/README.md b/src/pyfvs/README.md similarity index 100% rename from pyfvs/README.md rename to src/pyfvs/README.md diff --git a/pyfvs/README.txt b/src/pyfvs/README.txt similarity index 100% rename from pyfvs/README.txt rename to src/pyfvs/README.txt diff --git a/pyfvs/__init__.py b/src/pyfvs/__init__.py similarity index 100% rename from pyfvs/__init__.py rename to src/pyfvs/__init__.py diff --git a/pyfvs/__main__.py b/src/pyfvs/__main__.py similarity index 100% rename from pyfvs/__main__.py rename to src/pyfvs/__main__.py diff --git a/pyfvs/config_default.yaml b/src/pyfvs/config_default.yaml similarity index 100% rename from pyfvs/config_default.yaml rename to src/pyfvs/config_default.yaml diff --git a/pyfvs/fvs.py b/src/pyfvs/fvs.py similarity index 100% rename from pyfvs/fvs.py rename to src/pyfvs/fvs.py diff --git a/pyfvs/keywords/__init__.py b/src/pyfvs/keywords/__init__.py similarity index 100% rename from pyfvs/keywords/__init__.py rename to src/pyfvs/keywords/__init__.py diff --git a/pyfvs/keywords/_fields.py b/src/pyfvs/keywords/_fields.py similarity index 100% rename from pyfvs/keywords/_fields.py rename to src/pyfvs/keywords/_fields.py diff --git a/pyfvs/keywords/_utils.py b/src/pyfvs/keywords/_utils.py similarity index 100% rename from pyfvs/keywords/_utils.py rename to src/pyfvs/keywords/_utils.py diff --git a/pyfvs/keywords/eventmonitor.py b/src/pyfvs/keywords/eventmonitor.py similarity index 100% rename from pyfvs/keywords/eventmonitor.py rename to src/pyfvs/keywords/eventmonitor.py diff --git a/pyfvs/keywords/keywords.py b/src/pyfvs/keywords/keywords.py similarity index 100% rename from pyfvs/keywords/keywords.py rename to src/pyfvs/keywords/keywords.py diff --git a/pyfvs/meson.build b/src/pyfvs/meson.build similarity index 66% rename from pyfvs/meson.build rename to src/pyfvs/meson.build index b05ed62bc..2e6120284 100644 --- a/pyfvs/meson.build +++ b/src/pyfvs/meson.build @@ -1,6 +1,8 @@ # Generate the variants file conf_data = configuration_data() +pyfvs_install_dir = py3.get_install_dir() / 'pyfvs' + # stringify the variant library dictionary libs_str = '{' foreach k,v : variant_libs @@ -14,7 +16,7 @@ configure_file( output: 'variants.py', configuration: conf_data, install: true, - install_dir: py3.get_install_dir() / 'pyfvs' + install_dir: pyfvs_install_dir ) python_sources = [ @@ -31,18 +33,18 @@ py3.install_sources( install_subdir( 'keywords', - install_dir: py3.get_install_dir() / 'pyfvs', + install_dir: pyfvs_install_dir, exclude_directories : ['__pycache__'] ) install_data( - project_folder / 'pyfvs/config_default.yaml', - install_dir: py3.get_install_dir() / 'pyfvs', + 'config_default.yaml', + install_dir: pyfvs_install_dir, ) ## FIXME: Filter out all the extraneous files -# exclude_files = run_command(py3,'-c', 'import os.path as pth,glob;f=glob.glob("../pyfvs/test/*");print(";".join([pth.basename(p) for p in f if pth.isfile(p) and not pth.splitext(p)[-1] in (".py",".ini")]))').stdout().strip().split(';') -# exclude_dirs = run_command(py3,'-c', 'import os.path as pth,glob;f=glob.glob("../pyfvs/test/*");print(";".join([pth.basename(p) for p in f if pth.isdir(p) and not pth.splitext(p)[-1] in ("rmrs","reg_test")]))').stdout().strip().split(';') +# exclude_files = run_command(py3,'-c', 'import os.path as pth,glob;f=glob.glob("../../tests");print(";".join([pth.basename(p) for p in f if pth.isfile(p) and not pth.splitext(p)[-1] in (".py",".ini")]))').stdout().strip().split(';') +# exclude_dirs = run_command(py3,'-c', 'import os.path as pth,glob;f=glob.glob("../../tests/*");print(";".join([pth.basename(p) for p in f if pth.isdir(p) and not pth.splitext(p)[-1] in ("rmrs","reg_test")]))').stdout().strip().split(';') # exclude_files += '.pytest_cache' # Because Python interprets this dir as a file??? # message('Exclude Files') @@ -52,7 +54,7 @@ install_data( # install_subdir( # 'test', -# install_dir: py3.get_install_dir() / 'pyfvs', +# install_dir: pyfvs_install_dir, # # exclude_files: exclude_files, # exclude_directories : ['__pycache__','.pytest_cache','notebooks'], #,'reg_test','fia_test','api_test'] # # exclude_directories: exclude_dirs, diff --git a/pyfvs/variants.py.in b/src/pyfvs/variants.py.in similarity index 100% rename from pyfvs/variants.py.in rename to src/pyfvs/variants.py.in From 2496259c57f69e84aad7ca6a211123c309c2b5a5 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Tue, 26 May 2026 07:25:53 +0000 Subject: [PATCH 26/29] Testing src project structure --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 472ae8718..201162f33 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -68,7 +68,7 @@ jobs: CIBW_BUILD_VERBOSITY: 1 CIBW_TEST_REQUIRES: pytest openpyxl - CIBW_TEST_COMMAND: cd {project}/tests && pytest . + # CIBW_TEST_COMMAND: cd {project}/tests && pytest . with: output-dir: dist From d524f085c48059946fd17e7c13fbf0de31c5a73b Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Tue, 26 May 2026 08:00:18 +0000 Subject: [PATCH 27/29] Move cibuildwheel config to pyproject.toml --- .github/workflows/python-package.yml | 3 --- pyproject.toml | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 201162f33..d95a51d1a 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -67,9 +67,6 @@ jobs: CIBW_BUILD_FRONTEND: "build" CIBW_BUILD_VERBOSITY: 1 - CIBW_TEST_REQUIRES: pytest openpyxl - # CIBW_TEST_COMMAND: cd {project}/tests && pytest . - with: output-dir: dist diff --git a/pyproject.toml b/pyproject.toml index 5ae205993..0f68fdbdd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,6 +70,10 @@ addopts = [ "--import-mode=importlib", ] +[tool.cibuildwheel] +test-requires = ["pytest","openpyxl"] +test-command = "pytest {project}/tests" + [tool.pixi.workspace] channels = ["conda-forge"] platforms = ["linux-64"] From 9e550f828a963ac004cb182775b40140aae71ee5 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Tue, 26 May 2026 08:15:20 +0000 Subject: [PATCH 28/29] Remove distutils import from fvs.py --- src/pyfvs/fvs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pyfvs/fvs.py b/src/pyfvs/fvs.py index b4f7fcd00..7c5469b9a 100644 --- a/src/pyfvs/fvs.py +++ b/src/pyfvs/fvs.py @@ -10,7 +10,6 @@ """ from dataclasses import field -from distutils.log import debug import os import sys import re From 03d6b297b1431cb238814ccc2b6f53da0c1c8af0 Mon Sep 17 00:00:00 2001 From: Tod Haren Date: Tue, 26 May 2026 15:01:17 +0000 Subject: [PATCH 29/29] Move api sources into src --- meson.build | 42 ++++++++++++------------- pyproject.toml | 4 +-- {api => src/api}/carbon_data.f90 | 0 {api => src/api}/downwood_data.f90 | 0 {api => src/api}/fvs_api.f90 | 0 {api => src/api}/fvs_step.f90 | 0 {api => src/api}/globals.f90 | 0 {api => src/api}/globals.f90.in | 0 {api => src/api}/inventory_trees.f90 | 0 {api => src/api}/morts_wrap.f90 | 0 {api => src/api}/prtrls_wrap.f90 | 0 {api => src/api}/snag_data.f90 | 0 {api => src/api}/tree_data.f90 | 0 {api => src/api}/variant/pn/morts_fvs.f | 0 {api => src/api}/variant/wc/morts_fvs.f | 0 {api => src/api}/version.f90 | 0 16 files changed, 23 insertions(+), 23 deletions(-) rename {api => src/api}/carbon_data.f90 (100%) rename {api => src/api}/downwood_data.f90 (100%) rename {api => src/api}/fvs_api.f90 (100%) rename {api => src/api}/fvs_step.f90 (100%) rename {api => src/api}/globals.f90 (100%) rename {api => src/api}/globals.f90.in (100%) rename {api => src/api}/inventory_trees.f90 (100%) rename {api => src/api}/morts_wrap.f90 (100%) rename {api => src/api}/prtrls_wrap.f90 (100%) rename {api => src/api}/snag_data.f90 (100%) rename {api => src/api}/tree_data.f90 (100%) rename {api => src/api}/variant/pn/morts_fvs.f (100%) rename {api => src/api}/variant/wc/morts_fvs.f (100%) rename {api => src/api}/version.f90 (100%) diff --git a/meson.build b/meson.build index 3dd7a9362..cf2c5c666 100644 --- a/meson.build +++ b/meson.build @@ -358,8 +358,8 @@ foreach variant : variants variant_args += '-DFVS_MORTS_WRAP' # Add the wrappers to the file lists - f_sources += 'api/variant/@0@/morts_fvs.f'.format(variant) - f90_sources += 'api/morts_wrap.f90' + f_sources += 'src/api/variant/@0@/morts_fvs.f'.format(variant) + f90_sources += 'src/api/morts_wrap.f90' endif @@ -368,7 +368,7 @@ foreach variant : variants conf_data = configuration_data() conf_data.set('variant', variant) configure_file( - input: 'api/globals.f90.in', + input: 'src/api/globals.f90.in', output: variant + '_globals.f90', configuration: conf_data ) @@ -377,26 +377,26 @@ foreach variant : variants f90_sources += join_paths(meson.project_build_root(), variant + '_globals.f90') # Additional API files to compile - # f90_sources += 'api/apisubs.f90' - - f90_sources += 'api/version.f90' - f90_sources += 'api/fvs_api.f90' - # f90_sources += 'api/sim_monitor.f90' - # f90_sources += 'api/initialize.f90' - f90_sources += 'api/inventory_trees.f90' - f90_sources += 'api/fvs_step.f90' - f90_sources += 'api/tree_data.f90' - f90_sources += 'api/snag_data.f90' - f90_sources += 'api/carbon_data.f90' - f90_sources += 'api/downwood_data.f90' - # f90_sources += 'api/step_tregro.f90' - f90_sources += 'api/prtrls_wrap.f90' - # f90_sources += 'api/stop_wrap.f90' - # f90_sources += 'api/foo.f90' - # f90_sources += 'api/test.f90' + # f90_sources += 'src/api/apisubs.f90' + + f90_sources += 'src/api/version.f90' + f90_sources += 'src/api/fvs_api.f90' + # f90_sources += 'src/api/sim_monitor.f90' + # f90_sources += 'src/api/initialize.f90' + f90_sources += 'src/api/inventory_trees.f90' + f90_sources += 'src/api/fvs_step.f90' + f90_sources += 'src/api/tree_data.f90' + f90_sources += 'src/api/snag_data.f90' + f90_sources += 'src/api/carbon_data.f90' + f90_sources += 'src/api/downwood_data.f90' + # f90_sources += 'src/api/step_tregro.f90' + f90_sources += 'src/api/prtrls_wrap.f90' + # f90_sources += 'src/api/stop_wrap.f90' + # f90_sources += 'src/api/foo.f90' + # f90_sources += 'src/api/test.f90' # ## TODO: Auto-generate F90 includes from F77 - # f90_inc_dirs += 'api/gen/@0@/include'.format(variant) + # f90_inc_dirs += 'src/api/gen/@0@/include'.format(variant) # # Add the include folders as a dependency to trigger # inc_dep = declare_dependency( diff --git a/pyproject.toml b/pyproject.toml index 0f68fdbdd..2c7c86b80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,8 +79,8 @@ channels = ["conda-forge"] platforms = ["linux-64"] [tool.pixi.tasks] -dev = "python -m pip install --no-build-isolation -e ." -build = "python -m build --no-isolation" +dev = "python -m pip install -e . --no-build-isolation --verbose" +build = "python -m build --no-isolation --verbose" [tool.pixi.dependencies] # Python runtime and build tools diff --git a/api/carbon_data.f90 b/src/api/carbon_data.f90 similarity index 100% rename from api/carbon_data.f90 rename to src/api/carbon_data.f90 diff --git a/api/downwood_data.f90 b/src/api/downwood_data.f90 similarity index 100% rename from api/downwood_data.f90 rename to src/api/downwood_data.f90 diff --git a/api/fvs_api.f90 b/src/api/fvs_api.f90 similarity index 100% rename from api/fvs_api.f90 rename to src/api/fvs_api.f90 diff --git a/api/fvs_step.f90 b/src/api/fvs_step.f90 similarity index 100% rename from api/fvs_step.f90 rename to src/api/fvs_step.f90 diff --git a/api/globals.f90 b/src/api/globals.f90 similarity index 100% rename from api/globals.f90 rename to src/api/globals.f90 diff --git a/api/globals.f90.in b/src/api/globals.f90.in similarity index 100% rename from api/globals.f90.in rename to src/api/globals.f90.in diff --git a/api/inventory_trees.f90 b/src/api/inventory_trees.f90 similarity index 100% rename from api/inventory_trees.f90 rename to src/api/inventory_trees.f90 diff --git a/api/morts_wrap.f90 b/src/api/morts_wrap.f90 similarity index 100% rename from api/morts_wrap.f90 rename to src/api/morts_wrap.f90 diff --git a/api/prtrls_wrap.f90 b/src/api/prtrls_wrap.f90 similarity index 100% rename from api/prtrls_wrap.f90 rename to src/api/prtrls_wrap.f90 diff --git a/api/snag_data.f90 b/src/api/snag_data.f90 similarity index 100% rename from api/snag_data.f90 rename to src/api/snag_data.f90 diff --git a/api/tree_data.f90 b/src/api/tree_data.f90 similarity index 100% rename from api/tree_data.f90 rename to src/api/tree_data.f90 diff --git a/api/variant/pn/morts_fvs.f b/src/api/variant/pn/morts_fvs.f similarity index 100% rename from api/variant/pn/morts_fvs.f rename to src/api/variant/pn/morts_fvs.f diff --git a/api/variant/wc/morts_fvs.f b/src/api/variant/wc/morts_fvs.f similarity index 100% rename from api/variant/wc/morts_fvs.f rename to src/api/variant/wc/morts_fvs.f diff --git a/api/version.f90 b/src/api/version.f90 similarity index 100% rename from api/version.f90 rename to src/api/version.f90