Skip to content

Commit

Permalink
Add vscode linting defaults, add documentation about venv use and loc…
Browse files Browse the repository at this point in the history
…al dev
  • Loading branch information
vicwomg committed Aug 28, 2024
1 parent b9ef030 commit dc170ce
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 32 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
*.pyc
*.swp
.vscode/
.venv/
.venv*
__pycache__/
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"pylint.args": ["--rcfile=${workspaceFolder}/code_quality/.pylintrc"]
}
40 changes: 35 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,36 @@ Windows / OSX / Linux:

### Install pikaraoke

Optional: create a virtual environment. Recommended if you might have conflicting python programs installed. Probably not a concern for many users. (See: https://docs.python.org/3/library/venv.html)
Optional: create a virtual environment. Recommended if you might have conflicting python programs installed. This may not be a concern for most users, but is generally good practice (See: https://docs.python.org/3/library/venv.html). On the other hand, if you install globally with pip, you can launch pikaraoke without activating a venv each time.

Install pikaraoke from PyPi on the host:
```sh
# Create a .venv directory in the homedir
python -m venv ~/.venv
# Activate your virtual environment
source ~/.venv/bin/activate
```

Install pikaraoke from PyPi on the host into your venv:

```sh
# Install pikaraoke from PyPi
pip install pikaraoke
```

Note: if you did not use a venv, you may need to add the `--break-system-packages` parameter to ignore the warning and install pikaraoke and its dependencies globally.

### Run

Pikaraoke is now installed in `$PATH` with the command line interface `pikaraoke`. Start by
calling the pikaraoke command.
Pikaraoke is now installed in the `$PATH` with the command line interface `pikaraoke`. Start by calling the pikaraoke command.

```sh
# Run pikaraoke
pikaraoke
```

Virtual env users: note that if you close your terminal, you'll need to run
`source ~/.venv/bin/activate` again before launching pikaraoke again.

### More Options

See the help command `pikaraoke --help` for available options.
Expand All @@ -104,7 +115,26 @@ See the help command `pikaraoke --help` for available options.

See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for help with issues.

## Install from Repository (Legacy)
## Developing pikaraoke

The Pikaraoke project utilizes poetry dependency management and local development.

- Install poetry: https://python-poetry.org/docs/#installation
- Clone this repo.

From the pikaraoke directory:

```sh
# install dependencies
poetry install
```

```sh
# Run pikaraoke from the local codebase
poetry run pikaraoke
```

## Run from Repository (Legacy)

See [README](../scripts/README.md) for how to install pikaraoke cloning this repo and using the
scripts. This is a legacy method and may no longer work.
10 changes: 3 additions & 7 deletions pikaraoke/karaoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@
from unidecode import unidecode

from pikaraoke.lib.file_resolver import FileResolver
from pikaraoke.lib.get_platform import (
get_ffmpeg_version,
get_os_version,
get_platform,
is_raspberry_pi,
supports_hardware_h264_encoding,
)
from pikaraoke.lib.get_platform import (get_ffmpeg_version, get_os_version,
get_platform, is_raspberry_pi,
supports_hardware_h264_encoding)


# Support function for reading lines from ffmpeg stderr without blocking
Expand Down
109 changes: 90 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dc170ce

Please sign in to comment.