Skip to content

#39367 DOC: split contributing.rst #40130

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 13 commits into from
Apr 4, 2021
Prev Previous commit
Next Next commit
DOC: restructure enviroment setup as new file
  • Loading branch information
David Herbert committed Mar 31, 2021
commit 4e6b22314d43d71f8f145884d6dc378e728100fd
2 changes: 1 addition & 1 deletion doc/source/development/contributing_documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Requirements
~~~~~~~~~~~~

First, you need to have a development environment to be able to build pandas
(see the docs on :any:`creating a development environment <contributing.dev_env>`).
(see the docs on :ref:`creating a development environment <contributing_environment>`).

Building the documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,60 @@
.. _env_outside_docker:
.. _contributing_environment:

{{ header }}

===========================================
Setting up an environment outside of Docker
===========================================
==================================
Creating a development environment
==================================

To test out code changes, you'll need to build pandas from source, which
requires a C/C++ compiler and Python environment. If you're making documentation
changes, you can skip to :ref:`contributing to the documentation <contributing_documentation>` but if you skip
creating the development environment you won't be able to build the documentation
locally before pushing your changes.

.. contents:: Table of contents:
:local:


Creating an environment using Docker
--------------------------------------

Instead of manually setting up a development environment, you can use `Docker
<https://docs.docker.com/get-docker/>`_ to automatically create the environment with just several
commands. pandas provides a ``DockerFile`` in the root directory to build a Docker image
with a full pandas development environment.

**Docker Commands**

Pass your GitHub username in the ``DockerFile`` to use your own fork::

# Build the image pandas-yourname-env
docker build --tag pandas-yourname-env .
# Run a container and bind your local forked repo, pandas-yourname, to the container
docker run -it --rm -v path-to-pandas-yourname:/home/pandas-yourname pandas-yourname-env

Even easier, you can integrate Docker with the following IDEs:

**Visual Studio Code**

You can use the DockerFile to launch a remote session with Visual Studio Code,
a popular free IDE, using the ``.devcontainer.json`` file.
See https://code.visualstudio.com/docs/remote/containers for details.

**PyCharm (Professional)**

Enable Docker support and use the Services tool window to build and manage images as well as
run and interact with containers.
See https://www.jetbrains.com/help/pycharm/docker.html for details.

Note that you might need to rebuild the C extensions if/when you merge with upstream/master using::

python setup.py build_ext -j 4


Creating an environment without Docker
---------------------------------------

Installing a C compiler
~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -87,7 +133,6 @@ compiler installation instructions.

Let us know if you have any difficulties by opening an issue or reaching out on `Gitter <https://gitter.im/pydata/pandas/>`_.

.. _contributing.dev_python:

Creating a Python environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -139,7 +184,6 @@ To return to your root environment::

See the full conda docs `here <https://conda.pydata.org/docs>`__.

.. _contributing.pip:

Creating a Python environment (pip)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion doc/source/development/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Development
:maxdepth: 2

contributing
contributing_environment
contributing_documentation
contributing_codebase
env_outside_docker
code_style
maintaining
internals
Expand Down