Skip to content

Commit a43a7a1

Browse files
committed
Update pandas setup instructions
1 parent 3d7552a commit a43a7a1

File tree

1 file changed

+85
-50
lines changed

1 file changed

+85
-50
lines changed

pandas/guide/source/pandas_setup.rst

Lines changed: 85 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ This document is a short summary with some additional information specific to
1515
the sprint.
1616

1717
.. note::
18-
Next steps will download from the Internet around 900Mb for the pandas
19-
repository, and around 600Mb for Anaconda. If you don't have access to
20-
a fast Internet connection, contact your local chapter organizer, who will
21-
try to get a copy of both in a usb key.
18+
The steps below will download around 900Mb for the pandas repository, and
19+
around 600Mb for Anaconda from the Internet. If you don't have access to a
20+
fast Internet connection, contact your local chapter organizer, who will
21+
try to get a copy of both on a usb key.
2222

2323
Instructions
2424
------------
@@ -33,38 +33,51 @@ and provide your personal information (name, email...). Select the free plan.
3333
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3434

3535
All the changes during the sprints need to be made to the latest development
36-
version of pandas. Do not make them to a version downloaded from the Internet
37-
via pip, conda or a zip.
36+
version of pandas in a Git repository. Do not make them to a version downloaded
37+
from the Internet via pip, conda or a zip.
3838

3939
To get the latest development version:
4040

41-
* Fork the `pandas repository <https://github.com/pandas-dev/pandas>`_ on GitHub by click on the top-right `Fork` button
41+
* Fork the `pandas repository <https://github.com/pandas-dev/pandas>`_ on
42+
GitHub by clicking the `Fork` button on the top-right
4243

4344
.. note::
44-
**Windows users**: run the next commands in a Git Bash session in the directory where you want
45-
to download pandas source code (download `Git for Windows <https://gitforwindows.org/>`_ if needed).
45+
**Windows users**: run the next commands in a Git Bash session in the
46+
directory where you want to download pandas source code (download `Git for
47+
Windows <https://gitforwindows.org/>`_ if needed).
4648

47-
* In the terminal of your computer, in the directory where you want the copy of pandas source code, run:
49+
* In the terminal of your computer, in the directory where you want the copy of
50+
pandas source code, run: ::
4851

49-
| ``git clone https://github.com/<your-github-username>/pandas``
52+
git clone https://github.com/<your-github-username>/pandas
5053

51-
This will create a directory named `pandas`, containing the latest version of
52-
the source code. We will name this directory `<pandas-dir>` in the rest of
54+
or (if you have set up SSH keys for accessing GitHub): ::
55+
56+
git clone [email protected]:<your-github-username>/pandas
57+
58+
This will create a directory named ``pandas``, containing the latest version of
59+
the source code. We will name this directory ``<pandas-dir>`` in the rest of
5360
this document.
5461

55-
Make sure you're in the root of the `<pandas-dir>` directory.
62+
Make sure you're in the root of the ``<pandas-dir>`` directory. ::
5663

57-
| ``cd <pandas-dir>``
64+
cd <pandas-dir>
5865

5966
Then, set the upstream remote, so you can fetch the updates from the pandas
60-
repository:
67+
repository: ::
6168

62-
| ``git remote add upstream https://github.com/pandas-dev/pandas``
63-
64-
On how to fetch the latest updates from the pandas repository, follow the steps in `Syncing a Fork <https://help.github.com/articles/syncing-a-fork/>`_:
65-
| ``git fetch upstream``
66-
| ``git checkout master``
67-
| ``git merge upstream/master``
69+
git remote add upstream https://github.com/pandas-dev/pandas
70+
71+
or (if you have set up SSH keys for accessing GitHub): ::
72+
73+
git remote add upstream [email protected]:pandas-dev/pandas
74+
75+
To fetch the latest updates from the pandas repository, follow the steps in
76+
`Syncing a Fork <https://help.github.com/articles/syncing-a-fork/>`_: ::
77+
78+
git fetch upstream
79+
git checkout master
80+
git merge upstream/master
6881

6982

7083
3. Set up a Python environment
@@ -76,19 +89,30 @@ On how to fetch the latest updates from the pandas repository, follow the steps
7689
**Windows users**: run the next commands in the Anaconda Prompt (found in the Anaconda
7790
folder of the Start menu).
7891

79-
* Activate conda by one of the next (or equivalent, if you know what you're doing):
80-
* If you chose to prepend Anaconda to your PATH during install adding it to your ``~/.bashrc``, just restart your terminal.
81-
* Otherwise, run ``export PATH="<path-to-anaconda>/bin:$PATH"`` in your terminal. Keep in mind that it will be active exclusively in the terminal you run this command.
82-
* Create a conda environment:
83-
``conda env create -n pandas_dev -f <path-to-pandas-dir>/ci/environment-dev.yaml``
92+
* Activate conda in one of the following ways (or equivalent, if you know what
93+
you're doing):
94+
95+
* If you chose to prepend Anaconda to your PATH during install adding it to
96+
your ``~/.bashrc``, just restart your terminal.
97+
* Otherwise, run ``export PATH="<path-to-anaconda>/bin:$PATH"`` in your
98+
terminal. Keep in mind that it will be active exclusively in the terminal
99+
you run this command.
100+
101+
* Create a conda environment: ::
102+
103+
conda env create -n pandas_dev -f <path-to-pandas-dir>/ci/environment-dev.yaml
84104

85105
.. note::
86-
**Windows users**: If you're copy-pasting the path, replace all pasted ``\`` characters with ``/`` for the command to work.
106+
**Windows users**: If you're copy-pasting the path, replace all pasted
107+
``\`` characters with ``/`` for the command to work.
108+
109+
* Activate the new conda environment: ::
110+
111+
source activate pandas_dev
87112

88-
* Activate the new conda environment:
89-
``conda activate pandas_dev``
90-
* Install pandas development dependencies:
91-
``conda install -c defaults -c conda-forge --file=<path-to-pandas-dir>/ci/requirements-optional-conda.txt``
113+
* Install pandas development dependencies: ::
114+
115+
conda install -c defaults -c conda-forge --file=<path-to-pandas-dir>/ci/requirements-optional-conda.txt
92116

93117
4. Compile C code in pandas
94118
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -97,16 +121,24 @@ Besides the Python `.py` files, pandas source code includes C/Cython files
97121
which need to be compiled in order to run the development version of pandas.
98122

99123
.. note::
100-
**Windows users**: to compile pandas, you need to install `Visual Studio 2017 <https://www.visualstudio.com/>`_. You need Visual Studio Community 2017 (2.5GB download during installation) as a minimum. Visual Studio Code does not support the required Build Tools and will not work.
101-
Select the workload "Python development" and the option "Python native development tools" on the right side.
124+
**Windows users**: to compile pandas, you need to install `Visual Studio
125+
2017 <https://www.visualstudio.com/>`_. You need Visual Studio Community
126+
2017 (2.5GB download during installation) as a minimum. Visual Studio Code
127+
does not support the required Build Tools and will not work.
128+
129+
Select the workload "Python development" and the option "Python native
130+
development tools" on the right side.
102131

103-
(Users of legacy Python 2.7 should install `Microsoft Visual C++ Compiler for Python 2.7 <https://www.microsoft.com/download/details.aspx?id=44266>`_ instead).
132+
Users of legacy Python 2.7 should install `Microsoft Visual C++ Compiler
133+
for Python 2.7 <https://www.microsoft.com/download/details.aspx?id=44266>`_
134+
instead.
104135

105136
After the installation, run the following commands in Anaconda Prompt.
106137

107-
To compile these files simply run:
108-
| ``cd <pandas-dir>``
109-
| ``python setup.py build_ext --inplace``
138+
To compile these files simply run: ::
139+
140+
cd <pandas-dir>
141+
python setup.py build_ext --inplace
110142

111143
The process will take several minutes.
112144

@@ -119,27 +151,30 @@ changes. This will be useful when you have finished your changes, and you want
119151
to submit a pull request, so they are included in pandas.
120152

121153
.. note::
122-
**Windows users**: run the next commands with Git Bash started at the cloned
154+
**Windows users**: run the next commands with Git Bash started in the cloned
123155
pandas folder.
124156

125157
Before creating a branch, make sure that you fetched the latest master version
126-
of the upstream pandas repository. You can do this with:
158+
of the upstream pandas repository. You can do this with: ::
159+
160+
git checkout master
161+
git pull upstream master --ff-only
127162

128-
| ``git checkout master``
129-
| ``git pull upstream master --ff-only``
163+
Then, you can create a new git branch running: ::
130164

131-
Then, you can create a new git branch running:
132-
| ``git checkout -b <new_branch_name>``
165+
git checkout -b <new_branch_name>
133166

134167
The branch name should be descriptive of the feature you will work on. For
135-
example, if you will work on the docstring of the method `head`, you can
136-
name your branch `docstring_head`.
168+
example, if you will work on the docstring of the method ``head``, you can
169+
name your branch ``docstring_head``.
137170

138171
If during the sprint you work in more than one docstring, you will need a
139172
branch for each.
140173

141-
To check in which branch are you:
142-
| ``git branch``
174+
To check in which branch are you: ::
175+
176+
git branch
177+
178+
To change to another branch: ::
143179

144-
To change to another branch:
145-
| ``git checkout <branch_name>``
180+
git checkout <branch_name>

0 commit comments

Comments
 (0)