diff --git a/.github/workflows/dev_wheel_build.yml b/.github/workflows/dev_wheel_build.yml new file mode 100644 index 000000000..d101806e2 --- /dev/null +++ b/.github/workflows/dev_wheel_build.yml @@ -0,0 +1,73 @@ + +name: Build latest wheel + +on: + pull_request: + push: + branches: master + +env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + +jobs: + build-dev-wheel: + runs-on: ubuntu-latest + permissions: + contents: read + pages: write + id-token: write + + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-python@v7 + with: + python-version: '3.14' + + - name: Generate short sha + run: echo "GITHUB_SHORT_SHA=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV + + - name: Install/upgrade pip and buildtools + run: pip install --upgrade build pip + + - name: Build the wheel and clean + run: python -m build && rm dist/*.tar.gz + + - name: Test the wheel + run: | + pip install $(ls dist/*.whl) + pip install pytest ipython docutils + (cd dist && pytest ../tests) + + - name: Fetch previous wheels + if: contains(env.BRANCH_NAME, 'master') + uses: actions/cache/restore@v6 + with: + key: cached-dist-${{ github.run_id }}-${{ github.run_attempt }} + restore-keys: cached-dist + path: dist + + - name: Store + if: contains(env.BRANCH_NAME, 'master') + uses: actions/cache/save@v6 + with: + key: cached-dist-${{ github.run_id }}-${{ github.run_attempt }} + path: dist + + - name: Setup Pages + if: contains(env.BRANCH_NAME, 'master') + uses: actions/configure-pages@v6 + + - name: List wheels + run: (cd dist && ls -1 *.whl > index.html) + + - name: Upload pages + if: contains(env.BRANCH_NAME, 'master') + uses: actions/upload-pages-artifact@v3 + with: + path: ./dist + + - name: Deploy to GH pages + if: contains(env.BRANCH_NAME, 'master') + id: publish_step + uses: actions/deploy-pages@v5 diff --git a/setup.py b/setup.py index e25c144f9..85f410c7c 100644 --- a/setup.py +++ b/setup.py @@ -17,14 +17,20 @@ reqs = [] setup_reqs = [] +VERSION = "2.9.0dev" + +# Get short sha, if defined +SHORT_SHA = os.environ.get("GITHUB_SHORT_SHA", "") + # ReadTheDocs, AppVeyor and Azure builds will break when trying to instal pip deps in a conda env is_rtd = "READTHEDOCS" in os.environ is_appveyor = "APPVEYOR" in os.environ is_azure = "CONDA_PY" in os.environ is_conda = "CONDA_PREFIX" in os.environ +ignore_conda = "IGNORE_CONDA" in os.environ # Only include the installation dependencies if we are not running on RTD or AppVeyor or in a conda env -if not is_rtd and not is_appveyor and not is_azure and not is_conda: +if (not is_rtd and not is_appveyor and not is_azure and not is_conda) or ignore_conda: reqs = [ "cadquery-ocp==8.0.1.1", "ezdxf>=1.3.0", @@ -44,7 +50,7 @@ setup( name="cadquery", - version="2.9.0dev", + version=f"{VERSION}{f"+{SHORT_SHA}" if SHORT_SHA else ""}", url="https://github.com/CadQuery/cadquery", license="Apache Public License 2.0", author="David Cowden",