Skip to content

Commit

Permalink
Update documentation for scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfenton committed Nov 8, 2024
1 parent c3df248 commit 0575e6d
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,34 @@ This code uses Python 3. It is tested on Python 3.12, but will probably work on

To install the project dependencies, first install pipenv globally with `pip install pipenv`. Then create a virtual env/install dependencies with `pipenv install --dev`.

To run code in the project, prefix your command with `pipenv run`, a la `pipenv run python -m mediabridge.main`.
To run code in the project, prefix your command with `pipenv run` (ex. `pipenv run python -m mediabridge.main` runs the main.py script).

## Running main

The "main.py" script is part of the `mediabridge` module. Additionally, running it requires `pipenv run` as mentioned above. So the full command to run the main script (or any other script in the `mediabridge` module) is:

```
pipenv run python -m mediabridge.main
```

This should be run from the root of the project directory.

### Running from VSCode
### Using the pipenv environment in VSCode

To fix import errors and other Intellisense features, make sure you've let VSCode know about your pipenv environment. To do that:

1. Open the VSCode command palette (Control/Command+SHIFT+P)
2. Search for and select the "Python: Select Interpreter" command
3. Choose the option that starts with `MediaBridge`

## Running code

The "main.py" script is part of the `mediabridge` module, and running it requires `pipenv run`, as mentioned above. However, for convenience, you can simply run the dev script:

```
pipenv run dev
```

This is currently just an alias to run the main script using `pipenv run python -m mediabridge.main`.

If you encounter a ModuleNotFoundError, make sure you are in the root directory, as the `mediabridge` directory is the module Pipenv is trying to reference.

## Testing

To run unit tests,

1. Ensure `pipenv` is installed
2. Run `pipenv run pytest`
2. Run `pipenv run test`

There is a GitHub actions "check" for passing tests, which must pass for you to be able to merge your PR.

Expand Down

0 comments on commit 0575e6d

Please sign in to comment.