Skip to content

Commit 4910dac

Browse files
committed
Separate wheel and source distribution builds
Add build-sourcedist recipe and fix duplicate source dist bug where macOS/Windows were building source distributions unnecessarily. Changes to Justfile: 1. Modified 'build' recipe to only build wheels (python -m build --wheel) - Keeps NVX flag which only applies to native wheel compilation - Clear separation: build = wheels only 2. Added 'build-sourcedist' recipe to build source dist only - No NVX flag (doesn't apply to source distributions) - Uses python -m build --sdist 3. build-all continues to work as meta-recipe for all venvs Changes to wheels.yml: 1. Added 'Build source distribution' step (Linux x86_64 only) - Runs after wheel build - Calls 'just build-sourcedist' - Source dists are platform-independent, only need one Result: - Linux: Builds wheels (no NVX) + source dist (once) - macOS: Builds wheels (with NVX) only - Windows: Builds wheels (with NVX) only This fixes the bug where macOS and Windows were creating duplicate source distributions, causing file conflicts during artifact downloads in release workflow due to overwrite: false setting.
1 parent 60c658a commit 4910dac

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

.github/workflows/wheels.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ jobs:
192192
just build-all
193193
shell: bash
194194

195+
- name: Build source distribution (Linux x86_64 only)
196+
if: matrix.platform == 'linux' && matrix.arch == 'x86_64'
197+
run: |
198+
# Build source distribution (only once, on Linux x86_64)
199+
# Source distributions are platform-independent
200+
just build-sourcedist
201+
shell: bash
202+
195203
- name: Force file system sync (post-build, pre-validation) - Linux
196204
if: matrix.platform == 'linux'
197205
run: |

justfile

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ docs-clean:
789789
# -- Building and Publishing
790790
# -----------------------------------------------------------------------------
791791

792-
# Build distribution packages (wheels and source tarball)
792+
# Build wheel only (usage: `just build cpy314`)
793793
build venv="": (install-build-tools venv)
794794
#!/usr/bin/env bash
795795
set -e
@@ -801,9 +801,25 @@ build venv="": (install-build-tools venv)
801801
fi
802802
VENV_PATH="{{ VENV_DIR }}/${VENV_NAME}"
803803
VENV_PYTHON=$(just --quiet _get-venv-python "${VENV_NAME}")
804-
echo "==> Building distribution packages..."
805-
# Set environment variable for NVX acceleration
806-
AUTOBAHN_USE_NVX=1 ${VENV_PYTHON} -m build
804+
echo "==> Building wheel package..."
805+
# Set environment variable for NVX acceleration (only affects wheels)
806+
AUTOBAHN_USE_NVX=1 ${VENV_PYTHON} -m build --wheel
807+
ls -la dist/
808+
809+
# Build source distribution only (no wheels, no NVX flag needed)
810+
build-sourcedist venv="": (install-build-tools venv)
811+
#!/usr/bin/env bash
812+
set -e
813+
VENV_NAME="{{ venv }}"
814+
if [ -z "${VENV_NAME}" ]; then
815+
echo "==> No venv name specified. Auto-detecting from system Python..."
816+
VENV_NAME=$(just --quiet _get-system-venv-name)
817+
echo "==> Defaulting to venv: '${VENV_NAME}'"
818+
fi
819+
VENV_PATH="{{ VENV_DIR }}/${VENV_NAME}"
820+
VENV_PYTHON=$(just --quiet _get-venv-python "${VENV_NAME}")
821+
echo "==> Building source distribution..."
822+
${VENV_PYTHON} -m build --sdist
807823
ls -la dist/
808824

809825
# Meta-recipe to run `build` on all environments

0 commit comments

Comments
 (0)