conda-forge / fmpy-feedstock

A conda-smithy repository for fmpy.
BSD 3-Clause "New" or "Revised" License
4 stars 8 forks source link

ENH: Create a package with the minimal dependencies #11

Closed fcollonval closed 4 years ago

fcollonval commented 4 years ago

This is an enhancement proposal.

With pip it is possible to choose the dependency granularity (and it is beautifully illustrated by this project). Unfortunately with conda this can only be done through different packages. matplotlib recipe solves this nicely by outputting various package from an unique recipe. It makes sense to keep the current fmpy package with all dependencies. But it would be great to generate at the same time a fmpy-base (name to be chosen) for advanced users with the minimal dependencies.

Note: if you agree, I happily submit a PR.

t-sommer commented 4 years ago

AFAIK pip also supports permutations of optional dependencies, e.g. examples and plot but no gui. Is this also possible with conda?

fcollonval commented 4 years ago

Unfortunately conda lacks behind on that front 😞 This is the reason restricting to two flavors seems a good strategy to me:

Note: matplotlib went for matplotlib and matplotlib-base

conda build doc: https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#outputs-section

t-sommer commented 4 years ago

Can't you just install with --no-deps and select the dependencies you need?

fcollonval commented 4 years ago

Sorry for the late answer.

I try using --no-deps. It works as expected. But unfortunately, each time I made a modification (install, remove or update a package) on the environment, conda is installing all fmpy dependencies to correct the inconsistency. So back to my proposal to have a fmpy-base package with minimal dependencies. What do you think?

trulede commented 4 years ago

I have a similar problem/idea. I'm looking into creating a sub-package called FMPy.fmiwhich includes the FMI interface code and loaders. Basically a separatesetup.pyunder fmpy/fmi but still in the same git repo ... so its mostly seamless. Then you could:

So I think its an approach which might help in other areas too.

t-sommer commented 4 years ago

I've started a new attempt on https://github.com/conda-forge/fmpy-feedstock/tree/testing but found a number of issues:

channel_targets:
  - conda-forge testing
(fmpybase) C:\Users\XXX\Documents>fmpy info Clock.fmu
Fatal error in launcher: Unable to create process using '"d:\bld\fmpy_1602599620764\_h_env\python.exe"  "E:\Anaconda3\envs\fmpybase\Scripts\fmpy.exe" info Clock1.fmu': Das System kann die angegebene Datei nicht finden.

however it does work after installing fmpy.

t-sommer commented 4 years ago

@fcollonval, @wulmer, do you have an idea how to fix the above points?

wulmer commented 4 years ago

It seems there exist two ways of specifying target channels: through recipe/conda_build_config.yaml and through the conda-forge.yml (in the root folder). There also seemed to be some interference between the two in the past, but I think the currently recommended way is to use conda-forge.yml (see https://conda-forge.org/docs/maintainer/conda_forge_yml.html#channels).

I also tested the fmpy-base package on Linux with the fmpy info Rectifier.fmu command, and it worked fine. Guessing from the Windows error message, there surely is a DLL dependency problem. You might want to diff the two environments (with fmpy or just with fmpy-base and try to figure out which package resolves this error). Or you could try tools like https://www.dependencywalker.com/ to check which DLLs the FMU requires.

t-sommer commented 4 years ago

It turns out that we have to run conda smithy rerender after making changes to the meta.yaml. This solved the problem with the testing label.