Changes between Version 73 and Version 74 of TracDev/PluginDevelopment
- Timestamp:
- May 7, 2020, 2:45:52 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/PluginDevelopment
v73 v74 59 59 == Packaging plugins 60 60 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.61 TracPlugins are packaged using [https://setuptools.readthedocs.io/en/latest/ setuptools], to create an egg or wheel package. 62 62 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:63 The 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: 64 64 65 65 {{{#!python … … 77 77 }}} 78 78 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. 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. The `myplugs` directory must contain an `__init__.py` to make it a regular package, but the file can be empty. 80 81 The structure of files and directories is: 82 {{{ 83 setup.py 84 myplugin/ 85 myplugin/__init__.py 86 myplugin/helloworld.py 87 }}} 80 88 81 89 == !Internationalization/Localization of plugins