|
1 | | -.. _env_outside_docker: |
| 1 | +.. _contributing_environment: |
2 | 2 |
|
3 | 3 | {{ header }} |
4 | 4 |
|
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. |
8 | 14 |
|
9 | 15 | .. contents:: Table of contents: |
10 | 16 | :local: |
11 | 17 |
|
| 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 | + |
12 | 58 | Installing a C compiler |
13 | 59 | ~~~~~~~~~~~~~~~~~~~~~~~ |
14 | 60 |
|
@@ -87,7 +133,6 @@ compiler installation instructions. |
87 | 133 |
|
88 | 134 | Let us know if you have any difficulties by opening an issue or reaching out on `Gitter <https://gitter.im/pydata/pandas/>`_. |
89 | 135 |
|
90 | | -.. _contributing.dev_python: |
91 | 136 |
|
92 | 137 | Creating a Python environment |
93 | 138 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
@@ -139,7 +184,6 @@ To return to your root environment:: |
139 | 184 |
|
140 | 185 | See the full conda docs `here <https://conda.pydata.org/docs>`__. |
141 | 186 |
|
142 | | -.. _contributing.pip: |
143 | 187 |
|
144 | 188 | Creating a Python environment (pip) |
145 | 189 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
0 commit comments