Skip to content
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

Fix prepare action when using global "dependencies:" #245

Merged
merged 10 commits into from
Jan 24, 2020

Conversation

AlbertDeFusco
Copy link
Collaborator

I caught a problem where running anaconda-project prepare on the following spec would install a Python 3.8 environment. This happened because while dependencies: was an allowed key it was ignored.

name: test-deps

dependencies:
  - python=3.7
channels:
  - defaults

env_specs:
  default: {}

This PR also adds a test that will fail on the master branch.

@jbednar
Copy link
Collaborator

jbednar commented Dec 24, 2019

Is the issue that "dependencies" is accepted for some things, like "anaconda-project run", but not others, like "anaconda-project prepare"? If so, looks good!

@AlbertDeFusco
Copy link
Collaborator Author

Yes, the key is accepted, but won't do the right thing with either prepare or run. Would anyone else care to test this on version 0.8.4 on defaults?

name: test-deps

dependencies:
  - python=3.7

commands:
  version:
    unix: python -c 'import sys;print(sys.version)'
>anaconda-project run
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: /Users/adefusco/Development/AnacondaPlatform/anaconda-project/examples/deps/envs/default

  added / updated specs:
    - python


The following NEW packages will be INSTALLED:

  ca-certificates    pkgs/main/osx-64::ca-certificates-2019.11.27-0
  certifi            pkgs/main/osx-64::certifi-2019.11.28-py38_0
  libcxx             pkgs/main/osx-64::libcxx-4.0.1-hcfea43d_1
  libcxxabi          pkgs/main/osx-64::libcxxabi-4.0.1-hcfea43d_1
  libedit            pkgs/main/osx-64::libedit-3.1.20181209-hb402a30_0
  libffi             pkgs/main/osx-64::libffi-3.2.1-h475c297_4
  ncurses            pkgs/main/osx-64::ncurses-6.1-h0a44026_1
  openssl            pkgs/main/osx-64::openssl-1.1.1d-h1de35cc_3
  pip                pkgs/main/osx-64::pip-19.3.1-py38_0
  python             pkgs/main/osx-64::python-3.8.0-h359304d_2
  readline           pkgs/main/osx-64::readline-7.0-h1de35cc_5
  setuptools         pkgs/main/osx-64::setuptools-42.0.2-py38_0
  sqlite             pkgs/main/osx-64::sqlite-3.30.1-ha441bb4_0
  tk                 pkgs/main/osx-64::tk-8.6.8-ha441bb4_0
  wheel              pkgs/main/osx-64::wheel-0.33.6-py38_0
  xz                 pkgs/main/osx-64::xz-5.2.4-h1de35cc_4
  zlib               pkgs/main/osx-64::zlib-1.2.11-h1de35cc_3


Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
#
# To activate this environment, use
#
#     $ conda activate /Users/adefusco/Development/AnacondaPlatform/anaconda-project/examples/deps/envs/default
#
# To deactivate an active environment, use
#
#     $ conda deactivate

3.8.0 (default, Nov  6 2019, 15:49:01) 
[Clang 4.0.1 (tags/RELEASE_401/final)]

@jbednar
Copy link
Collaborator

jbednar commented Dec 24, 2019

D'oh! For some time now we've been using anaconda-project.yml files where packages and dependencies are aliased to each other so they are usable in every context, so it's possible we wouldn't have noticed problems with it. But I'm still very confused how this behavior could have been broken, as it looks like "dependencies" was the name originally used (#200), so any older .yml file would no longer have worked? It's hard to see how any tests are passing or old projects are working.

@jbednar
Copy link
Collaborator

jbednar commented Dec 24, 2019

In any case yes, I can verify that the incorrect Python version (3.8) is installed with the given .yml file, and that Python 3.7 is installed when "dependencies" is changed to "packages".

@mcg1969 mcg1969 merged commit a3fc4d9 into anaconda:master Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants