Open mbargull opened 5 years ago
If we update/split the packages as outlined above, one case we have to take into account is this:
ruamel.yaml=NEW
: new build that depends on ruamel.yaml.pylib=NEW
ruamel.yaml=OLD
: old build whose payload is identical to ruamel.yaml.pylib=NEW
# install ruamel.yaml=NEW and ruamel.yaml.pylib=NEW
conda install ruamel.yaml=NEW
conda install ruamel.yaml=OLD
conda remove ruamel.yaml.pylib
import ruamel.yaml
fails
Solutions:
1. Add a `constrains` requirements to `ruamel.yaml.pylib` for `ruamel.yaml>=NEW`:
- This would introduce a dependency cycle in the `constrains`, which is not optimal.
I know `conda` had issues with this at some point; not sure what the current state of this is.
- `>=NEW` hits a limitation of `conda` if it does not indicate a version change; meaning:
If we do not increase the version but only the build number, we are not able to express "either a new version or newer builds of the current version" with `conda`'s current capabilities.
- Add a `constrains` requirement on old `ruamel.yaml` builds:
- metadata patching
- can just do `constrain: ["ruamel.yaml.pylib<0a0" ]` to prevent `ruamel.yaml=OLD` and `ruame.yaml.pylib` from being simultaneously installed.
I'm generally no big fan of patching metadata. However, in this case it is the less troublesome solution and only affects `constrains` dependencies and "packages coming from the future" (from the PoV of `ruamel.yaml=OLD`) and thus should not change the consistency of current installations.
If we do not increase the version but only the build number
We could lump the build into a "custom" conda-forge-specific version number, of course, meaning: have contrains: [ "ruamel.yaml>=0.16.5.0.post0" ]
or something. This still leaves the "cycle in constrains
dependencies" issue, though..
I gave the awkward "circular dependency" mentioned in https://github.com/conda-forge/ruamel.yaml.clib-feedstock/pull/3#issuecomment-549126205 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 inextras_require
but with an empty "extra" plus platform specifier which makes it a platform-dependent hard dependency, AFAIK. (* except forpython >=3.8
for whichruamel.yaml.clib
is not built for PyPI)_ruamel_yaml
has a hard dependency onruamel.yaml
: Has a bunch offrom 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 theruamel
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 thesource:
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?