Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing CLI #332

Merged
merged 9 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading