Skip to content

Commit

Permalink
require requests for extended conditions; update requirements in tuto…
Browse files Browse the repository at this point in the history
…rials
  • Loading branch information
ruthenian8 committed Dec 4, 2023
1 parent 25b6d2d commit bd7355a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
3 changes: 1 addition & 2 deletions dff/script/extras/conditions/models/remote_api/rasa_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
from urllib.parse import urljoin
from typing import Optional

import requests

try:
import httpx
import requests

rasa_available = True
except ImportError:
Expand Down
16 changes: 8 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def merge_req_lists(*req_lists: List[str]) -> List[str]:
"typing-extensions",
]

requests_dependencies = [
"requests==2.31.0",
]

async_files_dependencies = [
"aiofiles",
]
Expand Down Expand Up @@ -77,7 +81,7 @@ def merge_req_lists(*req_lists: List[str]) -> List[str]:

sklearn_dependencies = ["scikit-learn>=1.1.3", "joblib==1.2.0"]

extended_conditions_dependencies = merge_req_lists(sklearn_dependencies, ["pyyaml==6.0"])
extended_conditions_dependencies = merge_req_lists(requests_dependencies, sklearn_dependencies, ["pyyaml==6.0"])

httpx_dependencies = [
"httpx==0.23.0",
Expand Down Expand Up @@ -122,8 +126,8 @@ def merge_req_lists(*req_lists: List[str]) -> List[str]:

stats_dependencies = merge_req_lists(
otl_dependencies,
requests_dependencies,
[
"requests",
"wrapt",
"tqdm",
"omegaconf",
Expand All @@ -149,10 +153,6 @@ def merge_req_lists(*req_lists: List[str]) -> List[str]:
dialogflow_dependencies,
)

requests_requirements = [
"requests==2.31.0",
]

test_requirements = merge_req_lists(
[
"pytest==7.4.0",
Expand All @@ -168,7 +168,7 @@ def merge_req_lists(*req_lists: List[str]) -> List[str]:
"httpx<=0.23.0",
"sqlparse==0.4.4",
],
requests_requirements,
requests_dependencies,
)

tutorial_dependencies = [
Expand Down Expand Up @@ -204,7 +204,7 @@ def merge_req_lists(*req_lists: List[str]) -> List[str]:
"jupytext==1.15.0",
"jupyter==1.0.0",
],
requests_requirements,
requests_dependencies,
)

devel = [
Expand Down
3 changes: 3 additions & 0 deletions tests/tutorials/test_tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def check_tutorial_dependencies(venv: "VirtualEnv", tutorial_source_code: str):
@pytest.mark.parametrize("dff_tutorial_py_file", DFF_TUTORIAL_PY_FILES)
@pytest.mark.slow
@pytest.mark.docker
@pytest.mark.rasa
@pytest.mark.dialogflow
@pytest.mark.huggingface
@pytest.mark.no_coverage
def test_tutorials(dff_tutorial_py_file, virtualenv):
with open(dff_tutorial_py_file, "r", encoding="utf-8") as fd:
Expand Down
2 changes: 1 addition & 1 deletion tutorials/script/extras/conditions/2_gensim_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
for annotating user phrases.
"""

# %pip install dff[gensim]
# %pip install dff[ext,gensim]

# %%
import os
Expand Down
2 changes: 1 addition & 1 deletion tutorials/script/extras/conditions/3_hf_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
for annotating user phrases.
"""

# %pip install dff[huggingface]
# %pip install dff[ext,huggingface]

# %%
from transformers import AutoTokenizer, AutoModelForSequenceClassification
Expand Down

0 comments on commit bd7355a

Please sign in to comment.