Where can you force pip to install as "flat" and not as "egg".
For me it seems random. Sometimes it gets installed as egg, sometime as flat.
pip help install
shows only an option --egg
which forces an egg installation. But I could not find a --flat
option.
The packages are from an own pypiserver, and uploaded like this:
python setup.py sdist upload -r internal
Output of pip during install:
Best match: foo-client 2015.2
Downloading https://installserver:40443/pypi/packages/foo_client-2015.2.tar.gz
Processing foo_client-2015.2.tar.gz
Writing /home/bar_eins_daad/tmp/easy_install-z20B7b/foo_client-2015.2/setup.cfg
Running foo_client-2015.2/setup.py -q bdist_egg --dist-dir /home/bar_eins_daad/tmp/easy_install-z20B7b/foo_client-2015.2/egg-dist-tmp-GO1snX
I don't know why bdist_egg
gets used here. Does it force creating an egg install?
The setup.py
does use setuptools
not distutils
.
The package on our pypiserver looks like this:
tar -tzf packages/foo_client-2015.3.tar.gz
content:
foo_client-2015.2/
foo_client-2015.2/foo_client.egg-info/
foo_client-2015.2/foo_client.egg-info/SOURCES.txt
foo_client-2015.2/foo_client.egg-info/top_level.txt
foo_client-2015.2/foo_client.egg-info/dependency_links.txt
foo_client-2015.2/foo_client.egg-info/PKG-INFO
foo_client-2015.2/setup.cfg
foo_client-2015.2/PKG-INFO
foo_client-2015.2/foo_client/
foo_client-2015.2/foo_client/models.py
...
Background
pip seems to sometimes install packages several times if zipped eggs are installed.
Update
I found under which condition the package gets installed as egg: if it gets installed via python setup.py develop
(it is an install_requires dependency).
If I use pip install foo_client
it gets installed flat (the way I want it).
Update2
The very ugly part: If the egg gets installed, the old version installed flat does not get removed.
Version: pip 1.5.6
--egg
option is there to make pip install an egg (binary) distribution if available, rather than to install from source (the default), for example. Can you give us some sample packages that show the difference? – Isissite-packages
. Are you saying you have zipped egg files there, or are there only.egg-info
directories there? – Isisinstall_requires
indeed installs the requirement as an egg. It won't remove other versions because what is installed now is only a installation dependency. You can remove those again after installation has completed, in any case. – Isisinstall_requires
what should be used in setup.py? I read these docs: python-packaging-user-guide.readthedocs.org/en/latest/… – Lesleepip
directly or viapython setup develop
). – Lesleeinstall_requires
field. Why are you using it? – Isissetup_requires
.install_requires
should not result in eggs being installed,pip
will install those correctly still. – Isis