This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: bdist_rpm should enable --fix-python by default
Type: behavior Stage: resolved
Components: Distutils Versions: Python 3.8
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: John5342, akitada, eric.araujo, steve.dower, tarek, vstinner
Priority: normal Keywords:

Created on 2008-11-29 14:42 by John5342, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (7)
msg76596 - (view) Author: John5342 (John5342) Date: 2008-11-29 14:42
When using bdist_rpm the %build section of the generated spec file
contains the following:

env CFLAGS="$RPM_OPT_FLAGS" python setup.py build

This works fine until the python is installed using altinstall. In this
situation the spec file will use the default python rather than the one
currently used.

I am currently using python3.0 with the default python being 2.5. As a
result the spec file is created which then calles python (2.5) and my
setup.py contains 3.0 code so the spec file fails.

When the above line is generated it should use the current interpreters
path and name rather than just "python"
msg82948 - (view) Author: Akira Kitada (akitada) * Date: 2009-02-28 22:52
There are two options for that in bdist_rpm.

  --python             path to Python interpreter to hard-code in the .spec
                       file (default: "python")
  --fix-python         hard-code the exact path to the current Python
                       interpreter in the .spec file
msg82957 - (view) Author: John5342 (John5342) Date: 2009-03-01 12:25
Thanks.

i had noticed those options since i filed this report but considering
the spec file is generated and then built immediately wouldn't it make
more sense to effectively enable --fix-python by default (perhaps with a
--no-fix-python option if people do in fact want to do something odd).
The rpm would then automatically be built using the same version of
python used for development which is in my experience almost always what
is intended.

I do at least have a workable workaround.

Thanks again.
msg113876 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-14 05:59
Considering that bdist_rpm is removed in distutils2, that its use in distutils is not encouraged (platform-specific tools are more adapted and can move quicker than the stdlib), that you have a workaround, and that we can’t change behavior for fear of breaking third-party tools (what happened all the time and lead Tarek to create distutils2), I’m closing this in one week unless Tarek objects.
msg119390 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-10-22 15:14
FYI, this is fixed in the new bdist_rpm2 command: https://bitbucket.org/tarek/pypi2rpm/changeset/ce6626df0225
msg337667 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-03-11 13:37
I reopen the issue. The command still needs --fix-python and distutils2 project has been abandonned.

Bug report in RHEL:
https://bugzilla.redhat.com/show_bug.cgi?id=1673325
msg386309 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:16
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools
History
Date User Action Args
2022-04-11 14:56:41adminsetgithub: 48709
2021-02-03 18:16:24steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386309

resolution: out of date
2019-03-11 13:37:08vstinnersetstatus: closed -> open
versions: + Python 3.8, - Python 3.0
nosy: + vstinner

messages: + msg337667

resolution: rejected -> (no value)
2010-10-22 15:14:10eric.araujosetmessages: + msg119390
2010-09-08 03:04:11eric.araujosetstatus: pending -> closed
resolution: rejected
stage: resolved
2010-08-14 05:59:42eric.araujosetstatus: open -> pending

nosy: + eric.araujo
messages: + msg113876

assignee: eric.araujo
2009-03-03 13:36:52akitadasettitle: bdist_rpm assumes python -> bdist_rpm should enable --fix-python by default
2009-03-01 12:25:52John5342setmessages: + msg82957
2009-02-28 22:52:36akitadasetnosy: + akitada, tarek
messages: + msg82948
2008-11-29 14:42:30John5342create