From bd1efe5f1a16521934d5240a47bdd32cecce24d8 Mon Sep 17 00:00:00 2001 From: Jirka Date: Tue, 19 Jul 2022 12:27:16 +0200 Subject: [PATCH 1/4] add UI for install all --- src/lightning/__setup__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lightning/__setup__.py b/src/lightning/__setup__.py index 22c3fd2b847cd..a1cb05fa32224 100644 --- a/src/lightning/__setup__.py +++ b/src/lightning/__setup__.py @@ -39,6 +39,7 @@ def _adjust_manifest(**kwargs: Any) -> None: lines += [ "recursive-include src *.md" + os.linesep, "recursive-include requirements *.txt" + os.linesep, + "recursive-include src/lightning_app/ui *" + os.linesep, ] with open(manifest_path, "w") as fp: fp.writelines(lines) From bf7e121d4f6c2b425e025a755db2f10202437fb0 Mon Sep 17 00:00:00 2001 From: Jirka Date: Tue, 19 Jul 2022 12:33:40 +0200 Subject: [PATCH 2/4] fstr --- .github/workflows/ci_pr-gatekeeper.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_pr-gatekeeper.yml b/.github/workflows/ci_pr-gatekeeper.yml index d76801fd529a5..92215edd3c107 100644 --- a/.github/workflows/ci_pr-gatekeeper.yml +++ b/.github/workflows/ci_pr-gatekeeper.yml @@ -26,7 +26,7 @@ jobs: run: | patterns = ('docs/source-${{ matrix.pkg }}', 'src/lightning_${{ matrix.pkg }}', 'tests/tests_${{ matrix.pkg }}') changed = any(p in "${{steps.changed-files.outputs.all_changed_and_modified_files}}" for p in patterns) - print('::set-output name=files::' + int(changed)) + print(f'::set-output name=files::{int(changed)}') shell: python - uses: octodemo/pr-gatekeeper@main if: steps.touched.outputs.files == 1 From 9d3c0b1afff2138454c8890f1d9673f0e5818c79 Mon Sep 17 00:00:00 2001 From: Jirka Date: Tue, 19 Jul 2022 19:51:10 +0200 Subject: [PATCH 3/4] ci --- .github/actions/pkg-check/action.yml | 18 ++++++++++++++++++ .github/actions/pkg-install/action.yml | 23 +++++++++++++++++------ .github/workflows/ci_pkg-install.yml | 7 ------- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/.github/actions/pkg-check/action.yml b/.github/actions/pkg-check/action.yml index dc6031a1b769c..128fbdfc77954 100644 --- a/.github/actions/pkg-check/action.yml +++ b/.github/actions/pkg-check/action.yml @@ -33,3 +33,21 @@ runs: - name: copy/export pkg run: cp dist/* pypi/ shell: bash + + - name: Unzip packages + if: ${{ inputs.pkg-name != '' }} + working-directory: dist + run: for file in `ls *.gz`; do tar -xzf $file; done + shell: bash + + - name: Check single pkg/folder + if: ${{ inputs.pkg-name != '' }} + working-directory: dist + run: | + import os, glob, pathlib, shutil + # list folders without ending .egg-info + dirs = [d for d in glob.glob(os.path.join("*", "src", "*")) if not d.endswith(".egg-info")] + assert len(dirs) == 1 + # cleaning + shutil.rmtree(pathlib.Path(dirs[0]).parent.parent) + shell: python diff --git a/.github/actions/pkg-install/action.yml b/.github/actions/pkg-install/action.yml index b5253cd1779c2..652a82d76155b 100644 --- a/.github/actions/pkg-install/action.yml +++ b/.github/actions/pkg-install/action.yml @@ -4,7 +4,8 @@ description: installing and validationg the package inputs: pkg-name: description: package name for import - required: true + required: false + default: "" pip-flags: description: additional pil install flags required: false @@ -13,14 +14,24 @@ inputs: runs: using: "composite" steps: + - name: Determine package name + if: ${{ inputs.pkg-import == '' }} + working-directory: ./dist + run: python -c "import glob ; ls = glob.glob('*.tar.gz') ; name = '_'.join(ls[0].split('-')[:-1]) ; print(f'PKG_NAME={name}')" >> $GITHUB_ENV + shell: bash + + - name: Pass package name + if: ${{ inputs.pkg-import != '' }} + run: echo "PKG_NAME=${{ inputs.pkg-name }}" >> $GITHUB_ENV + shell: bash - name: Install | Uninstall package - archive working-directory: ./dist run: | - pip install *.tar.gz ${{ inputs.pip-flags }} + pip install *.tar.gz ${PKG_NAME} pip list | grep lightning - python -c "import ${{ inputs.pkg-name }} ; print(${{ inputs.pkg-name }}.__version__)" - pip uninstall -y ${{ inputs.pkg-name }} + python -c "import ${PKG_NAME} ; print(${PKG_NAME}.__version__)" + pip uninstall -y ${PKG_NAME} shell: bash - name: Install | Uninstall package - wheel @@ -28,6 +39,6 @@ runs: run: | pip install *.whl ${{ inputs.pip-flags }} pip list | grep lightning - python -c "import ${{ inputs.pkg-name }} ; print(${{ inputs.pkg-name }}.__version__)" - pip uninstall -y ${{ inputs.pkg-name }} + python -c "import ${PKG_NAME} ; print(${PKG_NAME}.__version__)" + pip uninstall -y ${PKG_NAME} shell: bash diff --git a/.github/workflows/ci_pkg-install.yml b/.github/workflows/ci_pkg-install.yml index c2df822d502de..1c9002965e8ca 100644 --- a/.github/workflows/ci_pkg-install.yml +++ b/.github/workflows/ci_pkg-install.yml @@ -60,14 +60,7 @@ jobs: name: ci-packages-${{ github.sha }} path: pypi - - name: Determine package name - if: ${{ inputs.pkg-import == '' }} - working-directory: ./dist - run: python -c "import glob ; ls = glob.glob('*.tar.gz') ; name = '_'.join(ls[0].split('-')[:-1]) ; print(f'PKG_NAME={name}')" >> $GITHUB_ENV - - uses: ./.github/actions/pkg-install - with: - pkg-name: ${{ env.PKG_NAME }} install-meta-src: needs: install-standalone From 7f85196ff81fb4b7d116bdec0138c26b7db3e352 Mon Sep 17 00:00:00 2001 From: Jirka Date: Tue, 19 Jul 2022 19:57:10 +0200 Subject: [PATCH 4/4] print --- .github/actions/pkg-check/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/pkg-check/action.yml b/.github/actions/pkg-check/action.yml index 128fbdfc77954..aa0ecd3db4968 100644 --- a/.github/actions/pkg-check/action.yml +++ b/.github/actions/pkg-check/action.yml @@ -47,6 +47,7 @@ runs: import os, glob, pathlib, shutil # list folders without ending .egg-info dirs = [d for d in glob.glob(os.path.join("*", "src", "*")) if not d.endswith(".egg-info")] + print(dirs) assert len(dirs) == 1 # cleaning shutil.rmtree(pathlib.Path(dirs[0]).parent.parent)