From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0H0tEWLe9F/xTwAA0tVLHw (envelope-from ) for ; Tue, 05 Jan 2021 21:47:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KJwGDWLe9F/MBAAAB5/wlQ (envelope-from ) for ; Tue, 05 Jan 2021 21:47:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7CCBA9404C9 for ; Tue, 5 Jan 2021 21:47:13 +0000 (UTC) Received: from localhost ([::1]:34762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwuAa-0007co-E2 for larch@yhetil.org; Tue, 05 Jan 2021 16:47:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwuAR-0007ch-GG for help-guix@gnu.org; Tue, 05 Jan 2021 16:47:03 -0500 Received: from mira.cbaines.net ([2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27]:36149) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwuAO-0001Cq-Q7 for help-guix@gnu.org; Tue, 05 Jan 2021 16:47:03 -0500 Received: from localhost (188.28.108.198.threembb.co.uk [188.28.108.198]) by mira.cbaines.net (Postfix) with ESMTPSA id 0E22727BC0C; Tue, 5 Jan 2021 21:46:58 +0000 (GMT) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 1ba6f4c9; Tue, 5 Jan 2021 21:46:55 +0000 (UTC) References: <85lfd8qnuv.fsf@beadling.co.uk> <87h7nwjm69.fsf@cbaines.net> <85im8bqvjk.fsf@beadling.co.uk> User-agent: mu4e 1.4.13; emacs 27.1 From: Christopher Baines To: Phil Subject: Re: No Explicit Python Version Dependency In Package Definitions? In-reply-to: <85im8bqvjk.fsf@beadling.co.uk> Date: Tue, 05 Jan 2021 21:46:52 +0000 Message-ID: <87ble3jbub.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.44 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 7CCBA9404C9 X-Spam-Score: -3.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: liuUdb6l+j8t --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Phil writes: > Thanks for the reply. > > Christopher Baines writes: > >> Build systems are a mechanic to deduplicate common steps, but also >> common inputs between packages, and the python-build-system will include >> a default Python as an input. >> >> https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build-system/python= .scm#n138 > > Got it - so the version is set behind the scenes depending on the > current python package definition. > >> So, you can't have this particular python-scipy output in your store >> without python as well, as it's referenced by some shared libraries, >> which I guess makes sense. > > Yep - so even tho python 3.8 is not installed by installing eg > python-scipy, the package is made available in the store as it's referenc= ed. > >> When the default python version is changed, the build system will change >> accordingly. > > Yep makes sense - so the python package will now reference the 3.9 > package here instead of 3.8: > > ;; Current 3.x version. > (define-public python-3 python-3.8) > > I'm guessing my local Guix would stay on 3.8 until I did a guix > upgrade. At this point the new version of python-3 would force any > python packages I had to reinstall against 3.9. I assume my local 3.8 sy= stem > would be left untouched, such that I could rollback both the python > version and my packages if I wanted? What you say is roughly right, but it's not very representative of what happens. Upgrading to Guix that has Python 3.9 as the default from a version where 3.8 is the default will affect the build system behaviour as you've seen. Upgrading your profile will generate you a new generation where the Python packages are built with 3.9 (as that's what the updated Guix provides). Changes to profiles are not destructive, so you can roll back. > What would happen if I installed a new python package after pulling the > latest package definitions tho? Guix profiles work with search paths, and the PYTHONPATH is version specifc, so python@3.9 will look in lib/python3.9/site-packages. You can see this in action here: =E2=86=92 guix environment --ad-hoc python python-pandas --search-paths export PATH=3D"/gnu/store/08y11hsyflh1fdpkvs8f8snydkr9vq36-profile/bin${PAT= H:+:}$PATH" export PYTHONPATH=3D"/gnu/store/08y11hsyflh1fdpkvs8f8snydkr9vq36-profile/li= b/python3.8/site-packages${PYTHONPATH:+:}$PYTHONPATH" If you have a python@3.8 plus one python library built with python@3.8 and another python library built with python@3.9, the PYTHONPATH Guix generates will just include lib/python3.8/site-packages. > So I have a system say with python3.8 and python-scipy, and I decide I > want to then install python-pandas (for example). Will it not then > build this for python 3.9 (due to the new definition), if the version of > python has incremented between the installs of python-scipy and > python-pandas? Would I then have to manually reinstall python-scipy to > have it under 3.9 (as well as 3.8) (or do a guix upgrade)? Yep. > Last question, if today I wanted to create a profile that installed > python-scipy against the python 3.9 package definition (which already > exists in Guix it's just not the default). Do I have to change the > python-3 definition as per above, or is there another way of saying "use > python3.9 just for this profile". You can pass the python package to use to the python-build-system through the #:python argument. Look for examples of this in Guix, there's plenty for Python 2 only libraries. There are quite a few transformation options that you can use when building/installing packages, but I'm not aware of one that works with build system arguments. Maybe that could be added though. Without that, you'd need to either change the default python, or generate a variant of the library which uses the python you intend. > I suspect I could use a manifest to install 3.9 rather than the default, > but won't any packages still depend on 3.8 unless I switch the python-3 > definition? Yes. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl/03kxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9Xd0GBAAjhPQ+FxUAMOgiaId1L5xYbFd3GDDRFd3 CV8LTuHLCXPMNcc7JMAyYHarseU7arYHCMmB3Mnhez2u62H1IKzXkFqJ1UpJvAKW boTU0Jikh+wO0L7KKQxsPGqikgY5UNSx6dsFliFIOQDffbD13aJLJONu0l6A79Hr C1sjV+KN1paPKd4iyiz571io1cfJoHVzzT5KqeVvkWKIyl9v8Rtdaw/DCUmxLAxx NM46Z/QotKE1Vq7f90bKEzv7xsmpwTKrZHGS74qEkf+NeDzU4X6q+qOk+CzMpECv 5nXOrcMJ2Z4yq9ipUBOdWToO40X3ufYHiVAzq67TRCMpwpUuz/mYQFpGHuDldw+R PDsoOJMqGUS4e3dSjOivYDOm4X8+7TDBAVpv6l5Z5uzBkqZ6gF9zs/m5a28CwbuT GZ8PfsBnS3q0TI+LfnWrmy4RlMDJJudIuUFURUvs6tn+4f9gbLT6JlNhCMk5FItK 7oL9OL+no7AX9/c8adKSj6I37db3ZB4eCAHPXnIPx27bx7B/+OBS86O/NVL2gzM3 QEVDO2kqcAn+Mg+1d83F82pDaxNiXclqbwP/SbogCt3OYqBiApawkhYXYiZuRMYG /0s9+olrbLHa1xtbiWSfRGTx8iT6/AvyFuWlYnvT/fY46+rYRMpYpLfyVr49Gn4L moO8orv63Kk= =rd5h -----END PGP SIGNATURE----- --=-=-=--