conda-forge / geoviews-core-feedstock

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

Different versions of geoviews and geoviews-core can be installed #1

Closed jjhelmus closed 6 years ago

jjhelmus commented 6 years ago

Different versions of geoviews and geoviews-core can be installed into the same environment. The contents of the two packages will clobber each other:

For example:

~$ conda create -n gv_example geoviews=1.5.0 geoviews-core=1.5.1 -c conda-forge -y -q
...
ClobberWarning: Conda was asked to clobber an existing path.
...
~$ source activate gv_example
(gv_example) ~$ conda list geoview
# packages in environment at /home/jhelmus/anaconda3/envs/gv_example:
#
# Name                    Version                   Build  Channel
geoviews                  1.5.0                      py_0    conda-forge
geoviews-core             1.5.1                      py_0    conda-forge
ocefpaf commented 6 years ago

B/c there is not concept of "conflicts with" we need to remove the old geoviews once https://github.com/conda-forge/geoviews-feedstock/pull/4 is merged.

jjhelmus commented 6 years ago

I believe adding:

run_constrained:
   - geoviews {{ version }}

To the requirements section of the geoviews-core recipe can be used to create a barrier which will prevent non-matching version from being installed into the same environment.

ocefpaf commented 6 years ago

Cool. I did not know about that. Thank!

jjhelmus commented 6 years ago

I'd test out the run_constrained idea before committing to it. I think it should work but I haven't tested it extensively. Also, you will need conda 4.4+ for it to run correctly, 4.3 and prior will ignore the constraint.

ocefpaf commented 6 years ago

I'd test out the run_constrained idea before committing to it.

OK. I though it was already well tests :smile:

Also, you will need conda 4.4+ for it to run correctly

The conda 4.4+ is something we have to live with it is not worth trying to support all the older versions of conda.

jjhelmus commented 6 years ago

Give me a few minutes and I'll test it :smile:. I need to do something similar for another package.

jjhelmus commented 6 years ago

run_constrained does what I expected, it creates a barrier which prevents non-matched versions of package and package-base from being installed:

$ conda create -n barrier_test_01 -c local foo-base=2.0 foo=1.0
Solving environment: failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - foo-base=2.0 -> foo==2.0
  - foo=1.0
Use "conda info <package>" to see the dependencies for each package.

Installing package-base doesn't pull in the constrained dependency:

$ conda create -n barrier_test_01 -c local foo-base
Solving environment: done

## Package Plan ##

  environment location: /home/jhelmus/anaconda3/envs/barrier_test_01

  added / updated specs: 
    - foo-base

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    foo-base-2.0               |                0           4 KB  local

The following NEW packages will be INSTALLED:

    foo-base:  2.0-0             local   
    libgcc-ng: 7.2.0-hdf63c60_3  defaults
    zlib:      1.2.11-ha838bed_2 defaults

Unfortunately no barrier is created with conda 4.3 but there is not much that can be done about that.

# conda -V
conda 4.3.34
# conda create -n barrier_test_01 -c local foo=1.0 foo-base=2.0
Fetching package metadata .............
Solving package specifications: .

Package plan for installation in environment /opt/conda/envs/barrier_test_01:

The following NEW packages will be INSTALLED:

    foo:       1.0-0             local   
    foo-base:  2.0-0             local   
    libgcc-ng: 7.2.0-hdf63c60_3  defaults
    zlib:      1.2.11-ha838bed_2 defaults
ocefpaf commented 6 years ago

Thanks @jjhelmus! I'll go ahead and merge #2