Changes between Version 35 and Version 36 of DevGuide
- Timestamp:
- Apr 15, 2021, 6:13:13 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DevGuide
v35 v36 48 48 49 49 {{{#!python 50 version ="$Rev$"51 home_page ="https://trac-hacks.org/wiki/MyAmazingPlugin"52 license ="3-Clause BSD"53 author ="Joe Bloggs"54 author_email ="trac@python.org"50 version="$Rev$" 51 home_page="https://trac-hacks.org/wiki/MyAmazingPlugin" 52 license="3-Clause BSD" 53 author="Joe Bloggs" 54 author_email="trac@python.org" 55 55 }}} 56 56 … … 60 60 61 61 {{{#!python 62 version ='$Rev$'62 version='$Rev$' 63 63 }}} 64 64 … … 74 74 == Assert Minimum Trac Version Requirement 75 75 76 A 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']`. However, this may cause issues, some of which are documented in #9800, and is not recommended. One of the more severe consequences is that setuptools may download and install a newer version of Trac duringinstallation of a plugin and the result can be an unintended upgrade of a user's installation (#10607).76 A 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']`. However, this may cause issues, some of which are documented in #9800, and is not recommended. One of the more severe consequences is that setuptools may download and install a newer version of Trac during the installation of a plugin and the result can be an unintended upgrade of a user's installation (#10607). 77 77 78 78 A better approach is to place the following in the package `__init__.py`, modifying `min_trac_version` as appropriate for your plugin: … … 82 82 }}} 83 83 84 You should still specify that Trac is an installation requirement, but without enforcing a version requirement: `install_requires =['Trac']`.84 You should still specify that Trac is an installation requirement, but without enforcing a version requirement: `install_requires=['Trac']`. 85 85 86 86 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: … … 116 116 {{{#!python 117 117 setup( 118 name ='YourPluginsName',119 version ='1.2.0',118 name='YourPluginsName', 119 version='1.2.0', 120 120 [...] 121 121 ) … … 138 138 {{{#!python 139 139 setup( 140 name ='YourPluginsName',140 name='YourPluginsName', 141 141 # Note that the version number was changed from 1.2.0 to 1.3.0 142 142 # which will be the next release. 143 version ='1.3.0',143 version='1.3.0', 144 144 [...] 145 145 )