Skip to content

Commit 407175f

Browse files
authored
ci: debug pkg create on multi-OS (#347)
* debug pkg create on multi-OS * split install action * chlog * os prune
1 parent 99989fd commit 407175f

File tree

6 files changed

+34
-22
lines changed

6 files changed

+34
-22
lines changed

.github/actions/pkg-create/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ runs:
66
steps:
77
- name: Create package 📦
88
# python setup.py clean
9-
run: python -m build
9+
run: python -m build --verbose
1010
shell: bash
1111

1212
- name: Check package 📦
1313
working-directory: dist
1414
run: |
1515
ls -lh .
16-
twine check *
16+
twine check * --strict
1717
shell: bash

.github/actions/pkg-install/action.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Install and check package
22
description: installing and validation the package
33

44
inputs:
5+
install-from:
6+
description: "Define if the package is from archive or wheel"
7+
required: true
58
import-name:
69
description: "Import name to test with after installation"
710
required: true
@@ -29,12 +32,24 @@ runs:
2932
working-directory: ${{ inputs.pkg-folder }}
3033
run: |
3134
ls -lh
35+
pip -V
3236
echo "PKG_WHEEL=$(ls *.whl | head -n1)" >> $GITHUB_ENV
3337
echo "PKG_SOURCE=$(ls *.tar.gz | head -n1)" >> $GITHUB_ENV
3438
pip list
3539
shell: bash
3640

41+
- name: Install package (archive)
42+
if: ${{ inputs.install-from == 'archive' }}
43+
working-directory: pypi/
44+
run: |
45+
set -ex
46+
pip install '${{ env.PKG_SOURCE }}${{ inputs.pkg-extras }}' \
47+
--force-reinstall ${{ inputs.pip-flags }}
48+
pip list
49+
shell: bash
50+
3751
- name: Install package (wheel)
52+
if: ${{ inputs.install-from == 'wheel' }}
3853
working-directory: ${{ inputs.pkg-folder }}
3954
run: |
4055
set -ex
@@ -61,19 +76,3 @@ runs:
6176
pip freeze > _reqs.txt
6277
pip uninstall -y -r _reqs.txt
6378
shell: bash
64-
65-
- name: Install package (archive)
66-
working-directory: pypi/
67-
run: |
68-
set -ex
69-
pip install '${{ env.PKG_SOURCE }}${{ inputs.pkg-extras }}' \
70-
--force-reinstall ${{ inputs.pip-flags }}
71-
pip list
72-
shell: bash
73-
74-
- name: package check
75-
run: |
76-
set -ex
77-
python -c "import ${{ inputs.import-name }} as pkg; print(f'version: {pkg.__version__}')"
78-
python -c '${{ inputs.custom-import-code }}'
79-
shell: bash

.github/workflows/check-package.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,21 @@ jobs:
148148
with:
149149
name: ${{ inputs.artifact-name }}
150150
path: pypi
151-
- name: Installing package 📦
152-
timeout-minutes: 20
151+
- name: Installing package 📦 as Archive
152+
timeout-minutes: 10
153153
uses: ./.cicd/.github/actions/pkg-install
154154
with:
155+
install-from: "archive"
156+
artifact-name: ${{ inputs.artifact-name }}
157+
pkg-extras: ${{ inputs.install-extras }}
158+
pip-flags: ${{ inputs.install-flags }}
159+
import-name: ${{ inputs.import-name }}
160+
custom-import-code: ${{ inputs.custom-import-code }}
161+
- name: Installing package 📦 as Wheel
162+
timeout-minutes: 10
163+
uses: ./.cicd/.github/actions/pkg-install
164+
with:
165+
install-from: "wheel"
155166
artifact-name: ${{ inputs.artifact-name }}
156167
pkg-extras: ${{ inputs.install-extras }}
157168
pip-flags: ${{ inputs.install-flags }}

.github/workflows/ci-use-checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
custom-import-code: "import fire"
6868
build-matrix: |
6969
{
70-
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
70+
"os": ["ubuntu-latest", "macos-latest"],
7171
"python-version": ["3.10"]
7272
}
7373
testing-matrix: |

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
- Bump minimal Python version to be 3.9 ([#331](https://github.com/Lightning-AI/utilities/pull/331))
2424

2525

26+
- CI: split install action for archive and wheel ([#347](https://github.com/Lightning-AI/utilities/pull/347))
27+
28+
2629
## [0.11.9] - 2024-11-19
2730

2831
### Changed

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def _requirement_extras(path_req: str = _PATH_REQUIRE) -> dict:
5454
url=about.__homepage__,
5555
download_url="https://github.com/Lightning-AI/utilities",
5656
license=about.__license__,
57-
# fixme: somehow the `.cli` is missing in created package
5857
packages=find_packages(where="src"),
5958
package_dir={"": "src"},
6059
long_description=readme,

0 commit comments

Comments
 (0)