comparison setup.py @ 29:c06e438f68b2

Build a real Python package
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 07 Dec 2020 03:10:44 +0100
parents
children ffcce6062bee
comparison
equal deleted inserted replaced
28:ffe2d6320f2e 29:c06e438f68b2
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 import re
5 import os
6 import sys
7 try:
8 from setuptools import setup
9 except ImportError:
10 from distutils.core import setup
11
12
13 if (sys.version_info[0] < 2) or \
14 ((sys.version_info[0] == 2) and (sys.version_info[1] < 7)):
15 raise ValueError("Need at least Python 2.7")
16
17
18 pkg_root = os.path.dirname(__file__)
19
20 _version_re = re.compile(br"^\s*__version__\s*=\s*(\"|')(.*)\1\s*(#.*)?$",
21 re.MULTILINE)
22
23 with open(os.path.join(pkg_root, "shasum.py"), "rb") as vf:
24 version = _version_re.search(vf.read()).group(2).decode("utf-8")
25
26
27 setup(
28 name="py-cutils",
29 version=version,
30 author="Franz Glasner",
31 license="BSD 3-Clause License",
32 url="https://pypi.dom66.de/simple/py-cutils/",
33 description="Pure Python implementation of some coreutils",
34 long_description="Pure Python implementation of some coreutils",
35 py_modules=["shasum"],
36 include_package_data=False,
37 zip_safe=True,
38 platforms="any",
39 classifiers=[
40 "Development Status :: 5 - Production/Stable",
41 "Environment :: Console",
42 "Intended Audience :: Developers",
43 "Intended Audience :: System Administrators",
44 "License :: OSI Approved :: BSD License",
45 "Operating System :: OS Independent",
46 "Programming Language :: Python",
47 "Programming Language :: Python :: 2.7",
48 "Programming Language :: Python :: 3",
49 "Topic :: System",
50 "Topic :: Utilities",
51 ],
52 python_requires=">=2.7",
53 entry_points = {
54 "console_scripts": [
55 "py-shasum=shasum:main",
56 ]
57 }
58 )