|
| 1 | +from pathlib import Path |
| 2 | +from typing import Union |
| 3 | + |
1 | 4 | from setuptools import setup, find_packages |
2 | 5 |
|
| 6 | +# The directory containing this file |
| 7 | +HERE = Path(__file__).parent |
| 8 | + |
| 9 | +# The text of the README file |
| 10 | +README = (HERE / "README.md").read_text() |
| 11 | + |
| 12 | +def load_requirements(requirements_files: Union[Path, list[Path]]) -> list: |
| 13 | + """Helper to load requirements list from a path or a list of paths. |
| 14 | +
|
| 15 | + Args: |
| 16 | + requirements_files (Path | list[Path]): path or list to paths of requirements |
| 17 | + file(s) |
| 18 | +
|
| 19 | + Returns: |
| 20 | + list: list of requirements loaded from file(s) |
| 21 | + """ |
| 22 | + out_requirements = [] |
| 23 | + |
| 24 | + if isinstance(requirements_files, Path): |
| 25 | + requirements_files = [ |
| 26 | + requirements_files, |
| 27 | + ] |
| 28 | + |
| 29 | + for requirements_file in requirements_files: |
| 30 | + with requirements_file.open(encoding="UTF-8") as f: |
| 31 | + out_requirements += [ |
| 32 | + line |
| 33 | + for line in f.read().splitlines() |
| 34 | + if not line.startswith(("#", "-")) and len(line) |
| 35 | + ] |
| 36 | + |
| 37 | + return out_requirements |
3 | 38 |
|
4 | 39 | setup( |
5 | 40 | name='mkdocs-git-committers-plugin-2', |
6 | 41 | version='1.1.2', |
7 | | - description='An MkDocs plugin to create a list of contributors on the page', |
8 | | - long_description='The git-committers plugin will seed the template context with a list of github committers and other useful GIT info such as last modified date', |
| 42 | + description='An MkDocs plugin to create a list of contributors on the page. The git-committers plugin will seed the template context with a list of github committers and other useful GIT info such as last modified date', |
| 43 | + long_description=README, |
| 44 | + long_description_content_type="text/markdown", |
9 | 45 | keywords='mkdocs pdf github', |
10 | 46 | url='https://github.com/ojacques/mkdocs-git-committers-plugin-2/', |
11 | 47 | author='Byrne Reese, Olivier Jacques', |
12 | 48 | |
13 | 49 | license='MIT', |
14 | | - python_requires='>=2.7', |
15 | | - install_requires=[ |
16 | | - 'mkdocs>=1.0.3', |
17 | | - 'gitpython', |
18 | | - 'requests', |
19 | | - 'beautifulsoup4' |
20 | | - ], |
| 50 | + python_requires='>=3.8,<4', |
| 51 | + install_requires=load_requirements(HERE / "requirements.txt"), |
21 | 52 | classifiers=[ |
22 | 53 | 'Development Status :: 4 - Beta', |
23 | 54 | 'Intended Audience :: Developers', |
24 | 55 | 'Intended Audience :: Information Technology', |
25 | 56 | 'License :: OSI Approved :: MIT License', |
26 | 57 | 'Programming Language :: Python', |
27 | 58 | 'Programming Language :: Python :: 3 :: Only', |
28 | | - 'Programming Language :: Python :: 3.4', |
29 | | - 'Programming Language :: Python :: 3.5', |
30 | | - 'Programming Language :: Python :: 3.6', |
31 | | - 'Programming Language :: Python :: 3.7' |
| 59 | + 'Programming Language :: Python :: 3.8' |
| 60 | + 'Programming Language :: Python :: 3.9' |
| 61 | + 'Programming Language :: Python :: 3.10' |
| 62 | + 'Programming Language :: Python :: 3.11' |
32 | 63 | ], |
33 | 64 | packages=find_packages(), |
34 | 65 | entry_points={ |
|
0 commit comments