|
- #!/usr/bin/env python3
- # -*- coding: utf-8; mode: python; tab-width: 4; indent-tabs-mode: nil -*-
- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
-
- # THIS FILE IS PART OF adtools PROJECT
- # setup.py Package script for adtools
- #
- # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
- # Version 2, December 2004
- #
- # Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
- #
- # Everyone is permitted to copy and distribute verbatim or modified
- # copies of this license document, and changing it is allowed as long
- # as the name is changed.
- #
- # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
- # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- #
- # 0. You just DO WHAT THE FUCK YOU WANT TO.
-
- import os
- import re
- from setuptools import setup, find_packages
-
- __author__ = ['"anjingyu" <anjingyu_ws@foxmail.com>']
- SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-
- def readme() -> str:
- return open("README.md").read()
-
-
- def version() -> str:
- filename = os.path.join(SCRIPT_DIR, 'adtools', '__init__.py')
-
- content = open(filename).read()
- version = re.search(r"""__version__\s*=\s*['"]([0-9a-z.-]+)['"]""", content).group(1)
-
- return version
-
-
- def requirements(filename: str = '') -> list:
- filename = os.path.join(SCRIPT_DIR, "requirements.txt") if not filename else filename
-
- rs = []
- for _line in open(filename):
- line = _line.strip()
- # Ignore the comments and command options
- if line.startswith("#") or line.startswith("-"):
- continue
- rs.append(line)
- return rs
-
-
- def main():
- setup(name='adtools',
- version=version(),
- description="Advanced Build Tools",
- long_description=readme(),
- classifiers=[
- "Development Status :: 3 - Beta",
- "Programming Language :: Python :: 3.7"
- ],
- cmdclass={},
- keywords="AdMake",
- author="anjingyu",
- author_email="anjingyu@navinfo.com",
- license="WTFPL2",
- packages=find_packages(),
- install_requires=requirements(),
- python_requires='~=3.7',
- package_data={"adtools": ["cmake/*.cmake", "cmake/**/*.cmake", "completion/*.*sh"]},
- entry_points={
- 'console_scripts':
- ['admake=adtools.admake:main', 'adgit=adtools.adgit:main']
- },
- include_package_data=True,
- zip_safe=False)
-
-
- if __name__ == '__main__':
- main()
|