Changes between Version 17 and Version 18 of DevGuide
- Timestamp:
- Jun 11, 2015, 6:57:36 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DevGuide
v17 v18 93 93 == Assert Minimum Trac Version Requirement 94 94 95 The most common method employed to specifya minimum required Trac version is to add an installation requirement in `setup.py`. For example: `install_requires = ['Trac >= 0.12']`. This causes numerous problems, some of which are documented in #9800, and is not recommended. One of the most negative consequences is that setuptools may download and install a newer version of Trac. The result can be an unintended upgrade of a user's installation (#10607).95 The most common method of specifying a minimum required Trac version is to add an installation requirement in `setup.py`. For example: `install_requires = ['Trac >= 0.12']`. This causes numerous problems, some of which are documented in #9800, and is not recommended. One of the most negative consequences is that setuptools may download and install a newer version of Trac. The result can be an unintended upgrade of a user's installation (#10607). 96 96 97 97 A better approach is to place the following in the package `__init__.py`, modifying `min_trac_version` as appropriate for your plugin: … … 102 102 }}} 103 103 104 The check is performed at runtime, so the egg can be built in an environment that does not satisfy the installation requirements. One use-case for this behavior is building the egg on a development computer and uploading it through the plugin admin page. An error such as the following will be seen in the logs if the plugin fails to load due to a failed requirement: 104 You may still want to specify that Trac is an installation requirement, but without enforcing a version requirement: `install_requires = ['Trac']`. 105 106 The check in `__init__.py` is performed at runtime, so the egg can be built in an environment that does not satisfy the installation requirements. One use-case for this behavior is building the egg on a development computer and uploading it through the plugin admin page. An error such as the following will be seen in the logs if the plugin fails to load due to a failed requirement: 105 107 {{{ 106 108 02:39:22 PM Trac[loader] DEBUG: Loading changelog.ChangeLogMacro from /home/user/Workspace/clm/lib/python2.7/site-packages/ChangeLogMacro-0.2-py2.7.egg