# HG changeset patch # User Goffi # Date 1522917668 -7200 # Node ID 4aca060075b7c28c6fccbffbf885f8e27f2ceb07 # Parent 2ac37dfc408b84774bc9300cf8a8fb1b48ecb42c setup: version is now set in SAT/VERSION, sat is not imported anymore in setup diff -r 2ac37dfc408b -r 4aca060075b7 MANIFEST.in --- a/MANIFEST.in Wed Apr 04 22:09:20 2018 +0200 +++ b/MANIFEST.in Thu Apr 05 10:41:08 2018 +0200 @@ -1,4 +1,4 @@ -include MANIFEST.in ez_setup.py +include MANIFEST.in sat/VERSION global-include *.py global-include *.ini global-include *.po *.mo diff -r 2ac37dfc408b -r 4aca060075b7 sat/VERSION --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat/VERSION Thu Apr 05 10:41:08 2018 +0200 @@ -0,0 +1,1 @@ +0.7.0D diff -r 2ac37dfc408b -r 4aca060075b7 sat/__init__.py --- a/sat/__init__.py Wed Apr 04 22:09:20 2018 +0200 +++ b/sat/__init__.py Thu Apr 05 10:41:08 2018 +0200 @@ -1,3 +1,23 @@ -from .core.constants import Const as C +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- + +# SàT: a XMPP client +# Copyright (C) 2009-2018 Jérôme Poisson (goffi@goffi.org) + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. -__version__ = C.APP_VERSION +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. + +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +import os.path + +version_file = os.path.join(os.path.dirname(__file__), 'VERSION') +with open(version_file) as f: + __version__ = f.read().strip() diff -r 2ac37dfc408b -r 4aca060075b7 sat/core/constants.py --- a/sat/core/constants.py Wed Apr 04 22:09:20 2018 +0200 +++ b/sat/core/constants.py Thu Apr 05 10:41:08 2018 +0200 @@ -22,6 +22,7 @@ from os.path import expanduser, realpath except ImportError: BaseDirectory = None +import sat class Const(object): @@ -32,7 +33,7 @@ APP_NAME_FILE = u'sat' APP_NAME_FULL = u'{name_short} ({name})'.format(name_short=APP_NAME_SHORT, name=APP_NAME) - APP_VERSION = u'0.7.0D' # Please add 'D' at the end for dev versions + APP_VERSION = sat.__version__ # Please add 'D' at the end of version in sat/VERSION for dev versions APP_RELEASE_NAME = u'La Commune' APP_URL = u'https://salut-a-toi.org' diff -r 2ac37dfc408b -r 4aca060075b7 setup.py --- a/setup.py Wed Apr 04 22:09:20 2018 +0200 +++ b/setup.py Thu Apr 05 10:41:08 2018 +0200 @@ -19,7 +19,6 @@ # along with this program. If not, see . from setuptools import setup, find_packages -from sat.core.constants import Const as C import os import sys @@ -55,15 +54,17 @@ DBUS_DIR = 'dbus-1/services' DBUS_FILE = 'misc/org.goffi.SAT.service' +with open('sat/VERSION') as f: + VERSION = f.read().strip() setup(name=NAME, - version=C.APP_VERSION, + version=VERSION, description=u'Salut à Toi multipurpose and multi frontend XMPP client', long_description=u'Salut à Toi (SàT) is a XMPP client based on a daemon/frontend architecture. Its multi frontend (desktop, web, console interface, CLI, etc) and multipurpose (instant messaging, microblogging, games, file sharing, etc).', author='Association « Salut à Toi »', author_email='contact@goffi.org', - url=C.APP_URL, + url='https://salut-a-toi.org', classifiers=['Development Status :: 3 - Alpha', 'Environment :: Console', 'Framework :: Twisted', @@ -78,5 +79,6 @@ scripts=['sat_frontends/jp/jp', 'sat_frontends/primitivus/primitivus', 'bin/sat'], zip_safe=False, install_requires=install_requires, + package_data={'sat': ['VERSION']}, python_requires='~=2.7', )