[Bug 2029651] Review Request: python-frozenlist - List-like structure which can be made immutable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=2029651



--- Comment #6 from Ben Beasley <code@xxxxxxxxxxxxxxxxxx> ---
(In reply to Miro Hrončok from comment #3)
> I am not particularly keen on the  "Temporary local installation" -- is
> setting PYTHONPATH to the built directory (depending on pip version, it
> might be in _pyproject_buildir or PWD) not enough?

I’ve used this method a few times, and I like the reliability but not the
ugliness—especially copying the pip invocation from pyproject-rpm-macros. It’s
well worth revisiting.

Setting PYTHONPATH=$PWD, PYTHONPATH=$PWD/src, or similar is typically fine for
normal pure-Python packages, but it definitely doesn’t work for projects with
compiled extensions or generated code under the current combination of pip and
pyproject-rpm-macros.

The only free-standing copy of the built extension is at a path like:

> ./build/lib.linux-x86_64-3.10/frozenlist/_frozenlist.cpython-310-x86_64-linux-gnu.so

but I believe that path is chosen by the Python build system. I guess I could
imitate it with

> PYTHONPATH='build/lib.linux-%{_arch}-%{python3_version}'

and hope it remains stable.

I remember this path changing with different versions of setuptools in the
past, prior to the introduction of pyproject-rpm-macros, but maybe it’s done
changing for the time being, at least with the library versions in stable
Fedora releases. Since packages using pyproject-rpm-macros require a lot of
other changes to backport to EPEL7-8 anyway, it doesn’t matter so much if it’s
different there.

I just tested on F34–F36, and this pattern works for all primary architectures,
so this is a viable approach.

Beyond that, the only other copy of the compiled extension is inside the wheel.
In particular, %{_pyproject_builddir} doesn’t have anything interesting after
the build:

> + find /builddir/build/BUILD/frozenlist-1.2.0/.pyproject-builddir
> /builddir/build/BUILD/frozenlist-1.2.0/.pyproject-builddir
> /builddir/build/BUILD/frozenlist-1.2.0/.pyproject-builddir/pip-ephem-wheel-cache-1h_4pyl1
> /builddir/build/BUILD/frozenlist-1.2.0/.pyproject-builddir/pip-wheel-qqkfb8ts

> OTOH If you actually need it, would %pyproject_install -T <TARGET> help?

I haven’t tested it, but it seems like this would successfully eliminate the
long, messy installation command and improve it a great deal. Either I didn’t
find that option in the past, or I tried it but using %pyproject_install twice
broke %pyproject_save_files/%pyproject_files.

In the end, I’m happy enough with

> PYTHONPATH='build/lib.linux-%{_arch}-%{python3_version}'

that I’ll do that instead, although I’d be even happier if I could definitively
trust this path not to change over time.


-- 
You are receiving this mail because:
You are always notified about changes to this product and component
You are on the CC list for the bug.
https://bugzilla.redhat.com/show_bug.cgi?id=2029651
_______________________________________________
package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/package-review@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite Conditions]     [KDE Users]

  Powered by Linux