Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

GUI / BLD: Make separate happi-qt sub-package? #340

Open
tangkong opened this issue Nov 7, 2023 · 5 comments
Open

GUI / BLD: Make separate happi-qt sub-package? #340

tangkong opened this issue Nov 7, 2023 · 5 comments

Comments

@tangkong
Copy link
Contributor

tangkong commented Nov 7, 2023

Expected Behavior

We might want to consider having a happi[core] and happi[qt] , once we start to accrue significant qt elements.

Current Behavior

Qt widgets and their dependencies are grouped with the core code.

Possible Solution

optional dependencies install instructions

Context

#246

Your Environment

pcds-5.8.0

@untzag
Copy link
Contributor

untzag commented Nov 15, 2023

You might already be doing this, but please consider using qtpy abstraction layer. As a pyside2 user I often get bitten by people expecting pyqt to be installed. Whatever works best for you!

@klauer
Copy link
Contributor

klauer commented Nov 15, 2023

from qtpy import QtCore, QtGui, QtWidgets

@tangkong
Copy link
Contributor Author

tangkong commented Jan 4, 2024

Dumping some notes so I can find them whenever we decide to do this. Adding sub-packages would be simple if we only used PIP, but conda feedstocks get a bit more confusing.

Pip

For pip, we can simply define the extra dependencies in pyproject.toml and install via pip install happi[qt] (link as above). This is rather clean and simple.

Conda

Conda does not have an analogous mechanism. Instead a recipe can specify additional "outputs", which lead to the creation of "metapackages". This is what matplotlib does with matplotlib-base (matplotlib example recipe)

package:
  name: my_package

requirements:
  host: 
   - python
  run:
    - my_package-the_subpackage1
    - my_package-the_subpackage2

outputs:
  - name: my_package.the_subpackage1
    requirements:
      - some-dep
    script: some_build_script.sh
  - name: my_package.the_subpackage2
    requirements:
      - some-other-dep
    script: some_other_build_script.sh

This seems to create multiple conda install-able packages from one recipe, both sourced from the same feedstock.
Screenshot 2024-01-04 at 9 58 46 AM

It'd be great to have the same package names, but I think conda disallows brackets in package names. So we'd have to do something like conda install happi-qt

@ZLLentz
Copy link
Member

ZLLentz commented Jan 4, 2024

I think happi (installs all the py files) and happi-qt (adds qtpy dependency and maybe pyqt in run_constrained) makes a lot of sense for the conda recipe. This is probably the pattern we should follow in general for packages that have optional widget components, i.e. there are qt elements provided but they aren't the main focus of the library.

@tangkong
Copy link
Contributor Author

I should revisit this, now that we have a working example of this in lightpath https://github.com/conda-forge/lightpath-feedstock/blob/main/recipe/meta.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants