Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add windows to test_python and fix compilation/importing #471

Merged
merged 4 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ jobs:
- macos-12
# latest is ARM
- macos-latest
- windows-latest
python-minor:
- 5
- 6
Expand Down Expand Up @@ -420,10 +421,25 @@ jobs:
key: ${{ runner.os }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Run python test command
- name: Install soar-sml
run: |
pip3.${{ matrix.python-minor }} install soar-sml -f wheelhouse --no-index
python3.${{ matrix.python-minor }} Core/ClientSMLSWIG/Python/TestPythonSML.py

- name: Run test command (Non-Windows)
if: matrix.os != 'windows-latest'
env:
# Ensures unicode outputs properly on all versions
PYTHONUTF8: 1
PYTHONIOENCODING: utf-8
run: python3.${{ matrix.python-minor }} Core/ClientSMLSWIG/Python/TestPythonSML.py

- name: Run test command (Windows)
if: matrix.os == 'windows-latest'
env:
# Ensures unicode outputs properly on all versions
PYTHONUTF8: 1
PYTHONIOENCODING: utf-8
run: py -3.${{ matrix.python-minor }} Core/ClientSMLSWIG/Python/TestPythonSML.py

python_push_dev:
name: Publish to test.pypi.org
Expand Down
6 changes: 5 additions & 1 deletion Core/ClientSMLSWIG/Python/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ clone.Append(CPPPATH = inc_path)
# GHA Runners. (python installations are handled by cibuildwheel)
#
# Omitting python's libraries is safe, as python itself injects its symbols when importing the library.
if (not env['ENSCONS_ACTIVE']) or os.name == 'nt':
if (not env['ENSCONS_ACTIVE']):
clone.Append(LIBPATH = lib_path, LIBS = pylib)
elif os.name == 'nt':
# For windows specifically, we need to give it a path to find 'python3.lib',
# without linking it against 'python3X' (with X being the minor version).
clone.Append(LIBPATH = lib_path)

if os.name == 'posix':
clone.Append(CPPFLAGS = Split('-Wno-unused -fno-strict-aliasing'))
Expand Down
5 changes: 4 additions & 1 deletion Core/ClientSMLSWIG/Python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ test-command = "SOAR_UNIT_TEST_BASE_DIR={project}/out/ python {project}/Core/Cli
test-skip = "cp38-macosx_*:arm64"

[tool.cibuildwheel.windows]
# For windows we need a slightly different command
# For windows, we need to include msvcp140.dll and vcruntime140_1.dll in the wheel.
before-build = "pip install delvewheel"
repair-wheel-command = "delvewheel repair --ignore-in-wheel -w {dest_dir} {wheel}"
# For windows we need a slightly different test command
test-command = """\
set SOAR_UNIT_TEST_BASE_DIR={project}/out/
python {project}/Core/ClientSMLSWIG/Python/TestPythonSML.py
Expand Down
Loading