File: extending.rst

package info (click to toggle)
python-whey 0.1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,912 kB
  • sloc: python: 4,433; makefile: 7
file content (38 lines) | stat: -rw-r--r-- 1,358 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
=====================
Extending whey
=====================

``whey`` can be extended to support building different distribution types (e.g. conda, DEB, RPM) or to modify the behaviour of an existing builder.

Custom builders must be registered as an entry point in the ``whey.builder`` group. For example:

.. code-block:: toml

	# pyproject.toml

	[project.entry-points."whey.builder"]
	whey_sdist = "whey.builder:SDistBuilder"
	whey_wheel = "whey.builder:WheelBuilder"


.. code-block:: ini

	# setup.cfg

	[options.entry_points]
	whey.builder =
		whey_sdist = whey.builder:SDistBuilder
		whey_wheel = whey.builder:WheelBuilder

Each builder must inherit from :class:`whey.builder.AbstractBuilder`.

The custom builders can be enabled by setting keys in the ``tool.whey.builders`` table.
The table supports three keys: ``sdist``, ``wheel``, ``binary``.

* The ``sdist`` builder is used when running whey with the :option:`--sdist <whey -s>` option
  or when using the :pep:`517` backend to build an sdist.
* The ``wheel`` builder is used when running whey with the :option:`--wheel <whey -w>` option
  or when using the :pep:`517` backend to build a wheel.
* The ``binary`` builder is used when running whey with the :option:`--binary <whey -b>` option.

The value for each key is the name of an entry point, such as ``whey_sdist`` from the example above.