File tree Expand file tree Collapse file tree 4 files changed +24
-8
lines changed
Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 1+ ## 0.5.1-dev1
2+
3+ ### Enhancements
4+
5+ ### Features
6+
7+ ### Fixes
8+
9+ * Fix several issues with the ` requires_dependencies ` decorator, including the error message
10+ and how it was used.
11+
112## 0.5.0
213
314### Enhancements
415
516* Add ` requires_dependencies ` Python decorator to check dependencies are installed before
6- instantiating a class or running a function
17+ instantiating a class or running a function
718
819### Features
920
Original file line number Diff line number Diff line change 1- __version__ = "0.5.0 " # pragma: no cover
1+ __version__ = "0.5.1-dev1 " # pragma: no cover
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ def write_result(self):
125125 print (f"Wrote { output_filename } " )
126126
127127
128- @requires_dependencies (["pygithub " ], extras = "github" )
128+ @requires_dependencies (["github " ], extras = "github" )
129129class GitHubConnector (BaseConnector ):
130130 def __init__ (self , config : SimpleGitHubConfig ):
131131 from github import Github
Original file line number Diff line number Diff line change @@ -14,7 +14,10 @@ def read_from_jsonl(filename: str) -> List[Dict]:
1414 return [json .loads (line ) for line in input_file ]
1515
1616
17- def requires_dependencies (dependencies : Union [str , List [str ]], extras : Optional [str ] = None ):
17+ def requires_dependencies (
18+ dependencies : Union [str , List [str ]],
19+ extras : Optional [str ] = None ,
20+ ):
1821 if isinstance (dependencies , str ):
1922 dependencies = [dependencies ]
2023
@@ -29,10 +32,12 @@ def wrapper(*args, **kwargs):
2932 missing_deps .append (dep )
3033 if len (missing_deps ) > 0 :
3134 raise ImportError (
32- f"Following dependencies are missing: { ', ' .join (missing_deps )} ."
33- + f"Please install them using `pip install unstructured[{ extras } ]`."
34- if extras
35- else f"Please install them using `pip install { ' ' .join (missing_deps )} `." ,
35+ f"Following dependencies are missing: { ', ' .join (missing_deps )} . "
36+ + (
37+ f"Please install them using `pip install unstructured[{ extras } ]`."
38+ if extras
39+ else f"Please install them using `pip install { ' ' .join (missing_deps )} `."
40+ ),
3641 )
3742 return func (* args , ** kwargs )
3843
You can’t perform that action at this time.
0 commit comments