Open tangkong opened 1 year ago
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!
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.
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 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.
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
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.
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
Expected Behavior
We might want to consider having a
happi[core]
andhappi[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