diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 70af7ea14..8037ba891 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -101,7 +101,7 @@ jobs: if: matrix.config.extras run: | . scripts/activate.sh ffmpeg-${{ matrix.config.ffmpeg }} - scripts/test doctest + make -C docs test - name: Examples if: matrix.config.extras diff --git a/Makefile b/Makefile index e8ad38277..9a0b0a95f 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ PYAV_PYTHON ?= python PYTHON := $(PYAV_PYTHON) -.PHONY: default build clean docs fate-suite lint test +.PHONY: default build clean fate-suite lint test default: build @@ -18,7 +18,6 @@ clean: - rm -rf build - rm -rf sandbox - rm -rf src - - rm -rf tmp - make -C docs clean fate-suite: @@ -32,20 +31,3 @@ lint: test: $(PYTHON) setup.py test - -tmp/ffmpeg-git: - @ mkdir -p tmp/ffmpeg-git - git clone --depth=1 git://source.ffmpeg.org/ffmpeg.git tmp/ffmpeg-git - -tmp/Doxyfile: tmp/ffmpeg-git - cp tmp/ffmpeg-git/doc/Doxyfile $@ - echo "GENERATE_TAGFILE = ../tagfile.xml" >> $@ - -tmp/tagfile.xml: tmp/Doxyfile - cd tmp/ffmpeg-git; doxygen ../Doxyfile - -docs: tmp/tagfile.xml - PYTHONPATH=.. make -C docs html - -deploy-docs: docs - ./docs/upload docs diff --git a/docs/Makefile b/docs/Makefile index 65a1e540e..f26ef7dc3 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -2,6 +2,7 @@ SPHINXOPTS = SPHINXBUILD = sphinx-build BUILDDIR = _build +FFMPEGDIR = _ffmpeg ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) . @@ -12,7 +13,8 @@ default: html TAGFILE := _build/doxygen/tagfile.xml $(TAGFILE) : - ./generate-tagfile -o $(TAGFILE) + git clone --depth=1 git://source.ffmpeg.org/ffmpeg.git $(FFMPEGDIR) + ./generate-tagfile --library $(FFMPEGDIR) -o $(TAGFILE) TEMPLATES := $(wildcard api/*.py development/*.py) @@ -24,7 +26,7 @@ _build/rst/%.rst: %.py $(TAGFILE) $(shell find ../include ../av -name '*.pyx' -o clean: - - rm -rf $(BUILDDIR)/* + rm -rf $(BUILDDIR) $(FFMPEGDIR) html: $(RENDERED) $(TAGFILE) $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html diff --git a/docs/generate-tagfile b/docs/generate-tagfile index f00ed7ad4..113a9d9b3 100755 --- a/docs/generate-tagfile +++ b/docs/generate-tagfile @@ -6,14 +6,8 @@ import argparse parser = argparse.ArgumentParser() -parser.add_argument('-l', '--library', default=os.environ.get('PYAV_LIBRARY')) -parser.add_argument('-o', '--output', default=os.path.abspath(os.path.join( - __file__, - '..', - '_build', - 'doxygen', - 'tagfile.xml', -))) +parser.add_argument("-l", "--library", required=True) +parser.add_argument("-o", "--output", required=True) args = parser.parse_args() @@ -21,15 +15,8 @@ if not args.library: print("Please provide --library or set $PYAV_LIBRARY") exit(1) -library = os.path.abspath(os.path.join( - __file__, - '..', '..', - 'vendor', - args.library, -)) - -if not os.path.exists(library): - print("Library does not exist:", library) +if not os.path.exists(args.library): + print("Library does not exist:", args.library) exit(2) @@ -39,8 +26,9 @@ if not os.path.exists(outdir): os.makedirs(outdir) -proc = subprocess.Popen(['doxygen', '-'], stdin=subprocess.PIPE, cwd=library) -proc.communicate(''' +proc = subprocess.Popen(["doxygen", "-"], stdin=subprocess.PIPE, cwd=args.library) +proc.communicate( + """ #@INCLUDE = doc/Doxyfile GENERATE_TAGFILE = {} @@ -49,6 +37,7 @@ GENERATE_LATEX = no CASE_SENSE_NAMES = yes INPUT = libavcodec libavdevice libavfilter libavformat libavresample libavutil libswresample libswscale -'''.format(output).encode()) - - +""".format( + output + ).encode() +) diff --git a/scripts/test b/scripts/test index c34734456..01991f5a6 100755 --- a/scripts/test +++ b/scripts/test @@ -22,10 +22,6 @@ if istest main; then $PYAV_PYTHON setup.py test fi -if istest doctest; then - make -C docs test -fi - if istest examples; then for name in $(find examples -name '*.py'); do echo