From ccbe1040b52bf232484525f261186b53918c1077 Mon Sep 17 00:00:00 2001 From: Garrett Barter Date: Fri, 24 May 2024 05:50:36 -0600 Subject: [PATCH 1/5] bringing back user options --- meson.build | 8 +++++++- meson_options.txt | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 7e831f4..c158070 100644 --- a/meson.build +++ b/meson.build @@ -69,7 +69,13 @@ endif # https://mesonbuild.com/Python-module.html # Here we differentiate from the python used by meson, py3_command, and that python target, py3_target. This is useful # when cross compiling like on conda-forge -py3 = import('python').find_installation(pure: false) +#py3 = import('python').find_installation(pure: false) +py_mod = import('python') +if get_option('python_target') != '' + py3 = py_mod.find_installation(get_option('python_target')) +else + py3 = py_mod.find_installation('python') +endif py3_dep = py3.dependency() message(py3.path()) diff --git a/meson_options.txt b/meson_options.txt index 1bd3d33..a768c27 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,9 @@ option('incdir_numpy', type: 'string', value: '', description: 'Include directory for numpy. If left empty Meson will try to find it on its own.') +option('python_target', type: 'string', value: '', + description: '''Target python path. This is used in the case that the Python installation that PyOptSparse is intended + to be built for is different than the Python installation that is used to run Meson. For example, Meson may be installed + on the user's system which is run using the system Python installation, but the user may want build PyOptSparse for + a Python installation in a virtual environment. Leave as an empty string to build for Python installation running + Meson.''') From 9b6ef44a248ce5f2dfcb8e90488889730bbda0ef Mon Sep 17 00:00:00 2001 From: Garrett Barter Date: Fri, 19 Sep 2025 15:18:06 -0600 Subject: [PATCH 2/5] gha update --- .github/workflows/CI_pyHAMS.yml | 10 +++++----- .github/workflows/Publish_pyHAMS.yml | 28 ++++++++++++++-------------- pyproject.toml | 2 ++ 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/CI_pyHAMS.yml b/.github/workflows/CI_pyHAMS.yml index deb73f8..9c0a5d8 100644 --- a/.github/workflows/CI_pyHAMS.yml +++ b/.github/workflows/CI_pyHAMS.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false #true matrix: os: ["ubuntu-latest", "macOS-latest"] #, "windows-latest"] - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - name: Setup GNU Fortran @@ -44,7 +44,7 @@ jobs: mingw-w64-x86_64-gcc-fortran - name: checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Mac openmp if: contains( matrix.os, 'mac') @@ -58,7 +58,7 @@ jobs: echo "CXX=${{ steps.install_cc.outputs.cxx }}" >> $GITHUB_ENV - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 id: cp with: python-version: ${{ matrix.python-version }} @@ -91,11 +91,11 @@ jobs: fail-fast: false #true matrix: os: ["ubuntu-latest", "macOS-latest", "windows-latest"] - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - name: checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - uses: conda-incubator/setup-miniconda@v2 # https://github.com/marketplace/actions/setup-miniconda diff --git a/.github/workflows/Publish_pyHAMS.yml b/.github/workflows/Publish_pyHAMS.yml index 921c34e..d69bb3d 100644 --- a/.github/workflows/Publish_pyHAMS.yml +++ b/.github/workflows/Publish_pyHAMS.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-12, macos-13, macos-14] + os: [ubuntu-latest, windows-latest, macos-13, macos-14, macos-15] steps: - name: Set up QEMU @@ -46,22 +46,14 @@ jobs: - name: Build wheels linux if: contains( matrix.os, 'ubuntu') - uses: pypa/cibuildwheel@v2.18.1 + uses: pypa/cibuildwheel@v3.1.4 env: CC: ${{ steps.install_cc.outputs.cc }} CXX: ${{ steps.install_cc.outputs.cxx }} - - name: Build wheels mac-12 - if: contains( matrix.os, 'macos-12') - uses: pypa/cibuildwheel@v2.18.1 - env: - CC: ${{ steps.install_cc.outputs.cc }} - CXX: ${{ steps.install_cc.outputs.cxx }} - CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET="12.0" - - name: Build wheels mac-13 if: contains( matrix.os, 'macos-13') - uses: pypa/cibuildwheel@v2.18.1 + uses: pypa/cibuildwheel@v3.1.4 env: CC: ${{ steps.install_cc.outputs.cc }} CXX: ${{ steps.install_cc.outputs.cxx }} @@ -69,15 +61,23 @@ jobs: - name: Build wheels mac-14 if: contains( matrix.os, 'macos-14') - uses: pypa/cibuildwheel@v2.18.1 + uses: pypa/cibuildwheel@v3.1.4 env: CC: ${{ steps.install_cc.outputs.cc }} CXX: ${{ steps.install_cc.outputs.cxx }} CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET="14.0" + - name: Build wheels mac-15 + if: contains( matrix.os, 'macos-15') + uses: pypa/cibuildwheel@v3.1.4 + env: + CC: ${{ steps.install_cc.outputs.cc }} + CXX: ${{ steps.install_cc.outputs.cxx }} + CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET="15.0" + - name: Build wheels windows if: contains( matrix.os, 'windows') - uses: pypa/cibuildwheel@v2.18.1 + uses: pypa/cibuildwheel@v3.1.4 - uses: actions/upload-artifact@v4 with: @@ -88,7 +88,7 @@ jobs: name: Build source distribution runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Build sdist run: pipx run build --sdist diff --git a/pyproject.toml b/pyproject.toml index c92d4e9..5dd4d26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,8 @@ classifiers = [ # Optional "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Fortran", "Operating System :: Microsoft :: Windows", From 5d5cd1a10814aa806fcfa1dc6dc7dd06ef8dcaa5 Mon Sep 17 00:00:00 2001 From: Garrett Barter Date: Fri, 19 Sep 2025 17:02:36 -0600 Subject: [PATCH 3/5] fixing build issues --- .github/workflows/CI_pyHAMS.yml | 7 ++++--- pyhams/meson.build | 18 +++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/CI_pyHAMS.yml b/.github/workflows/CI_pyHAMS.yml index 9c0a5d8..b32f79f 100644 --- a/.github/workflows/CI_pyHAMS.yml +++ b/.github/workflows/CI_pyHAMS.yml @@ -97,7 +97,8 @@ jobs: - name: checkout repository uses: actions/checkout@v5 - - uses: conda-incubator/setup-miniconda@v2 + - name: Install miniconda + uses: conda-incubator/setup-miniconda@v3 # https://github.com/marketplace/actions/setup-miniconda with: #mamba-version: "*" @@ -118,13 +119,13 @@ jobs: - name: Add dependencies unix specific if: contains( matrix.os, 'ubuntu') run: | - conda install -y libgomp + conda install -y libgomp gfortran gfortran --version - name: Add dependencies mac specific if: contains( matrix.os, 'mac') run: | - conda install -y compilers llvm-openmp + conda install -y gfortran llvm-openmp gfortran --version # Install diff --git a/pyhams/meson.build b/pyhams/meson.build index 464fbdb..78daaae 100644 --- a/pyhams/meson.build +++ b/pyhams/meson.build @@ -1,13 +1,13 @@ # NumPy include directory - needed in all submodules -incdir_numpy = meson.get_external_property('numpy-include-dir', 'not-given') -if incdir_numpy == 'not-given' - incdir_numpy = run_command(py3, - [ - '-c', - 'import os; os.chdir(".."); import numpy; print(numpy.get_include())' - ], - check: true - ).stdout().strip() +incdir_numpy = get_option('incdir_numpy') +if incdir_numpy == '' + incdir_numpy = run_command(py3, + [ + '-c', + 'import os; os.chdir(".."); import numpy; print(numpy.get_include())' + ], + check: true + ).stdout().strip() endif # this creates a raw string which is useful for Windows use of '\' for paths incdir_numpy = '''@0@'''.format(incdir_numpy) From fe0be077e93d4896b0ff2e2e15433976c2c5ed68 Mon Sep 17 00:00:00 2001 From: Garrett Barter Date: Fri, 19 Sep 2025 17:06:37 -0600 Subject: [PATCH 4/5] remove deprecated calls --- test/test_cylinder.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/test/test_cylinder.py b/test/test_cylinder.py index 28d688f..23af594 100644 --- a/test/test_cylinder.py +++ b/test/test_cylinder.py @@ -94,16 +94,5 @@ def test_cylinder_heading_list(self): #npt.assert_array_almost_equal(truth3, actual3) -def suite(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(CertTest)) - return suite - if __name__ == '__main__': - result = unittest.TextTestRunner().run(suite()) - - if result.wasSuccessful(): - exit(0) - else: - exit(1) - + unittest.main() From c1c376f00a9d4ae38ab1df8f3d88f06c301ca35e Mon Sep 17 00:00:00 2001 From: Garrett Barter Date: Fri, 19 Sep 2025 17:17:19 -0600 Subject: [PATCH 5/5] update version number --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5dd4d26..6eec848 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pyHAMS" -version = "1.3.0" +version = "1.3.1" description = "Python module wrapping around HAMS" readme = "README.md" requires-python = ">=3.9"