Skip to content

Commit

Permalink
latest comit
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnysavita10 committed Jan 8, 2024
1 parent 518a566 commit b7d76fc
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 27 deletions.
18 changes: 18 additions & 0 deletions init_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
echo [$(date)]: "START"


echo [$(date)]: "creating env with python 3.8 version"


conda create --prefix ./env python=3.8 -y


echo [$(date)]: "activating the environment"

source activate ./env

echo [$(date)]: "installing the dev requirements"

pip install -r requirements_dev.txt

echo [$(date)]: "END"
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[build-system]
requires = ['setuptools>=42.0', "wheel"]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
testpaths = [
"tests"
]

[tool.mypy]
mypy_path = "src"
ignore_missing_imports = true
17 changes: 17 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
pandas
scikit-learn
numpy
seaborn
flask
mlflow==2.2.2
dvc

# dev requirements -

pytest==7.1.3
tox==3.25.1
black==22.8.0
flake8==5.0.4
mypy==0.971

-e .
29 changes: 29 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[metadata]
license = MIT
license_file = LICENSE
classifiers =
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Operating System :: OS Independent

[options]
install_requires =
ensure==1.0.2
py-youtube==1.1.7
python_requires = >=3.7

[options.extras_require]
testing =
pytest>=7.1.3
mypy>=0.971
flake8>=5.0.4
tox>=3.25.1
black>=22.8.0

[options.package_data]
MongoDB-Connect=py.typed

[flake8]
max-line-length = 160
exclude = __init__.py
43 changes: 43 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from setuptools import setup, find_packages
from typing import List

HYPEN_E_DOT='-e .'

'''def get_requiremet(file_path:str)->List[str]:
requirements = []
with open(file_path) as f:
requirements=f.readlines()
requirements=[req.replace("\n","")for req in requirements]
if HYPEN_E_DOT in requirements:
requirements.remove(HYPEN_E_DOT)
return requirements'''


with open('README.md', 'r', encoding='utf-8') as f:
long_description = f.read()


__version__ = "0.0.4"
REPO_NAME = "mongodb_connector"
PKG_NAME= "MongoDB-Connect"
AUTHOR_USER_NAME = "sunnysavita10"
AUTHOR_EMAIL = "sunny.savita@ineuron.ai"

setup(
name=PKG_NAME,
version=__version__,
author=AUTHOR_USER_NAME,
author_email=AUTHOR_EMAIL,
description="A python package for connecting with database.",
long_description=long_description,
long_description_content="text/markdown",
url=f"https://github.com/{AUTHOR_USER_NAME}/{REPO_NAME}",
project_urls={
"Bug Tracker": f"https://github.com/{AUTHOR_USER_NAME}/{REPO_NAME}/issues",
},
package_dir={"": "src"},
packages=find_packages(where="src"),


)
45 changes: 18 additions & 27 deletions template.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,23 @@
import os
from pathlib import Path

package_name = "mongodb_connect"

list_of_files=[

".github/workflows/.gitkeep",
"src/__init__.py",
"src/components/__init__.py",
"src/components/data_ingestion.py",
"src/components/data_transformation.py",
"src/components/model_trainer.py",
"src/components/model_evaluation.py",
"src/pipeline/__init__.py",
"src/pipeline/training_pipeline.py",
"src/pipeline/prediction_pipeline.py",
"src/utils/__init__.py",
"src/utils/utils.py",
"src/logger/logging.py",
"src/exception/exception.py",
"tests/unit/__init__.py",
"tests/integration/__init__.py",
"init_setup.sh",
"requirements.txt",
"requirements_dev.txt",
"setup.py",
"setup.cfg",
"pyproject.toml",
"tox.ini",
"experiment/experiments.ipynb"

list_of_files = [
".github/workflows/ci.yaml",
"src/__init__.py",
f"src/{package_name}/__init__.py",
f"src/{package_name}/mongo_crud.py",
"tests/__init__.py",
"tests/unit/__init__.py",
"tests/integration/__init__.py",
"init_setup.sh",
"requirements.txt",
"setup.py",
"setup.cfg",
"pyproject.toml",
"tox.ini",
"experiments/experiments.ipynb",
]

for filepath in list_of_files:
Expand All @@ -40,3 +29,5 @@
if (not os.path.exists(filepath)) or (os.path.getsize(filepath) == 0):
with open(filepath, "w") as f:
pass # create an empty file

#its updated
22 changes: 22 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[tox]
envlist = python3.7, python3.8, python3.9

[gh-actions]
python =
3.7: python3.7
3.8: python3.8
3.9: python3.9

[testenv]
deps = -rrequirements_dev.txt
commands =
# stop the build if there are Python syntax errors or undefined names
flake8 src --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 src --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# type linting
mypy src/
# pytest unit
pytest -v tests/unit
# pytest integration
pytest -v tests/integration

0 comments on commit b7d76fc

Please sign in to comment.