Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

pip package installer sometimes fails when ran in a directory with a setup.cfg file #1531

Open
micptolshaw opened this Issue · 5 comments

4 participants

@micptolshaw

using pip 1.5.2 to install python packages appears to be inappropriately affected by having a setup.cfg file in your local directory when you install some packages.

sudo pip install see <--- works
sudo pip install wheel <-- fails

e.g.

[core]$ sudo pip install wheel
Downloading/unpacking wheel
Downloading wheel-0.22.0-py2.py3-none-any.whl (54kB): 54kB downloaded
Installing collected packages: wheel
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 279, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python2.7/site-packages/pip/req.py", line 1380, in install
requirement.install(install_options, global_options, args, *kwargs)
File "/usr/lib/python2.7/site-packages/pip/req.py", line 664, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/lib/python2.7/site-packages/pip/req.py", line 894, in move_wheel_files
pycompile=self.pycompile,
File "/usr/lib/python2.7/site-packages/pip/wheel.py", line 135, in move_wheel_files
scheme = distutils_scheme(name, user=user, home=home, root=root)
File "/usr/lib/python2.7/site-packages/pip/locations.py", line 147, in distutils_scheme
d.parse_config_files()
File "/usr/lib/python2.7/distutils/dist.py", line 397, in parse_config_files
val = parser.get(section,opt)
File "/usr/lib/python2.7/ConfigParser.py", line 623, in get
return self._interpolate(section, option, value, d)
File "/usr/lib/python2.7/ConfigParser.py", line 669, in _interpolate
option, section, rawval, e.args[0])
InterpolationMissingOptionError: Bad value substitution:
section: [pytest]
option : addopts
key : levelname
rawval : -s --log-format="%(levelname)-8s [%(name)s (%(module)s:%(lineno)d)] %(message)s"

setup.cfg contains:

[pytest]

addopts = -s --log-format="%(levelname)-8s [%(name)s (%(module)s:%(lineno)d)] %(message)s"

@Ivoz
Owner

A setup.cfg present in the current directory is designed to modify how a package installs, afaik

You can find documentation for it under distutils, which comes from python

http://docs.python.org/2/distutils/configfile.html

@micptolshaw

If we were talking about a file setup.cfg in the package we were installing, or if we were running the setup.py script in the current directory to install the package in our directory then this would make sense.

However, using pip to install a package from pypa, and having its installation modified because you happen to be in the directory of a package you are developing seems wrong, and dangerous.

@dmick

This is still breaking.

@jcsp

The culprit appears to be ab21c1d

@qwcode can you explain the intent of that change, is it meant to be reading setup.cfg from the package being installed, or is it really meant to look for a setup.cfg in the directory pip is run from?

@micptolshaw
@jcsp jcsp referenced this issue from a commit in ceph/calamari
@jcsp jcsp doc: remove setup.cfg, broke RTD build
Known pip bug, certain versions dislike a
setup.cfg in source dir.  Removing our
CFG is harmless because it was only
setting test log format.

pypa/pip#1531

Signed-off-by: John Spray <john.spray@inktank.com>
9ae0e65
@jcsp jcsp referenced this issue from a commit in ceph/calamari
@jcsp jcsp doc: remove setup.cfg, broke RTD build
Known pip bug, certain versions dislike a
setup.cfg in source dir.  Removing our
CFG is harmless because it was only
setting test log format.

pypa/pip#1531

Signed-off-by: John Spray <john.spray@inktank.com>
f490b55
@jcsp jcsp referenced this issue from a commit in ceph/calamari
@jcsp jcsp doc: remove setup.cfg, broke RTD build
Known pip bug, certain versions dislike a
setup.cfg in source dir.  Removing our
CFG is harmless because it was only
setting test log format.

pypa/pip#1531

Signed-off-by: John Spray <john.spray@inktank.com>
2752cdd
@jcsp jcsp referenced this issue from a commit in ceph/calamari
@jcsp jcsp doc: remove setup.cfg, broke RTD build
Known pip bug, certain versions dislike a
setup.cfg in source dir.  Removing our
CFG is harmless because it was only
setting test log format.

pypa/pip#1531

Signed-off-by: John Spray <john.spray@inktank.com>
5b3a1f0
@jcsp jcsp referenced this issue from a commit in ceph/calamari
@jcsp jcsp doc: remove setup.cfg, broke RTD build
Known pip bug, certain versions dislike a
setup.cfg in source dir.  Removing our
CFG is harmless because it was only
setting test log format.

pypa/pip#1531

Signed-off-by: John Spray <john.spray@inktank.com>
256881d
@jcsp jcsp referenced this issue from a commit in ceph/calamari
@jcsp jcsp doc: remove setup.cfg, broke RTD build
Known pip bug, certain versions dislike a
setup.cfg in source dir.  Removing our
CFG is harmless because it was only
setting test log format.

pypa/pip#1531

Signed-off-by: John Spray <john.spray@inktank.com>
b536e49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.