1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-11-18 23:45:23 +00:00

[build] Migrate to pyproject.toml and hatchling

Authored by: bashonly
This commit is contained in:
bashonly
2024-02-11 15:13:03 +01:00
committed by Simon Sawicki
parent 868d2f60a7
commit 775cde82dc
8 changed files with 130 additions and 157 deletions

View File

@@ -6,8 +6,8 @@ on:
paths:
- "yt_dlp/**.py"
- "!yt_dlp/version.py"
- "setup.py"
- "bundle/*.py"
- "pyproject.toml"
concurrency:
group: release-master
permissions:

View File

@@ -18,7 +18,7 @@ jobs:
- name: Check for new commits
id: check_for_new_commits
run: |
relevant_files=("yt_dlp/*.py" ':!yt_dlp/version.py' "setup.py" "bundle/*.py")
relevant_files=("yt_dlp/*.py" ':!yt_dlp/version.py' "bundle/*.py" "pyproject.toml")
echo "commit=$(git log --format=%H -1 --since="24 hours ago" -- "${relevant_files[@]}")" | tee "$GITHUB_OUTPUT"
release:

View File

@@ -266,14 +266,19 @@ jobs:
run: |
python devscripts/update-version.py -c "${{ env.channel }}" -r "${{ env.target_repo }}" -s "${{ env.suffix }}" "${{ env.version }}"
python devscripts/make_lazy_extractors.py
sed -i -E "s/(name=')[^']+(', # package name)/\1${{ env.pypi_project }}\2/" setup.py
sed -i -E '0,/(name = ")[^"]+(")/s//\1${{ env.pypi_project }}\2/' pyproject.toml
- name: Build
run: |
rm -rf dist/*
make pypi-files
printf '%s\n\n' \
'Official repository: <https://github.com/yt-dlp/yt-dlp>' \
'**PS**: Some links in this document will not work since this is a copy of the README.md from Github' > ./README.md.new
cat ./README.md >> ./README.md.new && mv -f ./README.md.new ./README.md
python devscripts/set-variant.py pip -M "You installed yt-dlp with pip or using the wheel from PyPi; Use that to update"
python setup.py sdist bdist_wheel
make clean-cache
python -m build --no-isolation .
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1