Skip to content

Commit

Permalink
Experiment with hynek/build-and-inspect-python-package
Browse files Browse the repository at this point in the history
  • Loading branch information
rmartin16 committed May 24, 2024
1 parent a4b75f4 commit d4baa92
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 29 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main

concurrency:
group: ${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
Expand Down Expand Up @@ -169,21 +169,31 @@ jobs:
strategy:
fail-fast: false
matrix:
repo: [ briefcase, gbulb, rubicon-objc, toga ]
name: [ briefcase, gbulb, rubicon-objc, toga, toga-android ]
include:
- tox-source: .[dev]
- dist-path: dist
- repo: briefcase
- name: briefcase
repo: briefcase
tox-source: .[dev]
tox-factors: -with-automation
dist-path: dist
- repo: gbulb
- name: gbulb
repo: gbulb
tox-source: tox
dist-path: dist
- repo: toga
- name: rubicon-objc
repo: rubicon-objc
- name: toga
repo: toga
tox-source: ./core[dev]
dist-path: "*/dist/*"
build-subdir: core
- name: toga-android
repo: toga
tox-source: ./core[dev]
dist-path: "*/dist/*"
build-subdir: android

test-verify-projects-briefcase:
name: Verify Project
Expand Down
54 changes: 30 additions & 24 deletions .github/workflows/python-package-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
name: Create Python Package
runs-on: ${{ inputs.runner-os }}
outputs:
artifact-name: packages-${{ steps.package.outputs.name }}
artifact-name: "Packages-${{ steps.package.outputs.name }}${{ inputs.build-subdirectory && format('-{0}', inputs.build-subdirectory) || '' }}"
steps:

- name: Determine Package Name
Expand All @@ -67,32 +67,38 @@ jobs:
repository: ${{ inputs.repository }}
fetch-depth: 0 # Fetch all refs so setuptools_scm can generate the correct version number

- name: Setup Python
uses: actions/setup-python@v5.1.0
- name: Build & Upload Package
uses: hynek/build-and-inspect-python[email protected].0
with:
python-version: ${{ inputs.python-version }}
cache: pip
cache-dependency-path: |
**/setup.cfg
**/pyproject.toml
path: ${{ inputs.build-subdirectory || '.' }}
upload-name-suffix: "-${{ steps.package.outputs.name }}${{ inputs.build-subdirectory && format('-{0}', inputs.build-subdirectory) || '' }}"

- name: Update pip
run: python -m pip install -U pip
# - name: Setup Python
# uses: actions/[email protected]
# with:
# python-version: ${{ inputs.python-version }}
# cache: pip
# cache-dependency-path: |
# **/setup.cfg
# **/pyproject.toml

- name: Install tox
run: python -m pip install ${{ inputs.tox-source }}
# - name: Update pip
# run: python -m pip install -U pip

- name: Build Wheels
if: inputs.build-subdirectory == ''
run: tox -e package${{ inputs.tox-factors }}
# - name: Install tox
# run: python -m pip install ${{ inputs.tox-source }}

- name: Build Wheels from Subdirectory
if: inputs.build-subdirectory != ''
run: tox -e package${{ inputs.tox-factors }} -- ${{ inputs.build-subdirectory }}
# - name: Build Wheels
# if: inputs.build-subdirectory == ''
# run: tox -e package${{ inputs.tox-factors }}

- name: Upload Package
uses: actions/[email protected]
with:
name: packages-${{ steps.package.outputs.name }}${{ inputs.build-subdirectory && format('-{0}', inputs.build-subdirectory) || '' }}
path: ${{ inputs.distribution-path }}
if-no-files-found: error
# - name: Build Wheels from Subdirectory
# if: inputs.build-subdirectory != ''
# run: tox -e package${{ inputs.tox-factors }} -- ${{ inputs.build-subdirectory }}

# - name: Upload Package
# uses: actions/[email protected]
# with:
# name: packages-${{ steps.package.outputs.name }}${{ inputs.build-subdirectory && format('-{0}', inputs.build-subdirectory) || '' }}
# path: ${{ inputs.distribution-path }}
# if-no-files-found: error

0 comments on commit d4baa92

Please sign in to comment.