Metadata-Version: 2.1
Name: nubium-dude
Version: 1.0.7
Summary: Developer utilities to help manage nubium applications and other typical maintenance tasks
Home-page: https://gitlab.corp.redhat.com/mkt-ops-de/dude
Author: RedHat Marketing Operations Data Engineering
Author-email: mkt-ops-de@redhat.com,
License: MIT
Platform: UNKNOWN
Requires-Python: >=3.7
Description-Content-Type: text/markdown; charset=UTF-8
Requires-Dist: black (<22.0,>=21.6b0)
Requires-Dist: click (<9.0.0,>=8.0.1)
Requires-Dist: nubium-schemas (<2.0.0,>=1.1.2a)
Requires-Dist: nubium-utils[confluent] (>=0.27.0a18)
Requires-Dist: python-dotenv (>=0.19.0)
Requires-Dist: virtualenv-api (<3.0.0,>=2.1.18)
Requires-Dist: virtualenv (<21.0.0,>=20.4.7)
Provides-Extra: all
Requires-Dist: coverage[toml] ; extra == 'all'
Requires-Dist: pylint ; extra == 'all'
Requires-Dist: pytest (>=6.2.2) ; extra == 'all'
Requires-Dist: pytest-cov ; extra == 'all'
Provides-Extra: test
Requires-Dist: coverage[toml] ; extra == 'test'
Requires-Dist: pylint ; extra == 'test'
Requires-Dist: pytest (>=6.2.2) ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'

# dude CLI

# Installation and Setup
```
pipx install nubium-dude
```

## Further setup
In order to use `dude`, you will need to set a few things up.

## Environment Variables and Configuration

`dude` can largely be configured via a `config.env` file, an example of which
can be found at `./dude/config.env` (which is also used by default if one not provided. It
will basically set any possible working defaults). Simply set the path of:

`DUDE_CONFIG_DOTENV`

Additionally, you'll likely need to set, at minimum:

`DUDE_CREDENTIALS_DOTENV`={path to a .env with various credentials}

NOTE: this will likely change in the future and secrets will be downloaded by default for you.


Lastly, there are (new) variables related to `nubium-utils`; these can just go in your `dude` creds.env file:


```
RHOSAK_USERNAME=(same as preprod)
RHOSAK_PASSWORD=(same as preprod)
TEST_CLUSTER=(ask Tim)
```

# Usage

## examples of common tasks

- Create topics:

    `dude topics create topic_a,topic_b`


- Build requirements.txt:

    (in app root folder): `dude app build_reqs`


- Run app:
    
    (in app root folder): `dude app run`


## Known limitations:

- Currently, no proper error handling if topics already exist (create) or are missing (delete); you will
  need to validate whether your topics exist else it will fail.

- Test coverage is almost non-existent.


# Development
There's two ways to develop: 

## option 1
if you only need to make changes to `dude`, the easiest thing to do is just install an
editable version of the library:
```
pipx install -e /PATH/TO/DUDE/REPO
```

## option 2
Another option more suitable for coordinating changes that involve multiple nubium
libraries is instead making a new venv, sourcing it, and then:
```
pip install -e /PATH/TO/DUDE/REPO
```
then you can install `-e` versions of all the `nubium-{}` packages. You'll of course need to
source this environment when you test.

### once we finish adding more tests...
Run tests via
```
pipx install tox
tox && tox -e cov
```


