diff options
| author | Astounds <kirito@disroot.org> | 2026-05-30 00:34:34 -0500 |
|---|---|---|
| committer | Astounds <kirito@disroot.org> | 2026-05-30 00:34:34 -0500 |
| commit | 4e54a34d87056067c0110c00282f6a3248dc5f6f (patch) | |
| tree | d85617414cb083447523238803ba88146a0dc543 /docs/HACKING.md | |
| parent | ed2af5e3d7a3fcd5a1f383003b6723f5d419f634 (diff) | |
| download | yt-local-4e54a34d87056067c0110c00282f6a3248dc5f6f.tar.lz yt-local-4e54a34d87056067c0110c00282f6a3248dc5f6f.tar.xz yt-local-4e54a34d87056067c0110c00282f6a3248dc5f6f.zip | |
Use pip-compile --generate-hashes in the Docker build stage so that
the runtime stage installs pinned dependencies with verified integrity,
ensuring fully reproducible container builds.
- Add Docker section to README
- Fix Python badge (3.7+ → 3.11+) and outdated docs links
- Upgrade pip, setuptools, and wheel in Dockerfile to fix grype findings
Diffstat (limited to 'docs/HACKING.md')
| -rw-r--r-- | docs/HACKING.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/HACKING.md b/docs/HACKING.md index 25f5449..24ffccf 100644 --- a/docs/HACKING.md +++ b/docs/HACKING.md @@ -14,9 +14,9 @@ # Testing and releases -* This project uses pytest. To install pytest and any future dependencies needed for development, run pip3 on the requirements-dev.txt file. To run tests, run `python3 -m pytest` rather than just `pytest` because the former will make sure the toplevel directory is in Python's import search path. +* This project uses pytest. Run `pip install pip-tools && pip-compile --generate-hashes requirements-dev.txt -o requirements-dev.lock && pip-sync requirements-dev.lock` to install everything, then `python3 -m pytest` to run tests. -* To build releases for Windows, run `python3 generate_release.py [intended python version here, without v infront]`. The required software (such as 7z, git) are listed in the `generate_release.py` file. For instance, wine is required if building on GNU+Linux. The build script will automatically download the embedded Python release to include. Use the latest release of Python 3.7.x so that Vista will be supported. See https://github.com/user234683/youtube-local/issues/6#issuecomment-672608388 +* To build releases for Windows, run `python3 generate_release.py [intended python version here, without v infront]`. The required software (such as 7z, git) are listed in the `generate_release.py` file. For instance, wine is required if building on GNU+Linux. The build script will automatically download the embedded Python release to include. ## Overview of the software architecture @@ -30,9 +30,9 @@ ### Flask and Gevent -* The `youtube` handler in server.py then delegates the request to the Flask yt_app object, which the rest of the project uses. [Flask](https://flask.palletsprojects.com/en/1.1.x/) is a web application framework that makes handling requests easier than accessing the raw WSGI requests. Flask (Werkzeug specifically) figures out which function to call for a particular url. Each request handling function is registered into Flask's routing table by using function annotations above it. The request handling functions are always at the bottom of the file for a particular youtube page (channel, watch, playlist, etc.), and they're where you want to look to see how the response gets constructed for a particular url. Miscellaneous request handlers that don't belong anywhere else are located in `__init__.py`, which is where the `yt_app` object is instantiated. +* The `youtube` handler in server.py then delegates the request to the Flask yt_app object, which the rest of the project uses. [Flask](https://flask.palletsprojects.com/en/stable/) is a web application framework that makes handling requests easier than accessing the raw WSGI requests. Flask (Werkzeug specifically) figures out which function to call for a particular url. Each request handling function is registered into Flask's routing table by using function annotations above it. The request handling functions are always at the bottom of the file for a particular youtube page (channel, watch, playlist, etc.), and they're where you want to look to see how the response gets constructed for a particular url. Miscellaneous request handlers that don't belong anywhere else are located in `__init__.py`, which is where the `yt_app` object is instantiated. -* The actual html for yt-local is generated using Jinja templates. Jinja lets you embed a Python-like language inside html files so you can use constructs such as for loops to construct the html for a list of 30 videos given a dictionary with information for those videos. Jinja is included as part of Flask. It has some annoying differences from Python in a lot of details, so check the [docs here](https://jinja.palletsprojects.com/en/2.11.x/) when you use it. The request handling functions will pass the information that has been scraped from YouTube into these templates for the final result. +* The actual html for yt-local is generated using Jinja templates. Jinja lets you embed a Python-like language inside html files so you can use constructs such as for loops to construct the html for a list of 30 videos given a dictionary with information for those videos. Jinja is included as part of Flask. It has some annoying differences from Python in a lot of details, so check the [docs here](https://jinja.palletsprojects.com/en/stable/) when you use it. The request handling functions will pass the information that has been scraped from YouTube into these templates for the final result. * The project uses the gevent library for parallelism (such as for launching requests in parallel), as opposed to using the async keyword. ### util.py @@ -65,7 +65,7 @@ * You'll want to have a utility or IDE that can perform full text search on a repository, since this is crucial for navigating unfamiliar codebases to figure out where certain strings appear or where things get defined. -* If you're confused what the purpose of a particular line/section of code is, you can use the "git blame" feature on github (click the line number and then the three dots) to view the commit where the line of code was created and check the commit message. This will give you an idea of how it was put together. +* If you're confused what the purpose of a particular line/section of code is, you can use the `git blame` feature (click the line number and then the three dots) to view the commit where the line of code was created and check the commit message. This will give you an idea of how it was put together. ## OpenRC init |
