Skip to content

Commit

Permalink
fix: missing CLI (#332)
Browse files Browse the repository at this point in the history
* fix missing CLI
* ci update
* codecov / informational: true
* chlog

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Borda and pre-commit-ci[bot] authored Nov 19, 2024
1 parent 4bce827 commit 86c111c
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/ci-cli.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 3 additions & 5 deletions .github/workflows/ci-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include CHANGELOG.md
recursive-include src py.typed
graft src/lightning_utilities/test

graft requirements
prune src/lightning_utilities/cli
9 changes: 6 additions & 3 deletions src/lightning_utilities/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__),
})


Expand Down

0 comments on commit 86c111c

Please sign in to comment.