Skip to content

Commit

Permalink
Merge pull request #415 from GeminiDRSoftware/conda_forge_master
Browse files Browse the repository at this point in the history
Update `master` tests/docs to use conda-forge instead of Astroconda
  • Loading branch information
jehturner committed Feb 2, 2023
2 parents e63df0e + 307dbac commit d8c7027
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 66 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ jobs:
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channels: http://ssb.stsci.edu/astroconda
channel-priority: disabled
channels: conda-forge
python-version: ${{ matrix.python-version }}
use-only-tar-bz2: true

Expand Down
25 changes: 16 additions & 9 deletions .jenkins/scripts/download_and_install_anaconda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,42 @@

echo "Checking (Ana/Mini)Conda installation at ${JENKINS_CONDA_HOME}"

mkdir -p "${TMPDIR}" # otherwise micromamba (miniforge install) crashes

## Remove anaconda to replace with miniconda
if [ -d "${JENKINS_CONDA_HOME}/bin/anaconda" ]; then
rm -Rf ${JENKINS_CONDA_HOME}
fi

LINUX_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"
MACOS_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh"
LINUX_URL="https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh"
MACOS_URL="https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh"

if [[ "$(uname)" == "Darwin" ]]; then
CONDA_URL="${MACOS_URL}"
elif [[ "$(expr substr $(uname -s) 1 5)" == "Linux" ]]; then
CONDA_URL="${LINUX_URL}"
fi

env

if ! [[ "$(command -v conda)" ]]; then
echo "\n\n Conda is not installed - Downloading and installing\n\n"
curl "${CONDA_URL}" --output Miniconda3-latest.sh --silent
curl -L "${CONDA_URL}" --output Miniforge3-latest.sh --silent

chmod a+x Miniconda3-latest.sh
./Miniconda3-latest.sh -u -b -p ${JENKINS_CONDA_HOME}
chmod a+x Miniforge3-latest.sh
./Miniforge3-latest.sh -u -b -p ${JENKINS_CONDA_HOME}
else
echo "\n\n Conda is already installed --- Skipping step.\n\n"
fi

echo ${PATH}
which conda
conda update --quiet conda
conda config --add channels http://ssb.stsci.edu/astroconda
conda config --add channels http://astroconda.gemini.edu/public/noarch
conda config --set channel_priority false
conda config --set restore_free_channel true
# These 2 channels need removing if testing old branches has reinstated them:
conda config --remove channels http://ssb.stsci.edu/astroconda || :
conda config --remove channels http://astroconda.gemini.edu/public/noarch || :
conda config --add channels conda-forge
conda config --add channels http://astroconda.gemini.edu/public
conda config --set channel_priority true
conda config --set restore_free_channel false
conda env list
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ data for science purposes, please continue to use the [Gemini IRAF package](http
To install DRAGONS:

```
$ conda create -n dragons python=3.7 dragons stsci
$ conda create -n dragons python=3.7 dragons ds9
```

You might need to add two relevant conda channels if you haven't already:

```
$ conda config --add channels http://ssb.stsci.edu/astroconda
$ conda config --add channels conda-forge
$ conda config --add channels http://astroconda.gemini.edu/public
```

Expand Down
14 changes: 7 additions & 7 deletions astrodata/doc/usermanual/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Installing Astrodata

The |astrodata| package has a few dependencies, |astropy|, |numpy| and others.
The best way to get everything you need is to install Anaconda_, and the
|dragons| stack from the AstroConda channel.
|dragons| stack from conda-forge and Gemini's public conda channel.

|astrodata| itself is part of |DRAGONS|. It is available from the
repository, as a tar file, or as a conda package. The bare |astrodata| package
Expand Down Expand Up @@ -86,12 +86,12 @@ repository, the tar file or the conda package.
$ conda init

#. Set up conda channels.
Configure the ``conda`` package manager to look in the AstroConda channel
hosted by STScI, and in the GEMINI Conda Channel. This is a one-time step.
It affects current and future Anaconda installations belonging to the same
user on the same machine.::
Configure the ``conda`` package manager to look in conda-forge, and in the
GEMINI Conda Channel. This is a one-time step. It affects current and
future Anaconda installations belonging to the same user on the same
machine.::

$ conda config --add channels http://ssb.stsci.edu/astroconda
$ conda config --add channels conda-forge
$ conda config --add channels http://astroconda.gemini.edu/public

#. Create an environment.
Expand All @@ -107,7 +107,7 @@ repository, the tar file or the conda package.
recommend that you use this specific version of Python with DRAGONS.
::

$ conda create -n dragons python=3.7 dragons stsci
$ conda create -n dragons python=3.7 dragons ds9


#. Activate your new virtual environment.
Expand Down
4 changes: 0 additions & 4 deletions doc/DRAGONS/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,6 @@ on Python 3.7:
# specifying the environment with an environment variable:
$ TOXENV=py37-unit tox
.. note::
Since we use the `astroconda <http://ssb.stsci.edu/astroconda>`_ channel
which does not have packages for Python 3.8 and 3.9, tox can currently
only be used with Python 3.7.
Pinpointing Tests
-----------------
Expand Down
2 changes: 0 additions & 2 deletions geminidr/doc/tutorials/F2Img-DRTutorial/01_introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ been installed. If you have an error message, make sure:

- A Conda Virtual Environment is properly created and is active;

- AstroConda (STScI) is properly installed within the Virtual Environment;

- DRAGONS was successfully installed within the Conda Virtual Environment;


Expand Down
2 changes: 0 additions & 2 deletions geminidr/doc/tutorials/GMOSImg-DRTutorial/01_introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ be installed. If you have an error message, make sure:

- A Conda Virtual Environment is properly created and is active;

- AstroConda (STScI) is properly installed within the Virtual Environment;

- DRAGONS was successfully installed within the Conda Virtual Environment;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ be installed. If you have an error message, make sure:

- A Conda Virtual Environment is properly created and is active;

- AstroConda (STScI) is properly installed within the Virtual Environment;

- DRAGONS was successfully installed within the Conda Virtual Environment;

.. _datasetup:
Expand Down
29 changes: 9 additions & 20 deletions recipe_system/doc/rs_UsersManual/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,12 @@ anaconda. To activate or deactivate Anaconda manually::
$ conda activate
$ conda deactivate

Now that Anaconda works, we add the needed astronomy software. Add the
Astroconda channel and the Gemini channel. Those channels host
the conda astronomy packages.
Now that Anaconda works, we add the needed astronomy software. Add conda-forge
and the Gemini channel. Those channels host the conda astronomy packages.

::

$ conda config --add channels http://ssb.stsci.edu/astroconda
$ conda config --add channels conda-forge
$ conda config --add channels http://astroconda.gemini.edu/public

The next step is to create a virtual environment and install the DRAGONS
Expand All @@ -105,14 +104,7 @@ Python 3.7.

::

$ conda create -n dragons python=3.7 dragons

Or, to include things like ds9

$ conda create -n dragons python=3.7 dragons stsci

Most users will probably want to install the extra astronomy tools that come
with the ``stsci`` conda package.
$ conda create -n dragons python=3.7 dragons ds9

To use this environment, activate it::

Expand All @@ -124,16 +116,13 @@ command to your ``.bash_profile``, after the "conda init" block.

.. note::
As a side note, if you are going to use PyRAF regularly, for example to
reduce Gemini data not yet supported in DRAGONS, you should be installing
Python 2.7 **as well** in a different environment, along with the ``gemini``,
``iraf-all`` and ``pyraf-all`` conda packages. Do not use PyRAF from the
Python 3 environment; PyRAF is very slow under Python 3.
reduce Gemini data not yet supported in DRAGONS, you should install the
``iraf-all`` and ``pyraf-all`` conda packages as well.

$ conda create -n geminiconda python=2.7 iraf-all pyraf-all stsci gemini
$ conda create -n geminiconda python=3.7 iraf-all pyraf-all ds9 dragons

DRAGONS and the Recipe System do not need IRAF, PyRAF. Only DRAGONS v2
is compatible with Python 2.7. See the Gemini website for information on
how to configure IRAF (|geminiiraf_link|)
DRAGONS and the Recipe System do not need IRAF or PyRAF, however. See the
Gemini website for information on how to configure IRAF (|geminiiraf_link|)

.. _configure::

Expand Down
48 changes: 32 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{36,37,38,39}-{unit,f2,gsaoi,niri,gnirs,gmosls,integ,reg,slow}
py{37,38,39,310,311}-{unit,f2,gsaoi,niri,gnirs,gmosls,integ,reg,slow}
codecov
check
docs-{astrodata}
Expand All @@ -21,26 +21,43 @@ passenv =
MPLBACKEND
TMPDIR
conda_deps =
asdf>=2.7,!=2.10.0
astropy>=4.3
astroquery
cython
future
gwcs
Jinja2
matplotlib
numpy
pytest
scipy
sextractor
specutils
sqlalchemy
astroquery>=0.4
astroscrappy>=1.1
bokeh>=2.3
bottleneck>=1.2
coverage
cython>=0.29
docutils>=0.15
future>=0.17
gwcs>=0.15
holoviews>=1.14
jinja2>=3.0
jsonschema>=3.0
matplotlib>=3.1
numpy>=1.17
objgraph>=3.5
psutil>=5.6 # only used by adcc?
pyerfa>=1.7
pytest>=5.2
python-dateutil>=2.5.3
requests>=2.22
scipy>=1.3
sextractor>=2.8.6
specutils>=1.1,<1.9 # the 1.9.1 conda package has incorrect constraints
sqlalchemy>=1.3
conda_channels =
http://ssb.stsci.edu/astroconda
http://astroconda.gemini.edu/public
conda-forge
conda_create_args =
--override-channels
conda_install_args =
--override-channels
extras =
test
docs: docs
deps =
coverage
.jenkins/local_calibration_manager/GeminiObsDB-1.0.22-py3-none-any.whl
.jenkins/local_calibration_manager/GeminiCalMgr-1.1.12-py3-none-any.whl
git+https://github.com/GeminiDRSoftware/pytest_dragons.git@v1.0.4#egg=pytest_dragons
Expand All @@ -51,7 +68,6 @@ commands =
which python
which pip
which pytest
pip install git+https://github.com/astropy/astroscrappy.git@1.1.0#egg=astroscrappy
pip install git+https://github.com/GeminiDRSoftware/AstroFaker#egg=AstroFaker
conda list
unit: python -m coverage run --rcfile={toxinidir}/.coveragerc -m pytest -v --dragons-remote-data --durations=20 -m "not integration_test and not gmosls and not f2 and not f2ls and not f2image and not gsaoi and not gsaoiimage and not niri and not nirils and not niriimage and not gnirs and not gnirsls and not gnirsimage and not wavecal and not regression and not slow" {posargs:astrodata geminidr gemini_instruments gempy recipe_system}
Expand Down

0 comments on commit d8c7027

Please sign in to comment.