mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-10-03 07:41:27 +02:00
Compare commits
6 Commits
d6bf35001d
...
b6db885167
Author | SHA1 | Date | |
---|---|---|---|
|
b6db885167 | ||
|
4666124e36 | ||
|
7d1240dd2f | ||
|
b1f8ead16a | ||
|
9d2e339b50 | ||
|
46221c90dd |
10
MANIFEST.in
10
MANIFEST.in
|
@ -1,10 +0,0 @@
|
|||
include AUTHORS
|
||||
include Changelog.md
|
||||
include LICENSE
|
||||
include README.md
|
||||
include completions/*/*
|
||||
include supportedsites.md
|
||||
include yt-dlp.1
|
||||
include pyproject.toml
|
||||
recursive-include devscripts *
|
||||
recursive-include test *
|
26
Makefile
26
Makefile
|
@ -1,25 +1,16 @@
|
|||
all: lazy-extractors yt-dlp doc pypi-files
|
||||
clean: clean-test clean-dist clean-pyproject
|
||||
clean: clean-test clean-dist
|
||||
clean-all: clean clean-cache
|
||||
completions: completion-bash completion-fish completion-zsh
|
||||
doc: README.md CONTRIBUTING.md issuetemplates supportedsites
|
||||
ot: offlinetest
|
||||
tar: yt-dlp.tar.gz
|
||||
|
||||
PREFIX ?= /usr/local
|
||||
BINDIR ?= $(PREFIX)/bin
|
||||
MANDIR ?= $(PREFIX)/man
|
||||
SHAREDIR ?= $(PREFIX)/share
|
||||
PYTHON ?= /usr/bin/env python3
|
||||
|
||||
# Keep this list in sync with MANIFEST.in
|
||||
# Keep this list in sync with pyproject.toml includes/artifacts
|
||||
# intended use: when building a source distribution,
|
||||
# make pypi-files && python3 -m build -sn .
|
||||
pypi-files: AUTHORS Changelog.md LICENSE README.md README.txt supportedsites \
|
||||
completions yt-dlp.1 pyproject.toml setup.cfg devscripts/* test/*
|
||||
-mv -f pyproject.toml.old pyproject.toml
|
||||
cp -f pyproject.toml pyproject.toml.old
|
||||
$(PYTHON) devscripts/include_data_files.py pyproject.toml
|
||||
|
||||
.PHONY: all clean install test tar pypi-files completions ot offlinetest codetest supportedsites
|
||||
|
||||
|
@ -31,8 +22,6 @@ clean-test:
|
|||
clean-dist:
|
||||
rm -rf yt-dlp.1.temp.md yt-dlp.1 README.txt MANIFEST build/ dist/ .coverage cover/ yt-dlp.tar.gz completions/ \
|
||||
yt_dlp/extractor/lazy_extractors.py *.spec CONTRIBUTING.md.tmp yt-dlp yt-dlp.exe yt_dlp.egg-info/ AUTHORS
|
||||
clean-pyproject:
|
||||
-mv -f pyproject.toml.old pyproject.toml
|
||||
clean-cache:
|
||||
find . \( \
|
||||
-type d -name .pytest_cache -o -type d -name __pycache__ -o -name "*.pyc" -o -name "*.class" \
|
||||
|
@ -43,6 +32,12 @@ completion-fish: completions/fish/yt-dlp.fish
|
|||
completion-zsh: completions/zsh/_yt-dlp
|
||||
lazy-extractors: yt_dlp/extractor/lazy_extractors.py
|
||||
|
||||
PREFIX ?= /usr/local
|
||||
BINDIR ?= $(PREFIX)/bin
|
||||
MANDIR ?= $(PREFIX)/man
|
||||
SHAREDIR ?= $(PREFIX)/share
|
||||
PYTHON ?= /usr/bin/env python3
|
||||
|
||||
# set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local
|
||||
SYSCONFDIR = $(shell if [ $(PREFIX) = /usr -o $(PREFIX) = /usr/local ]; then echo /etc; else echo $(PREFIX)/etc; fi)
|
||||
|
||||
|
@ -149,9 +144,8 @@ yt-dlp.tar.gz: all
|
|||
-- \
|
||||
README.md supportedsites.md Changelog.md LICENSE \
|
||||
CONTRIBUTING.md Collaborators.md CONTRIBUTORS AUTHORS \
|
||||
Makefile MANIFEST.in yt-dlp.1 README.txt completions \
|
||||
setup.cfg yt-dlp yt_dlp pyproject.toml \
|
||||
devscripts test
|
||||
Makefile yt-dlp.1 README.txt completions .gitignore \
|
||||
setup.cfg yt-dlp yt_dlp pyproject.toml devscripts test
|
||||
|
||||
AUTHORS:
|
||||
git shortlog -s -n HEAD | cut -f2 | sort > AUTHORS
|
||||
|
|
|
@ -362,7 +362,6 @@ py -m bundle.py2exe
|
|||
* **`devscripts/set-variant.py`** - Set the build variant of the executable.
|
||||
* **`devscripts/make_changelog.py`** - Create a markdown changelog using short commit messages and update `CONTRIBUTORS` file.
|
||||
* **`devscripts/make_lazy_extractors.py`** - Create lazy extractors. Running this before building the binaries (any variant) will improve their startup performance. Set the environment variable `YTDLP_NO_LAZY_EXTRACTORS=1` if you wish to forcefully disable lazy extractor loading.
|
||||
* **`devscripts/include_data_files.py`** - Running this before building a wheel will ensure any generated documentation and/or shell completions will be included in the wheel.
|
||||
|
||||
Note: See their `--help` for more info.
|
||||
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
# Allow execution from anywhere
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from devscripts.utils import get_filename_args, read_file
|
||||
|
||||
TABLE_HEADER = '[tool.setuptools.data-files]'
|
||||
|
||||
FILES_SPEC = {
|
||||
'share/bash-completion/completions': ['completions/bash/yt-dlp'],
|
||||
'share/zsh/site-functions': ['completions/zsh/_yt-dlp'],
|
||||
'share/fish/vendor_completions.d': ['completions/fish/yt-dlp.fish'],
|
||||
'share/doc/yt_dlp': ['README.txt'],
|
||||
'share/man/man1': ['yt-dlp.1'],
|
||||
}
|
||||
|
||||
|
||||
def build_data_files(input_file):
|
||||
project_root = Path(input_file).resolve().parent
|
||||
|
||||
for dirname, files in FILES_SPEC.items():
|
||||
resfiles = [fn for fn in files if (project_root / fn).is_file()]
|
||||
if resfiles:
|
||||
yield f'"{dirname}" = {resfiles!r}\n'
|
||||
|
||||
|
||||
def main():
|
||||
tomlfile = get_filename_args(default_outfile='pyproject.toml')
|
||||
|
||||
if TABLE_HEADER in read_file(tomlfile):
|
||||
print(
|
||||
f'{tomlfile!r} already contains a data-files table. '
|
||||
+ 'Try running "make clean-pyproject" or "git restore pyproject.toml"',
|
||||
file=sys.stderr)
|
||||
return 1
|
||||
|
||||
data_files = list(build_data_files(tomlfile))
|
||||
if not data_files:
|
||||
print('No data files to include. Try running "make pypi-files"', file=sys.stderr)
|
||||
return # `make` should not error here
|
||||
|
||||
with open(tomlfile, 'a', encoding='utf-8') as f:
|
||||
f.write(f'\n{TABLE_HEADER}\n')
|
||||
f.writelines(data_files)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
|
@ -1,6 +1,6 @@
|
|||
[build-system]
|
||||
build-backend = "setuptools.build_meta"
|
||||
requires = ["setuptools>=61", "wheel"]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "yt-dlp"
|
||||
|
@ -56,8 +56,8 @@ pyinstaller = ["pyinstaller>=6.3"]
|
|||
py2exe = ["py2exe>=0.12"]
|
||||
build = [
|
||||
"build",
|
||||
"hatchling",
|
||||
"pip",
|
||||
"setuptools>=61",
|
||||
"wheel",
|
||||
]
|
||||
dev = [
|
||||
|
@ -78,10 +78,38 @@ yt-dlp = "yt_dlp:main"
|
|||
[project.entry-points.pyinstaller40]
|
||||
hook-dirs = "yt_dlp.__pyinstaller:get_hook_dirs"
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
include = ["yt_dlp*"]
|
||||
exclude = ["youtube_dl*", "youtube_dlc*", "test*", "ytdlp_plugins*", "devscripts*", "bundle*"]
|
||||
namespaces = false # to disable scanning PEP 420 namespaces (true by default)
|
||||
[tool.hatch.build.targets.sdist]
|
||||
include = [
|
||||
"/yt_dlp",
|
||||
"/devscripts",
|
||||
"/test",
|
||||
"/.gitignore", # included by default, needed for auto-excludes
|
||||
"/Changelog.md",
|
||||
"/LICENSE", # included as license
|
||||
"/pyproject.toml", # included by default
|
||||
"/README.md", # included as readme
|
||||
"/setup.cfg",
|
||||
"/supportedsites.md",
|
||||
]
|
||||
artifacts = [
|
||||
"/yt_dlp/extractor/lazy_extractors.py",
|
||||
"/completions",
|
||||
"/AUTHORS", # included by default
|
||||
"/README.txt",
|
||||
"/yt-dlp.1",
|
||||
]
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
version = {attr = "yt_dlp.version._pkg_version"}
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["yt_dlp"]
|
||||
artifacts = ["/yt_dlp/extractor/lazy_extractors.py"]
|
||||
|
||||
[tool.hatch.build.targets.wheel.shared-data]
|
||||
"completions/bash/yt-dlp" = "share/bash-completion/completions/yt-dlp"
|
||||
"completions/zsh/_yt-dlp" = "share/zsh/site-functions/_yt-dlp"
|
||||
"completions/fish/yt-dlp.fish" = "share/fish/vendor_completions.d/yt-dlp.fish"
|
||||
"README.txt" = "share/doc/yt_dlp/README.txt"
|
||||
"yt-dlp.1" = "share/man/man1/yt-dlp.1"
|
||||
|
||||
[tool.hatch.version]
|
||||
path = "yt_dlp/version.py"
|
||||
pattern = "_pkg_version = '(?P<version>[^']+)'"
|
||||
|
|
Loading…
Reference in New Issue
Block a user