From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 45C6813873B for ; Sun, 2 Mar 2014 15:42:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 035F0E0A5B; Sun, 2 Mar 2014 15:42:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 26632E0A5A for ; Sun, 2 Mar 2014 15:42:18 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2C45233FAF2 for ; Sun, 2 Mar 2014 15:42:17 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id EE867188ED for ; Sun, 2 Mar 2014 15:42:15 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1393093831.46b261e967904262245c42322a96f0d7f2322a27.dol-sen@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: /, catalyst/, bin/ X-VCS-Repository: proj/catalyst X-VCS-Files: .gitignore AUTHORS MANIFEST.in bin/catalyst catalyst/__init__.py catalyst/main.py setup.py X-VCS-Directories: / catalyst/ bin/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 46b261e967904262245c42322a96f0d7f2322a27 X-VCS-Branch: master Date: Sun, 2 Mar 2014 15:42:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4f674b20-4fd9-41cd-96f3-6d3fbe926830 X-Archives-Hash: 4e5de977851d17dd0d044f4e49732e10 commit: 46b261e967904262245c42322a96f0d7f2322a27 Author: W. Trevor King tremily us> AuthorDate: Wed Jun 5 17:13:43 2013 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sat Feb 22 18:30:31 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=46b261e9 setup.py: Add disutils-based packaging Package catalyst in the usual manner for Python projects. Now it is ready for PyPI :). I also expose the version string in catalyst.__version__ and the maintainer string in catalyst.__maintainer__, since those are more traditional locations. I dropped official Python 2.6 support following: 19:31 <@jmbsvicetto> I don't see a need to make catalyst incompatible with 2.6, but I think it's time we drop it as a "requirement". So feel free to do any changes that improve the code, even if they drop 2.6 compatibility I kept the explicit indexes in the string formatting, since Python 2.6 doesn't support: '{}'.format(value) --- .gitignore | 4 +++ AUTHORS | 1 + MANIFEST.in | 6 ++++ bin/catalyst | 6 ++-- catalyst/__init__.py | 4 +++ catalyst/main.py | 3 +- setup.py | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 99 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 539da74..d52b297 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ *.py[co] +dist +build +files +MANIFEST diff --git a/AUTHORS b/AUTHORS index 3c43706..a379d42 100644 --- a/AUTHORS +++ b/AUTHORS @@ -36,6 +36,7 @@ Lars Weiler Gustavo Zacarias Raúl Porcel Jorge Manuel B. S. Vicetto +W. Trevor King Maintainers: diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..4274094 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,6 @@ +include AUTHORS +include ChangeLog +include COPYING +include Makefile +recursive-include doc *.conf *.py HOWTO.txt catalyst*.txt +recursive-include examples README *.example *.spec diff --git a/bin/catalyst b/bin/catalyst index ace43fc..19f5289 100755 --- a/bin/catalyst +++ b/bin/catalyst @@ -12,10 +12,6 @@ from __future__ import print_function import sys -__maintainer__="Catalyst " -__version__="2.0.12.2" - - # This block ensures that ^C interrupts are handled quietly. try: import signal @@ -36,6 +32,8 @@ except KeyboardInterrupt: from catalyst.main import main +from catalyst import __maintainer__ +from catalyst import __version__ try: main() diff --git a/catalyst/__init__.py b/catalyst/__init__.py index e69de29..43a75d6 100644 --- a/catalyst/__init__.py +++ b/catalyst/__init__.py @@ -0,0 +1,4 @@ +"Catalyst is the release building tool used by Gentoo Linux" + +__version__ = '2.0.16' +__maintainer__ = 'Catalyst ' diff --git a/catalyst/main.py b/catalyst/main.py index cb30bd7..6b90989 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -18,13 +18,12 @@ __selfpath__ = os.path.abspath(os.path.dirname(__file__)) sys.path.append(__selfpath__ + "/modules") +from . import __version__ import catalyst.config import catalyst.util from catalyst.support import (required_build_targets, valid_build_targets, CatalystError, hash_map, find_binary, LockInUse) -__maintainer__="Catalyst " -__version__="2.0.15" conf_values={} diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..fb49cd6 --- /dev/null +++ b/setup.py @@ -0,0 +1,81 @@ +"Catalyst is the release building tool used by Gentoo Linux" + +import codecs as _codecs +from distutils.core import setup as _setup +from email.utils import parseaddr as _parseaddr +import itertools as _itertools +import os as _os + +from catalyst import __version__, __maintainer__ + + +_this_dir = _os.path.dirname(__file__) +_package_name = 'catalyst' +_maintainer_name, _maintainer_email = _parseaddr(__maintainer__) + + +def _posix_path(path): + """Convert a native path to a POSIX path + + Distutils wants all paths to be written in the Unix convention + (i.e. slash-separated) [1], so that's what we'll do here. + + [1]: http://docs.python.org/2/distutils/setupscript.html#writing-the-setup-script + """ + if _os.path.sep != '/': + return path.replace(_os.path.sep, '/') + return path + + +def _files(prefix, root): + """Iterate through all the file paths under `root` + + Yielding `(target_dir, (file_source_paths, ...))` tuples. + """ + for dirpath, dirnames, filenames in _os.walk(root): + reldir = _os.path.relpath(dirpath, root) + install_directory = _posix_path( + _os.path.join(prefix, reldir)) + file_source_paths = [ + _posix_path(_os.path.join(dirpath, filename)) + for filename in filenames] + yield (install_directory, file_source_paths) + + +_setup( + name=_package_name, + version=__version__, + maintainer=_maintainer_name, + maintainer_email=_maintainer_email, + url='http://www.gentoo.org/proj/en/releng/{0}/'.format(_package_name), + download_url='http://distfiles.gentoo.org/distfiles/{0}-{1}.tar.bz2'.format( + _package_name, __version__), + license='GNU General Public License (GPL)', + platforms=['all'], + description=__doc__, + long_description=_codecs.open( + _os.path.join(_this_dir, 'README'), 'r', 'utf-8').read(), + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)', + 'Intended Audience :: System Administrators', + 'Operating System :: POSIX', + 'Topic :: System :: Archiving :: Packaging', + 'Topic :: System :: Installation/Setup', + 'Topic :: System :: Software Distribution', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + ], + scripts=['bin/{0}'.format(_package_name)], + packages=[ + _package_name, + '{0}.arch'.format(_package_name), + '{0}.targets'.format(_package_name), + ], + data_files=list(_itertools.chain( + _files(prefix='/etc/catalyst', root='etc'), + _files(prefix='lib/catalyst/livecd', root='livecd'), + _files(prefix='lib/catalyst/targets', root='targets'), + )), + provides=[_package_name], + ) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 8C003138F21 for ; Sat, 22 Feb 2014 18:43:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E3DA8E0B37; Sat, 22 Feb 2014 18:43:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2367CE0B36 for ; Sat, 22 Feb 2014 18:43:31 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3222333FAD4 for ; Sat, 22 Feb 2014 18:43:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 74CA1188ED for ; Sat, 22 Feb 2014 18:43:27 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1393093831.46b261e967904262245c42322a96f0d7f2322a27.dol-sen@gentoo> Subject: [gentoo-commits] proj/catalyst:pending commit in: /, catalyst/, bin/ X-VCS-Repository: proj/catalyst X-VCS-Files: .gitignore AUTHORS MANIFEST.in bin/catalyst catalyst/__init__.py catalyst/main.py setup.py X-VCS-Directories: / catalyst/ bin/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 46b261e967904262245c42322a96f0d7f2322a27 X-VCS-Branch: pending Date: Sat, 22 Feb 2014 18:43:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 2475c96a-c578-4147-8544-b4c6a21a32cf X-Archives-Hash: f9a85f40ee4784baf9ec8a87613edfcc Message-ID: <20140222184327.IStHznQuXWrWzQy81CWRiq8XDduaRciOFAZaDLW9rQ0@z> commit: 46b261e967904262245c42322a96f0d7f2322a27 Author: W. Trevor King tremily us> AuthorDate: Wed Jun 5 17:13:43 2013 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sat Feb 22 18:30:31 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=46b261e9 setup.py: Add disutils-based packaging Package catalyst in the usual manner for Python projects. Now it is ready for PyPI :). I also expose the version string in catalyst.__version__ and the maintainer string in catalyst.__maintainer__, since those are more traditional locations. I dropped official Python 2.6 support following: 19:31 <@jmbsvicetto> I don't see a need to make catalyst incompatible with 2.6, but I think it's time we drop it as a "requirement". So feel free to do any changes that improve the code, even if they drop 2.6 compatibility I kept the explicit indexes in the string formatting, since Python 2.6 doesn't support: '{}'.format(value) --- .gitignore | 4 +++ AUTHORS | 1 + MANIFEST.in | 6 ++++ bin/catalyst | 6 ++-- catalyst/__init__.py | 4 +++ catalyst/main.py | 3 +- setup.py | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 99 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 539da74..d52b297 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ *.py[co] +dist +build +files +MANIFEST diff --git a/AUTHORS b/AUTHORS index 3c43706..a379d42 100644 --- a/AUTHORS +++ b/AUTHORS @@ -36,6 +36,7 @@ Lars Weiler Gustavo Zacarias Raúl Porcel Jorge Manuel B. S. Vicetto +W. Trevor King Maintainers: diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..4274094 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,6 @@ +include AUTHORS +include ChangeLog +include COPYING +include Makefile +recursive-include doc *.conf *.py HOWTO.txt catalyst*.txt +recursive-include examples README *.example *.spec diff --git a/bin/catalyst b/bin/catalyst index ace43fc..19f5289 100755 --- a/bin/catalyst +++ b/bin/catalyst @@ -12,10 +12,6 @@ from __future__ import print_function import sys -__maintainer__="Catalyst " -__version__="2.0.12.2" - - # This block ensures that ^C interrupts are handled quietly. try: import signal @@ -36,6 +32,8 @@ except KeyboardInterrupt: from catalyst.main import main +from catalyst import __maintainer__ +from catalyst import __version__ try: main() diff --git a/catalyst/__init__.py b/catalyst/__init__.py index e69de29..43a75d6 100644 --- a/catalyst/__init__.py +++ b/catalyst/__init__.py @@ -0,0 +1,4 @@ +"Catalyst is the release building tool used by Gentoo Linux" + +__version__ = '2.0.16' +__maintainer__ = 'Catalyst ' diff --git a/catalyst/main.py b/catalyst/main.py index cb30bd7..6b90989 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -18,13 +18,12 @@ __selfpath__ = os.path.abspath(os.path.dirname(__file__)) sys.path.append(__selfpath__ + "/modules") +from . import __version__ import catalyst.config import catalyst.util from catalyst.support import (required_build_targets, valid_build_targets, CatalystError, hash_map, find_binary, LockInUse) -__maintainer__="Catalyst " -__version__="2.0.15" conf_values={} diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..fb49cd6 --- /dev/null +++ b/setup.py @@ -0,0 +1,81 @@ +"Catalyst is the release building tool used by Gentoo Linux" + +import codecs as _codecs +from distutils.core import setup as _setup +from email.utils import parseaddr as _parseaddr +import itertools as _itertools +import os as _os + +from catalyst import __version__, __maintainer__ + + +_this_dir = _os.path.dirname(__file__) +_package_name = 'catalyst' +_maintainer_name, _maintainer_email = _parseaddr(__maintainer__) + + +def _posix_path(path): + """Convert a native path to a POSIX path + + Distutils wants all paths to be written in the Unix convention + (i.e. slash-separated) [1], so that's what we'll do here. + + [1]: http://docs.python.org/2/distutils/setupscript.html#writing-the-setup-script + """ + if _os.path.sep != '/': + return path.replace(_os.path.sep, '/') + return path + + +def _files(prefix, root): + """Iterate through all the file paths under `root` + + Yielding `(target_dir, (file_source_paths, ...))` tuples. + """ + for dirpath, dirnames, filenames in _os.walk(root): + reldir = _os.path.relpath(dirpath, root) + install_directory = _posix_path( + _os.path.join(prefix, reldir)) + file_source_paths = [ + _posix_path(_os.path.join(dirpath, filename)) + for filename in filenames] + yield (install_directory, file_source_paths) + + +_setup( + name=_package_name, + version=__version__, + maintainer=_maintainer_name, + maintainer_email=_maintainer_email, + url='http://www.gentoo.org/proj/en/releng/{0}/'.format(_package_name), + download_url='http://distfiles.gentoo.org/distfiles/{0}-{1}.tar.bz2'.format( + _package_name, __version__), + license='GNU General Public License (GPL)', + platforms=['all'], + description=__doc__, + long_description=_codecs.open( + _os.path.join(_this_dir, 'README'), 'r', 'utf-8').read(), + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)', + 'Intended Audience :: System Administrators', + 'Operating System :: POSIX', + 'Topic :: System :: Archiving :: Packaging', + 'Topic :: System :: Installation/Setup', + 'Topic :: System :: Software Distribution', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + ], + scripts=['bin/{0}'.format(_package_name)], + packages=[ + _package_name, + '{0}.arch'.format(_package_name), + '{0}.targets'.format(_package_name), + ], + data_files=list(_itertools.chain( + _files(prefix='/etc/catalyst', root='etc'), + _files(prefix='lib/catalyst/livecd', root='livecd'), + _files(prefix='lib/catalyst/targets', root='targets'), + )), + provides=[_package_name], + )