-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
58 lines (44 loc) · 1.58 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"""
Setup script for the Passwordometer package.
"""
from typing import List
from setuptools import find_packages, setup
HYPHEN_E_DOT = "-e ."
def get_requirements(file_path: str) -> List[str]:
"""Reads a file containing a list of requirements and returns list.
Args:
file_path (str): The path to the file containing the requirements.
Returns:
List[str]: A list of requirements read from the file.
"""
requirements = []
with open(file_path, encoding="utf-8") as file:
requirements = file.readlines()
requirements = [req.replace("\n", "") for req in requirements]
if HYPHEN_E_DOT in requirements:
requirements.remove(HYPHEN_E_DOT)
return requirements
def get_long_description(file_path: str = "README.md") -> str:
"""Reads the contents of a file and returns it as a string.
Args:
file_path (str, optional): The path to the file.
Defaults to "README.md".
Returns:
str: The contents of the file as a string.
"""
with open(file_path, encoding="utf-8") as file:
long_description = file.read()
return long_description
setup(
name="Passwordometer",
version="1.2.0",
author="Karthik Udyawar",
author_email="[email protected]",
license="MIT",
description="A package for evaluating password strength",
long_description=get_long_description(),
long_description_content_type="text/markdown",
url="https://github.com/KarthikUdyawar/Passwordometer",
packages=find_packages(),
install_requires=get_requirements("requirements.txt"),
)