Skip to content

Commit

Permalink
update entrypoint config in plugin docs + tests
Browse files Browse the repository at this point in the history
  • Loading branch information
behackl committed Jan 26, 2025
1 parent 498bcc9 commit d61b89f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
11 changes: 6 additions & 5 deletions docs/source/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,15 @@ The only requirement of manim plugins is that they specify an entry point
with the group, ``"manim.plugins"``. This allows Manim to discover plugins
available in the user's environment. Everything regarding the plugin's
directory structure, build system, and naming are completely up to your
discretion as an author. The aforementioned template plugin is only a model
using Poetry since this is the build system Manim uses. The plugin's `entry
point <https://packaging.python.org/specifications/entry-points/>`_ can be
specified in Poetry as:
discretion as an author.

The standard way to specify an entry point (see
`the Python packaging guide <https://packaging.python.org/specifications/entry-points/>`__
for details) is to include the following in your ``pyproject.toml``:

.. code-block:: toml
[tool.poetry.plugins."manim.plugins"]
[project.entry-points."manim.plugins"]
"name" = "object_reference"
.. versionremoved:: 0.18.1
Expand Down
16 changes: 7 additions & 9 deletions tests/test_plugins/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,19 @@

plugin_pyproject_template = textwrap.dedent(
"""\
[tool.poetry]
[project]
name = "{plugin_name}"
authors = ["ManimCE Test Suite"]
authors = [{name = "ManimCE Test Suite"},]
version = "0.1.0"
description = ""
description = "A fantastic Manim plugin"
requires-python = ">=3.9"
[tool.poetry.dependencies]
python = "^3.7"
[tool.poetry.plugins."manim.plugins"]
[project.entry-points."manim.plugins"]
"{plugin_name}" = "{plugin_entrypoint}"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"
""",
)

Expand Down

0 comments on commit d61b89f

Please sign in to comment.