Skip to content

Commit 1edf86b

Browse files
committed
chore: set install_requires list from requirements/base.txt
1 parent d8344a0 commit 1edf86b

File tree

7 files changed

+73
-78
lines changed

7 files changed

+73
-78
lines changed

.gitignore

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
# Jupyter Notebook
2-
.ipynb_checkpoints
3-
data
41

5-
.DS_Store
6-
# Local .terraform directories
7-
.terraform/
82
.env
9-
lambda_dist_pkg
3+
data
4+
.DS_Store
105
*.zip
11-
__pycache__
12-
.pytest_cache
136

147
# Python
8+
build
9+
__pycache__
10+
.pytest_cache
11+
*.egg-info
1512
venv
1613
.venv
1714
.pytest_cache
@@ -21,24 +18,6 @@ venv
2118
*.swp
2219
*.log
2320

24-
# .tfstate files
25-
.terraform.lock.hcl
26-
*.tfstate
27-
*.tfstate.*
28-
29-
30-
# ignore this file
31-
!tfmodule-template.tf
32-
33-
# tardigrade-ci
34-
tardigrade-ci/
35-
.tardigrade-ci
36-
37-
# go tests
38-
tests/go.*
39-
40-
# ReactJS
41-
client/node_modules/
21+
# npm
4222
node_modules
43-
4423
package-lock.json

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ init:
3939
$(PYTHON) -m venv venv && \
4040
$(ACTIVATE_VENV) && \
4141
$(PIP) install --upgrade pip && \
42-
$(PIP) install -r requirements.txt && \
42+
$(PIP) install -r requirements/local.txt && \
4343
npm install && \
4444
pre-commit install
4545

requirements.txt

Lines changed: 0 additions & 36 deletions
This file was deleted.

requirements/base.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
python-decouple==3.8
3+
langchainhub==0.1.21
4+
langchain-openai==0.1.25
5+
langchain-experimental
6+
openai>=1.40.0
7+
langchain==0.2.11
8+
langchain-pinecone==0.1.3
9+
langchain-experimental
10+
pinecone-client==5.0.1
11+
pinecone-text==0.9.0
12+
pydantic==2.10.4
13+
pydantic-settings==2.7.1
14+
python-dotenv==1.0.1
15+
pypdf==5.2.0
16+
tiktoken==0.8.0

requirements/local.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
-r base.txt
3+
4+
# dev and test
5+
# ------------
6+
pytest==8.3.4
7+
pytest_mock==3.14.0
8+
9+
# Code linters, formatters, and security scanners
10+
# ------------
11+
black==25.1.0
12+
flake8==7.1.1
13+
flake8-coding==1.3.2
14+
pre-commit==4.0.1
15+
isort==6.0.0
16+
mypy==1.14.1
17+
pylint==3.3.4
18+
bandit==1.7.10
19+
pydocstringformatter==0.7.3
20+
tox==4.23.2
21+
codespell==2.4.1

setup.py

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,34 @@
11
# -*- coding: utf-8 -*-
22
"""Setup for openai_embeddings package."""
3+
import io
4+
import os
5+
from typing import List
6+
37
from setuptools import find_packages, setup
48

59
from setup_utils import get_semantic_version # pylint: disable=import-error
610

711

12+
HERE = os.path.abspath(os.path.dirname(__file__))
13+
14+
15+
def is_requirement(line: str) -> bool:
16+
"""
17+
True if line is a valid requirement line from a
18+
Python requirements file.
19+
"""
20+
return not (line.strip() == "" or line.startswith("#"))
21+
22+
23+
def load_requirements(filename: str) -> List[str]:
24+
"""
25+
Returns Python package requirements as a list of semantically
26+
versioned pip packages.
27+
"""
28+
with io.open(os.path.join(HERE, "requirements", filename), "rt", encoding="utf-8") as f:
29+
return [line.strip() for line in f if is_requirement(line) and not line.startswith("-r")]
30+
31+
832
setup(
933
name="openai_embeddings",
1034
version=get_semantic_version(),
@@ -18,16 +42,8 @@
1842
package_data={
1943
"openai_embeddings": ["*.md"],
2044
},
21-
install_requires=[
22-
"langchain>=0.2",
23-
"langchainhub>=0.1.14",
24-
"langchain-experimental",
25-
"openai>=1.40",
26-
"pinecone-client>=5",
27-
"pinecone-text>=0.9",
28-
"pydantic>=2.10",
29-
"pypdf>=5",
30-
"python-dotenv>=1.0.0",
31-
"tiktoken>=0.8",
32-
],
45+
install_requires=load_requirements("base.txt"),
46+
extras_require={
47+
"dev": load_requirements("local.txt"),
48+
},
3349
)

setup_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
# pylint: disable=duplicate-code
3-
# pylint: disable=duplicate-code
43
"""Lawrence McDaniel https://lawrencemcdaniel.com."""
54
import importlib.util
65
import os

0 commit comments

Comments
 (0)