Skip to content

Commit

Permalink
README enhanced
Browse files Browse the repository at this point in the history
  • Loading branch information
tschm committed Jul 31, 2023
1 parent 72ae19b commit 0e82eac
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,34 @@
[![Apache 2.0 License](https://img.shields.io/badge/License-APACHEv2-brightgreen.svg)](https://github.com/cvxgrp/cvxcli/blob/master/LICENSE)
[![PyPI download month](https://img.shields.io/pypi/dm/cvxcli.svg)](https://pypi.python.org/pypi/cvxcli/)
[![Coverage Status](https://coveralls.io/repos/github/cvxgrp/simulator/badge.png?branch=main)](https://coveralls.io/github/cvxgrp/cvxcli?branch=main)

We demonstrate how to deploy to simple command line apps using pipx.

## Install pipx

The current way to deploy apps is to use [pipx](https://pypa.github.io/pipx/).
The tool that creates a virtual environment for each app.

For the installation of pipx please refer to the [pipx documentation](https://pypa.github.io/pipx/installation/).

## Install cvxcli with pipx

cvxcli has been deployed to PyPI like any other Python package. It could be
installed via pip but we advise against that.

cvxcli is not exactly a package you should use as a dependency in your own code.
cvxcli is the home for two apps that are meant to be used from the command line.
So please install via pipx

```bash
pipx cvxcli
```

This command will create a virtual environment for cvxcli and install the package
into that environment.

Please note that you **do not need poetry** to be installed on your machine.

## Using the apps

## Uninstall cvxcli with pipx
2 changes: 1 addition & 1 deletion cvx/cli/smallest_eigenvalue.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ def smallest_ev(bson_file) -> None:
print(np.min(np.linalg.eigh(matrix)[0]))


def main(): # pragma: no cover
def main(): # pragma: no cover
fire.Fire(smallest_ev)
1 change: 0 additions & 1 deletion tests/test_smallest_eigenvalue.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ def test_smallest_eigenvalue(resource_dir):
file = resource_dir / "test.bson"

smallest_ev(file)

5 changes: 2 additions & 3 deletions tests/test_weather.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import pytest
import mock
import pytest

from cvx.cli.weather import cli


def test_weather():
temperature = cli(metric="temperature")
print(temperature)
Expand All @@ -20,5 +21,3 @@ def test_server_down():
with mock.patch("requests.get", return_value=mock.Mock(status_code=500)):
with pytest.raises(ConnectionError):
cli("temperature")


0 comments on commit 0e82eac

Please sign in to comment.