[systemd-devel] [PATCH] python-systemd: add version number
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Mon Apr 29 19:33:36 PDT 2013
On Tue, Apr 23, 2013 at 08:11:03PM +0100, Steven Hiscocks wrote:
> From: Steven Hiscocks <steven at hiscocks.me.uk>
>
> ---
> Hi,
>
> I thought it would be useful to have a version number in the python systemd module.
Hi,
I haven't replied to this before because of one reservation. Namely,
right now all systemd modules are independent, and could be packaged
separately, with systemd being an implicit namespace package à la
PEP 420. I think that this makes a lot of sense, since systemd itself
is composed of many loosely linked parts and and we're unlikely to
ever put any functionality in systemd package itself. But adding
systemd.__version__ and encouraging people to use it will make such
a step harder. OTOH, adding __version__ to individual packages would
definitely be worthwhile. As an additional bonus, all those packages
have compiled components, so __version__ could be added without any
sed postprocessing.
Zbyszek
> I'm not overly familiar with Make, etc. but hopefully I've taken the right approach. :)
>
> Thanks
> Steven Hiscocks
>
> Makefile.am | 3 +++
> src/python-systemd/{__init__.py => __init__.py.in} | 1 +
> 2 files changed, 4 insertions(+)
> rename src/python-systemd/{__init__.py => __init__.py.in} (95%)
>
> diff --git a/Makefile.am b/Makefile.am
> index d594a3d..718e6f8 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -3868,6 +3868,9 @@ src/%.policy.in: src/%.policy.in.in Makefile
> %.rules: %.rules.in Makefile
> $(SED_PROCESS)
>
> +src/python-systemd/%: src/python-systemd/%.in
> + $(SED_PROCESS)
> +
> %.sh: %.sh.in Makefile
> $(SED_PROCESS)
> $(AM_V_GEN)chmod +x $@
> diff --git a/src/python-systemd/__init__.py b/src/python-systemd/__init__.py.in
> similarity index 95%
> rename from src/python-systemd/__init__.py
> rename to src/python-systemd/__init__.py.in
> index 0d56b99..7109f2a 100644
> --- a/src/python-systemd/__init__.py
> +++ b/src/python-systemd/__init__.py.in
> @@ -16,3 +16,4 @@
> #
> # You should have received a copy of the GNU Lesser General Public License
> # along with systemd; If not, see <http://www.gnu.org/licenses/>.
> +__version__ = '@PACKAGE_VERSION@'
> --
> 1.8.2.1
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
More information about the systemd-devel
mailing list