Skip to content

Commit

Permalink
Testing: Fix function that parses setup requirements
Browse files Browse the repository at this point in the history
Also, fix small style issue in setup.py
  • Loading branch information
ccordoba12 committed Dec 2, 2024
1 parent 983a98f commit 7ad18e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ def get_qt_requirements(qt_requirements, default='pyqt5'):

if install_requires is None:
raise ValueError(
f"Unsupported Qt binding: {env_qt_binding}. "
"Supported: " + ", ".join(qt_requirements.keys())
)
f"Unsupported Qt binding: {env_qt_binding}. "
f"Supported: " + ", ".join(qt_requirements.keys())
)

return install_requires

Expand Down
10 changes: 8 additions & 2 deletions spyder/tests/test_dependencies_in_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,22 @@ def parse_setup_install_requires(fpath):
start = None
end = None
for idx, line in enumerate(lines):
if line.startswith('install_requires = '):
if "'pyqt5': " in line:
idx_qt = idx

if line.startswith('install_requires += '):
start = idx + 1

if start is not None and line.startswith(']'):
end = idx
break

qt_deps = lines[idx_qt].split("'pyqt5': ")[1]
qt_deps = literal_eval(qt_deps[:qt_deps.index("]") + 1])
dep_list = literal_eval('[' + '\n'.join(lines[start:end + 1]))
dep_list = [item for item in dep_list if item[0] != '#']
for dep in dep_list:

for dep in dep_list + qt_deps:
dep = dep.split(';')[0]
name, ver = None, None

Expand Down

0 comments on commit 7ad18e0

Please sign in to comment.