|
- #!/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
-
- import os
- import re
- from setuptools import setup, find_packages
-
- __author__ = ['"anjingyu" <anjingyu@navinfo.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 :: 4 - Beta",
- "Programming Language :: Python :: 3.7",
- "Programming Language :: Python :: 3.8",
- "Programming Language :: Python :: 3.9",
- "Programming Language :: Python :: 3.10",
- "Programming Language :: Python :: 3.11",
- "Programming Language :: Python :: 3.12",
- ],
- cmdclass={},
- keywords="AdTools",
- 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"]},
- entry_points={
- "console_scripts": [
- "admake=adtools.admake:main",
- "adgit=adtools.adgit:main",
- ]
- },
- include_package_data=True,
- zip_safe=False,
- )
-
-
- if __name__ == "__main__":
- main()
|