Skip to content

Commit 524786b

Browse files
committed
Re-add publishing the sdist
@jlaine and @hmaarrfk are responsible for maintaining this format.
1 parent 3186956 commit 524786b

File tree

4 files changed

+95
-2
lines changed

4 files changed

+95
-2
lines changed

.github/workflows/tests.yml

+19-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ on:
44
types: [published]
55
workflow_dispatch:
66
jobs:
7+
package-source:
8+
runs-on: ubuntu-24.04
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-python@v5
12+
with:
13+
python-version: "3.13"
14+
- name: Build source package
15+
run: |
16+
pip install setuptools cython
17+
python scripts/fetch-vendor.py --config-file scripts/ffmpeg-7.1.json /tmp/vendor
18+
PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig python setup.py sdist
19+
- name: Upload source package
20+
uses: actions/upload-artifact@v4
21+
with:
22+
name: dist-source
23+
path: dist/
24+
725
package-wheel:
826
runs-on: ${{ matrix.os }}
927
strategy:
@@ -64,7 +82,7 @@ jobs:
6482

6583
publish:
6684
runs-on: ubuntu-latest
67-
needs: [package-wheel]
85+
needs: [package-source, package-wheel]
6886
steps:
6987
- uses: actions/checkout@v4
7088
- uses: actions/download-artifact@v4

MANIFEST.in

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
include *.txt *.md
2+
recursive-include av *.pyx *.pxd
3+
recursive-include docs *.rst *.py
4+
recursive-include examples *.py
5+
recursive-include include *.pxd *.h
6+
recursive-include src/av *.c *.h
7+
recursive-include tests *.py

README.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,23 @@ conda install av -c conda-forge
3232
See the [Conda install][conda-install] docs to get started with (mini)Conda.
3333

3434

35+
Alternative installation methods
36+
--------------------------------
37+
38+
Due to the complexity of the dependencies, PyAV is not always the easiest Python package to install from source. If you want to use your existing ffmpeg (must be the correct major version), the source version of PyAV is on [PyPI][pypi]:
39+
40+
> [!WARNING]
41+
> You must be in a posix env, and have the correct version of ffmpeg installed on your system.
42+
43+
```bash
44+
pip install av --no-binary av
45+
```
46+
47+
3548
Installing From Source
3649
----------------------
3750

38-
Here's how to build PyAV from source source. You must use [MSYS2](https://www.msys2.org/) when using Windows.
51+
Here's how to build PyAV from source. You must use [MSYS2](https://www.msys2.org/) when using Windows.
3952

4053
```bash
4154
git clone https://github.com/PyAV-Org/PyAV.git

docs/overview/installation.rst

+55
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,61 @@ Another way to install PyAV is via `conda-forge <https://conda-forge.github.io>`
2121
See the `Conda quick install <https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html>`_ docs to get started with (mini)Conda.
2222

2323

24+
Bring your own FFmpeg
25+
---------------------
26+
27+
PyAV can also be compiled against your own build of FFmpeg (version ``7.0`` or higher). You can force installing PyAV from source by running:
28+
29+
.. code-block:: bash
30+
pip install av --no-binary av
31+
PyAV depends upon several libraries from FFmpeg:
32+
33+
- ``libavcodec``
34+
- ``libavdevice``
35+
- ``libavfilter``
36+
- ``libavformat``
37+
- ``libavutil``
38+
- ``libswresample``
39+
- ``libswscale``
40+
41+
and a few other tools in general:
42+
43+
- ``pkg-config``
44+
- Python's development headers
45+
46+
47+
MacOS
48+
^^^^^
49+
50+
On **MacOS**, Homebrew_ saves the day::
51+
52+
brew install ffmpeg pkg-config
53+
54+
.. _homebrew: http://brew.sh/
55+
56+
57+
Ubuntu >= 18.04 LTS
58+
^^^^^^^^^^^^^^^^^^^
59+
60+
On **Ubuntu 18.04 LTS** everything can come from the default sources::
61+
62+
# General dependencies
63+
sudo apt-get install -y python-dev pkg-config
64+
65+
# Library components
66+
sudo apt-get install -y \
67+
libavformat-dev libavcodec-dev libavdevice-dev \
68+
libavutil-dev libswscale-dev libswresample-dev libavfilter-dev
69+
70+
71+
Windows
72+
^^^^^^^
73+
74+
It is possible to build PyAV on Windows without Conda by installing FFmpeg yourself, e.g. from the `shared and dev packages <https://ffmpeg.zeranoe.com/builds/>`_.
75+
76+
Unpack them somewhere (like ``C:\ffmpeg``), and then :ref:`tell PyAV where they are located <build_on_windows>`.
77+
78+
2479
Building from the latest source
2580
-------------------------------
2681

0 commit comments

Comments
 (0)