Open
Description
Environment
- pip version:
$ docker run -it python pip --version
pip 20.2.2 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
- Python version:
$ docker run -it python python --version
Python 3.8.5
- OS:
$ docker run -it python uname -a
Linux 098fbbd81e20 4.19.76-linuxkit #1 SMP Tue May 26 11:42:35 UTC 2020 x86_64 GNU/Linux
Description
In a fresh Docker container, I'm seeing a difference in the files installed between pip install X --target /tmp
and pip install X --target /tmp --upgrade
. My understanding of --target
is that the --upgrade
flag will only produce different behavior if there's already an existing installation present.
I can't determine if this due to a badly formed distribution of the project in question, a bug in pip
, wheel
, or a combination of them all.
(You can ignore --no-deps
below, I just included it to keep the output smaller).
Behavior without --upgrade
$ docker run -it python bash
root@cdd4f75b6a82:/# ls /tmp
root@b899188462d1:/# pip install -t /tmp --no-deps teradatasql
Collecting teradatasql
Downloading teradatasql-17.0.0.4-py3-none-any.whl (16.4 MB)
|████████████████████████████████| 16.4 MB 5.2 MB/s
Installing collected packages: teradatasql
Successfully installed teradatasql-17.0.0.4
WARNING: Target directory /tmp/teradatasql already exists. Specify --upgrade to force replacement.
root@b899188462d1:/# tree /tmp
/tmp
├── teradatasql
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-38.pyc
│ │ └── vernumber.cpython-38.pyc
│ ├── teradatasql.dll
│ ├── teradatasql.dylib
│ ├── teradatasql.so
│ └── vernumber.py
└── teradatasql-17.0.0.4.dist-info
├── INSTALLER
├── METADATA
├── RECORD
├── REQUESTED
├── WHEEL
└── top_level.txt
3 directories, 13 files
Behavior with --upgrade
$ docker run -it python bash
root@cdd4f75b6a82:/# ls /tmp
root@6c6a7d9f84a7:/# pip install -t /tmp --no-deps --upgrade teradatasql
Collecting teradatasql
Downloading teradatasql-17.0.0.4-py3-none-any.whl (16.4 MB)
|████████████████████████████████| 16.4 MB 7.3 kB/s
Installing collected packages: teradatasql
Successfully installed teradatasql-17.0.0.4
root@6c6a7d9f84a7:/# tree /tmp
/tmp
├── teradatasql
│ ├── LICENSE
│ ├── README.md
│ ├── THIRDPARTYLICENSE
│ └── samples
│ ├── BatchInsPerf.py
│ ├── BatchInsert.py
│ ├── CharPadding.py
│ ├── CommitRollback.py
│ ├── DriverDatabaseVersion.py
│ ├── ElicitFile.py
│ ├── FakeResultSetCon.py
│ ├── FakeResultSetEsc.py
│ ├── FastLoadBatch.py
│ ├── HelpSession.py
│ ├── IgnoreErrors.py
│ ├── InsertXML.py
│ ├── LoadCSVFile.py
│ ├── MetadataFromPrepare.py
│ ├── ParamDataTypes.py
│ ├── StoredProc.py
│ ├── TJEncryptPassword.py
│ ├── __pycache__
│ │ ├── BatchInsPerf.cpython-38.pyc
│ │ ├── BatchInsert.cpython-38.pyc
│ │ ├── CharPadding.cpython-38.pyc
│ │ ├── CommitRollback.cpython-38.pyc
│ │ ├── DriverDatabaseVersion.cpython-38.pyc
│ │ ├── ElicitFile.cpython-38.pyc
│ │ ├── FakeResultSetCon.cpython-38.pyc
│ │ ├── FakeResultSetEsc.cpython-38.pyc
│ │ ├── FastLoadBatch.cpython-38.pyc
│ │ ├── HelpSession.cpython-38.pyc
│ │ ├── IgnoreErrors.cpython-38.pyc
│ │ ├── InsertXML.cpython-38.pyc
│ │ ├── LoadCSVFile.cpython-38.pyc
│ │ ├── MetadataFromPrepare.cpython-38.pyc
│ │ ├── ParamDataTypes.cpython-38.pyc
│ │ ├── StoredProc.cpython-38.pyc
│ │ └── TJEncryptPassword.cpython-38.pyc
│ ├── airports.csv
│ └── udfinc.c
└── teradatasql-17.0.0.4.dist-info
├── INSTALLER
├── METADATA
├── RECORD
├── REQUESTED
├── WHEEL
└── top_level.txt
4 directories, 45 files
Expected behavior
The same files are installed regardless of whether --upgrade
is specified.