PBR

UserWarning: Unknown distribution option when using pbr with Python 3.6

Bug #1634839 reported by Free Ekanayaka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PBR
Fix Released
Undecided
Unassigned

Bug Description

It seems that the interaction between distutils, setuptools and pbr is broken when running against Python 3.6 (development release).

To reproduce the problem, run this:

# Download and install Python 3.6
pip3.6 install --user -U pip
pip3.6 install --user -U wheel setuptools pbr
git clone https://github.com/testing-cabal/fixtures.git
cd fixtures
python3.6 setup.py egg_info

You'll get an output similar to:

/home/ubuntu/.local/lib/python3.6/site-packages/pbr/core.py:135: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
/home/ubuntu/.local/lib/python3.6/site-packages/pbr/core.py:135: UserWarning: Unknown distribution option: 'packages'
  warnings.warn(msg)
/home/ubuntu/.local/lib/python3.6/site-packages/pbr/core.py:135: UserWarning: Unknown distribution option: 'include_package_data'
  warnings.warn(msg)
/home/ubuntu/.local/lib/python3.6/site-packages/pbr/core.py:135: UserWarning: Unknown distribution option: 'extras_require'
  warnings.warn(msg)
/home/ubuntu/.local/lib/python3.6/site-packages/pbr/core.py:135: UserWarning: Unknown distribution option: 'zip_safe'
  warnings.warn(msg)
running egg_info
writing fixtures.egg-info/PKG-INFO
writing dependency_links to fixtures.egg-info/dependency_links.txt
writing top-level names to fixtures.egg-info/top_level.txt
writing pbr to fixtures.egg-info/pbr.json
[pbr] Processing SOURCES.txt
[pbr] In git context, generating filelist from git
warning: no files found matching 'AUTHORS'
warning: no files found matching 'ChangeLog'
warning: no previously-included files found matching '.gitreview'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
reading manifest template 'MANIFEST.in'
writing manifest file 'fixtures.egg-info/SOURCES.txt'

The "pip3.6 list" command shows:

docutils (0.12)
extras (1.0.0)
fixtures (3.0.1.dev17)
linecache2 (1.0.0)
mock (2.0.0)
pbr (1.10.0)
pip (8.1.2)
python-mimeparse (1.6.0)
setuptools (28.6.0)
six (1.10.0)
testtools (2.2.0)
traceback2 (1.4.0)
unittest2 (1.1.0)
wheel (0.29.0)

Essentially when running against Python 3.6, the setuptools egg_info command doesn't correctly write the requires.txt file in the egg directory.

I think the reason for which the egg_info command is broken is because when pbr gets to this line:

https://github.com/openstack-dev/pbr/blob/master/pbr/core.py#L134

with "key" being either "install_requires" or "extras_requires", the dist object has not those attributes at all (they would normally be set to None by previous setuptools entry point hooks).

This turns makes "pip3.6 install -U .[docs,test]" not install the dependencies at all (since there's no requires.txt):

ubuntu:~/src/fixtures$ pip3.6 install --user -U .[docs,test]
Processing /home/ubuntu/src/fixtures
  fixtures 3.0.1.dev17 does not provide the extra 'docs'
  fixtures 3.0.1.dev17 does not provide the extra 'test'
Installing collected packages: fixtures
  Found existing installation: fixtures 3.0.1.dev17
    Uninstalling fixtures-3.0.1.dev17:
      Successfully uninstalled fixtures-3.0.1.dev17
  Running setup.py install for fixtures ... done
Successfully installed fixtures-3.0.1.dev17

For even more details see:

https://github.com/testing-cabal/fixtures/pull/32

Revision history for this message
Gaetan Semet (gaetan-xeberon) wrote :

works great with python 3.6, end of 2017. should be officially supported

Revision history for this message
Ben Nemec (bnemec) wrote :

Closing per the previous comment. I know we fixed some things related to 3.6 support and this was probably one of them.

Changed in pbr:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.