Mercurial > hgrepos > Python > apps > py-cutils
comparison setup.py @ 140:bf77784ee288
Use a declarative setup configuration now in setup.cfg
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 03 Jan 2025 01:06:19 +0100 |
| parents | 73e8116484f2 |
| children |
comparison
equal
deleted
inserted
replaced
| 139:73e8116484f2 | 140:bf77784ee288 |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # -*- coding: utf-8 -*- | 2 # -*- coding: utf-8 -*- |
| 3 | 3 |
| 4 import re | 4 from setuptools import setup |
| 5 import os | |
| 6 import sys | |
| 7 try: | |
| 8 from setuptools import setup | |
| 9 except ImportError: | |
| 10 from distutils.core import setup | |
| 11 | 5 |
| 12 | 6 setup() |
| 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 pkg_root = os.path.dirname(__file__) | |
| 18 | |
| 19 _version_re = re.compile(br"^\s*__version__\s*=\s*(\"|')(.*)\1\s*(#.*)?$", | |
| 20 re.MULTILINE) | |
| 21 | |
| 22 with open(os.path.join(pkg_root, "cutils", "__init__.py"), "rb") as vf: | |
| 23 version = _version_re.search(vf.read()).group(2).decode("utf-8") | |
| 24 | |
| 25 with open(os.path.join(pkg_root, "README.txt"), "rt") as rf: | |
| 26 long_description = rf.read() | |
| 27 | |
| 28 setup( | |
| 29 name="py-cutils", | |
| 30 version=version, | |
| 31 author="Franz Glasner", | |
| 32 license="""BSD 3-Clause "New" or "Revised" License""", | |
| 33 url="https://pypi.dom66.de/simple/py-cutils/", | |
| 34 description="Pure Python implementation of some coreutils with some extensions", | |
| 35 long_description=long_description, | |
| 36 packages=["cutils", "cutils.util"], | |
| 37 include_package_data=False, | |
| 38 zip_safe=True, | |
| 39 platforms="any", | |
| 40 classifiers=[ | |
| 41 "Development Status :: 5 - Production/Stable", | |
| 42 "Environment :: Console", | |
| 43 "Intended Audience :: Developers", | |
| 44 "Intended Audience :: End Users/Desktop", | |
| 45 "Intended Audience :: System Administrators", | |
| 46 "License :: OSI Approved :: BSD License", | |
| 47 "Operating System :: OS Independent", | |
| 48 "Programming Language :: Python :: 2.7", | |
| 49 "Programming Language :: Python :: 3", | |
| 50 "Topic :: System", | |
| 51 "Topic :: Utilities", | |
| 52 ], | |
| 53 python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", | |
| 54 entry_points={ | |
| 55 "console_scripts": [ | |
| 56 "py-dos2unix=cutils.dos2unix:main", | |
| 57 "py-shasum=cutils.shasum:main", | |
| 58 "py-treesum=cutils.treesum:main", | |
| 59 ] | |
| 60 } | |
| 61 ) |
