feat: solve bug reported in the alpha feedback and added some features like the cumulative arg. #66
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: pip packaging | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| python_repository: | |
| description: python repository | |
| type: choice | |
| default: None # no publishing to any Package Index by default | |
| options: [None, testpypi, pypi] | |
| push: | |
| tags: ['*'] | |
| pull_request: | |
| paths: | |
| - .github/workflows/pack-pip.yml | |
| - pyproject.toml | |
| - CMakeLists.txt | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build-wheel: | |
| name: Build wheel | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2025, windows-11-arm, macos-15-intel, macos-15] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Load Visual C++ Environment Variables (Windows) | |
| if: runner.os == 'Windows' | |
| shell: cmd | |
| run: | | |
| call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat" | |
| set >> %GITHUB_ENV% | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.3.1 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| - name: Set up UV | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Test built wheel | |
| run: | | |
| uv venv .test-env | |
| uv pip install --python .test-env --find-links=wheelhouse "khisto[all]" | |
| uv sync --python .test-env --group dev --no-install-project | |
| uv run --python .test-env pytest tests/ --no-cov | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: pkg-wheel-${{ matrix.os }} | |
| path: wheelhouse/*.whl | |
| if-no-files-found: error | |
| release-testpypi: | |
| # Publish only on tag pushes in the KhiopsML repository | |
| if: github.ref_type == 'tag' && github.repository_owner == 'KhiopsML' && inputs.python_repository == 'testpypi' | |
| name: Publish to Test.PyPI.org | |
| needs: [build-wheel] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| environment: | |
| name: testpypi | |
| steps: | |
| - uses: actions/download-artifact@v6 | |
| with: | |
| pattern: pkg-* | |
| path: dist | |
| merge-multiple: true | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| verbose: true | |
| repository-url: https://test.pypi.org/legacy/ | |
| release-pypi: | |
| # Publish only on tag pushes in the KhiopsML repository | |
| name: Publish to PyPI.org | |
| if: github.ref_type == 'tag' && github.repository_owner == 'KhiopsML' && inputs.python_repository == 'pypi' | |
| needs: [build-wheel] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| environment: | |
| name: pypi | |
| steps: | |
| - uses: actions/download-artifact@v6 | |
| with: | |
| pattern: pkg-* | |
| path: dist | |
| merge-multiple: true | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| verbose: true |