Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add wrapped qt package as dependency fix #182 #187

Merged
merged 7 commits into from
Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [Unreleased] - XXXX-XX-XX

### Changed
- PySide2 installed by default if wrapped Qt bindings (PyQt5, PySide2) are not found ([#187](https://github.com/cbrnr/mnelab/pull/187) by [Guillaume Dollé](https://github.com/gdolle))

## [0.6.2] - 2020-10-30
### Fixed
Expand Down
16 changes: 16 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@

from setuptools import setup, find_packages
from os import path
from importlib import import_module


def optdep(*args, default=None):
"""Manage alternative dependencies."""
for dep in args:
try:
import_module(dep)
except ImportError:
continue
else:
return dep
return default


here = path.abspath(path.dirname(__file__))
Expand All @@ -23,6 +36,9 @@
with open(path.join(here, "requirements.txt")) as f:
requires = f.read().splitlines()

qtpkg = optdep("PySide2", "PyQt5", default="PySide2")
requires.append(qtpkg)

# get extra (optional) requirements
extras_require = {}
with open(path.join(here, "requirements-extras.txt")) as f:
Expand Down