Skip to content

Commit

Permalink
Fix wheel building
Browse files Browse the repository at this point in the history
  • Loading branch information
tbttfox committed Sep 16, 2024
1 parent 4169fe6 commit bf00f04
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 14 deletions.
48 changes: 42 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,29 @@ jobs:
- name: Get pyver macos-latest
if: ${{ matrix.os == 'macos-latest' }}
shell: bash
run: echo "PY_VER=3.9" >> $GITHUB_ENV
run: |
echo "PY_VER=3.9" >> $GITHUB_ENV
echo "PY_VER_FLAT=39" >> $GITHUB_ENV
echo "PY_EXT=so" >> $GITHUB_ENV
echo "PLAT_TAG=macosx_12_0_arm64" >> $GITHUB_ENV
- name: Get pyver
if: ${{ matrix.os != 'macos-latest' }}
- name: Get pyver ubuntu-latest
if: ${{ matrix.os == 'ubuntu-latest' }}
shell: bash
run: echo "PY_VER=3.7" >> $GITHUB_ENV
run: |
echo "PY_VER=3.7" >> $GITHUB_ENV
echo "PY_VER_FLAT=37" >> $GITHUB_ENV
echo "PY_EXT=so" >> $GITHUB_ENV
echo "PLAT_TAG=manylinux_2_17_x86_64" >> $GITHUB_ENV
- name: Get pyver windows-latest
if: ${{ matrix.os == 'windows-latest' }}
shell: bash
run: |
echo "PY_VER=3.7" >> $GITHUB_ENV
echo "PY_VER_FLAT=37" >> $GITHUB_ENV
echo "PY_EXT=pyd" >> $GITHUB_ENV
echo "PLAT_TAG=win_amd64" >> $GITHUB_ENV
- name: Get an older python version
uses: actions/setup-python@v5
Expand All @@ -117,11 +134,30 @@ jobs:
--backend ninja
install-args: --skip-subprojects

- name: Build Wheel
shell: bash
run: |
python -m pip install -U pip
python -m pip install -U build wheel hatch
python -m hatch version $(git describe --tags --abbrev=0)
python -m build --wheel
for PY_WHEEL in dist/*.whl
do
python -m wheel tags --remove --python-tag ${{ env.PY_VER_FLAT }} --abi-tag abi3 --platform-tag ${{ env.PLAT_TAG }} ${PY_WHEEL}
done
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-pyModule
path: output_Python/*.*
path: output_Python/*.${{ env.PY_EXT }}
if-no-files-found: error

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-wheels
path: dist/*.whl
if-no-files-found: error

upload_release:
Expand All @@ -143,7 +179,7 @@ jobs:
module-name: simplex
folder-list: scripts icons
version: ${{ steps.previoustag.outputs.tag }}
python-limited-api: true
py-limited-api: true

- name: Upload distribution
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
Expand Down
21 changes: 13 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,24 @@ dependencies = [
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel.sources]
"scripts" = ""
"output_Python" = "simplexui"

[tool.hatch.build]
include = ["simplexui"]
exclude = ["*.bak"]
[tool.hatch.build.targets.wheel]
only-packages = false
artifacts = [
"/*.so",
"/*.pyd",
"*.so",
"*.pyd",
"!*.lib",
]
only-include = [
"scripts/simplexui",
"output_Python",
]

[tool.hatch.version]
path = "simplexui/__init__.py"

path = "scripts/simplexui/__init__.py"

[tool.ruff]
# Exclude a variety of commonly ignored directories.
Expand Down Expand Up @@ -131,4 +137,3 @@ skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"


0 comments on commit bf00f04

Please sign in to comment.