Skip to content

Commit 4e6b223

Browse files
author
David Herbert
committed
DOC: restructure enviroment setup as new file
1 parent b843153 commit 4e6b223

File tree

3 files changed

+52
-8
lines changed

3 files changed

+52
-8
lines changed

doc/source/development/contributing_documentation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Requirements
141141
~~~~~~~~~~~~
142142

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

146146
Building the documentation
147147
~~~~~~~~~~~~~~~~~~~~~~~~~~

doc/source/development/env_outside_docker.rst renamed to doc/source/development/contributing_environment.rst

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,60 @@
1-
.. _env_outside_docker:
1+
.. _contributing_environment:
22

33
{{ header }}
44

5-
===========================================
6-
Setting up an environment outside of Docker
7-
===========================================
5+
==================================
6+
Creating a development environment
7+
==================================
8+
9+
To test out code changes, you'll need to build pandas from source, which
10+
requires a C/C++ compiler and Python environment. If you're making documentation
11+
changes, you can skip to :ref:`contributing to the documentation <contributing_documentation>` but if you skip
12+
creating the development environment you won't be able to build the documentation
13+
locally before pushing your changes.
814

915
.. contents:: Table of contents:
1016
:local:
1117

18+
19+
Creating an environment using Docker
20+
--------------------------------------
21+
22+
Instead of manually setting up a development environment, you can use `Docker
23+
<https://docs.docker.com/get-docker/>`_ to automatically create the environment with just several
24+
commands. pandas provides a ``DockerFile`` in the root directory to build a Docker image
25+
with a full pandas development environment.
26+
27+
**Docker Commands**
28+
29+
Pass your GitHub username in the ``DockerFile`` to use your own fork::
30+
31+
# Build the image pandas-yourname-env
32+
docker build --tag pandas-yourname-env .
33+
# Run a container and bind your local forked repo, pandas-yourname, to the container
34+
docker run -it --rm -v path-to-pandas-yourname:/home/pandas-yourname pandas-yourname-env
35+
36+
Even easier, you can integrate Docker with the following IDEs:
37+
38+
**Visual Studio Code**
39+
40+
You can use the DockerFile to launch a remote session with Visual Studio Code,
41+
a popular free IDE, using the ``.devcontainer.json`` file.
42+
See https://code.visualstudio.com/docs/remote/containers for details.
43+
44+
**PyCharm (Professional)**
45+
46+
Enable Docker support and use the Services tool window to build and manage images as well as
47+
run and interact with containers.
48+
See https://www.jetbrains.com/help/pycharm/docker.html for details.
49+
50+
Note that you might need to rebuild the C extensions if/when you merge with upstream/master using::
51+
52+
python setup.py build_ext -j 4
53+
54+
55+
Creating an environment without Docker
56+
---------------------------------------
57+
1258
Installing a C compiler
1359
~~~~~~~~~~~~~~~~~~~~~~~
1460

@@ -87,7 +133,6 @@ compiler installation instructions.
87133

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

90-
.. _contributing.dev_python:
91136

92137
Creating a Python environment
93138
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -139,7 +184,6 @@ To return to your root environment::
139184

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

142-
.. _contributing.pip:
143187

144188
Creating a Python environment (pip)
145189
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

doc/source/development/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Development
1313
:maxdepth: 2
1414

1515
contributing
16+
contributing_environment
1617
contributing_documentation
1718
contributing_codebase
18-
env_outside_docker
1919
code_style
2020
maintaining
2121
internals

0 commit comments

Comments
 (0)