From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Subject: [gentoo-portage-dev] [PATCHES] setup.py install for Portage
Date: Thu, 21 Aug 2014 22:19:38 +0200 [thread overview]
Message-ID: <1408652384-1954-1-git-send-email-mgorny@gentoo.org> (raw)
Hello, everyone.
Here is a rebase of my recent work on bringing setup.py install for
Portage.
About the patches:
(1) teaches the self-update function to deal with PORTAGE_PYM_PATH that
contains more packages than Portage itself. In particular, it makes it
copy packages of Portage only rather than everything found in 'pym' :).
(2) makes PORTAGE_PYM_PATH contain wherever Portage is loaded from
rather than 'pym' subdirectory of PORTAGE_BASE_PATH. This makes the code
work well when 'pym' directory is removed.
(3) makes sure that all important test files are suffixed with .py so
that they are installed by setup.py without extra hackery.
(4) fixes all the remaining issues with tests, allowing them to be run
on the installed copy of Portage.
(5) replaces the Makefiles with setup.py. It's distutils with a few
extensions -- mostly making it possible to install scripts to multiple
locations, install data files recursively and override all the paths.
(6) updates .travis.yml to run tests using setup.py, and also try
installing and re-running tests after install.
I will follow this thread with updated ebuild.
About the new install layout:
1. /usr/lib/portage/pym no longer exists. Python files are installed
directly to site-packages for each implementation (by default).
2. /usr/lib/portage/bin no longer contains copies of the scripts that
are installed to /usr/bin and /usr/sbin.
3. All Python scripts have proper shebangs set by distutils. To fit this
with how distutils usually works and how the eclass expects it to be
done, my ebuild had done a few more changes:
3a. all programs from /usr/sbin are moved to /usr/bin, and all programs
in /usr/bin are wrapped.
3b. The Portage internal tools are moved from /usr/lib/portage/bin
to /usr/lib/portage/${EPYTHON} so that no Python mismatch is possible.
3c. /usr/lib/portage/bin became a symlink for external tool
compatibility. It uses the 'last' Python implementation as chosen
by distutils-r1.
I have tested these changes for a while and I think Portage itself can
handle them well. However, some of the external tools overrelying on
Portage itself can be broken, eix in particular.
In particular, tools that want to play with Portage internals need to
export proper PORTAGE_BIN_PATH and PORTAGE_PYM_PATH before spawning
them. The correct values can be obtained using portageq:
$ portageq envvar PORTAGE_BIN_PATH
/usr/lib/portage/python3.4
$ portageq envvar PORTAGE_PYM_PATH
/usr/lib64/python3.4/site-packages
Please look through the patches and test at will :). Thanks.
--
Michał Górny
next reply other threads:[~2014-08-21 20:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-21 20:19 Michał Górny [this message]
2014-08-21 20:19 ` [gentoo-portage-dev] [PATCH 1/6] self-update: Copy only relevant packages from PORTAGE_PYM_PATH Michał Górny
2014-08-22 21:47 ` Brian Dolbec
2014-08-21 20:19 ` [gentoo-portage-dev] [PATCH 2/6] portage.const: Make PORTAGE_PYM_PATH point to the real package tree Michał Górny
2014-08-21 20:19 ` [gentoo-portage-dev] [PATCH 3/6] tests: Append .py to files that need to be installed Michał Górny
2014-08-21 20:19 ` [gentoo-portage-dev] [PATCH 4/6] tests: Fix running on installed copy of Portage Michał Górny
2014-08-22 22:19 ` Brian Dolbec
2014-08-22 22:52 ` Michał Górny
2014-08-21 20:19 ` [gentoo-portage-dev] [PATCH 5/6] Install Python modules using setup.py Michał Górny
2014-08-22 22:30 ` Brian Dolbec
2014-08-22 22:55 ` Michał Górny
2014-08-23 20:30 ` [gentoo-portage-dev] [PATCH v2] Install Portage " Michał Górny
2014-08-23 21:56 ` Brian Dolbec
2014-08-29 17:08 ` Brian Dolbec
2014-08-29 23:30 ` Brian Dolbec
2014-09-05 6:58 ` [gentoo-portage-dev] [PATCH v3] " Michał Górny
2014-08-21 20:19 ` [gentoo-portage-dev] [PATCH 6/6] travis: Use setup.py for running tests Michał Górny
2014-08-21 20:22 ` [gentoo-portage-dev] [PATCHES] setup.py install for Portage Michał Górny
2014-08-21 20:25 ` Michał Górny
2014-08-22 22:32 ` Brian Dolbec
2014-08-24 19:42 ` Brian Dolbec
2014-08-24 21:19 ` Michał Górny
2014-09-12 7:17 ` Michał Górny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1408652384-1954-1-git-send-email-mgorny@gentoo.org \
--to=mgorny@gentoo.org \
--cc=gentoo-portage-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox