@@ -375,7 +375,6 @@ jobs:
375375 build/src/RelWithDebInfo/JSBSim.lib
376376 build/src/RelWithDebInfo/JSBSim.exe
377377 build/utils/aeromatic++/RelWithDebInfo/aeromatic.exe
378- build/python/setup.py
379378 MSVC_version.txt
380379
381380 Windows-installer :
@@ -497,18 +496,10 @@ jobs:
497496 working-directory : build
498497 run : ctest --parallel $(sysctl -n hw.logicalcpu) --output-on-failure
499498 - name : Build the source package for Python
500- if : env.release == 'true'
501- working-directory : build/python
502499 run : |
503- echo "::group::Generate the type hints stub"
504- python ../../python/pyxstubgen.py --pyxfile=_jsbsim.pyx --output=jsbsim/_jsbsim.pyi
505- touch jsbsim/py.typed
506- echo "::endgroup::"
507-
508- echo "::group::Build the source package"
509- rm -f _jsbsim.cxx # Make sure that jsbsim.cxx is not stored in the source distribution
500+ python python/pyxstubgen.py --pyxfile=build/python/_jsbsim.pyx --output=python/_jsbsim.pyi
501+ cp build/python/pyproject.toml .
510502 python -m build --sdist
511- echo "::endgroup::"
512503 - name : Check reset for real time execution
513504 run : |
514505 start_time=$(date +%s)
@@ -532,16 +523,12 @@ jobs:
532523
533524 - name : Upload Files for Release
534525 uses : actions/upload-artifact@v7
535- if : env.release == 'true'
536526 with :
537527 name : ${{ runner.os }}.binaries
538528 path : |
539- build/src/libJSBSim.a
540- build/python/setup.py
541- build/python/dist/*.tar.gz
529+ dist/*.tar.gz
542530
543531 Test-Build-PyPackage-From-Source :
544- if : github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
545532 name : Build Python Module from Source
546533 needs : MacOSX
547534 strategy :
@@ -560,14 +547,9 @@ jobs:
560547 uses : actions/download-artifact@v8
561548 with :
562549 name : macOS.binaries
563- - name : Build Python module from sources (Linux & MacOSX)
564- if : runner.os != 'Windows'
565- run : pip install python/dist/*.tar.gz -vv
566- - name : Build Python module from sources (Windows)
567- if : runner.os == 'Windows'
568- run : |
569- $PyPackage = Get-ChildItem -Path python\dist -Filter *.tar.gz | Select-Object -First 1
570- pip install $PyPackage.FullName -vv
550+ - name : Build Python module from sources
551+ shell : bash
552+ run : pip install *.tar.gz -vv
571553 - name : Test Python module
572554 shell : python
573555 run : |
@@ -582,6 +564,8 @@ jobs:
582564 run : |
583565 echo "import jsbsim" > test.py
584566 mypy test.py
567+ - name : Test JSBSim.py script
568+ run : jsbsim --help
585569
586570 Python-Wheels :
587571 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
@@ -596,83 +580,32 @@ jobs:
596580 steps :
597581 - name : Checkout JSBSim
598582 uses : actions/checkout@v6
599- - name : Set up Python 3.10
600- uses : actions/setup-python@v6
601- with :
602- python-version : ' 3.10'
603- - name : Install Python packages
604- run : pip install -U cython 'numpy>=1.20' mypy
605- - name : Install Doxygen (Linux)
606- if : matrix.os == 'ubuntu-latest'
607- run : |
608- sudo apt-get update
609- sudo apt-get install doxygen
610- - name : Install Doxygen (MacOSX)
611- if : matrix.os == 'macos-14'
612- run : brew install doxygen
613- - name : Install Doxygen (Windows)
614- if : runner.os == 'Windows'
615- run : choco install doxygen.install
616- - name : Configure Doxygen
617- run : |
618- # We don't want Doxygen to generate the HTML docs in this job (saves time)
619- # Set GENERATE_HTML and HAVE_DOT to NO
620- perl -i -pe 's/^(GENERATE_HTML\s*=\s*)YES/\1NO/g' doc/JSBSim.dox.in
621- perl -i -pe 's/^(HAVE_DOT\s*=\s*)YES/\1NO/g' doc/JSBSim.dox.in
622583 - name : Download source package
623584 uses : actions/download-artifact@v8
624585 with :
625586 name : macOS.binaries
626- - name : Configure JSBSim (BSD/Unix)
627- if : runner.os != 'Windows'
587+ - name : Identify the source distribution
588+ shell : bash
628589 run : |
629- echo "::group::Run CMake"
630- mkdir build && cd build
631- cmake ..
632- echo "::endgroup::"
633-
634- echo "::group::Get Python package sources"
635- touch python/jsbsim/py.typed
636- cd ../python/dist
637- tar zxvf *.tar.gz
638- cp -R jsbsim-*/jsbsim/*.pyi ../../build/python/jsbsim/.
639- echo "::endgroup::"
640- - name : Configure JSBSim (Windows)
641- if : runner.os == 'Windows'
642- run : |
643- echo "::group::Run CMake"
644- New-Item -Path .\build -ItemType Directory -Force
645- cd build
646- cmake ..
647- cmake --build . --target libJSBSim --config RelWithDebInfo --parallel $Env:NUMBER_OF_PROCESSORS
648- echo "::endgroup::"
649-
650- echo "::group::Get Python package sources"
651- New-Item python\jsbsim\py.typed
652- cd ..\python\dist
653- $PyPackage = Get-ChildItem .\*.tar.gz -Name
654- tar zxvf $PyPackage
655- Copy-Item -Path .\JSBSim-*\jsbsim\*.pyi -Destination ..\..\build\python\jsbsim
656- echo "::endgroup::"
590+ SDIST_PATH=$(ls jsbsim-*.tar.gz | head -n 1)
591+ echo "SDIST_PATH=$SDIST_PATH" >> $GITHUB_ENV
657592 - name : Build wheels
658593 uses : pypa/cibuildwheel@v3.3
659594 env :
660- CIBW_BEFORE_ALL_LINUX : |
661- cd build
662- rm -f CMakeCache.txt
663- cmake -DCMAKE_C_FLAGS_RELEASE="-g -O2 -DNDEBUG -fno-math-errno" -DCMAKE_CXX_FLAGS_RELEASE="-g -O2 -DNDEBUG -fno-math-errno" -DCMAKE_BUILD_TYPE=Release ..
664- cmake --build . --target libJSBSim --parallel $(nproc)
665- CIBW_BEFORE_ALL_MACOS : |
666- cd build
667- rm -f CMakeCache.txt
668- cmake -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_C_FLAGS_RELEASE="-g -O2 -DNDEBUG -fno-math-errno -fno-fast-math" -DCMAKE_CXX_FLAGS_RELEASE="-g -O2 -DNDEBUG -fno-math-errno -fno-fast-math" -DCMAKE_BUILD_TYPE=Release ..
669- cmake --build . --target libJSBSim --parallel $(sysctl -n hw.logicalcpu)
670595 CIBW_ARCHS_MACOS : universal2
671596 CIBW_SKIP : cp*-musllinux_*
672597 CIBW_ARCHS_WINDOWS : native
673- JSBSIM_BUILD_CONFIG : RelWithDebInfo
598+ # Force the buid directory to allow reusing compiled files.
599+ CIBW_CONFIG_SETTINGS_LINUX : " build-dir=${{ runner.temp }}/jsbsim_build_cache"
600+ SKBUILD_BUILD_DIR : " ${{ runner.temp }}/jsbsim_build_cache"
601+ with :
602+ package-dir : ${{ env.SDIST_PATH }}
603+ - name : Set up Python 3.10
604+ uses : actions/setup-python@v6
674605 with :
675- package-dir : build/python
606+ python-version : ' 3.10'
607+ - name : Install Python packages
608+ run : pip install -U 'numpy>=1.20' mypy
676609 - name : Test wheel package
677610 run : |
678611 echo "::group::Test module execution"
@@ -733,7 +666,6 @@ jobs:
733666 run : |
734667 mkdir dist
735668 find . -type f -name *.exe -exec cp {} dist/. \;
736- find . -type f -name *.whl -exec cp {} dist/. \;
737669 find . -type f -name *.deb -exec cp {} dist/. \;
738670 - name : Rolling release
739671 uses : softprops/action-gh-release@v2
@@ -748,7 +680,6 @@ jobs:
748680 (branch ${{ github.ref }} commit ${{ github.sha}})
749681 files : |
750682 dist/*.exe
751- dist/*.whl
752683 dist/*.deb
753684
754685 Stable-Release :
0 commit comments