Skip to content

Commit

Permalink
Package: support with and without isolation mode (#39)
Browse files Browse the repository at this point in the history
# New Features

* Added a 3rd overload for parameter `requirements` in job template `Package`:
  1. When `requirements` is empty  
     → build Python package with `build` in isolation mode. (old behavior)
  1. When `requirements` is `no-isolation`  
     → build Python package with `build` in non-isolation mode. (intended behavior since last release, but it had side-effects)
  1. When `requirements` is any other string  
     → build Python package with `setuptools` using the given `requirements.txt` file to install build dependencies.

# Bug Fixes

* Restore old behavior (run `build` in isolation mode using `venv`).
  • Loading branch information
umarcor authored Mar 1, 2022
2 parents 6ba0204 + 457870d commit 8cfda1f
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/Package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,38 @@ jobs:

- name: πŸ”¨ [build] Build Python package (source distribution)
if: inputs.requirements == ''
run: python -m build --no-isolation --sdist
run: python -m build --sdist

- name: πŸ”¨ [build] Build Python package (binary distribution - wheel)
if: inputs.requirements == ''
run: python -m build --wheel

# build (not isolated)

- name: πŸ”§ [build] Install dependencies for packaging and release
if: inputs.requirements == 'no-isolation'
run: python -m pip install build

- name: πŸ”¨ [build] Build Python package (source distribution)
if: inputs.requirements == 'no-isolation'
run: python -m build --no-isolation --sdist

- name: πŸ”¨ [build] Build Python package (binary distribution - wheel)
if: inputs.requirements == 'no-isolation'
run: python -m build --no-isolation --wheel

# setuptools

- name: πŸ”§ [setuptools] Install dependencies for packaging and release
if: inputs.requirements != ''
if: inputs.requirements != '' && inputs.requirements != 'no-isolation'
run: python -m pip install ${{ inputs.requirements }}

- name: πŸ”¨ [setuptools] Build Python package (source distribution)
if: inputs.requirements != ''
if: inputs.requirements != '' && inputs.requirements != 'no-isolation'
run: python setup.py sdist

- name: πŸ”¨ [setuptools] Build Python package (binary distribution - wheel)
if: inputs.requirements != ''
if: inputs.requirements != '' && inputs.requirements != 'no-isolation'
run: python setup.py bdist_wheel


Expand Down

0 comments on commit 8cfda1f

Please sign in to comment.