Skip to content

Commit

Permalink
Merge branch 'pipfile-scripts' of https://github.com/noisebridge/Medi…
Browse files Browse the repository at this point in the history
…aBridge into 16-add-logging-to-wiki_to_netflixpy
  • Loading branch information
skyfenton committed Nov 8, 2024
2 parents 0ef5d81 + fb91359 commit 74f8511
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
6 changes: 5 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ name = "pypi"
[packages]
python-dotenv = "~=1.0"
requests = "~=2.26"
ruff = "~=0.7"
tqdm = "~=4.66"
typer = "~=0.12"

[dev-packages]
pytest = "~=8.3"
pytest-cov = "~=5.0"
ruff = "~=0.7"

[requires]
python_version = "3.12"

[scripts]
dev = "pipenv run python -m mediabridge.main"
test = "pipenv run pytest"
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# What is MediaBridge?

MediaBridge is a project being developed at the [Noisebridge](https://github.com/noisebridge) hackerspace in San Francisco, CA, USA. See also the [Noisebridge hompage](https://www.noisebridge.net/wiki/Noisebridge) and the [wiki entry for this project](https://www.noisebridge.net/wiki/Python_Project_Meetup).
MediaBridge is a project being developed at the [Noisebridge](https://github.com/noisebridge) hackerspace in San Francisco, CA, USA. See also the [Noisebridge homepage](https://www.noisebridge.net/wiki/Noisebridge) and the [wiki entry for this project](https://www.noisebridge.net/wiki/Python_Project_Meetup).

MediaBridge is in a _very_ early stage of the development. It's intended functionality is to provide recommendations that _bridge_ media types. So for example, you might say you're interested in the film _Saw_ and MediaBrige might recommend the video game _Silent Hill_ or a Stephen King book. For now, we are working on simply returning recommendations for movies, based on the [Netflix Prize dataset](https://www.kaggle.com/datasets/netflix-inc/netflix-prize-data).

Expand All @@ -12,7 +12,27 @@ 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).

### 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.

## Running main

Expand All @@ -37,7 +57,7 @@ To fix import errors and other Intellisense features, make sure you've let VSCod
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 74f8511

Please sign in to comment.