Skip to content

Commit 3289c7b

Browse files
committed
chore(dependecies): add script to auto-update requirements
1 parent 254bde7 commit 3289c7b

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed

manual deployment/autorequirements.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import toml
2+
3+
# Load the TOML file
4+
data = toml.load('pyproject.toml')
5+
6+
# Get the dependencies
7+
dependencies = data['project']['dependencies']
8+
9+
# Write the dependencies to a requirements.txt file
10+
with open('requirements.txt', 'w') as f:
11+
for dependency in dependencies:
12+
f.write(dependency + '\n')
13+
14+
# Get the dev dependencies
15+
dev_dependencies = data['tool']['rye']['dev-dependencies']
16+
17+
# Expand the optional dependencies
18+
optional_dependencies = data['project']['optional-dependencies']
19+
expanded_dev_dependencies = []
20+
for dependency in dev_dependencies:
21+
if dependency.startswith('-e file:.'):
22+
optional_dependency_name = dependency.split('.')[1][1:-1]
23+
expanded_dev_dependencies.extend(optional_dependencies[optional_dependency_name])
24+
else:
25+
expanded_dev_dependencies.append(dependency)
26+
27+
# Write the expanded dev dependencies to a requirements-dev.txt file
28+
with open('requirements-dev.txt', 'w') as f:
29+
for dependency in expanded_dev_dependencies:
30+
f.write(dependency + '\n')

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,4 @@ dev-dependencies = [
9191
[tool.rye.scripts]
9292
pylint-local = "pylint scrapegraphai/**/*.py"
9393
pylint-ci = "pylint --disable=C0114,C0115,C0116 --exit-zero scrapegraphai/**/*.py"
94+
update-requirements = "python 'manual deployment/autorequirements.py'"

requirements-dev.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pytest==8.0.0
2+
pytest-mock==3.14.0
3+
burr[start]==0.22.1
4+
sphinx==6.0
5+
furo==2024.5.6
6+
pylint>=3.2.5

requirements.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
langchain>=0.2.10
2+
langchain-google-genai>=1.0.7
3+
langchain-google-vertexai
4+
langchain-openai>=0.1.17
5+
langchain-groq>=0.1.3
6+
langchain-aws>=0.1.3
7+
langchain-anthropic>=0.1.11
8+
html2text>=2024.2.26
9+
faiss-cpu>=1.8.0
10+
beautifulsoup4>=4.12.3
11+
pandas>=2.2.2
12+
python-dotenv>=1.0.1
13+
tiktoken>=0.7
14+
tqdm>=4.66.4
15+
graphviz>=0.20.3
16+
minify-html>=0.15.0
17+
free-proxy>=1.1.1
18+
playwright>=1.43.0
19+
google>=3.0.0
20+
undetected-playwright>=0.3.0
21+
semchunk>=1.0.1
22+
html2text>=2024.2.26
23+
langchain-fireworks>=0.1.3

0 commit comments

Comments
 (0)