Skip to content

Commit d8bc7a3

Browse files
committed
Merge pull request #9810 from jreback/dev
DOC: add dev environment creation details to contributing.rst
2 parents 1fafe76 + 5ac2b50 commit d8bc7a3

File tree

5 files changed

+192
-50
lines changed

5 files changed

+192
-50
lines changed

CONTRIBUTING.md

+74-5
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,69 @@ clear what the branch brings to *pandas*. You can have many
137137
shiny-new-features and switch in between them using the git checkout
138138
command.
139139

140+
### Creating a Development Environment
141+
142+
An easy way to create a *pandas* development environment is as follows.
143+
144+
- Install either Install Anaconda \<install-anaconda\> or
145+
Install miniconda \<install-miniconda\>
146+
- Make sure that you have
147+
cloned the repository \<contributing-forking\>
148+
- `cd` to the pandas source directory
149+
150+
Tell `conda` to create a new environment, named `pandas_dev`, or any
151+
name you would like for this environment by running:
152+
153+
conda create -n pandas_dev --file ci/requirements_dev.txt
154+
155+
For a python 3 environment
156+
157+
conda create -n pandas_dev python=3 --file ci/requirements_dev.txt
158+
159+
If you are on `windows`, then you will need to install the compiler
160+
linkages:
161+
162+
conda install -n pandas_dev libpython
163+
164+
This will create the new environment, and not touch any of your existing
165+
environments, nor any existing python installation. It will install all
166+
of the basic dependencies of *pandas*, as well as the development and
167+
testing tools. If you would like to install other dependencies, you can
168+
install them as follows:
169+
170+
conda install -n pandas_dev -c pandas pytables scipy
171+
172+
To install *all* pandas dependencies you can do the following:
173+
174+
conda install -n pandas_dev -c pandas --file ci/requirements_all.txt
175+
176+
To work in this environment, `activate` it as follows:
177+
178+
activate pandas_dev
179+
180+
At which point, the prompt will change to indicate you are in the new
181+
development environment.
182+
183+
> **note**
184+
>
185+
> The above syntax is for `windows` environments. To work on
186+
> `macosx/linux`, use:
187+
>
188+
> source activate pandas_dev
189+
190+
To view your environments:
191+
192+
conda info -e
193+
194+
To return to you home root environment:
195+
196+
deactivate
197+
198+
See the full `conda` docs [here](http://conda.pydata.org/docs).
199+
200+
At this point you can easily do an *in-place* install, as detailed in
201+
the next section.
202+
140203
### Making changes
141204

142205
Before making your code changes, it is often necessary to build the code
@@ -231,13 +294,19 @@ docstrings that follow the Numpy Docstring Standard (see above), but you
231294
don't need to install this because a local copy of `numpydoc` is
232295
included in the *pandas* source code.
233296

297+
It is easiest to
298+
create a development environment \<contributing-dev\_env\>, then
299+
install:
300+
301+
conda install -n pandas_dev sphinx ipython
302+
234303
Furthermore, it is recommended to have all [optional
235304
dependencies](http://pandas.pydata.org/pandas-docs/dev/install.html#optional-dependencies)
236-
installed. This is not needed, but be aware that you will see some error
237-
messages. Because all the code in the documentation is executed during
238-
the doc build, the examples using this optional dependencies will
239-
generate errors. Run `pd.show_versions()` to get an overview of the
240-
installed version of all dependencies.
305+
installed. This is not strictly necessary, but be aware that you will
306+
see some error messages. Because all the code in the documentation is
307+
executed during the doc build, the examples using this optional
308+
dependencies will generate errors. Run `pd.show_versions()` to get an
309+
overview of the installed version of all dependencies.
241310

242311
> **warning**
243312
>

ci/requirements_all.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
nose
2+
sphinx
3+
ipython
4+
dateutil
5+
pytz
6+
openpyxl
7+
xlsxwriter
8+
xlrd
9+
html5lib
10+
patsy
11+
beautiful-soup
12+
numpy
13+
cython
14+
scipy
15+
numexpr
16+
pytables
17+
matplotlib
18+
lxml
19+
sqlalchemy
20+
bottleneck
21+
pymysql

ci/requirements_dev.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dateutil
2+
pytz
3+
numpy
4+
cython
5+
nose

doc/source/contributing.rst

+87-4
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ Getting Started with Git
9696
setting up your SSH key, and configuring git. All these steps need to be completed before
9797
working seamlessly with your local repository and GitHub.
9898

99+
.. _contributing.forking:
100+
99101
Forking
100102
-------
101103

@@ -132,6 +134,84 @@ changes in this branch specific to one bug or feature so it is clear
132134
what the branch brings to *pandas*. You can have many shiny-new-features
133135
and switch in between them using the git checkout command.
134136

137+
.. _contributing.dev_env:
138+
139+
Creating a Development Environment
140+
----------------------------------
141+
142+
An easy way to create a *pandas* development environment is as follows.
143+
144+
- Install either :ref:`Install Anaconda <install-anaconda>` or :ref:`Install miniconda <install-miniconda>`
145+
- Make sure that you have :ref:`cloned the repository <contributing-forking>`
146+
- ``cd`` to the pandas source directory
147+
148+
Tell ``conda`` to create a new environment, named ``pandas_dev``, or any name you would like for this environment by running:
149+
150+
::
151+
152+
conda create -n pandas_dev --file ci/requirements_dev.txt
153+
154+
155+
For a python 3 environment
156+
157+
::
158+
159+
conda create -n pandas_dev python=3 --file ci/requirements_dev.txt
160+
161+
162+
If you are on ``windows``, then you will need to install the compiler linkages:
163+
164+
::
165+
166+
conda install -n pandas_dev libpython
167+
168+
This will create the new environment, and not touch any of your existing environments, nor any existing python installation. It will install all of the basic dependencies of *pandas*, as well as the development and testing tools. If you would like to install other dependencies, you can install them as follows:
169+
170+
::
171+
172+
conda install -n pandas_dev -c pandas pytables scipy
173+
174+
To install *all* pandas dependencies you can do the following:
175+
176+
::
177+
178+
conda install -n pandas_dev -c pandas --file ci/requirements_all.txt
179+
180+
To work in this environment, ``activate`` it as follows:
181+
182+
::
183+
184+
activate pandas_dev
185+
186+
At which point, the prompt will change to indicate you are in the new development environment.
187+
188+
.. note::
189+
190+
The above syntax is for ``windows`` environments. To work on ``macosx/linux``, use:
191+
192+
::
193+
194+
source activate pandas_dev
195+
196+
To view your environments:
197+
198+
::
199+
200+
conda info -e
201+
202+
To return to you home root environment:
203+
204+
::
205+
206+
deactivate
207+
208+
See the full ``conda`` docs `here
209+
<http://conda.pydata.org/docs>`_.
210+
211+
At this point you can easily do an *in-place* install, as detailed in the next section.
212+
213+
.. _contributing.getting_source:
214+
135215
Making changes
136216
--------------
137217

@@ -237,9 +317,15 @@ follow the Numpy Docstring Standard (see above), but you don't need to install
237317
this because a local copy of ``numpydoc`` is included in the *pandas* source
238318
code.
239319

320+
It is easiest to :ref:`create a development environment <contributing-dev_env>`, then install:
321+
322+
::
323+
324+
conda install -n pandas_dev sphinx ipython
325+
240326
Furthermore, it is recommended to have all `optional dependencies
241327
<http://pandas.pydata.org/pandas-docs/dev/install.html#optional-dependencies>`_
242-
installed. This is not needed, but be aware that you will see some error
328+
installed. This is not strictly necessary, but be aware that you will see some error
243329
messages. Because all the code in the documentation is executed during the doc
244330
build, the examples using this optional dependencies will generate errors.
245331
Run ``pd.show_versions()`` to get an overview of the installed version of all
@@ -572,6 +658,3 @@ branch has not actually been merged.
572658
The branch will still exist on GitHub, so to delete it there do ::
573659

574660
git push origin --delete shiny-new-feature
575-
576-
577-

doc/source/install.rst

+5-41
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ pandas at all.
3535
Simply create an account, and have access to pandas from within your brower via
3636
an `IPython Notebook <http://ipython.org/notebook.html>`__ in a few minutes.
3737

38+
.. _install.anaconda
39+
3840
Installing pandas with Anaconda
3941
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4042

@@ -66,6 +68,8 @@ admin rights to install it, it will install in the user's home directory, and
6668
this also makes it trivial to delete Anaconda at a later date (just delete
6769
that folder).
6870

71+
.. _install.miniconda
72+
6973
Installing pandas with Miniconda
7074
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7175

@@ -173,47 +177,8 @@ Installing using your Linux distribution's package manager.
173177

174178
Installing from source
175179
~~~~~~~~~~~~~~~~~~~~~~
176-
.. note::
177-
178-
Installing from the git repository requires a recent installation of `Cython
179-
<http://cython.org>`__ as the cythonized C sources are no longer checked
180-
into source control. Released source distributions will contain the built C
181-
files. I recommend installing the latest Cython via ``easy_install -U
182-
Cython``
183-
184-
The source code is hosted at http://github.com/pydata/pandas, it can be checked
185-
out using git and compiled / installed like so:
186-
187-
::
188-
189-
git clone git://github.com/pydata/pandas.git
190-
cd pandas
191-
python setup.py install
192-
193-
Make sure you have Cython installed when installing from the repository,
194-
rather then a tarball or pypi.
195180

196-
On Windows, I suggest installing the MinGW compiler suite following the
197-
directions linked to above. Once configured property, run the following on the
198-
command line:
199-
200-
::
201-
202-
python setup.py build --compiler=mingw32
203-
python setup.py install
204-
205-
Note that you will not be able to import pandas if you open an interpreter in
206-
the source directory unless you build the C extensions in place:
207-
208-
::
209-
210-
python setup.py build_ext --inplace
211-
212-
The most recent version of MinGW (any installer dated after 2011-08-03)
213-
has removed the '-mno-cygwin' option but Distutils has not yet been updated to
214-
reflect that. Thus, you may run into an error like "unrecognized command line
215-
option '-mno-cygwin'". Until the bug is fixed in Distutils, you may need to
216-
install a slightly older version of MinGW (2011-08-02 installer).
181+
See the :ref:`contributing documentation <contributing>` for complete instructions on building from the git source tree. Further, see :ref:`creating a devevlopment environment <contributing-dev_env>` if you wish to create a *pandas* development environment.
217182

218183
Running the test suite
219184
~~~~~~~~~~~~~~~~~~~~~~
@@ -354,4 +319,3 @@ Optional Dependencies
354319
work. Hence, it is highly recommended that you install these. A packaged
355320
distribution like `Enthought Canopy
356321
<http://enthought.com/products/canopy>`__ may be worth considering.
357-

0 commit comments

Comments
 (0)