Skip to content

Commit

Permalink
ci: debug pkg create on multi-OS (#347)
Browse files Browse the repository at this point in the history
* debug pkg create on multi-OS
* split install action
* chlog
* os prune
  • Loading branch information
Borda authored Jan 8, 2025
1 parent 99989fd commit 407175f
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/actions/pkg-create/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ runs:
steps:
- name: Create package 📦
# python setup.py clean
run: python -m build
run: python -m build --verbose
shell: bash

- name: Check package 📦
working-directory: dist
run: |
ls -lh .
twine check *
twine check * --strict
shell: bash
31 changes: 15 additions & 16 deletions .github/actions/pkg-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Install and check package
description: installing and validation the package

inputs:
install-from:
description: "Define if the package is from archive or wheel"
required: true
import-name:
description: "Import name to test with after installation"
required: true
Expand Down Expand Up @@ -29,12 +32,24 @@ runs:
working-directory: ${{ inputs.pkg-folder }}
run: |
ls -lh
pip -V
echo "PKG_WHEEL=$(ls *.whl | head -n1)" >> $GITHUB_ENV
echo "PKG_SOURCE=$(ls *.tar.gz | head -n1)" >> $GITHUB_ENV
pip list
shell: bash

- name: Install package (archive)
if: ${{ inputs.install-from == 'archive' }}
working-directory: pypi/
run: |
set -ex
pip install '${{ env.PKG_SOURCE }}${{ inputs.pkg-extras }}' \
--force-reinstall ${{ inputs.pip-flags }}
pip list
shell: bash

- name: Install package (wheel)
if: ${{ inputs.install-from == 'wheel' }}
working-directory: ${{ inputs.pkg-folder }}
run: |
set -ex
Expand All @@ -61,19 +76,3 @@ runs:
pip freeze > _reqs.txt
pip uninstall -y -r _reqs.txt
shell: bash

- name: Install package (archive)
working-directory: pypi/
run: |
set -ex
pip install '${{ env.PKG_SOURCE }}${{ inputs.pkg-extras }}' \
--force-reinstall ${{ inputs.pip-flags }}
pip list
shell: bash

- name: package check
run: |
set -ex
python -c "import ${{ inputs.import-name }} as pkg; print(f'version: {pkg.__version__}')"
python -c '${{ inputs.custom-import-code }}'
shell: bash
15 changes: 13 additions & 2 deletions .github/workflows/check-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,21 @@ jobs:
with:
name: ${{ inputs.artifact-name }}
path: pypi
- name: Installing package 📦
timeout-minutes: 20
- name: Installing package 📦 as Archive
timeout-minutes: 10
uses: ./.cicd/.github/actions/pkg-install
with:
install-from: "archive"
artifact-name: ${{ inputs.artifact-name }}
pkg-extras: ${{ inputs.install-extras }}
pip-flags: ${{ inputs.install-flags }}
import-name: ${{ inputs.import-name }}
custom-import-code: ${{ inputs.custom-import-code }}
- name: Installing package 📦 as Wheel
timeout-minutes: 10
uses: ./.cicd/.github/actions/pkg-install
with:
install-from: "wheel"
artifact-name: ${{ inputs.artifact-name }}
pkg-extras: ${{ inputs.install-extras }}
pip-flags: ${{ inputs.install-flags }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-use-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
custom-import-code: "import fire"
build-matrix: |
{
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
"os": ["ubuntu-latest", "macos-latest"],
"python-version": ["3.10"]
}
testing-matrix: |
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Bump minimal Python version to be 3.9 ([#331](https://github.com/Lightning-AI/utilities/pull/331))


- CI: split install action for archive and wheel ([#347](https://github.com/Lightning-AI/utilities/pull/347))


## [0.11.9] - 2024-11-19

### Changed
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def _requirement_extras(path_req: str = _PATH_REQUIRE) -> dict:
url=about.__homepage__,
download_url="https://github.com/Lightning-AI/utilities",
license=about.__license__,
# fixme: somehow the `.cli` is missing in created package
packages=find_packages(where="src"),
package_dir={"": "src"},
long_description=readme,
Expand Down

0 comments on commit 407175f

Please sign in to comment.