From 52c70312fba308d9571c87caa409774834e11d79 Mon Sep 17 00:00:00 2001 From: shaia Date: Wed, 7 Jan 2026 02:04:35 +0200 Subject: [PATCH] fix: Ensure sdist filename uses underscores per PEP 625 PyPI rejects sdists with hyphenated names. Add check and rename if needed (cfd-python -> cfd_python). --- .github/workflows/publish.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 921b755..079d07d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -50,10 +50,20 @@ jobs: - name: Install build dependencies run: | python -m pip install --upgrade pip - pip install build setuptools-scm + pip install "build>=1.0" setuptools-scm - name: Build sdist - run: python -m build --sdist + run: | + python -m build --sdist + # Verify sdist filename uses underscores (PEP 625) + ls -la dist/ + if ls dist/cfd-python-*.tar.gz 1> /dev/null 2>&1; then + echo "ERROR: sdist has hyphenated name, renaming..." + for f in dist/cfd-python-*.tar.gz; do + mv "$f" "${f/cfd-python/cfd_python}" + done + fi + ls -la dist/ - name: Upload sdist uses: actions/upload-artifact@v4