PBR

Comment 1 for bug 1817592

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to pbr (master)

Reviewed: https://review.openstack.org/625372
Committed: https://git.openstack.org/cgit/openstack-dev/pbr/commit/?id=e28fc7e8702826a5325db35472a51fec5068aff7
Submitter: Zuul
Branch: master

commit e28fc7e8702826a5325db35472a51fec5068aff7
Author: Brandon LeBlanc <email address hidden>
Date: Fri Dec 14 16:13:55 2018 -0600

    Resolve ``ValueError`` when mapping value contains a literal ``=``.

    Example ``setup.cfg``::

        project_urls =
          Documentation = https://format-pipfile.readthedocs.io/en/latest/?badge=latest

    Current result::

        $ ./setup.py
        ERROR:root:Error parsing
        Traceback (most recent call last):
          File "/usr/local/lib/python3.7/site-packages/pbr/core.py", line 96, in pbr
            attrs = util.cfg_to_args(path, dist.script_args)
          File "/usr/local/lib/python3.7/site-packages/pbr/util.py", line 258, in cfg_to_args
            kwargs = setup_cfg_to_setup_kwargs(config, script_args)
          File "/usr/local/lib/python3.7/site-packages/pbr/util.py", line 336, in setup_cfg_to_setup_kwargs
            k, v = i.split(=)
        ValueError: too many values to unpack (expected 2)
        error in setup command: Error parsing /Users/brandon/src/format-pipfile/setup.cfg: ValueError: too many values to unpack (expected 2)

    After changes::

        $ ./setup.py egg_info
        [...]
        $ grep -i project-url *.egg-info/PKG-INFO
        [...]
        Project-URL: Documentation, https://format-pipfile.readthedocs.io/en/latest/?badge=latest
        [...]

    add unit tests

        {1} pbr.tests.test_util.TestMapFieldsParsingScenarios.test_project_url_parsing(simple_project_urls) [0.034230s] ... ok
        {1} pbr.tests.test_util.TestMapFieldsParsingScenarios.test_project_url_parsing(query_parameters) [0.029791s] ... ok

    Closes-Bug: #1817592
    Change-Id: Ifd4c46111528d99dadee77d6aabed201d9e84bdb
    Signed-off-by: Brandon LeBlanc <email address hidden>