Skip to content

Commit 4fa04ef

Browse files
committed
Remove EOL Python versions and improve setup
1 parent 5a22480 commit 4fa04ef

File tree

1 file changed

+44
-13
lines changed

1 file changed

+44
-13
lines changed

setup.py

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,65 @@
1+
from pathlib import Path
2+
from typing import Union
3+
14
from setuptools import setup, find_packages
25

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
338

439
setup(
540
name='mkdocs-git-committers-plugin-2',
641
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",
945
keywords='mkdocs pdf github',
1046
url='https://github.com/ojacques/mkdocs-git-committers-plugin-2/',
1147
author='Byrne Reese, Olivier Jacques',
1248
1349
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"),
2152
classifiers=[
2253
'Development Status :: 4 - Beta',
2354
'Intended Audience :: Developers',
2455
'Intended Audience :: Information Technology',
2556
'License :: OSI Approved :: MIT License',
2657
'Programming Language :: Python',
2758
'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'
3263
],
3364
packages=find_packages(),
3465
entry_points={

0 commit comments

Comments
 (0)