summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sping@gentoo.org>2020-01-25 23:09:24 +0100
committerSebastian Pipping <sping@gentoo.org>2020-01-25 23:41:54 +0100
commit4efc69a52365dd5fbb5dad9dee6ee68c86b333e7 (patch)
tree64b48512be18127464e1d1a3b1a2b50437547797
parentmetagenerator.py: Fix execution of tests for Python 3 (diff)
downloadmetagen-4efc69a52365dd5fbb5dad9dee6ee68c86b333e7.tar.gz
metagen-4efc69a52365dd5fbb5dad9dee6ee68c86b333e7.tar.bz2
metagen-4efc69a52365dd5fbb5dad9dee6ee68c86b333e7.zip
setup.py: Get some cruft out, use setuptools
Signed-off-by: Sebastian Pipping <sping@gentoo.org>
-rwxr-xr-x[-rw-r--r--]setup.py71
1 files changed, 16 insertions, 55 deletions
diff --git a/setup.py b/setup.py
index 797a83a..4c546e9 100644..100755
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ SYNOPSIS:
python3 setup.py [options] [command]
DESCRIPTION:
- Using distutils "setup", build, install, or make tarball of the package.
+ Using setuptools "setup", build, install, or make tarball of the package.
OPTIONS:
See Distutils documentation for details on options and commands.
@@ -29,17 +29,12 @@ EXAMPLES:
python3 setup.py sdist
"""
-import os,sys,re,string,getopt,shutil,subprocess,glob
-from distutils.core import setup,Extension
+import glob
+from setuptools import setup
from metagen.version import __version__
-modname='setup'
-debug_p=0
-
pkgname='metagen'
-#version=string.strip(open("VERSION").readline())
version = __version__
-exec_prefix=sys.exec_prefix
description = "Metadata.xml Generator for Ebuilds"
author = "Rob Cakebread"
author_email = "pythonhead@gentoo.org"
@@ -50,56 +45,22 @@ packages=['metagen']
package_data={"metagen" : ["test_cli"]}
data_files=[("share/doc/%s-%s" % ("metagen", version), glob.glob("docs/*"))]
-#===utilities==========================
-def debug(ftn,txt):
- if debug_p:
- sys.stdout.write("%s.%s:%s\n" % (modname,ftn,txt))
- sys.stdout.flush()
-
-def fatal(ftn,txt):
- msg="%s.%s:FATAL:%s\n" % (modname,ftn,txt)
- raise SystemExit(msg)
-
-def usage():
- print(__doc__)
-#=============================
def main():
- setup (#---meta-data---
- name = pkgname,
- version = version,
- description = description,
- author = author,
- author_email = author_email,
- url=url,
- license = license,
+ setup(
+ name = pkgname,
+ version = version,
+ description = description,
+ author = author,
+ author_email = author_email,
+ url=url,
+ license = license,
- #---scripts,modules and packages---
- packages = packages,
- data_files = data_files,
- )
-#==============================
-if __name__ == '__main__':
- opts,pargs=getopt.getopt(sys.argv[1:],'hv',
- ['help','version','exec-prefix'])
- for opt in opts:
- if opt[0]=='-h' or opt[0]=='--help':
- usage()
- sys.exit(0)
- elif opt[0]=='-v' or opt[0]=='--version':
- print(modname+": version="+version)
- elif opt[0]=='--exec-prefix':
- exec_prefix=opt[1]
+ packages = packages,
+ data_files = data_files,
+ package_data = package_data,
+ )
- for arg in pargs:
- if arg=='test':
- do_test()
- sys.exit(0)
- elif arg=='doc':
- do_doc()
- sys.exit(0)
- else:
- pass
+if __name__ == '__main__':
main()
-