Skip to content

Update install docs for conda optional dependencies - #10343

Merged
taldcroft merged 5 commits into
astropy:masterfrom
taldcroft:docs-conda-optional
Jun 4, 2020
Merged

taldcroft merged 5 commits into
astropy:masterfrom
taldcroft:docs-conda-optional

Conversation

@taldcroft

Copy link
Copy Markdown
Member

Description

This pull request is to add explicit instructions for installing all the optional Python package
dependencies using conda. The instructions include specifying the conda channels pkgs/main and then conda-forge. I think this improves reproducibility in case users have messed with channel order in their .condarc. I've had problems in the past with getting confused by non-standard packages. I think pkgs/main is the right thing, but if someone knows better please chime in.

It also adds a comment about bintrees now being deprecated.

I'm not exactly sure how to milestone a docs update like this so I just picked 4.0.2.

Comment thread docs/install.rst Outdated

conda install -c pkgs/main -c conda-forge \
scipy h5py beautifulsoup4 html5lib bleach pyyaml pandas sortedcontainers \
pytz matplotlib setuptools mpmath bottleneck jplephem asdf bintrees

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why still install bintrees when we warn that it is no longer maintained above?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I thought about that. It is still supported in the code and listed as an optional dependency above, so it seems like it belongs in this list. In any case this is just a small package with no other dependencies.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have an unspoken policy to not actively advertise deprecated things. I would prefer if it is removed, as people usually blindly copy-paste, but if you insist it should stay on the command, then so be it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change, I was on the fence.

Comment thread docs/install.rst Outdated

To install all of the optional dependencies using ``conda`` enter the following::

conda install -c pkgs/main -c conda-forge \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think defaults is the user facing name for the main channel.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that users can override the default channels, but I guess if they have gone to that length then they know what they are doing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change it.

@taldcroft

Copy link
Copy Markdown
Member Author

@pllim - I pushed changes with your suggestions. I went one step further and put in the command line to optionally install pytest-astropy, which is necessary for the subsequent import astropy; astropy.test() to actually work.

@taldcroft

Copy link
Copy Markdown
Member Author

This is failing html-docs in a way that makes no sense to me. Ideas @pllim??

@pllim

pllim commented May 12, 2020

Copy link
Copy Markdown
Member

I see the failures at my other PR too. And Travis CI is not reporting back. I don't have time to investigate today. I am hoping it is going to magically go away tomorrow.

@pllim

pllim commented May 13, 2020

Copy link
Copy Markdown
Member

@taldcroft , @astrofrog has a fix. Might need rebase after #10347 is merged.

@astrofrog

Copy link
Copy Markdown
Member

@taldcroft - can you rebase now?

@taldcroft
taldcroft force-pushed the docs-conda-optional branch from dc351da to 21b59cb Compare May 28, 2020 13:52
@taldcroft

Copy link
Copy Markdown
Member Author

I rebased and made a minor new addition in 21b59cb.

Comment thread docs/install.rst
Installing ``astropy``
======================

If you are new to Python and/or do not have familiarity with `Python virtual

@taldcroft taldcroft Jun 4, 2020 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking of the new user that just comes to this page wanting to install astropy. What they'll likely run is the first command they see, which means opening a terminal window and typing pip install astropy. That will generally fail unless they have a non-root Python in their path.

@astrofrog astrofrog left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, small question below about defaults, but don't mind either way if this is addressed or not.

Comment thread docs/install.rst

It is highly recommended that you install all of the optional dependencies with::

conda install -c astropy -c defaults \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if -c defaults actually needed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also as an aside, this is why we need conda to support optional extra dependencies. See conda/conda#7502 for a possible approach (using 'outputs'). We should really just be able to do conda install -c astropy astropy.all or something like that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worry that users will set up their .condarc in a way that might prefer other channels in particular conda-forge. I think it is relatively easy to accidentally get in that situation and start pulling core packages from conda-forge instead of defaults.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a specific example, if a user does this seemingly innocuous command to add conda-forge to channels, then bad things happen:

conda config --add channels conda-forge
conda update jplephem
The following packages will be SUPERSEDED by a higher-priority channel:

  attrs                                           pkgs/main --> conda-forge
  certifi              pkgs/main::certifi-2020.4.5.1-py37_0 --> conda-forge::certifi-2020.4.5.1-py37hc8dfbb8_0
  importlib-metadata pkgs/main::importlib-metadata-1.6.0-p~ --> conda-forge::importlib-metadata-1.6.0-py37hc8dfbb8_0
  importlib_metadata                              pkgs/main --> conda-forge
  jplephem                                          astropy --> conda-forge
  kiwisolver         pkgs/main::kiwisolver-1.2.0-py37h04f5~ --> conda-forge::kiwisolver-1.2.0-py37ha1cc60f_0
  libgfortran        pkgs/main::libgfortran-3.0.1-h93005f0~ --> conda-forge::libgfortran-3.0.1-0
  libiconv              pkgs/main::libiconv-1.16-h1de35cc_0 --> conda-forge::libiconv-1.15-h0b31af3_1006
  mkl-service        pkgs/main::mkl-service-2.3.0-py37hfbe~ --> conda-forge::mkl-service-2.3.0-py37h0b31af3_0
  ncurses                 pkgs/main::ncurses-6.2-h0a44026_1 --> conda-forge::ncurses-6.1-h0a44026_1002
  openssl              pkgs/main::openssl-1.1.1g-h1de35cc_0 --> conda-forge::openssl-1.1.1g-h0b31af3_0
  py                                              pkgs/main --> conda-forge
  pyparsing                 pkgs/main::pyparsing-2.4.7-py_0 --> conda-forge::pyparsing-2.4.7-pyh9f0ad1d_0
  pytest-arraydiff                                  astropy --> conda-forge
  pytest-astropy-he~                                astropy --> conda-forge
  pytest-doctestplus                                astropy --> conda-forge
  pytest-openfiles                                  astropy --> conda-forge
  pytest-remotedata                                 astropy --> conda-forge
  python             pkgs/main::python-3.7.7-hc70fcce_0_cp~ --> conda-forge::python-3.7.6-cpython_h1fd5dd1_6
  python-dateutil                                 pkgs/main --> conda-forge
  readline               pkgs/main::readline-8.0-h1de35cc_0 --> conda-forge::readline-8.0-hcfe32e1_0
  soupsieve          pkgs/main/noarch::soupsieve-2.0.1-py_0 --> conda-forge/osx-64::soupsieve-2.0.1-py37hc8dfbb8_0
  sqlite                pkgs/main::sqlite-3.31.1-h5c1f38d_1 --> conda-forge::sqlite-3.30.1-h93121df_0
  tornado            pkgs/main::tornado-6.0.4-py37h1de35cc~ --> conda-forge::tornado-6.0.4-py37h9bfed18_1
  webencodings       pkgs/main/osx-64::webencodings-0.5.1-~ --> conda-forge/noarch::webencodings-0.5.1-py_1
  xz                         pkgs/main::xz-5.2.5-h1de35cc_0 --> conda-forge::xz-5.2.5-h0b31af3_0
  zipp                                            pkgs/main --> conda-forge
  zstd                     pkgs/main::zstd-1.4.4-h1990bb4_3 --> conda-forge::zstd-1.4.4-h4b3e974_3

@taldcroft
taldcroft merged commit 370bb94 into astropy:master Jun 4, 2020
@taldcroft
taldcroft deleted the docs-conda-optional branch June 4, 2020 14:57
astrofrog pushed a commit that referenced this pull request Jun 5, 2020
Update install docs for conda optional dependencies
astrofrog pushed a commit that referenced this pull request Jun 5, 2020
Update install docs for conda optional dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants