Bug 235301 - devel/py-setuptools_scm: py27-setuptools_scm-3.1.0 fails to upgrade from py27-setuptools_scm-1.17.0
Summary: devel/py-setuptools_scm: py27-setuptools_scm-3.1.0 fails to upgrade from py27...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Martin Wilke
Keywords: needs-qa
: 235326 (view as bug list)
Depends on:
Reported: 2019-01-29 17:54 UTC by Peter Putzer
Modified: 2019-01-30 16:40 UTC (History)
6 users (show)

See Also:
kai: maintainer-feedback+
koobs: merge-quarterly?

py-setuptools_scm-fix_inplace_upgrade.patch (992 bytes, patch)
2019-01-30 13:00 UTC, Kai Knoblich
kai: maintainer-approval+
Details | Diff
py-setuptools_scm-fix_inplace_upgrade-NON-SVN.shar / for non-SVN users (1020 bytes, text/plain)
2019-01-30 13:02 UTC, Kai Knoblich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Putzer 2019-01-29 17:54:51 UTC
An upgrade using postmaster on FreeBSD 11.2 fails with 

writing entry points to src/setuptools_scm.egg-info/entry_points.txt
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "setup.py", line 116, in <module>
  File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 143, in setup
    return distutils.core.setup(**attrs)
  File "/usr/local/lib/python2.7/distutils/core.py", line 151, in setup
  File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
  File "/usr/local/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
    return orig.install.run(self)
  File "/usr/local/lib/python2.7/distutils/command/install.py", line 575, in run
  File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
  File "/usr/local/lib/python2.7/site-packages/setuptools/command/install_egg_info.py", line 34, in run
  File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
  File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 296, in run
  File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 303, in find_sources
  File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 534, in run
  File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 573, in add_defaults
    rcfiles = list(walk_revctrl())
  File "/usr/local/lib/python2.7/site-packages/setuptools/command/sdist.py", line 20, in walk_revctrl
    for item in ep.load()(dirname):
  File "/usr/ports/devel/py-setuptools_scm/work-py27/setuptools_scm-3.1.0/src/setuptools_scm/integration.py", line 28, in find_files
    command = ep.load()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2346, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2356, in resolve
    raise ImportError(str(exc))
ImportError: 'module' object has no attribute 'FILES_COMMAND'
*** Error code 1
Comment 1 Serge 2019-01-29 19:00:53 UTC
I confirm this happens as well when building under FreeBSD 12.0-RELEASE-p1.
Comment 2 Serge 2019-01-29 19:03:37 UTC
I forgot to say that I am using Python 3.7, but the error looks exactly the same.
Comment 3 Kai Knoblich freebsd_committer 2019-01-29 22:41:42 UTC
(In reply to Peter Putzer from comment #0)
(In reply to Serge from comment #2)


thank you for the info. I was able to reproduce the issue with portmaster and the following quick fix might remedy the problem by removing the the old version and then install the new version from the ports tree:

> # pkg remove -f py27-setuptools_scm
> # cd /usr/ports/devel/py-setuptools_scm
> # make install

I'll investigate this issue more thoroughly what's exactly causing this as soon as possible.
Comment 4 Kai Knoblich freebsd_committer 2019-01-30 13:00:32 UTC
Created attachment 201529 [details]
Comment 5 Kai Knoblich freebsd_committer 2019-01-30 13:02:17 UTC
Created attachment 201530 [details]
py-setuptools_scm-fix_inplace_upgrade-NON-SVN.shar / for non-SVN users
Comment 6 Kai Knoblich freebsd_committer 2019-01-30 13:22:50 UTC
I created two patches that should remedy the issue with the inplace upgrade of devel/py-setuptools_scm. The second patch, a shar file, is meant for the users that don't use SVN.

The root cause of the issue is that setup.py has been slightly changed since 3.0.0 . [1]

Before that there had been also a discussion [2] that led to the changes in the setup.py file [1].

[1] https://github.com/pypa/setuptools_scm/pull/264/commits/de0bed4fc96330b021cbee63dc4f3a5eae2549c5

[2] https://github.com/pypa/setuptools_scm/issues/262

@koobs: A quartely-merge is afaik not required because devel/py-setuptools_scm 3.1.0 has not been introduced to the quartely branch.
Comment 7 Martin Wilke freebsd_committer 2019-01-30 16:32:28 UTC
*** Bug 235326 has been marked as a duplicate of this bug. ***
Comment 8 commit-hook freebsd_committer 2019-01-30 16:40:08 UTC
A commit references this bug:

Author: miwi
Date: Wed Jan 30 16:39:38 UTC 2019
New revision: 491631
URL: https://svnweb.freebsd.org/changeset/ports/491631

  - Fix update with portmaster

  PR:		235301
  Submitted by:	Maintainer
  Reported by:	Many
  Sponsored by:	iXsystems Inc.