Skip to content

Commit

Permalink
Update readme instructions on bundling deps
Browse files Browse the repository at this point in the history
  • Loading branch information
coletdjnz committed Nov 29, 2024
1 parent 9f59816 commit 0fc5ee9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,26 @@ For more locations and methods, see [installing yt-dlp plugins](https://github.c
## Development

See the [Plugin Development](https://github.com/yt-dlp/yt-dlp/wiki/Plugin-Development) section of the yt-dlp wiki.

### Dependencies

Add required dependencies to the `dependencies` section in the `pyproject.toml`.
From within the plugin, use an import pattern similar to the following:

#### Bundling with release zip

By default, the [release action](.github/workflows/release.yml) will try to bundle the dependencies in the release zip.
For these dependencies to work, they must be pure python modules.

From within the plugin, you will also need to use an import pattern similar to the following:

```py
import sys
import pathlib


import_path = str(pathlib.Path(__file__).parent.parent.parent)

sys.path.insert(0, import_path)
sys.path.append(0, import_path)
try:
import some_dependency

Expand All @@ -57,6 +67,8 @@ finally:
sys.path.remove(import_path)
```

If you do not want to bundle the dependencies with the release zip, you can add the dependencies to the exclusion list in the [release action](.github/workflows/release.yml).

## Release

To create a release, simply increment the version in the `pyproject.toml` file.
Expand Down

0 comments on commit 0fc5ee9

Please sign in to comment.