Bug 1825455

Summary: Removing *.egg-info breaks setuptools_scm
Product: [Fedora] Fedora Reporter: Elliott Sales de Andrade <quantum.analyst>
Component: pyp2rpmAssignee: Gordon Messmer <gordon.messmer>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 34CC: cstratak, gordon.messmer, igor.raits, kevin, m.cyprian, mhroncok, orion, philip.wyett, pviktori, python-sig, rkuska, slavek.kabrda
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-07 21:53:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Elliott Sales de Andrade 2020-04-18 08:13:53 UTC
Description of problem:
I'm not sure if this is specifically a problem with setuptools_scm or not. By default, `pyp2rpm` will add this line in prep:

# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info

However, doing so causes an incomplete installation. See the xarray build:
https://koji.fedoraproject.org/koji/buildinfo?buildID=1482334

where many directories are missing, e.g., xarray/core is gone.

If I comment out the deletion, then all files are correctly installed:
https://koji.fedoraproject.org/koji/taskinfo?taskID=43507763


Version-Release number of selected component (if applicable):
3.3.3-7.fc32


Steps to Reproduce:
1. Build python-xarray in Fedora 32+
2. Install python3-xarray
3. python3 -c 'import xarray'


Actual results:
Traceback because files are not installed.


Expected results:
Working rpm.

Comment 1 Elliott Sales de Andrade 2020-04-18 08:15:55 UTC
The Python Guidelines don't seem to mention removing *.egg-info (any more?), so maybe this should be assigned to pyp2rpm instead? But also a note that this directory might necessary now would be good.

Comment 2 Miro Hrončok 2020-04-18 08:19:41 UTC
This is added by pyp2rpm:

# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info

And in most cases, is not necessary nor desired.

Comment 3 Gordon Messmer 2020-04-19 19:31:15 UTC
I can remove this from pyp2rpm pretty quickly.  (Does anyone remember why it was included originally?  Should it be left in any other distro's templates?  I'd imagine not.)

Will we also push suggested changes to all of the packages that include that line, now?

Comment 4 Petr Viktorin (pviktori) 2020-04-20 08:03:34 UTC
AFAIK, egg-info (or dist-info) should be created by setuptools, so removing it before build should be a no-op. It's weird that it isn't.

I see that only the top-levelpackage is listed in setup.cfg. Apparently this changed 3 months ago from find_packages(), which should find subpackages recursively: https://github.com/pydata/xarray/commit/27a392906f12af5fa60d21bb327d739ee8411c82#diff-2eeaed663bd0d25b7e608891384b7298L106

The documentation hints at using "find:" when replacing find_packages using setup.cfg: https://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files

Comment 5 Miro Hrončok 2020-04-20 08:44:59 UTC
> Does anyone remember why it was included originally?

AFAIK it is trying to follow the old guideline that said "binary eggs should be removed in prep". In the most cases, the egg-info contains no binary, only metadata.


> AFAIK, egg-info (or dist-info) should be created by setuptools, so removing it before build should be a no-op. It's weird that it isn't.

I assumed this is the setuptools-scm case. When creating sdist, it creates egg-info with the version information. When removed, it is no-op, but ony if you are on the git repo. When removed from a tarball, the version info is gone. But this is all "I think this is the way it works" only.



However, here indeed, it is not the version that is missing :/

Comment 7 Ben Cotton 2020-08-11 13:19:08 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle.
Changing version to 33.

Comment 8 Ben Cotton 2021-11-04 17:34:25 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Ben Cotton 2022-05-12 15:27:43 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '34'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 10 Ben Cotton 2022-06-07 21:53:29 UTC
Fedora Linux 34 entered end-of-life (EOL) status on 2022-06-07.

Fedora Linux 34 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release.

Thank you for reporting this bug and we are sorry it could not be fixed.