Skip to content

Commit

Permalink
Merge pull request #6 from NASA-AMMOS/riverma-improvements
Browse files Browse the repository at this point in the history
Improvements to SLIM-CLI
  • Loading branch information
riverma authored Aug 28, 2024
2 parents 2247e98 + 30afaa3 commit 36a42ec
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 51 deletions.
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<hr>

<div align="center">
Expand Down Expand Up @@ -36,6 +37,9 @@ SLIM CLI is a command-line tool designed to infuse SLIM best practices seamlessl
- [Changelog](#changelog)
- [Frequently Asked Questions (FAQ)](#frequently-asked-questions-faq)
- [Contributing](#contributing)
- [Local Development](#local-development)
- [Running Tests](#running-tests)
- [Publishing a New Version](#publishing-a-new-version)
- [License](#license)
- [Support](#support)

Expand Down Expand Up @@ -83,6 +87,7 @@ Or select a specific version, such as `X.Y.Z`:
pip install slim-cli==X.Y.Z



### Run Instructions

This section provides detailed commands to interact with the SLIM CLI. Each command includes various options that you can specify to tailor the tool's behavior to your needs.
Expand Down Expand Up @@ -133,7 +138,7 @@ This section provides detailed commands to interact with the SLIM CLI. Each comm
- `--best-practice-ids`: List of best practice IDs to apply and then deploy.
- `--repo-urls`: List of repository URLs for cloning if not already cloned; not used if `--repo-dir` is specified.
- `--repo-dir`: Specifies the directory of the repository where the best practice will be applied and changes committed.
- `--remote-name`: Specifies the remote to which the changes will be pushed.
- `--remote-name`: Specifies the remote to which the changes will be pushed. Format should be a GitHub-like URL base. For example `https://github.com/my_github_user`
- `--commit-message`: A message describing the changes for the commit.
- `--use-ai`: If specified, enables AI customization of the best practice before applying. False by default.
```bash
Expand Down Expand Up @@ -166,7 +171,6 @@ For guidance on how to interact with our team, please see our code of conduct lo

For guidance on our governance approach, including decision-making process and our various roles, please see our governance model at: [GOVERNANCE.md](GOVERNANCE.md)


### Local Development

For local development of SLIM CLI, clone the GitHub repository, create a virtual environment, and then install the package in editable mode into it:
Expand All @@ -180,6 +184,34 @@ pip install --editable .

The `slim` console-script is now ready in editable mode; changes you make to the source files under `src` are immediately reflected when run.

### Running Tests

We use `pytest` for testing. The test files are located within the `tests` subdirectory. To run the tests, ensure you are in the root directory of the project (where the `pyproject.toml` or `setup.py` is located) and have `pytest` installed. You can install `pytest` via pip:

```bash
pip install pytest
```

To execute all tests, simply run:

```bash
pytest
```

If you want to run a specific test file, you can specify the path to the test file:

```bash
pytest tests/jpl/slim/test_cli.py
```

This will run all the tests in the specified file. You can also use `pytest` options like `-v` for verbose output or `-s` to see print statements in the output:

```bash
pytest -v -s
```

### Publishing a New Version

To publish a new version of SLIM CLI to the Python Package Index, typically you'll update the `VERSION.txt` file; then do:
```bash
pip install build wheel twine
Expand All @@ -189,7 +221,6 @@ twine upload dist/*

(Note: this can and should eventually be automated with GitHub Actions.)


## License

See our: [LICENSE](LICENSE)
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies = [
'python-dotenv ~= 1.0.1',
'requests ~= 2.32.3',
'rich ~= 13.7.1',
'numpy ~= 2.0.2'

# Commenting-out tabulate since it's not used in the code currenty:
# 'tabulate ~= 0.9.0',
Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
pythonpath = src
Loading

0 comments on commit 36a42ec

Please sign in to comment.