Skip to content

development

Oleksis Fraga Menéndez edited this page Aug 10, 2023 · 6 revisions

Development notes

Winget tools

  • 7Zip
➜ winget install -e  --id 7zip.7zip
  • Git
➜ winget install -e  --id Git.Git
  • AzureCLI
# https://learn.microsoft.com/en-us/azure/devops/repos/git/share-your-code-in-git-cmdline?view=azure-devops#download-and-install-azure-cli-and-add-azure-devops-extension
➜ winget install -e  --id Microsoft.AzureCLI
➜ az --version
# set environment variable for current process$env:AZURE_DEVOPS_EXT_PAT = 'xxxxxxxxxx'
➜ az devops login --organization https://dev.azure.com/oleksis
➜ az devops configure --defaults organization=https://dev.azure.com/oleksis project=yt-dlg
➜ git remote add azure https://dev.azure.com/oleksis/yt-dlg/_git/yt-dlg
➜ git push azure master
  • RealVNC.VNCViewer
➜ winget install -e --id RealVNC.VNCViewer
  • Advanced Installer
➜ winget install -e --id Caphyon.AdvancedInstaller

Winget Packages

  • Update package manifest
➜ wingetcreate update --urls "https://github.com/oleksis/youtube-dl-gui/releases/download/v1.8.4/yt-dlg-20221113.1.msi|x64" --version 1.8.4 -s -t ghp_PERSONAL_TOKEN yt-dlg.yt-dlg

Windows Development Environment

See

➜ py -3.11 -m venv venv
➜ .\venv\Scripts\Activate.ps1
➜ py -c "import sys; print(sys.version, sys.executable, sep='\n')"
➜ py -m pip install -U pip wheel setuptools
# See Notes: [wxPython Windows artifacts for Python 3.7 to 3.11]
➜ iwr -Uri "<https://artprodcca1.artifacts.visualstudio.com-artifact-wxPython-4.2.1a1-cp311-cp311-win_amd64.whl>" -OutFile wxPython-4.2.1a1-cp311-cp311-win_amd64.whl
➜ py -m pip install wxPython-4.2.1a1-cp311-cp311-win_amd64.whl
➜ py -m pip install polib -r requirements/requirements.in
➜ py setup.py build_trans
➜ py -m youtube_dl_gui

Tox

Use pip install tox>=4.1.2 for test diferents Python versions from Microsoft Store (3.7, 3.8, 3.9, 3.10)

Pyenv, Tox and py Launcher

See Pyenv and Py Launcher

➜ pyenv install 3.7.9 3.8.10 3.9.13 3.10.10 3.11.2
➜ pyenv local 3.7.9 3.8.10 3.9.13 3.10.10 3.11.2
➜ python310 -m venv venv
➜ .\venv\Scripts\Activate.ps1
➜ py -m pip install -e .[binaries]
➜ py -m pip install -r .\requirements\requirements-dev.in
➜ pyenv exec py -m tox

Docker

  • PyInstaller one dir
➜ pyinstaller -w -D --icon=youtube_dl_gui/data/pixmaps/youtube-dl-gui.ico --add-data="youtube_dl_gui/data;youtube_dl_gui/data" --add-data="youtube_dl_gui/locale;youtube_dl_gui/locale" --exclude-module=tests --version-file=file_version_info.txt --noconfirm --name=yt-dlg youtube_dl_gui/__main__.py

ManyLinux

➜ docker run --name yt-dlg -it -d --workdir /src -v ${pwd}:/src pyinstaller-manylinux -w -F --add-data=youtube_dl_gui/data:youtube_dl_gui/data --add-data=youtube_dl_gui/locale:youtube_dl_gui/locale --exclude-module=tests --name=yt-dlg youtube_dl_gui/__main__.py
  • Interactive terminal typing (tty)
➜ docker run --name ytdlg-pyenv -it --entrypoint bash --workdir /src -v ${pwd}:/src pyinstaller-manylinux

Dev Containers

Open in Dev Containers

Use devcontainer with dev container Features: Light-weight Desktop (desktop-lite)

VNC Sever

  • user: vscode

  • password: vscode

  • Public devcontainer to Packages (GHCR) Install devcontainer

npm install -g @devcontainers/cli
$env:PATH="$env:APPDATA\npm;$env:PATH"
devcontainer --version

Example of building and publishing an image

export CR_PAT='YOUR_TOKEN'
echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
devcontainer build --workspace-folder . --push true --image-name ghcr.io/USERNAME/IMAGE-NAME:latest
devcontainer up --workspace-folder .

Releases

Create a resume. What's Changed, Contributors

  • Compare from the lastest release https://github.com/oleksis/youtube-dl-gui/compare/v1.8.4...HEAD

Check

See all the Python base version from version-manifest.json

  • Select the Python base
    • Python 3.10.y

Python base

Search for 3.10.y in files like:

  • Review
    • youtube_dl_gui\version.py
    • .github/workflows/release.yml for Python base
    • .azure/azure-pipelines-build.yml
    • .python-version
    • setup.sh
    • file_version_info.txt
    • docs/yt-dlg.aip
    • snapcraft.yaml
  • Build

Install Open Build Service in openSUSE Tumbleweed

Install from GitHub

python3 -m pip install -U git+https://github.com/oleksis/youtube-dl-gui#egg=yt-dlg

Upload and Install from TestPyPI

twine upload --repository testpypi  "youtube-dl-gui/dist/yt_dlg-1.8.6*"

python3 -m pip install -U --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ yt-dlg

Distros GNU/Linux with glibc 2.31

Manylinux Timeline

  • Fedora 32
  • openSUSE Leap 15.3
  • Debian 11 Bullseye
  • Ubuntu 20.04 LTS (Focal Fossa)

Extras

  • wxPython using Wayland
GDK_BACKEND=x11 ./dist/yt-dlg