setuptools_scm: setuptools_scm does not work with setup.cfg

I was debuging the behaviour of setuptools_scm because I received exception from function version_keyword

File "/home/oglop/.virtualenvs/b/lib/python3.6/site-packages/setuptools_scm/integration.py", line 22, in version_keyword
    dist.metadata.version = get_version(**value)

in setuptools file config.py, all options go through parser except additional options like use_scm_version, I guess this should be handled by setuptools_scm file : setuptools/config.py

class ConfigOptionsHandler(ConfigHandler):

    section_prefix = 'options'

    @property
    def parsers(self):
        """Metadata item name to parser function mapping."""
        parse_list = self._parse_list
        parse_list_semicolon = partial(self._parse_list, separator=';')
        parse_bool = self._parse_bool
        parse_dict = self._parse_dict

        return {
            'zip_safe': parse_bool,
            'use_2to3': parse_bool,
            'include_package_data': parse_bool,
            'package_dir': parse_dict,
            'use_2to3_fixers': parse_list,
            'use_2to3_exclude_fixers': parse_list,
            'convert_2to3_doctests': parse_list,
            'scripts': parse_list,
            'eager_resources': parse_list,
            'dependency_links': parse_list,
            'namespace_packages': parse_list,
            'install_requires': parse_list_semicolon,
            'setup_requires': parse_list_semicolon,
            'tests_require': parse_list_semicolon,
            'packages': self._parse_packages,
            'entry_points': self._parse_file,
            'py_modules': parse_list,
        }

in setuptools_scm something goes wrong here:

[distutils.setup_keywords]
        use_scm_version = setuptools_scm.integration:version_keyword

because function version_keyword receives parameter value as str but that function expects bool - because the value did not go through the parsing process

what I do not know is how that version_keyword is called

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

I amended https://github.com/pypa/setuptools/pull/1150 to support the above use-case.

Almost. It’s usable already if you’re lucky to have setuptools_scm available beforehand.

Yet, I have some tweaks in mind for attr: to implement in a week or so, and I’ll try to put lazyness in the list.

thats pretty much a setuptools bug, to fix it it would require a additional setting for the parsers, as such its not something we can fix directly and it has to stay in setup.py