Changes between Version 35 and Version 36 of DevGuide


Ignore:
Timestamp:
Apr 15, 2021, 6:13:13 PM (3 years ago)
Author:
Ryan J Ollos
Comment:

Keyword args should not have whitespace per pep:0008#other-recommendations

Legend:

Unmodified
Added
Removed
Modified
  • DevGuide

    v35 v36  
    4848
    4949{{{#!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"
     50version="$Rev$"
     51home_page="https://trac-hacks.org/wiki/MyAmazingPlugin"
     52license="3-Clause BSD"
     53author="Joe Bloggs"
     54author_email="trac@python.org"
    5555}}}
    5656
     
    6060
    6161{{{#!python
    62 version = '$Rev$'
     62version='$Rev$'
    6363}}}
    6464
     
    7474== Assert Minimum Trac Version Requirement
    7575
    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 installation of a plugin and the result can be an unintended upgrade of a user's installation (#10607).
     76A 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).
    7777
    7878A better approach is to place the following in the package `__init__.py`, modifying `min_trac_version` as appropriate for your plugin:
     
    8282}}}
    8383
    84 You should still specify that Trac is an installation requirement, but without enforcing a version requirement: `install_requires = ['Trac']`.
     84You should still specify that Trac is an installation requirement, but without enforcing a version requirement: `install_requires=['Trac']`.
    8585
    8686The 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:
     
    116116   {{{#!python
    117117setup(
    118     name = 'YourPluginsName',
    119     version = '1.2.0',
     118    name='YourPluginsName',
     119    version='1.2.0',
    120120[...]
    121121     )
     
    138138   {{{#!python
    139139setup(
    140     name = 'YourPluginsName',
     140    name='YourPluginsName',
    141141    # Note that the version number was changed from 1.2.0 to 1.3.0
    142142    # which will be the next release.
    143     version = '1.3.0',
     143    version='1.3.0',
    144144[...]
    145145     )