Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip 19.0.2 puts wrong filenames in distribution-version.dist-info/RECORD #6266

Closed
gregcouch opened this Issue Feb 15, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@gregcouch
Copy link

gregcouch commented Feb 15, 2019

Environment

  • pip version: 19.0.2
  • Python version: 3.7.2
  • OS: Linux, macOS, Windows

Description

According to PEP 491, the distribution-1.0.dist-info/RECORD file is supposed to contain the installed paths. However, with pip 19.0.2, when the ChimeraX_Test wheel is installed, it puts in the pathname from the wheel, instead of where it was installed. So ChimeraX_Test-1.0.dist-info/RECORD contains:

ChimeraX_Test-1.0.data/purelib/chimerax/test/__init__.py,sha256=P-PYqFv-5p3uEWWg4S7ztdqb8ypeOQtckMqrxk4tbyA,1277
ChimeraX_Test-1.0.data/purelib/chimerax/test/bin/exectest.exe,sha256=4o0kWxymci14Rjvn9szfRh8n_N5aYRFY4iXKlJr5Vw4,31752
ChimeraX_Test-1.0.data/purelib/chimerax/test/test.py,sha256=CVpSUb2TwHNHYa_IZG3w2ooeTpdW88xRmIstjWlE0mc,4360

Expected behavior

ChimeraX_Test-1.0.dist-info/RECORD should contain:

chimerax/test/__init__.py,sha256=P-PYqFv-5p3uEWWg4S7ztdqb8ypeOQtckMqrxk4tbyA,1277
9,10d10
chimerax/test/bin/exectest.exe,sha256=4o0kWxymci14Rjvn9szfRh8n_N5aYRFY4iXKlJr5Vw4,31752
chimerax/test/test.py,sha256=CVpSUb2TwHNHYa_IZG3w2ooeTpdW88xRmIstjWlE0mc,4360

How to Reproduce

Use the wheel for your OS in the attached wheels.zip and the examine the contents of site-packages/ChimeraX_Test-1.0.dist-info/RECORD after installing it.

Try with pip 19.0.1 and 19.0.2.

On Linux:

python3.7 -m pip install pip==19.0.1
python3.7 -m pip install ChimeraX_Test-1.0-cp37-cp37m-linux_x86_64.whl
python3.7 -m pip uninstall ChimeraX_Test

Examine that Python's site-packages/ChimeraX_Test-1.0.dist-info/RECORD and see the contents of site-packages/chimerax/test/. The locations exist . A separate issue is that uninstalling fails with

Can't uninstall 'ChimeraX-Test'. No files were found to uninstall.

Next:

python3.7 -m pip install pip==19.0.2
python3.7 -m pip install -U ChimeraX_Test-1.0-cp37-cp37m-linux_x86_64.whl
python3.7 -m pip uninstall ChimeraX_Test

Examine that Python's site-packages/ChimeraX_Test-1.0.dist-info/RECORD and see the contents of site-packages/chimerax/test/. The filenames in RECORD are incorrect, but the right files are installed. Uninstalling fails in the same manner.

wheels.zip

@pradyunsg

This comment has been minimized.

Copy link
Member

pradyunsg commented Feb 15, 2019

@cjerdonek

This comment has been minimized.

Copy link
Member

cjerdonek commented Feb 15, 2019

Thanks a lot for the report. This was an error I introduced when fixing #6191. :/ It looks like we don't have good test coverage of generated RECORD files. Otherwise, this would have been caught.

I added PR #6267 to fix this, with a test of that code path to prevent future regressions. I also made the code more explicit at the point of the bug to make it easier to understand going forward.

@cjerdonek

This comment has been minimized.

Copy link
Member

cjerdonek commented Feb 15, 2019

A separate issue is that uninstalling fails with
Can't uninstall 'ChimeraX-Test'. No files were found to uninstall.

Also, should this be spun off as a separate issue for investigation?

atipi added a commit to vilkasgroup/Pakettikauppa that referenced this issue Mar 12, 2019

Scheduled monthly dependency update for March (#23)



### Update [pip](https://pypi.org/project/pip) from **19.0.1** to **19.0.3**.


<details>
  <summary>Changelog</summary>
  
  
   ### 19.0.3
   ```
   ===================

Bug Fixes
---------

- Fix an ``IndexError`` crash when a legacy build of a wheel fails. (`6252 &lt;https://github.com/pypa/pip/issues/6252&gt;`_)
- Fix a regression introduced in 19.0.2 where the filename in a RECORD file
  of an installed file would not be updated when installing a wheel. (`6266 &lt;https://github.com/pypa/pip/issues/6266&gt;`_)
   ```
   
  
  
   ### 19.0.2
   ```
   ===================

Bug Fixes
---------

- Fix a crash where PEP 517-based builds using ``--no-cache-dir`` would fail in
  some circumstances with an ``AssertionError`` due to not finalizing a build
  directory internally. (`6197 &lt;https://github.com/pypa/pip/issues/6197&gt;`_)
- Provide a better error message if attempting an editable install of a
  directory with a ``pyproject.toml`` but no ``setup.py``. (`6170 &lt;https://github.com/pypa/pip/issues/6170&gt;`_)
- The implicit default backend used for projects that provide a ``pyproject.toml``
  file without explicitly specifying ``build-backend`` now behaves more like direct
  execution of ``setup.py``, and hence should restore compatibility with projects
  that were unable to be installed with ``pip`` 19.0. This raised the minimum
  required version of ``setuptools`` for such builds to 40.8.0. (`6163 &lt;https://github.com/pypa/pip/issues/6163&gt;`_)
- Allow ``RECORD`` lines with more than three elements, and display a warning. (`6165 &lt;https://github.com/pypa/pip/issues/6165&gt;`_)
- ``AdjacentTempDirectory`` fails on unwritable directory instead of locking up the uninstall command. (`6169 &lt;https://github.com/pypa/pip/issues/6169&gt;`_)
- Make failed uninstalls roll back more reliably and better at avoiding naming conflicts. (`6194 &lt;https://github.com/pypa/pip/issues/6194&gt;`_)
- Ensure the correct wheel file is copied when building PEP 517 distribution is built. (`6196 &lt;https://github.com/pypa/pip/issues/6196&gt;`_)
- The Python 2 end of life warning now only shows on CPython, which is the
  implementation that has announced end of life plans. (`6207 &lt;https://github.com/pypa/pip/issues/6207&gt;`_)

Improved Documentation
----------------------

- Re-write README and documentation index (`5815 &lt;https://github.com/pypa/pip/issues/5815&gt;`_)
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pip
  - Changelog: https://pyup.io/changelogs/pip/
  - Homepage: https://pip.pypa.io/
</details>





### Update [wheel](https://pypi.org/project/wheel) from **0.32.3** to **0.33.1**.


<details>
  <summary>Changelog</summary>
  
  
   ### 0.33.1
   ```
   - Fixed the ``--build-number`` option for ``wheel pack`` not being applied
   ```
   
  
  
   ### 0.33.0
   ```
   - Added the ``--build-number`` option to the ``wheel pack`` command
- Fixed bad shebangs sneaking into wheels
- Fixed documentation issue with ``wheel pack`` erroneously being called
  ``wheel repack``
- Fixed filenames with &quot;bad&quot; characters (like commas) not being quoted in
  ``RECORD`` (PR by Paul Moore)
- Sort requirements extras to ensure deterministic builds
  (PR by PoncinMatthieu)
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/wheel
  - Changelog: https://pyup.io/changelogs/wheel/
  - Repo: https://github.com/pypa/wheel
</details>





### Update [PyYAML](https://pypi.org/project/PyYAML) from **4.2b4** to **5.1b3**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pyyaml
  - Homepage: http://pyyaml.org/wiki/PyYAML
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.