Opened 9 years ago

Closed 5 months ago

#48603 closed defect (wontfix)

py27-astropy @1.0.4: AttributeError: Distribution instance has no attribute 'exclude_package_data'

Reported by: skymoo (Adam Mercer) Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: petrrr
Port: py-astropy

Description

I'm trying to install py27-astropy-1.0.4_0 on a Mavericks machine and it's failing with the following:

:info:build running build_py
:info:build Traceback (most recent call last):
:info:build   File "setup.py", line 122, in <module>
:info:build     **package_info
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
:info:build     dist.run_commands()
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
:info:build     self.run_command(cmd)
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
:info:build     cmd_obj.run()
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run
:info:build     self.run_command(cmd_name)
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
:info:build     self.distribution.run_command(command)
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 971, in run_command
:info:build     cmd_obj.ensure_finalized()
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
:info:build     self.finalize_options()
:info:build   File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-astropy/py27-astropy/work/astropy-1.0.4/astropy_helpers/astropy_helpers/commands/build_py.py", line 22, in finalize_options
:info:build     SetuptoolsBuildPy.finalize_options(self)
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/command/build_py.py", line 30, in finalize_options
:info:build     self.exclude_package_data = (self.distribution.exclude_package_data or
:info:build AttributeError: Distribution instance has no attribute 'exclude_package_data'

Full build log is attached.

Attachments (3)

main.log (11.3 KB) - added by skymoo (Adam Mercer) 9 years ago.
main.20150821.log (60.6 KB) - added by skymoo (Adam Mercer) 9 years ago.
main-20140822.log (11.3 KB) - added by skymoo (Adam Mercer) 9 years ago.

Download all attachments as: .zip

Change History (18)

Changed 9 years ago by skymoo (Adam Mercer)

Attachment: main.log added

comment:1 Changed 9 years ago by petrrr

Cc: petr@… added

Cc Me!

comment:2 Changed 9 years ago by robitaille@…

Which version of setuptools do you have installed currently?

comment:3 in reply to:  2 Changed 9 years ago by skymoo (Adam Mercer)

Replying to robitaille@…:

Which version of setuptools do you have installed currently?

$ port installed py27-setuptools
The following ports are currently installed:
  py27-setuptools @18.0.1_0 (active)
$

comment:4 Changed 9 years ago by robitaille@…

This looks like an issue with the installation of setuptools, given the following warnings:

00	:info:build /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
101	:info:build   warnings.warn(msg)
102	:info:build /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'setup_requires'
103	:info:build   warnings.warn(msg)
104	:info:build /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'use_2to3'
105	:info:build   warnings.warn(msg)
106	:info:build /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'zip_safe'
107	:info:build   warnings.warn(msg)
108	:info:build /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'entry_points'
109	:info:build   warnings.warn(msg)

Could you try and uninstall setuptools, clean, and install again, then try astropy again?

Changed 9 years ago by skymoo (Adam Mercer)

Attachment: main.20150821.log added

comment:5 Changed 9 years ago by skymoo (Adam Mercer)

After uninstalling and reinstalling py27-setuptools I got the same error, I noticed that my system was downloading the package of py27-setuptools so I removed it again and forced a build from source. This also fails, the new main.log is attached.

comment:6 Changed 9 years ago by robitaille@…

I'm puzzled by this failure. The exclude_package_data option exists in setuptools since 0.6a9 which is a very old version. I just tried installing MacPorts from scratch and doing sudo port install py27-astropy and I don't see any issues, though this is on 10.8 (but not sure why this should matter?)

Do you have PYTHONPATH set by any chance?

Last edited 3 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:7 in reply to:  6 Changed 9 years ago by skymoo (Adam Mercer)

Replying to robitaille@…:

Do you have PYTHONPATH set by any chance?

No.

$ echo $PYTHONPATH

$

Changed 9 years ago by skymoo (Adam Mercer)

Attachment: main-20140822.log added

comment:8 Changed 9 years ago by skymoo (Adam Mercer)

Updated my ports tree, py27-setuptools was updated to 18.2_0 and py27-astropy to 1.0.4_0 and this still fails. Build log attached.

comment:9 Changed 9 years ago by skymoo (Adam Mercer)

Just tested on another machine, this one running Yosemite, and it built without issue on that. I have another Mavericks machine at work which I'll test on Monday...

comment:10 Changed 9 years ago by skymoo (Adam Mercer)

On a Mavericks VM, running on a Yosemite host, py27-astropy builds fine. I've performed a clean MacPorts install on the machine I'm seeing this problem and it still fails with the same error. Any ideas about what could be different on this machine that could cause this?

comment:11 Changed 7 years ago by jcfr (Jean-Christophe Fillion-Robin)

xref from https://github.com/serge-sans-paille/pythran/issues/489#issuecomment-295459022

AttributeError: Distribution instance has no attribute 'exclude_package_data'

Having faced this issue in a different context, the issue was most likely caused by the fact the installation of setuptools was done from its source tree available on https://github.com/pypa/setuptools and was NOT bootstrapped before being installed.

Not that installing using the source distribution available on pypi does not have problem.

To bootstrap before install, the following can be done:

cd setuptools
python bootstrap.py
python setup.py install

or if you prefer a non zipped version

cd setuptools
python bootstrap.py
python setup.py easy_install --always-unzip .

Omitting to bootstrap will prevent the file entry_points.txt for egg (or metadata.json for wheel) from being installed.

Without that file, the following code found in setuptools/dist.py#L319-L320@d8e1ed5 wouldn't extend distribution object with the setuptools specific keywords:

class Distribution(Distribution_parse_config_files, _Distribution):
    [...]
    def __init__(self, attrs=None):
        [...]
        for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
            vars(self).setdefault(ep.name, None)
        [...]

comment:12 Changed 5 years ago by kurthindenburg (Kurt Hindenburg)

Owner: robitaille@… deleted
Status: newassigned

comment:13 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to Schamschula
Summary: py27-astropy build fails with AttributeErrorpy27-astropy @1.0.4: AttributeError: Distribution instance has no attribute 'exclude_package_data'

comment:14 Changed 3 years ago by Schamschula (Marius Schamschula)

py-astropy is now at version 4.0.3. I doubt this issue is still relevant.

comment:15 Changed 5 months ago by Schamschula (Marius Schamschula)

Resolution: wontfix
Status: assignedclosed
Note: See TracTickets for help on using tickets.