-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
57 lines (48 loc) · 1.88 KB
/
setup.py
File metadata and controls
57 lines (48 loc) · 1.88 KB
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
"""
This module is used to setup a Python package for distribution. It includes
the package metadata such as name, version, author details, description, and
project URLs. It also includes a function to read and filter the requirements
from a file. The setup function from setuptools is used to package the code.
"""
from setuptools import find_packages, setup
IGNORE_ITEMS = ["-e .", "-i https://pypi.org/simple", ""]
__VERSION__ = "0.0.0"
REPO_NAME = "Test-Store-Data-Analysis"
SRC_REPO = "src"
AUTHOR_NAME = "Udit Kumar Chatterjee"
AUTHOR_EMAIL = "quantumudit@gmail.com"
AUTHOR_GH_USERNAME = "quantumudit"
SHORT_DESCRIPTION = "A small python package for web scraping"
GH_URL = "https://github.com/"
with open("README.md", "r", encoding="utf-8") as readme:
LONG_DESCRIPTION = readme.read()
def get_requirements(file_path: str) -> list[str]:
"""
This function reads a file from the provided file path, strips
each line, and filters out any items in the IGNORE_ITEMS list.
Args:
file_path (str): The path to the file that contains the requirements.
Returns:
list[str]: A list of requirements that are not in the
IGNORE_ITEMS list.
"""
with open(file_path, "r", encoding="utf-8") as f:
contents = [item.strip() for item in f.readlines()]
requirements = [item for item in contents if item not in IGNORE_ITEMS]
return requirements
setup(
name=SRC_REPO,
version=__VERSION__,
author=AUTHOR_NAME,
author_email=AUTHOR_EMAIL,
description=SHORT_DESCRIPTION,
long_description=LONG_DESCRIPTION,
long_description_content="text/markdown",
url=f"{GH_URL}/{AUTHOR_GH_USERNAME}/{REPO_NAME}",
project_urls={
"Bug Tracker": f"{GH_URL}/{AUTHOR_GH_USERNAME}/{REPO_NAME}/issues"
},
package_dir={"": "src"},
packages=find_packages(where="src"),
install_requires=get_requirements("./requirements.txt")
)