diff --git a/docs/user_guide/installation.rst b/docs/user_guide/installation.rst index c1fc2c2a..9d0be0d5 100644 --- a/docs/user_guide/installation.rst +++ b/docs/user_guide/installation.rst @@ -4,8 +4,8 @@ Installation :program:`rebase-helper` is packaged in Fedora, so you can just install it with :command:`dnf`. If you can't or don't want to use :program:`rebase-helper` package, you have to install, -apart from Python requirements listed in `get_requirements` function in :file:`setup.py`, -the following dependencies: +apart from Python requirements listed in `install_requires` in the `options` section +in :file:`setup.cfg`, the following dependencies: ============ ======================== ================================================= Dependency Package name (in Fedora) Notes diff --git a/docs/user_guide/writing_plugins.rst b/docs/user_guide/writing_plugins.rst index 159efa13..7e6012f3 100644 --- a/docs/user_guide/writing_plugins.rst +++ b/docs/user_guide/writing_plugins.rst @@ -38,7 +38,7 @@ Example return cls.NAME @classmethod - def run(cls, spec_file, rebase_spec_file): + def run(cls, spec_file, rebase_spec_file, **kwargs): """ This method is called after original SPEC file is processed @@ -54,15 +54,43 @@ Example from setuptools import setup + setup() - setup( - name='MySpecHook', - version='0.1', - description='Custom SPEC hook for rebase-helper', - author='John Doe', - install_requires=['rebasehelper>=0.10.0'], - packages=['my_spec_hook'], - entry_points={ - 'rebasehelper.spec_hooks': ['my_spec_hook = my_spec_hook:MySpecHook'] - } - ) +.. code-block:: ini + :caption: setup.cfg + + [metadata] + name = MySpecHook + version = 0.1 + description = Custom SPEC hook for rebase-helper + author = John Doe + + [options] + packages = my_spec_hook + install_requires = rebasehelper>=0.10.0 + + [options.entry_points] + rebasehelper.spec_hooks = + my-spec-hook = my_spec_hook:MySpecHook + +Alternatively, use `pyproject.toml` instead of `setup.py` and `setup.cfg`: + +.. code-block:: toml + :caption: pyproject.toml + + [build-system] + requires = ["setuptools"] + build-backend = "setuptools.build_meta" + + [project] + name = "MySpecHook" + version = "0.1" + description = "Custom SPEC hook for rebase-helper" + authors = [{name = "John Doe"}] + dependencies = ["rebasehelper>=0.10.0"] + + [project.entry-points."rebasehelper.spec_hooks"] + my-spec-hook = "my_spec_hook:MySpecHook" + + [tool.setuptools] + packages = ["my_spec_hook"]