Skip to content

Commit 35259c7

Browse files
committed
Setup.py file is ready
1 parent 557dd70 commit 35259c7

4 files changed

Lines changed: 270 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,11 @@ version = "0.1.0"
44
description = "Add your description here"
55
readme = "README.md"
66
requires-python = ">=3.12"
7-
dependencies = []
7+
dependencies = [
8+
"certifi>=2025.6.15",
9+
"numpy>=2.3.0",
10+
"pandas>=2.3.0",
11+
"pymongo>=4.13.2",
12+
"python-dotenv>=1.1.0",
13+
"setuptools>=80.9.0",
14+
]

requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
python-dotenv
2+
pandas
3+
numpy
4+
pymongo
5+
certifi
6+
7+
# -e .

setup.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"""
2+
The setup.py file is an essential part of packaging and distributing Python projects.
3+
4+
It is used by setuptools (or distutils in older Python versions) to define the configuration
5+
of your project, such as its metadata, dependencies, and more
6+
"""
7+
8+
from pathlib import Path
9+
10+
from setuptools import find_packages, setup
11+
12+
13+
def get_requirements() -> list[str]:
14+
"""Return a list of requirements."""
15+
requirement_lst: list[str] = []
16+
try:
17+
with Path("requirements.txt").open("r") as file:
18+
# Read lines from the file
19+
lines = file.readlines()
20+
## Process each line
21+
for line in lines:
22+
requirement = line.strip()
23+
## ignore empty lines and -e .
24+
if requirement and requirement != "-e .":
25+
requirement_lst.append(requirement)
26+
except FileNotFoundError:
27+
print("requirements.txt file not found")
28+
29+
return requirement_lst
30+
31+
32+
# print(get_requirements())
33+
34+
setup(
35+
name="Network-Security",
36+
version="0.0.1",
37+
author="Mit Patel",
38+
author_email="patel.m9521@gmail.com",
39+
packages=find_packages(),
40+
install_requires=get_requirements(),
41+
)

0 commit comments

Comments
 (0)