<feed xmlns='http://www.w3.org/2005/Atom'>
<title>guix/gnu/packages/aux-files/python, branch koszko</title>
<subtitle>Wojtek's customized Guix</subtitle>
<id>https://git.koszko.org/guix/atom?h=koszko</id>
<link rel='self' href='https://git.koszko.org/guix/atom?h=koszko'/>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/'/>
<updated>2024-08-31T08:44:38Z</updated>
<entry>
<title>gnu: python: Normalize sys.prefix in sitecustomize.py.</title>
<updated>2024-08-31T08:44:38Z</updated>
<author>
<name>Konrad Hinsen</name>
<email>konrad.hinsen@fastmail.net</email>
</author>
<published>2024-01-04T12:44:19Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=d5e0180805f52ef38a03ff9d6c11dd6174e3526b'/>
<id>urn:sha1:d5e0180805f52ef38a03ff9d6c11dd6174e3526b</id>
<content type='text'>
* gnu/packages/aux-files/python/sitecustomize.py: normalize sys.prefix to deal
with situations where it contains "../", as can happen in relocatable packs.

Change-Id: Ibfe13d7c2a14beaa199f599e64bc0b7bfb500fe8
Signed-off-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
</content>
</entry>
<entry>
<title>maint: Merge sanity-check-next.py into sanity-check.py.</title>
<updated>2023-04-15T01:01:34Z</updated>
<author>
<name>Maxim Cournoyer</name>
<email>maxim.cournoyer@gmail.com</email>
</author>
<published>2023-04-15T01:01:34Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=3c8a4d64ffb9fe80ffbb32981bae72b0e690b0fa'/>
<id>urn:sha1:3c8a4d64ffb9fe80ffbb32981bae72b0e690b0fa</id>
<content type='text'>
* gnu/packages/aux-files/python/sanity-check-next.py: Rename to...
* gnu/packages/aux-files/python/sanity-check.py: ... this.
* guix/build-system/pyproject.scm (sanity-check.py): Adjust file name.
* Makefile.am (AUX_FILES): De-register sanity-check-next.py.
</content>
</entry>
<entry>
<title>build-system: Add pyproject-build-system.</title>
<updated>2022-10-27T17:43:06Z</updated>
<author>
<name>Lars-Dominik Braun</name>
<email>lars@6xq.net</email>
</author>
<published>2022-04-23T09:36:55Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=400a7a4c80efbde1905ae98a298bbb5882d46a0d'/>
<id>urn:sha1:400a7a4c80efbde1905ae98a298bbb5882d46a0d</id>
<content type='text'>
This is an experimental build system based on python-build-system
that implements PEP 517-compliant builds.

* doc/guix.texi (Build Systems): Add pyproject-build-system section.
* doc/contributing.texi (Python Modules): Mention pyproject.toml and the
PYTHON-TOOLCHAIN package, as well as differences to python-build-system.
* guix/build-system/pyproject.scm,
guix/build/pyproject-build-system.scm,
gnu/packages/aux-files/python/sanity-check-next.py,
gnu/packages/python-commencement.scm: New files.
* Makefile.am (MODULES): Register the new build systems.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add python-commencement.scm.
* gnu/packages/python.scm (python-sans-pip, python-sans-pip-wrapper): New
variables.

Co-authored-by: Marius Bakke &lt;marius@gnu.org&gt;
</content>
</entry>
<entry>
<title>build/python: Improve error output in sanity check.</title>
<updated>2022-01-10T16:47:03Z</updated>
<author>
<name>Hartmut Goebel</name>
<email>h.goebel@crazy-compilers.com</email>
</author>
<published>2021-12-27T18:21:16Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=c3c943055d60ca4f926d0dac52b7b79b44f12c42'/>
<id>urn:sha1:c3c943055d60ca4f926d0dac52b7b79b44f12c42</id>
<content type='text'>
Instead of printing the "str()" representation of the excaption, print the
"repr()" representation. This will print the name of the exception and thus
ease understanding the actual error.

Signed-off-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
</content>
</entry>
<entry>
<title>sitecustomize.py: Honor .pth files.</title>
<updated>2022-01-10T16:44:26Z</updated>
<author>
<name>Maxim Cournoyer</name>
<email>maxim.cournoyer@gmail.com</email>
</author>
<published>2021-12-04T03:36:26Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=223cc96e5bb8d7d71f4b769ce722ebbdcebb8289'/>
<id>urn:sha1:223cc96e5bb8d7d71f4b769ce722ebbdcebb8289</id>
<content type='text'>
Fixes &lt;https://issues.guix.gnu.org/52269&gt;.

* gnu/packages/aux-files/python/sitecustomize.py: Use site.addsitedirs to add
the site directories; this takes care of the .pth files.  Make sure the added
items still appear before Python's own 'site-packages' directory.
</content>
</entry>
<entry>
<title>aux-files: sitecustomize: Cleanup and add explanatory comments.</title>
<updated>2021-11-11T15:31:32Z</updated>
<author>
<name>Maxim Cournoyer</name>
<email>maxim.cournoyer@gmail.com</email>
</author>
<published>2021-08-04T00:41:20Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=874188c0ab2955412519dc917402fefc6dd723fc'/>
<id>urn:sha1:874188c0ab2955412519dc917402fefc6dd723fc</id>
<content type='text'>
Fixes &lt;https://issues.guix.gnu.org/50105&gt;.

* gnu/packages/aux-files/python/sitecustomize.py: Add a comment explaining the
general idea, and use sys.prefix instead of sys.executable.

(major_minor): Use the unpacking operator (*) to provide the arguments.
(site_packages_prefix): Use os.path.join to form the path.
(python_site): Likewise.  Use sys.prefix instead of sys.executable.
(all_sites_raw): Split on os.path.pathsep.
(sys.path): Directly splice the result in the list.

Suggested-by: Hartmut Goebel &lt;h.goebel@crazy-compilers.com&gt;
Reported-by: Mathieu Othacehe &lt;othacehe@gnu.org&gt;
Signed-off-by: Maxim Cournoyer &lt;maxim.cournoyer@gmail.com&gt;
</content>
</entry>
<entry>
<title>build-system/python: Handle missing metadata on Python 2.</title>
<updated>2021-07-30T13:54:31Z</updated>
<author>
<name>Marius Bakke</name>
<email>marius@gnu.org</email>
</author>
<published>2021-07-30T13:54:31Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=f8458a228224942298e0967a099f872c13713ede'/>
<id>urn:sha1:f8458a228224942298e0967a099f872c13713ede</id>
<content type='text'>
* gnu/packages/aux-files/python/sanity-check.py: Catch the less specific
EnvironmentError rather than FileNotFoundError as the latter is Python 3
only.
</content>
</entry>
<entry>
<title>build/python: Handle FileNotFoundError exception in sanity-check.py.</title>
<updated>2021-02-04T02:56:53Z</updated>
<author>
<name>Maxim Cournoyer</name>
<email>maxim.cournoyer@gmail.com</email>
</author>
<published>2021-02-04T02:56:53Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=bb557c9ac19ab01cdf621c3fac887750981feb77'/>
<id>urn:sha1:bb557c9ac19ab01cdf621c3fac887750981feb77</id>
<content type='text'>
This exception was thrown while running the sanity-check on the python-isort
package, which doesn't make use of a setuptools-based build system but rather
of a PEP 517 compliant one.

* gnu/packages/aux-files/python/sanity-check.py: Handle the FileNotFoundError
whe attempting to read the 'top_level.txt' metadata file of the package.
Remove extraneous 'continue' statement.
</content>
</entry>
<entry>
<title>build/python: Add a sanity check phase.</title>
<updated>2021-02-01T16:53:43Z</updated>
<author>
<name>Lars-Dominik Braun</name>
<email>lars@6xq.net</email>
</author>
<published>2021-01-03T09:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=09448c0994390697e876db235a3b773311795238'/>
<id>urn:sha1:09448c0994390697e876db235a3b773311795238</id>
<content type='text'>
Add a new phase validating the usability of installed Python packages.

* gnu/packages/aux-files/python/sanity-check.py: New file.
* Makefile.am (AUX_FILES): Register it.
* guix/build-system/python.scm (sanity-check.py): New variable.
(lower): Add the script as an implicit input.
* guix/build/python-build-system.scm: Remove trailing #t.
(sanity-check): New phase.
(%standard-phases): Use it.
* tests/builders.scm: (make-python-dummy)
(dummy-ok, dummy-dummy-nosetuptools, dummy-fail-requirements)
(dummy-fail-import, dummy-fail-console-script): New variables.
("python-build-system: dummy-ok")
("python-build-system: dummy-dummy-nosetuptools")
("python-build-system: dummy-fail-requirements")
("python-build-system: dummy-fail-import")
("python-build-system: dummy-fail-console-script"): Add tests.
</content>
</entry>
<entry>
<title>gnu: python: Replace PYTHONPATH by GUIX_PYTHONPATH.</title>
<updated>2021-02-01T16:53:42Z</updated>
<author>
<name>Maxim Cournoyer</name>
<email>maxim.cournoyer@gmail.com</email>
</author>
<published>2021-01-22T04:26:01Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=cb72f9a773e0931ee3758c851d96007ded034e4c'/>
<id>urn:sha1:cb72f9a773e0931ee3758c851d96007ded034e4c</id>
<content type='text'>
Using PYTHONPATH as a mean to discover the Python packages had the following
issues:

        1. It is not versioned, so different versions of Python would clash if
        installed in a shared profile.

        2. It would interfere with the host Python site on foreign
        distributions, sometimes preventing a a user to login their GDM
        session (!).

        3. It would take precedence over user installed Python packages
        installed through pip.

        4. It would leak into Python virtualenvs, which are supposed to create
        isolated Python environments.

This changes fixes the above issues by making use of a sitecustomize.py
module.  The newly introduced GUIX_PYTHONPATH environment variable is read
from the environment, filtered for the current Python version of the
interpreter, and spliced in 'sys.path' just before Python's own site location,
which provides the expected behavior.

* gnu/packages/aux-files/python/sitecustomize.py: New file.
* Makefile.am: Register it.
* gnu/packages/python.scm (customize-site)
(guix-pythonpath-search-path): New procedures.
(python-2.7)[phases]{install-sitecustomize.py}: New phase.
[native-inputs]{sitecustomize.py}: New input.
[native-search-paths]: Replace PYTHONPATH with GUIX_PYTHONPATH.
(python-3.9)[native-search-paths]: Likewise.
[phases]{install-sitecustomize}: Override with correct version.
[native-search-paths]: Replace PYTHONPATH with GUIX_PYTHONPATH.
* gnu/packages/commencement.scm (python-boot0):
[phases]{install-sitecustomize}: Likewise.
[native-inputs]{sitecustomize.py}: New input.
[native-search-paths]: Replace PYTHONPATH with GUIX_PYTHONPATH.
* guix/build/python-build-system.scm (site-packages): Do not add a trailing
'/'.

squash! gnu: python: Replace PYTHONPATH by GUIX_PYTHONPATH.
</content>
</entry>
</feed>
