Skip to content

Commit

Permalink
MAINT: merge environment.yml and environment_meson.yml (scipy#16115)
Browse files Browse the repository at this point in the history
There's no longer a reason for the duplication, now that Meson
introduction is solid instead of experimental/early.

[ci skip]
  • Loading branch information
rgommers authored May 4, 2022
1 parent 2c3a826 commit 1e4d139
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches:
- main
paths:
- "environment_meson.yml"
- "environment.yml"

jobs:
build-base-docker:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/macos_meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,27 +76,27 @@ jobs:
mamba-version: "*"
channels: conda-forge
channel-priority: true
activate-environment: scipy-meson
activate-environment: scipy-dev
use-only-tar-bz2: true

- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache if environment_meson.yml has not changed
# Increase this value to reset cache if environment.yml has not changed
CACHE_NUMBER: 0
with:
path: /usr/local/miniconda/envs/scipy-meson
path: /usr/local/miniconda/envs/scipy-dev
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment_meson.yml') }}
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
id: envcache

- name: Update Conda Environment
run: mamba env update -n scipy-meson -f environment_meson.yml
run: mamba env update -n scipy-dev -f environment.yml

- name: Build and Install SciPy
shell: bash -l {0}
run: |
conda activate scipy-meson
conda activate scipy-dev
python -m pip install meson==0.61.1
# Python.org installers still use 10.9, so let's use that too. Note
# that scikit-learn already changed to 10.13 in Jan 2021, so increasing
Expand All @@ -110,7 +110,7 @@ jobs:
- name: Test SciPy
shell: bash -l {0}
run: |
conda activate scipy-meson
conda activate scipy-dev
export OMP_NUM_THREADS=2
python dev.py -n -j 2
Expand Down
4 changes: 1 addition & 3 deletions doc/source/dev/contributor/conda_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ the latest release of conda from either
or Linux PATH?" in the `Anaconda FAQ`_.

#. The Python-level dependencies for building SciPy will be installed as part of
the conda environment creation. They are listed on the
the conda environment creation - see
`environment.yml <https://github.com/scipy/scipy/blob/main/environment.yml>`_
or `environment_meson.yml <https://github.com/scipy/scipy/blob/main/environment_meson.yml>`_
(depending on the build system you are planning to use.)

Note that we're installing SciPy's build dependencies and some other
software, but not (yet) SciPy itself. Also note that you'll need to have
Expand Down
10 changes: 5 additions & 5 deletions doc/source/dev/contributor/meson.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Clone the repo if you haven't done so yet, and initialize the git submodules::
Create a conda development environment, build SciPy with Meson and run the test
suite::

conda env create -f environment_meson.yml
conda activate scipy-meson
conda env create -f environment.yml
conda activate scipy-dev
python dev.py


Expand All @@ -57,12 +57,12 @@ recommended installer is

To create a development environment::

conda env create -f environment_meson.yml # `mamba` works too for this command
conda activate scipy-meson
conda env create -f environment.yml # `mamba` works too for this command
conda activate scipy-dev

Support for Cython in Meson is very new, and we also need some recent bug
fixes and new features in Meson - hence we need a ``>=0.60.x`` release
(automatically installed via use of ``environment_meson.yml`` above).
(automatically installed via use of ``environment.yml`` above).

Meson uses a configure and a build stage. To configure it for putting the build
artifacts in ``build/`` and a local install under ``installdir/`` and then
Expand Down
8 changes: 4 additions & 4 deletions doc/source/dev/contributor/quickstart_gitpod.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Once you have authenticated to Gitpod through GitHub, you can install the `Gitpo

python dev.py

This command make use of Meson, for more details on how this affects your workflow migrating from ``distutils`` check the :ref:`meson` section in the Developer documentation.
This command make use of Meson, for more details on how this affects your workflow migrating from ``distutils`` check the :ref:`meson` section in the Developer documentation.

.. note::

Expand All @@ -76,12 +76,12 @@ Your workspace will look similar to the image below:
.. image:: ../../_static/gitpod/gitpod-workspace.png
:alt: Gitpod workspace showing the VSCode editor - some parts are highlighted: 1- Python interpreter, 2- Git branch, 3- GitHub Pull Requests extension on the side bar 4- VsCode Marketplace 5- Current directory

.. note::
.. note::
By default VSCode initialises with a light theme, you can change to a dark theme by with the keyboard shortcut :kbd:`Cmd-K Cmd-T` in Mac or :kbd:`Ctrl-K Ctrl-T` in Linux and Windows.

We have marked some important sections in the editor:

#. Your current Python interpreter - by default, the ``scipy-meson`` is marked as ``base`` on the status bar, but it should be displayed as ``scipy-meson`` on your terminal. You do not need to activate the conda environment as this will always be activated for you.
#. Your current Python interpreter - by default, the ``scipy-dev`` is marked as ``base`` on the status bar, but it should be displayed as ``scipy-dev`` on your terminal. You do not need to activate the conda environment as this will always be activated for you.
#. Your current branch is always displayed in the status bar. You can also use this button to change or create branches.
#. GitHub Pull Requests extension - you can use this to work with Pull Requests from your workspace.
#. Marketplace extensions - we have added some essential extensions to the SciPy Gitpod. Still, you can also install other extensions or syntax highlighting themes for your user, and these will be preserved for you.
Expand Down Expand Up @@ -131,7 +131,7 @@ Option 2: Using the rst extension

A quick and easy way to see live changes in a ``.rst`` file as you work on it uses the rst extension with docutils.

.. note::
.. note::
This will generate a simple live preview of the document without the ``html`` theme, and some backlinks might not be added correctly. But it is an easy and lightweight way to get instant feedback on your work.

#. Open any of the source documentation files located in ``doc/source`` in the editor.
Expand Down
10 changes: 5 additions & 5 deletions doc/source/dev/dev_quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ After :ref:`getting the source code from GitHub <git-start>`, there are three
steps to start contributing:

1. **Set up a development environment**

Using ``conda``, or some flavor of the many virtual environment management
tools, you can make sure the development version of SciPy does not interfere
with any other local installations of SciPy on your machine.

2. **Build SciPy**

SciPy uses compiled code for speed, which means you might need extra
dependencies to complete this step depending on your system.

3. **Perform development tasks**

These can include any changes you want to make to the source code, running
tests, building the documentation, running benchmarks, etc.

Expand Down Expand Up @@ -59,9 +59,9 @@ Next, set up your development environment.
`SciPy <https://github.com/scipy/scipy>`_ clone::

# Create an environment with all development dependencies
conda env create -f environment_meson.yml # works with `mamba` too
conda env create -f environment.yml # works with `mamba` too
# Activate the environment
conda activate scipy-meson
conda activate scipy-dev

Your command prompt now lists the name of your new environment, like so
``(scipy-dev)$``.
Expand Down
7 changes: 4 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ dependencies:
- setuptools<60.0
- cython
- compilers
- meson
- ninja
- numpy
- openblas
- pkg-config # note: not available on Windows
- libblas=*=*openblas # helps avoid pulling in MKL
- pybind11
- pythran>=0.9.12
- conda-build # to allow `conda develop .`
# For testing and benchmarking
- pytest
- pytest-cov
Expand All @@ -42,5 +44,4 @@ dependencies:
# For CLI
- rich-click
- click
- pip:
- doit==0.35.0
- doit>=0.35.0
51 changes: 0 additions & 51 deletions environment_meson.yml

This file was deleted.

2 changes: 1 addition & 1 deletion tools/docker_dev/gitpod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ FROM ${BASE_CONTAINER} as build

# Build argument - can pass Meson arguments during the build:
ARG BUILD_ARG="python dev.py --build-only -j2" \
CONDA_ENV=scipy-meson
CONDA_ENV=scipy-dev

# -----------------------------------------------------------------------------
USER root
Expand Down
10 changes: 5 additions & 5 deletions tools/docker_dev/meson.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# docker run --rm -it -v $(pwd):/home/scipy scipy:<image-tag>
#
# By default the container will activate the conda environment scipy-meson
# By default the container will activate the conda environment scipy-dev
# which contains all the dependencies needed for SciPy development
#
# To build Scipy run: python dev.py --build-only -j2
Expand Down Expand Up @@ -70,7 +70,7 @@ ENV CONDA_DIR=/opt/conda \

ENV CONDA_VERSION="${conda_version}" \
MINIFORGE_VERSION="${miniforge_version}" \
CONDA_ENV=scipy-meson \
CONDA_ENV=scipy-dev \
PATH=${CONDA_DIR}/bin:$PATH

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -151,9 +151,9 @@ RUN wget --quiet "https://github.com/conda-forge/miniforge/releases/download/${m
# ---- Create conda environment ----
# Install SciPy dependencies - since using miniforge no need to add
# conda-forge channel
COPY environment_meson.yml /tmp/environment_meson.yml
COPY environment.yml /tmp/environment.yml

RUN conda env create -f /tmp/environment_meson.yml && \
RUN conda env create -f /tmp/environment.yml && \
conda activate ${CONDA_ENV} && \
# needed for docs rendering later on
python -m pip install --no-cache-dir sphinx-autobuild && \
Expand All @@ -167,4 +167,4 @@ RUN conda env create -f /tmp/environment_meson.yml && \
# -----------------------------------------------------------------------------
USER ${GP_USER}

WORKDIR $HOME/scipy
WORKDIR $HOME/scipy
4 changes: 2 additions & 2 deletions tools/docker_dev/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"python.defaultInterpreterPath": "/opt/conda/envs/scipy-meson/bin/python",
"python.defaultInterpreterPath": "/opt/conda/envs/scipy-dev/bin/python",
// rst related - for the docs
"esbonio.sphinx.buildDir": "${workspaceRoot}/doc/build/html-scipyorg",
"esbonio.sphinx.confDir" : "",
Expand All @@ -9,4 +9,4 @@
"restructuredtext.updateDelay": 300,
"restructuredtext.linter.disabled": true,
"python.pythonPath": "/opt/conda/envs/scipy-dev/bin/python"
}
}
2 changes: 1 addition & 1 deletion tools/docker_dev/workspace_config
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi
echo ". ${CONDA_DIR}/etc/profile.d/conda.sh" >>~/.bashrc

# Ensures the environment is readily available
echo "conda activate scipy-meson" >>~/.bashrc
echo "conda activate scipy-dev" >>~/.bashrc

# Enable prompt color in the skeleton .bashrc
# hadolint ignore=SC2016
Expand Down

0 comments on commit 1e4d139

Please sign in to comment.