From 97c9ff79d0e035a0aaae61dc0ce2370d078a87ae Mon Sep 17 00:00:00 2001 From: Electro707 Date: Thu, 13 Jan 2022 22:53:57 -0500 Subject: [PATCH 01/13] Added pyroject --- PyNEC/pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 PyNEC/pyproject.toml diff --git a/PyNEC/pyproject.toml b/PyNEC/pyproject.toml new file mode 100644 index 0000000..4973c84 --- /dev/null +++ b/PyNEC/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel", "numpy"] +build-backend = "setuptools.build_meta" From afbb3234d539085fbb90bcc1baf458b26662b88f Mon Sep 17 00:00:00 2001 From: Benitoite Date: Wed, 15 Mar 2023 11:38:26 -0700 Subject: [PATCH 02/13] update swig command per solution https://github.com/tmolteno/python-necpp/issues/19#issuecomment-1469623955 --- PyNEC/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyNEC/build.sh b/PyNEC/build.sh index 728e305..4785138 100755 --- a/PyNEC/build.sh +++ b/PyNEC/build.sh @@ -14,5 +14,5 @@ make -f Makefile.git cd ${DIR} # Build PyNEC -swig3.0 -Wall -v -c++ -python PyNEC.i +swig -Wall -v -c++ -python PyNEC.i python3 setup.py build From e63115ca5e317be9f6137cc7d8e43257afea3fb3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 5 Jan 2026 21:45:04 +0000 Subject: [PATCH 03/13] Initial plan From 8ac49636d29e1de241f671c34165609bca7ce3b8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 5 Jan 2026 21:51:22 +0000 Subject: [PATCH 04/13] Add GitHub Actions workflow for building wheels with cibuildwheel Co-authored-by: tmolteno <85630+tmolteno@users.noreply.github.com> --- .github/workflows/build-wheels.yml | 147 +++++++++++++++++++++++++++++ necpp/pyproject.toml | 3 + 2 files changed, 150 insertions(+) create mode 100644 .github/workflows/build-wheels.yml create mode 100644 necpp/pyproject.toml diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml new file mode 100644 index 0000000..d9491d6 --- /dev/null +++ b/.github/workflows/build-wheels.yml @@ -0,0 +1,147 @@ +name: Build and upload to PyPI + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + release: + types: + - published + +jobs: + build_wheels: + name: Build wheels for ${{ matrix.package }} on ${{ matrix.os }} + runs-on: ${{ matrix.runs-on }} + strategy: + matrix: + include: + # PyNEC builds + - package: PyNEC + os: linux + runs-on: ubuntu-latest + - package: PyNEC + os: macos-intel + runs-on: macos-13 + - package: PyNEC + os: macos-arm + runs-on: macos-latest + # necpp builds + - package: necpp + os: linux + runs-on: ubuntu-latest + - package: necpp + os: macos-intel + runs-on: macos-13 + - package: necpp + os: macos-arm + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install build dependencies (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y swig autoconf automake libtool + + - name: Install build dependencies (macOS) + if: runner.os == 'macOS' + run: | + brew install swig autoconf automake libtool + + - name: Configure necpp_src + shell: bash + run: | + cd necpp_src + make -f Makefile.git + ./configure --without-lapack + + - name: Setup package directory and generate SWIG wrapper + shell: bash + run: | + cd ${{ matrix.package }} + ln -s ../necpp_src . + if [ "${{ matrix.package }}" = "PyNEC" ]; then + swig -Wall -c++ -python PyNEC.i + else + swig -I../necpp_src/src/ -python necpp.i + fi + + - name: Build wheels + uses: pypa/cibuildwheel@v2.16.5 + env: + CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*" + CIBW_SKIP: "*-musllinux_*" + CIBW_BUILD_VERBOSITY: 1 + with: + package-dir: ${{ matrix.package }} + output-dir: wheelhouse + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.package }}-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + strategy: + matrix: + package: [PyNEC, necpp] + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y swig autoconf automake libtool + + - name: Configure necpp_src + run: | + cd necpp_src + make -f Makefile.git + ./configure --without-lapack + + - name: Setup package directory and generate SWIG wrapper + run: | + cd ${{ matrix.package }} + ln -s ../necpp_src . + if [ "${{ matrix.package }}" = "PyNEC" ]; then + swig -Wall -c++ -python PyNEC.i + else + swig -I../necpp_src/src/ -python necpp.i + fi + + - name: Build sdist + run: | + cd ${{ matrix.package }} + pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist-${{ matrix.package }} + path: ${{ matrix.package }}/dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/necpp/pyproject.toml b/necpp/pyproject.toml new file mode 100644 index 0000000..9787c3b --- /dev/null +++ b/necpp/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" From 7e1220b11830ca4510afb7bcc789f908b498fb7c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 5 Jan 2026 21:55:04 +0000 Subject: [PATCH 05/13] Remove Python 3.8 (EOL) and fix artifact naming Co-authored-by: tmolteno <85630+tmolteno@users.noreply.github.com> --- .github/workflows/build-wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index d9491d6..cd96d05 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -75,7 +75,7 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.16.5 env: - CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*" + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" CIBW_SKIP: "*-musllinux_*" CIBW_BUILD_VERBOSITY: 1 with: @@ -84,7 +84,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: cibw-wheels-${{ matrix.package }}-${{ matrix.os }}-${{ strategy.job-index }} + name: cibw-wheels-${{ matrix.package }}-${{ matrix.os }} path: ./wheelhouse/*.whl build_sdist: From 649b59825f5e1f6b43278a3c3e622c208cba1164 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 5 Jan 2026 21:56:18 +0000 Subject: [PATCH 06/13] Add explicit permissions to workflow jobs for security Co-authored-by: tmolteno <85630+tmolteno@users.noreply.github.com> --- .github/workflows/build-wheels.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index cd96d05..bf81d64 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -14,6 +14,8 @@ jobs: build_wheels: name: Build wheels for ${{ matrix.package }} on ${{ matrix.os }} runs-on: ${{ matrix.runs-on }} + permissions: + contents: read strategy: matrix: include: @@ -90,6 +92,8 @@ jobs: build_sdist: name: Build source distribution runs-on: ubuntu-latest + permissions: + contents: read strategy: matrix: package: [PyNEC, necpp] From e52dd4f9e46726b7f25945903566e8ef27ea78bb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 5 Jan 2026 22:16:51 +0000 Subject: [PATCH 07/13] Split workflow into separate files for PyNEC and necpp Co-authored-by: tmolteno <85630+tmolteno@users.noreply.github.com> --- ...uild-wheels.yml => build-necpp-wheels.yml} | 55 +++----- .github/workflows/build-pynec-wheels.yml | 126 ++++++++++++++++++ 2 files changed, 141 insertions(+), 40 deletions(-) rename .github/workflows/{build-wheels.yml => build-necpp-wheels.yml} (66%) create mode 100644 .github/workflows/build-pynec-wheels.yml diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-necpp-wheels.yml similarity index 66% rename from .github/workflows/build-wheels.yml rename to .github/workflows/build-necpp-wheels.yml index bf81d64..952227e 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-necpp-wheels.yml @@ -1,4 +1,4 @@ -name: Build and upload to PyPI +name: Build and upload necpp to PyPI on: workflow_dispatch: @@ -12,32 +12,18 @@ on: jobs: build_wheels: - name: Build wheels for ${{ matrix.package }} on ${{ matrix.os }} + name: Build necpp wheels on ${{ matrix.os }} runs-on: ${{ matrix.runs-on }} permissions: contents: read strategy: matrix: include: - # PyNEC builds - - package: PyNEC - os: linux + - os: linux runs-on: ubuntu-latest - - package: PyNEC - os: macos-intel + - os: macos-intel runs-on: macos-13 - - package: PyNEC - os: macos-arm - runs-on: macos-latest - # necpp builds - - package: necpp - os: linux - runs-on: ubuntu-latest - - package: necpp - os: macos-intel - runs-on: macos-13 - - package: necpp - os: macos-arm + - os: macos-arm runs-on: macos-latest steps: @@ -66,13 +52,9 @@ jobs: - name: Setup package directory and generate SWIG wrapper shell: bash run: | - cd ${{ matrix.package }} + cd necpp ln -s ../necpp_src . - if [ "${{ matrix.package }}" = "PyNEC" ]; then - swig -Wall -c++ -python PyNEC.i - else - swig -I../necpp_src/src/ -python necpp.i - fi + swig -I../necpp_src/src/ -python necpp.i - name: Build wheels uses: pypa/cibuildwheel@v2.16.5 @@ -81,22 +63,19 @@ jobs: CIBW_SKIP: "*-musllinux_*" CIBW_BUILD_VERBOSITY: 1 with: - package-dir: ${{ matrix.package }} + package-dir: necpp output-dir: wheelhouse - uses: actions/upload-artifact@v4 with: - name: cibw-wheels-${{ matrix.package }}-${{ matrix.os }} + name: cibw-wheels-necpp-${{ matrix.os }} path: ./wheelhouse/*.whl build_sdist: - name: Build source distribution + name: Build necpp source distribution runs-on: ubuntu-latest permissions: contents: read - strategy: - matrix: - package: [PyNEC, necpp] steps: - uses: actions/checkout@v4 with: @@ -115,23 +94,19 @@ jobs: - name: Setup package directory and generate SWIG wrapper run: | - cd ${{ matrix.package }} + cd necpp ln -s ../necpp_src . - if [ "${{ matrix.package }}" = "PyNEC" ]; then - swig -Wall -c++ -python PyNEC.i - else - swig -I../necpp_src/src/ -python necpp.i - fi + swig -I../necpp_src/src/ -python necpp.i - name: Build sdist run: | - cd ${{ matrix.package }} + cd necpp pipx run build --sdist - uses: actions/upload-artifact@v4 with: - name: cibw-sdist-${{ matrix.package }} - path: ${{ matrix.package }}/dist/*.tar.gz + name: cibw-sdist-necpp + path: necpp/dist/*.tar.gz upload_pypi: needs: [build_wheels, build_sdist] diff --git a/.github/workflows/build-pynec-wheels.yml b/.github/workflows/build-pynec-wheels.yml new file mode 100644 index 0000000..b78073f --- /dev/null +++ b/.github/workflows/build-pynec-wheels.yml @@ -0,0 +1,126 @@ +name: Build and upload PyNEC to PyPI + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + release: + types: + - published + +jobs: + build_wheels: + name: Build PyNEC wheels on ${{ matrix.os }} + runs-on: ${{ matrix.runs-on }} + permissions: + contents: read + strategy: + matrix: + include: + - os: linux + runs-on: ubuntu-latest + - os: macos-intel + runs-on: macos-13 + - os: macos-arm + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install build dependencies (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y swig autoconf automake libtool + + - name: Install build dependencies (macOS) + if: runner.os == 'macOS' + run: | + brew install swig autoconf automake libtool + + - name: Configure necpp_src + shell: bash + run: | + cd necpp_src + make -f Makefile.git + ./configure --without-lapack + + - name: Setup package directory and generate SWIG wrapper + shell: bash + run: | + cd PyNEC + ln -s ../necpp_src . + swig -Wall -c++ -python PyNEC.i + + - name: Build wheels + uses: pypa/cibuildwheel@v2.16.5 + env: + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" + CIBW_SKIP: "*-musllinux_*" + CIBW_BUILD_VERBOSITY: 1 + with: + package-dir: PyNEC + output-dir: wheelhouse + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-pynec-${{ matrix.os }} + path: ./wheelhouse/*.whl + + build_sdist: + name: Build PyNEC source distribution + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y swig autoconf automake libtool + + - name: Configure necpp_src + run: | + cd necpp_src + make -f Makefile.git + ./configure --without-lapack + + - name: Setup package directory and generate SWIG wrapper + run: | + cd PyNEC + ln -s ../necpp_src . + swig -Wall -c++ -python PyNEC.i + + - name: Build sdist + run: | + cd PyNEC + pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist-pynec + path: PyNEC/dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 From b2dde1ef2539f11eda2a90ef6246e00ee9a51c96 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Tue, 6 Jan 2026 11:24:12 +1300 Subject: [PATCH 08/13] Bump to Mac-15 as 13 deprecated --- .github/workflows/build-necpp-wheels.yml | 2 +- .github/workflows/build-pynec-wheels.yml | 2 +- Makefile | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-necpp-wheels.yml b/.github/workflows/build-necpp-wheels.yml index 952227e..4f396ce 100644 --- a/.github/workflows/build-necpp-wheels.yml +++ b/.github/workflows/build-necpp-wheels.yml @@ -22,7 +22,7 @@ jobs: - os: linux runs-on: ubuntu-latest - os: macos-intel - runs-on: macos-13 + runs-on: macos-15 - os: macos-arm runs-on: macos-latest diff --git a/.github/workflows/build-pynec-wheels.yml b/.github/workflows/build-pynec-wheels.yml index b78073f..9e3e7ee 100644 --- a/.github/workflows/build-pynec-wheels.yml +++ b/.github/workflows/build-pynec-wheels.yml @@ -22,7 +22,7 @@ jobs: - os: linux runs-on: ubuntu-latest - os: macos-intel - runs-on: macos-13 + runs-on: macos-15 - os: macos-arm runs-on: macos-latest diff --git a/Makefile b/Makefile index 7442de6..dd1eb58 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ -PLAT=manylinux1_x86_64 -DOCKER_IMAGE=quay.io/pypa/manylinux2010_x86_64 +PLAT=manylinux2_x86_28 +DOCKER_IMAGE=quay.io/pypa/manylinux2014_x86_64 PRE_CMD= docker-wheels: docker run --rm -e PLAT=${PLAT} -v `pwd`:/io ${DOCKER_IMAGE} ${PRE_CMD} /io/build_wheels.sh auditwheel repair /output/mylibrary*whl -w /output - + install: docker pull ${DOCKER_IMAGE} From 3c1523235414e0ad99cf45931deb18de6d6c2be5 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Tue, 6 Jan 2026 12:00:45 +1300 Subject: [PATCH 09/13] Add Python 3.13 to CI build --- .github/workflows/build-necpp-wheels.yml | 2 +- .github/workflows/build-pynec-wheels.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-necpp-wheels.yml b/.github/workflows/build-necpp-wheels.yml index 4f396ce..f2ce2ba 100644 --- a/.github/workflows/build-necpp-wheels.yml +++ b/.github/workflows/build-necpp-wheels.yml @@ -59,7 +59,7 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.16.5 env: - CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*" CIBW_SKIP: "*-musllinux_*" CIBW_BUILD_VERBOSITY: 1 with: diff --git a/.github/workflows/build-pynec-wheels.yml b/.github/workflows/build-pynec-wheels.yml index 9e3e7ee..c5a3c63 100644 --- a/.github/workflows/build-pynec-wheels.yml +++ b/.github/workflows/build-pynec-wheels.yml @@ -59,7 +59,7 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.16.5 env: - CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*" CIBW_SKIP: "*-musllinux_*" CIBW_BUILD_VERBOSITY: 1 with: From aa296567a978ab2ca10a8d473bdc7aee8f9f55e9 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Tue, 6 Jan 2026 12:08:44 +1300 Subject: [PATCH 10/13] Version bump --- PyNEC/setup.py | 73 ++++++++++++++++++++++++++-------------------- necpp/setup.py | 79 ++++++++++++++++++++++++++++---------------------- 2 files changed, 86 insertions(+), 66 deletions(-) diff --git a/PyNEC/setup.py b/PyNEC/setup.py index 6d2a6ed..bc33761 100644 --- a/PyNEC/setup.py +++ b/PyNEC/setup.py @@ -7,24 +7,30 @@ """ import distutils.sysconfig -from glob import glob import os +from glob import glob + import numpy as np import setuptools # Remove silly flags from the compilation to avoid warnings. -#cfg_vars = distutils.sysconfig.get_config_vars() -#for key, value in cfg_vars.items(): +# cfg_vars = distutils.sysconfig.get_config_vars() +# for key, value in cfg_vars.items(): # if type(value) == str: # cfg_vars[key] = value.replace("-Wstrict-prototypes", "") -# Generate a list of the sources. +# Generate a list of the sources. nec_sources = [] -nec_sources.extend([fn for fn in glob('necpp_src/src/*.cpp') - if not os.path.basename(fn).endswith('_tb.cpp') - if not os.path.basename(fn).startswith('net_solve.cpp') - if not os.path.basename(fn).startswith('nec2cpp.cpp') - if not os.path.basename(fn).startswith('necDiff.cpp')]) +nec_sources.extend( + [ + fn + for fn in glob("necpp_src/src/*.cpp") + if not os.path.basename(fn).endswith("_tb.cpp") + if not os.path.basename(fn).startswith("net_solve.cpp") + if not os.path.basename(fn).startswith("nec2cpp.cpp") + if not os.path.basename(fn).startswith("necDiff.cpp") + ] +) nec_sources.extend(glob("PyNEC_wrap.cxx")) nec_headers = [] @@ -35,39 +41,44 @@ # At the moment, the config.h file is needed, and this should be generated from the ./configure # command in the parent directory. Use ./configure --without-lapack to avoid dependance on LAPACK # -necpp_module = setuptools.Extension('_PyNEC', +necpp_module = setuptools.Extension( + "_PyNEC", sources=nec_sources, - - include_dirs=[np.get_include(), 'necpp_src/src', 'necpp_src/', 'necpp_src/win32/'], - extra_compile_args = ['-fPIC'], - extra_link_args = ['-lstdc++'], + include_dirs=[np.get_include(), "necpp_src/src", "necpp_src/", "necpp_src/win32/"], + extra_compile_args=["-fPIC"], + extra_link_args=["-lstdc++"], depends=nec_headers, - define_macros=[('BUILD_PYTHON', '1'), ('NPY_NO_DEPRECATED_API','NPY_1_7_API_VERSION')] - ) + define_macros=[ + ("BUILD_PYTHON", "1"), + ("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"), + ], +) with open("README.md", "r") as fh: long_description = fh.read() - -setuptools.setup (name = 'PyNEC', - version = '1.7.3.6', - author = "Tim Molteno", - author_email = "tim@physics.otago.ac.nz", - url = "http://github.com/tmolteno/python-necpp", - keywords = "nec2 nec2++ antenna electromagnetism radio", - description = "Python Antenna Simulation Module (nec2++) object-oriented interface", + +setuptools.setup( + name="PyNEC", + version="1.7.4", + author="Tim Molteno", + author_email="tim@physics.otago.ac.nz", + url="http://github.com/tmolteno/python-necpp", + keywords="nec2 nec2++ antenna electromagnetism radio", + description="Python Antenna Simulation Module (nec2++) object-oriented interface", long_description=long_description, long_description_content_type="text/markdown", include_package_data=True, - data_files=[('examples', ['example/test_rp.py'])], - ext_modules = [necpp_module], - requires = ['numpy'], - py_modules = ["PyNEC"], - license='GPLv2', + data_files=[("examples", ["example/test_rp.py"])], + ext_modules=[necpp_module], + requires=["numpy"], + py_modules=["PyNEC"], + license="GPLv2", classifiers=[ "Development Status :: 5 - Production/Stable", "Topic :: Scientific/Engineering", "Topic :: Communications :: Ham Radio", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", - 'Programming Language :: Python :: 3', - "Intended Audience :: Science/Research"] + "Programming Language :: Python :: 3", + "Intended Audience :: Science/Research", + ], ) diff --git a/necpp/setup.py b/necpp/setup.py index f410e43..896ed98 100644 --- a/necpp/setup.py +++ b/necpp/setup.py @@ -1,19 +1,25 @@ #!/usr/bin/env python """ -setup.py file for necpp Python module. +setup.py file for necpp Python module. """ -from setuptools import setup, Extension -from glob import glob import os +from glob import glob + +from setuptools import Extension, setup nec_sources = [] -nec_sources.extend([fn for fn in glob('necpp_src/src/*.cpp') - if not os.path.basename(fn).endswith('_tb.cpp') - if not os.path.basename(fn).startswith('net_solve.cpp') - if not os.path.basename(fn).startswith('nec2cpp.cpp') - if not os.path.basename(fn).startswith('necDiff.cpp')]) +nec_sources.extend( + [ + fn + for fn in glob("necpp_src/src/*.cpp") + if not os.path.basename(fn).endswith("_tb.cpp") + if not os.path.basename(fn).startswith("net_solve.cpp") + if not os.path.basename(fn).startswith("nec2cpp.cpp") + if not os.path.basename(fn).startswith("necDiff.cpp") + ] +) nec_sources.extend(glob("necpp_wrap.c")) nec_headers = [] @@ -24,40 +30,43 @@ # At the moment, the config.h file is needed, and this should be generated from the ./configure # command in the parent directory. Use ./configure --without-lapack to avoid dependance on LAPACK # -necpp_module = Extension('_necpp', +necpp_module = Extension( + "_necpp", sources=nec_sources, - include_dirs=['necpp_src/src/', 'necpp_src/'], + include_dirs=["necpp_src/src/", "necpp_src/"], depends=nec_headers, - define_macros=[('BUILD_PYTHON', '1')] - ) + define_macros=[("BUILD_PYTHON", "1")], +) -with open('README.md') as f: +with open("README.md") as f: readme = f.read() -setup (name = 'necpp', - version = '1.7.3.5', - author = "Tim Molteno", - author_email = "tim@physics.otago.ac.nz", - url = "http://github.com/tmolteno/necpp", - keywords = "nec2 nec2++ antenna electromagnetism radio", - description = "Python Antenna Simulation Module (nec2++) C-style interface", +setup( + name="necpp", + version="1.7.4", + author="Tim Molteno", + author_email="tim@physics.otago.ac.nz", + url="http://github.com/tmolteno/necpp", + keywords="nec2 nec2++ antenna electromagnetism radio", + description="Python Antenna Simulation Module (nec2++) C-style interface", long_description=readme, long_description_content_type="text/markdown", include_package_data=True, - data_files=[('examples', ['necpp_src/example/test.py'])], - ext_modules = [necpp_module], - py_modules = ["necpp"], - license='GPLv2', + data_files=[("examples", ["necpp_src/example/test.py"])], + ext_modules=[necpp_module], + py_modules=["necpp"], + license="GPLv2", classifiers=[ - "Development Status :: 5 - Production/Stable", - "Topic :: Scientific/Engineering", - "Topic :: Communications :: Ham Radio", - "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - "Intended Audience :: Science/Research"] + "Development Status :: 5 - Production/Stable", + "Topic :: Scientific/Engineering", + "Topic :: Communications :: Ham Radio", + "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Intended Audience :: Science/Research", + ], ) From db34f239b92f746682717ad021b80b2dfc8bedb2 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Tue, 6 Jan 2026 12:10:55 +1300 Subject: [PATCH 11/13] Update submodule --- necpp_src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/necpp_src b/necpp_src index 0af22b1..bc9aace 160000 --- a/necpp_src +++ b/necpp_src @@ -1 +1 @@ -Subproject commit 0af22b10d5b8e96da412009ef1178f1b4131cbb8 +Subproject commit bc9aaceedec50ac44dbed6e58a970b8007b346d3 From 5fc06f20035abc19713eed3144c01384097d08ea Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Tue, 6 Jan 2026 12:14:14 +1300 Subject: [PATCH 12/13] Add gfortran as a dependency --- .github/workflows/build-necpp-wheels.yml | 6 +++--- .github/workflows/build-pynec-wheels.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-necpp-wheels.yml b/.github/workflows/build-necpp-wheels.yml index f2ce2ba..6a42efd 100644 --- a/.github/workflows/build-necpp-wheels.yml +++ b/.github/workflows/build-necpp-wheels.yml @@ -35,12 +35,12 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool + sudo apt-get install -y swig autoconf automake libtool gfortran - name: Install build dependencies (macOS) if: runner.os == 'macOS' run: | - brew install swig autoconf automake libtool + brew install swig autoconf automake libtool gfortran - name: Configure necpp_src shell: bash @@ -84,7 +84,7 @@ jobs: - name: Install build dependencies run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool + sudo apt-get install -y swig autoconf automake libtool gfortran - name: Configure necpp_src run: | diff --git a/.github/workflows/build-pynec-wheels.yml b/.github/workflows/build-pynec-wheels.yml index c5a3c63..0d02d2a 100644 --- a/.github/workflows/build-pynec-wheels.yml +++ b/.github/workflows/build-pynec-wheels.yml @@ -35,12 +35,12 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool + sudo apt-get install -y swig autoconf automake libtool gfortran - name: Install build dependencies (macOS) if: runner.os == 'macOS' run: | - brew install swig autoconf automake libtool + brew install swig autoconf automake libtool gfortran - name: Configure necpp_src shell: bash @@ -84,7 +84,7 @@ jobs: - name: Install build dependencies run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool + sudo apt-get install -y swig autoconf automake libtool gfortran - name: Configure necpp_src run: | From 99c1533c2063a950b33254f5119e200785147c74 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Tue, 6 Jan 2026 15:54:15 +1300 Subject: [PATCH 13/13] Remove lapack and gfortran dependence --- .github/workflows/build-necpp-wheels.yml | 10 +++++----- .github/workflows/build-pynec-wheels.yml | 10 +++++----- necpp_src | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-necpp-wheels.yml b/.github/workflows/build-necpp-wheels.yml index 6a42efd..b1255a2 100644 --- a/.github/workflows/build-necpp-wheels.yml +++ b/.github/workflows/build-necpp-wheels.yml @@ -35,19 +35,19 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool gfortran + sudo apt-get install -y swig autoconf automake libtool - name: Install build dependencies (macOS) if: runner.os == 'macOS' run: | - brew install swig autoconf automake libtool gfortran + brew install swig autoconf automake libtool - name: Configure necpp_src shell: bash run: | cd necpp_src make -f Makefile.git - ./configure --without-lapack + ./configure - name: Setup package directory and generate SWIG wrapper shell: bash @@ -84,13 +84,13 @@ jobs: - name: Install build dependencies run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool gfortran + sudo apt-get install -y swig autoconf automake libtool - name: Configure necpp_src run: | cd necpp_src make -f Makefile.git - ./configure --without-lapack + ./configure - name: Setup package directory and generate SWIG wrapper run: | diff --git a/.github/workflows/build-pynec-wheels.yml b/.github/workflows/build-pynec-wheels.yml index 0d02d2a..bb89d90 100644 --- a/.github/workflows/build-pynec-wheels.yml +++ b/.github/workflows/build-pynec-wheels.yml @@ -35,19 +35,19 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool gfortran + sudo apt-get install -y swig autoconf automake libtool - name: Install build dependencies (macOS) if: runner.os == 'macOS' run: | - brew install swig autoconf automake libtool gfortran + brew install swig autoconf automake libtool - name: Configure necpp_src shell: bash run: | cd necpp_src make -f Makefile.git - ./configure --without-lapack + ./configure - name: Setup package directory and generate SWIG wrapper shell: bash @@ -84,13 +84,13 @@ jobs: - name: Install build dependencies run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool gfortran + sudo apt-get install -y swig autoconf automake libtool - name: Configure necpp_src run: | cd necpp_src make -f Makefile.git - ./configure --without-lapack + ./configure - name: Setup package directory and generate SWIG wrapper run: | diff --git a/necpp_src b/necpp_src index bc9aace..049c556 160000 --- a/necpp_src +++ b/necpp_src @@ -1 +1 @@ -Subproject commit bc9aaceedec50ac44dbed6e58a970b8007b346d3 +Subproject commit 049c556cb10769410b760dcea7ef341a3e08f78b