Skip to content

Add conda env to setup instructions #23435

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

Merged
merged 1 commit into from
Aug 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 37 additions & 11 deletions doc/devel/development_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,33 @@
Setting up Matplotlib for development
=====================================

Retrieving the latest version of the code
=========================================

Matplotlib is hosted at https://github.com/matplotlib/matplotlib.git.

You can retrieve the latest sources with the command (see
:ref:`set-up-fork` for more details)::

git clone https://github.com/matplotlib/matplotlib.git

This will place the sources in a directory :file:`matplotlib` below your
current working directory.

If you have the proper privileges, you can use ``git@`` instead of
``https://``, which works through the ssh protocol and might be easier to use
if you are using 2-factor authentication.
Comment on lines +20 to +22
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If you have the proper privileges, you can use ``git@`` instead of
``https://``, which works through the ssh protocol and might be easier to use
if you are using 2-factor authentication.

No one should be pushing directly to the upstream fork (even if they can) as we do all work through PRs from individual forks.

Copy link
Member

Choose a reason for hiding this comment

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

Let's put that change into #23588?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good to me.


.. _dev-environment:

Creating a dedicated environment
================================
You should set up a dedicated environment to decouple your Matplotlib
development from other Python and Matplotlib installations on your system.

Using virtual environments
--------------------------

Here we use python's virtual environment `venv`_, but you may also use others
such as conda.

Expand All @@ -28,22 +49,27 @@ and activated with one of the following::
Whenever you plan to work on Matplotlib, remember to activate the development
environment in your shell.

Retrieving the latest version of the code
=========================================
Conda dev environment
---------------------
After you have cloned the repo change into the matplotlib directory.

Matplotlib is hosted at https://github.com/matplotlib/matplotlib.git.
A new conda environment can be set-up with::

You can retrieve the latest sources with the command (see
:ref:`set-up-fork` for more details)::
conda env create -f environment.yml

git clone https://github.com/matplotlib/matplotlib.git
Note that if you have mamba installed you can replace conda with mamba in
the above command.

This will place the sources in a directory :file:`matplotlib` below your
current working directory.
To activate your environment::

If you have the proper privileges, you can use ``git@`` instead of
``https://``, which works through the ssh protocol and might be easier to use
if you are using 2-factor authentication.
conda activate mpl-dev

Finish the install by the following command::

pip install -e .

Whenever you plan to work on Matplotlib, remember to ``conda activate mpl-dev``
in your shell.

Installing Matplotlib in editable mode
======================================
Expand Down