[Bug 259381] py-platformdirs does not build

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 23 Oct 2021 14:36:08 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259381

            Bug ID: 259381
           Summary: py-platformdirs does not build
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: xavier@groumpf.org
                CC: kai@FreeBSD.org, python@FreeBSD.org
                CC: kai@FreeBSD.org, python@FreeBSD.org

As mentioned in a thread in ports@freebsd.org, the problem seems to be related
with outdated versions of py-setuptools/py-setuptools_scm

On Mon, 18 Oct 2021 12:51:05 +0200, Xavier Humbert wrote:

> [root@numenor ~]# cd /usr/ports/devel/py-platformdirs/
> [root@numenor py-platformdirs]# make
> ===>   py38-platformdirs-2.4.0 depends on package: py38-setuptools>0 -
> found
> ===>   py38-platformdirs-2.4.0 depends on file:
> /usr/local/bin/python3.8 - found
> ===>  Configuring for py38-platformdirs-2.4.0
> Traceback (most recent call last):
> File "<string>", line 1, in <module>
> File "setup.py", line 3, in <module>
> setup()
> File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py",
> line 153, in setup
> return distutils.core.setup(**attrs)
> File "/usr/local/lib/python3.8/distutils/core.py", line 108, in setup
> _setup_distribution = dist = klass(attrs)
> File "/usr/local/lib/python3.8/site-packages/setuptools/dist.py", line
> 455, in __init__
> _Distribution.__init__(self, {
> File "/usr/local/lib/python3.8/distutils/dist.py", line 292, in __init__
> self.finalize_options()
> File "/usr/local/lib/python3.8/site-packages/setuptools/dist.py", line
> 801, in finalize_options
> ep(self)
> File
> "/usr/local/lib/python3.8/site-packages/setuptools_scm/integration.py",
> line 48, in infer_version
> dist.metadata.version = _get_version(config)
> File
> "/usr/local/lib/python3.8/site-packages/setuptools_scm/__init__.py",
> line 156, in _get_version
> dump_version(
> File
> "/usr/local/lib/python3.8/site-packages/setuptools_scm/__init__.py",
> line 84, in dump_version
> fp.write(template.format(version=version))
> KeyError: 'version_tuple'

OK, the build error is caused by devel/py-setuptools_scm.

It works if I

- update devel/py-setuptools to version 58.2.0
- update devel/py-setuptools_scm to version 6.3.2
- install texproc/py-tomli

Tested with python39 only and it possibly will break other ports.

Can you open a PR at https://bugs.freebsd.org? Maybe python@ or sunpoet@ can
help.

Regards,
Xavier

-- 
You are receiving this mail because:
You are on the CC list for the bug.