Edgewall Software

Changes between Version 73 and Version 74 of TracDev/PluginDevelopment


Ignore:
Timestamp:
May 7, 2020, 2:45:52 AM (4 years ago)
Author:
Ryan J Ollos
Comment:

Add packaging details.

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/PluginDevelopment

    v73 v74  
    5959== Packaging plugins
    6060
    61 TracPlugins are packaged as [http://peak.telecommunity.com/DevCenter/PythonEggs Python eggs]. You can use [https://pythonhosted.org/setuptools/setuptools.html setuptools] to make a `setup.py` script that will produce a Python egg for your plugin.
     61TracPlugins are packaged  using [https://setuptools.readthedocs.io/en/latest/ setuptools], to create an egg or wheel package.
    6262
    63 The egg needs to export an [https://pythonhosted.org/setuptools/setuptools.html#dynamic-discovery-of-services-and-plugins entry points] group named `trac.plugins`, listing the names of the modules that Trac should import for the plugin-provided components to get registered. For example:
     63The plugin needs to export an [https://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins entry points] group named `trac.plugins`, listing the names of the modules that Trac should import for the plugin-provided components to get registered. For example:
    6464
    6565{{{#!python
     
    7777}}}
    7878
    79 This assumes that the `HelloWorldPlugin` example above is defined in the module `helloworld.py` in the `myplugs` package. The entry point ''name'' (in this example "helloworld") is required by the Python egg runtime, but not currently used by Trac. In most cases, you can simply use the qualified module name there.
     79This assumes that the `HelloWorldPlugin` example above is defined in the module `helloworld.py` in the `myplugs` package. The entry point ''name'' (in this example `helloworld`) is required by the Python egg runtime, but not currently used by Trac. In most cases, you can simply use the qualified module name there. The `myplugs` directory must contain an `__init__.py` to make it a regular package, but the file can be empty.
     80
     81The structure of files and directories is:
     82{{{
     83setup.py
     84myplugin/
     85myplugin/__init__.py
     86myplugin/helloworld.py
     87}}}
    8088
    8189== !Internationalization/Localization of plugins