From: Brian Dolbec <dolsen@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Cc: "W. Trevor King" <wking@tremily.us>
Subject: [gentoo-catalyst] [PATCH 5/5] setup.py: Add disutils-based packaging
Date: Sat, 11 Jan 2014 17:46:58 -0800 [thread overview]
Message-ID: <1389491218-1488-6-git-send-email-dolsen@gentoo.org> (raw)
In-Reply-To: <1389491218-1488-1-git-send-email-dolsen@gentoo.org>
From: "W. Trevor King" <wking@tremily.us>
Package catalyst in the usual manner for Python projects. Now it is
ready for PyPI :).
I also expose the version string in catalyst.__version__, since that's
a more traditional location.
---
.gitignore | 4 +++
MANIFEST.in | 6 ++++
catalyst/__init__.py | 3 ++
setup.py | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 102 insertions(+)
create mode 100644 MANIFEST.in
create mode 100644 setup.py
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/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/catalyst/__init__.py b/catalyst/__init__.py
index e69de29..c058e16 100644
--- a/catalyst/__init__.py
+++ b/catalyst/__init__.py
@@ -0,0 +1,3 @@
+"Catalyst is a release building tool used by Gentoo Linux"
+
+__version__="2.0.15"
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..34eae53
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,89 @@
+# Copyright (C) 2013 W. Trevor King <wking@tremily.us>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+"Catalyst is a release building tool used by Gentoo Linux"
+
+import codecs as _codecs
+from distutils.core import setup as _setup
+import itertools as _itertools
+import os as _os
+
+from catalyst import __version__
+
+
+_this_dir = _os.path.dirname(__file__)
+package_name = 'catalyst'
+tag = '{0}-{1}'.format(package_name, __version__)
+
+
+def files(root):
+ """Iterate through all the file paths under `root`
+
+ 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
+ """
+ for dirpath, dirnames, filenames in _os.walk(root):
+ for filename in filenames:
+ path = _os.path.join(dirpath, filename)
+ if _os.path.sep != '/':
+ path = path.replace(_os.path.sep, '/')
+ yield path
+
+
+_setup(
+ name=package_name,
+ version=__version__,
+ maintainer='Gentoo Release Engineering',
+ maintainer_email='releng@gentoo.org',
+ url='http://www.gentoo.org/proj/en/releng/{0}/'.format(package_name),
+ download_url='http://git.overlays.gentoo.org/gitweb/?p=proj/{0}.git;a=snapshot;h={1};sf=tgz'.format(package_name, tag),
+ 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.6',
+ 'Programming Language :: Python :: 2.7',
+ ],
+ scripts=['bin/{0}'.format(package_name)],
+ packages=[
+ package_name,
+ '{0}.arch'.format(package_name),
+ '{0}.base'.format(package_name),
+ '{0}.targets'.format(package_name),
+ ],
+ data_files=[
+ ('/etc/catalyst', [
+ 'etc/catalyst.conf',
+ 'etc/catalystrc',
+ ]),
+ ('lib/catalyst/', list(_itertools.chain(
+ files('livecd'),
+ files('targets'),
+ ))),
+ ],
+ provides=[package_name],
+ )
--
1.8.3.2
next prev parent reply other threads:[~2014-01-12 1:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-12 1:46 [gentoo-catalyst] Re-organize the python structure Brian Dolbec
2014-01-12 1:46 ` [gentoo-catalyst] [PATCH 1/5] Initial rearrangement of the python directories Brian Dolbec
2014-01-12 20:25 ` Brian Dolbec
2014-02-22 17:10 ` W. Trevor King
2014-02-22 18:40 ` Brian Dolbec
2014-02-22 19:37 ` [gentoo-catalyst] [PATCH] Makefile: Fix PACKAGE_VERSION extraction W. Trevor King
2014-02-22 21:46 ` Brian Dolbec
2014-01-12 1:46 ` [gentoo-catalyst] [PATCH 2/5] Move catalyst_support, builder, catalyst_lock out of modules, into the catalyst namespace Brian Dolbec
2014-01-12 1:46 ` [gentoo-catalyst] [PATCH 3/5] Rename the modules subpkg to targets, to better reflect what it contains Brian Dolbec
2014-01-12 1:46 ` [gentoo-catalyst] [PATCH 4/5] Move catalyst.conf and catalystrc to an etc/ directory Brian Dolbec
2014-01-12 1:46 ` Brian Dolbec [this message]
2014-01-12 2:11 ` [gentoo-catalyst] Re: [PATCH 5/5] setup.py: Add disutils-based packaging W. Trevor King
2014-01-12 3:36 ` Brian Dolbec
2014-01-22 5:10 ` [gentoo-catalyst] Re-organize the python structure W. Trevor King
2014-01-22 15:49 ` Rick "Zero_Chaos" Farina
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=1389491218-1488-6-git-send-email-dolsen@gentoo.org \
--to=dolsen@gentoo.org \
--cc=gentoo-catalyst@lists.gentoo.org \
--cc=wking@tremily.us \
/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