-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Resolving "cyclic" dependency with ruamel.yaml.clib #119
Comments
If we update/split the packages as outlined above, one case we have to take into account is this:
# install ruamel.yaml=NEW and ruamel.yaml.pylib=NEW
conda install ruamel.yaml=NEW
# remove ruamel.yaml=NEW, leave ruamel.yaml.pylib=NEW in place, install ruamel.yaml=OLD
conda install ruamel.yaml=OLD
# if conda only warns in case of clobbering, ruamel.yaml.pylib=NEW is now broken
# remove ruamel.yaml.pylib=NEW, leave ruamel.yaml=OLD in place
conda remove ruamel.yaml.pylib
# now ruamel.yaml=OLD is broken, too, i.e., `import ruamel.yaml` fails Solutions:
I'm generally no big fan of patching metadata. However, in this case it is the less troublesome solution and only affects |
We could lump the build into a "custom" conda-forge-specific version number, of course, meaning: have |
I gave the awkward "circular dependency" mentioned in conda-forge/ruamel.yaml.clib-feedstock#3 (comment) a look this morning.
Here is what we've got:
ruamel.yaml
itself has an optional dependency onruamel.yaml.clib
:Guarded by :
try: ... from _ruamel_yaml import ... except:
inruamel.yaml.main
try: ... from .cyaml import ... except:
inruamel.yaml.__init__.py
(ruamel.yaml.cyaml
has the unconditionalfrom _ruamel_yaml import ...
)ruamel.yaml
has a hard* dependency onruamel.yaml.clib
:It is in
extras_require
but with an empty "extra" plus platform specifier which makes it a platform-dependent hard dependency, AFAIK.(* except for
python >=3.8
for whichruamel.yaml.clib
is not built for PyPI)_ruamel_yaml
has a hard dependency onruamel.yaml
:Has a bunch of
from ruamel.yaml...
imports.ruamel.yaml.clib
has no dependencies.Which means its actual content, i.e.,
_ruamel_yaml
, is simply broken if onepip
/conda
install
sruamel.yaml.clib
(:tada: ... /s).So, to cleanly resolve this messy situation (and assuming upstream doesn't change things in the foreseeable future), we can create yet another
ruamel.yaml.*
package that hosts only the Python code forruamel.yaml
(since the Python package has only an optional dependency on the C extension, as noted above).My proposal for the
ruamel
packages is thus:ruamel
:ruamel/__init__.py
and nothing else).ruamel.yaml
:noarch: generic
package which is itself empty and only hasruamel.yaml.clib
:run
dependency onruamel.yaml.pylib >=0.16
(version compatibility is not specified upstream => TODO: raise issue upstream at https://bitbucket.org/ruamel/yaml.clib/issues)ruamel.yaml.pylib
:_
, e.g.,ruamel.yaml._pylib
if we were to accommodate the possibility of upstream creating anotherruamel.yaml.pylib
package (personally, I'd just go forruamel.yaml.pylib
, TBH)ruamel.yaml
ruamel.yaml.clib
(breaking the cycle)noarch: python
just like the current package due to Python 2.7 support (https://bitbucket.org/ruamel/yaml/src/ff02b83b8f9127ca8e7fea3aaa15d0fa758dc0be/__init__.py#lines-17,18)Now, a slight issue/decision remains:
We could make the current recipe have multiple
outputs
and create the proposedruamel.yaml
andruamel.yaml.pylib
packages from this repo. However, this would introduce a dependency cycle not in the actual package builds but betweenruamel.yaml-feedstock
andruamel.yaml.clib-feedstock
:ruamel.yaml.clib-feedstock
would depend onruamel.yaml-feedstock
due toruamel.yaml.clib
needingruamel.yaml.pylib
ruamel.yaml-feedstock
would depend onruamel.yaml.clib-feedstock
due toruamel.yaml
needingruamel.yaml.clib
So, to avoid this "conda(-forge)-build-system-only" dependency, we'd need to not use
outputs
here, butruamel.yaml.pylib
to staged-recipes to createruamel.yaml.pylib-feedstock
.noarch: generic
and depend onruamel.yaml.pylib
andruamel.yaml.clib
(Even though this package will be "empty", we should retain the
source:
to continue getting updates via the bot and stay in-sync with the newruamel.yaml.pylib
.)ruamel.yaml.clib
's recipe to depend onruamel.yaml.pylib
.Thoughts, @conda-forge/ruamel, @conda-forge/ruamel-yaml, @conda-forge/ruamel-yaml-clib, @jjhelmus, @mingwandroid, @msarahan?
The text was updated successfully, but these errors were encountered: