diff --git a/.codecov.yml b/.codecov.yml index 38f09551..2db729c3 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -19,6 +19,7 @@ coverage: # https://codecov.readme.io/v1.0/docs/commit-status project: default: + informational: true target: 99% # specify the target coverage for each commit status threshold: 30% # allow this little decrease on project # https://github.com/codecov/support/wiki/Filtering-Branches @@ -27,6 +28,7 @@ coverage: # https://github.com/codecov/support/wiki/Patch-Status patch: default: + informational: true target: 50% # specify the target "X%" coverage to hit # threshold: 50% # allow this much decrease on patch changes: false diff --git a/.github/workflows/ci-cli.yml b/.github/workflows/ci-cli.yml new file mode 100644 index 00000000..6b1ed729 --- /dev/null +++ b/.github/workflows/ci-cli.yml @@ -0,0 +1,53 @@ +name: Test CLI + +on: + push: + branches: [main, "release/*"] + pull_request: + branches: [main, "release/*"] + +defaults: + run: + shell: bash + +jobs: + test-cli: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + python-version: ["3.10"] + timeout-minutes: 10 + steps: + - name: Checkout 🛎 + uses: actions/checkout@v4 + - name: Set up Python 🐍 ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: install package + run: | + pip install -e '.[cli]' + pip list + + - name: run CLI + working-directory: ./scripts + run: | + python -m lightning_utilities.cli version + python -m lightning_utilities.cli --help + + cli-guardian: + runs-on: ubuntu-latest + needs: test-cli + if: always() + steps: + - run: echo "${{ needs.test-cli.result }}" + - name: failing... + if: needs.test-cli.result == 'failure' + run: exit 1 + - name: cancelled or skipped... + if: contains(fromJSON('["cancelled", "skipped"]'), needs.test-cli.result) + timeout-minutes: 1 + run: sleep 90 diff --git a/.github/workflows/ci-scripts.yml b/.github/workflows/ci-scripts.yml index aa1838f5..1c626c37 100644 --- a/.github/workflows/ci-scripts.yml +++ b/.github/workflows/ci-scripts.yml @@ -16,14 +16,12 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-22.04", "macos-13", "windows-2022"] - python-version: ["3.8", "3.12"] - timeout-minutes: 35 + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + python-version: ["3.10"] + timeout-minutes: 15 steps: - name: Checkout 🛎 uses: actions/checkout@v4 - with: - submodules: recursive - name: Set up Python 🐍 ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a35df5e..f13f9c77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - CI: split and rename `custom-import` to `custom-import-code` ([#325](https://github.com/Lightning-AI/utilities/pull/325)) +### Fixed + +- fixed missing package's CLI ([#332](https://github.com/Lightning-AI/utilities/pull/332)) + ## [0.11.8] - 2024-10-15 diff --git a/MANIFEST.in b/MANIFEST.in index d1364248..dbf9643b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,4 @@ include CHANGELOG.md recursive-include src py.typed -graft src/lightning_utilities/test + graft requirements -prune src/lightning_utilities/cli diff --git a/src/lightning_utilities/cli/__main__.py b/src/lightning_utilities/cli/__main__.py index 1da7e88c..a0416b5f 100644 --- a/src/lightning_utilities/cli/__main__.py +++ b/src/lightning_utilities/cli/__main__.py @@ -2,18 +2,21 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # http://www.apache.org/licenses/LICENSE-2.0 # -import fire +import lightning_utilities from lightning_utilities.cli.dependencies import prune_pkgs_in_requirements, replace_oldest_ver def main() -> None: """CLI entry point.""" - fire.Fire({ + from fire import Fire + + Fire({ "requirements": { "prune-pkgs": prune_pkgs_in_requirements, "set-oldest": replace_oldest_ver, - } + }, + "version": lambda: print(lightning_utilities.__version__), })