@@ -8,16 +8,29 @@ Contributing
88
99Here are some guidelines for hacking on ``google-cloud-python ``.
1010
11+ Adding Features
12+ ---------------
13+
14+ In order to add a feature to ``google-cloud-python ``:
15+
16+ - The feature must be documented in both the API and narrative
17+ documentation (in ``docs/ ``).
18+
19+ - The feature must work fully on the following CPython versions: 2.7,
20+ 3.4, and 3.5 on both UNIX and Windows.
21+
22+ - The feature must not add unnecessary dependencies (where
23+ "unnecessary" is of course subjective, but new dependencies should
24+ be discussed).
25+
1126Using a Development Checkout
1227----------------------------
1328
14- You'll have to create a development environment to hack on `` google-cloud-python ``,
15- using a Git checkout:
29+ You'll have to create a development environment to hack on
30+ `` google-cloud-python ``, using a Git checkout:
1631
17- - While logged into your GitHub account, navigate to the ``google-cloud-python `` repo
18- on GitHub.
19-
20- https://github.com/GoogleCloudPlatform/google-cloud-python
32+ - While logged into your GitHub account, navigate to the
33+ ``google-cloud-python `` `repo `_ on GitHub.
2134
2235- Fork and clone the ``google-cloud-python `` repository to your GitHub account by
2336 clicking the "Fork" button.
@@ -42,6 +55,8 @@ repo, from which you can submit a pull request.
4255To work on the codebase and run the tests, we recommend using ``tox ``,
4356but you can also use a ``virtualenv `` of your own creation.
4457
58+ .. _repo : https://github.com/GoogleCloudPlatform/google-cloud-python
59+
4560Using a custom ``virtualenv ``
4661~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4762
@@ -96,6 +111,19 @@ Using ``tox``
96111 by the ``tox `` environment, so if you make changes, you'll need
97112 to again ``--recreate `` the environment.
98113
114+ - To run unit tests on a restricted set of packages::
115+
116+ $ tox -e py27 -- core datastore
117+
118+ Alternatively, you can just navigate directly to the package you are
119+ currently developing and run tests there::
120+
121+ $ export GIT_ROOT=$(pwd)
122+ $ cd ${GIT_ROOT}/core/
123+ $ tox -e py27
124+ $ cd ${GIT_ROOT}/datastore/
125+ $ tox -e py27
126+
99127Note on Editable Installs / Develop Mode
100128~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101129
@@ -124,21 +152,6 @@ On Debian/Ubuntu::
124152
125153 $ sudo apt-get install python-dev
126154
127- Adding Features
128- ---------------
129-
130- In order to add a feature to ``google-cloud-python ``:
131-
132- - The feature must be documented in both the API and narrative
133- documentation (in ``docs/ ``).
134-
135- - The feature must work fully on the following CPython versions: 2.7,
136- 3.4, and 3.5 on both UNIX and Windows.
137-
138- - The feature must not add unnecessary dependencies (where
139- "unnecessary" is of course subjective, but new dependencies should
140- be discussed).
141-
142155Coding Style
143156------------
144157
@@ -170,21 +183,25 @@ Running Tests
170183
171184- To run all tests for ``google-cloud-python `` on a single Python version, run
172185 ``py.test `` from your development virtualenv (See
173- *Using a Development Checkout * above).
186+ `Using a Development Checkout `_ above).
187+
188+ .. _Using a Development Checkout : #using-a-development-checkout
174189
175190- To run the full set of ``google-cloud-python `` tests on all platforms, install
176- ``tox `` (https://testrun.org/tox/ ) into a system Python. The `` tox `` console
177- script will be installed into the scripts location for that Python. While
178- ``cd ``'ed to the ``google-cloud-python `` checkout root directory (it contains
179- ``tox.ini ``), invoke the ``tox `` console script. This will read the
180- ``tox.ini `` file and execute the tests on multiple Python versions and
181- platforms; while it runs, it creates a virtualenv for each version/platform
182- combination. For example::
191+ ``tox `` (https://tox.readthedocs.io/en/latest/ ) into a system Python. The
192+ `` tox `` console script will be installed into the scripts location for that
193+ Python. While ``cd ``'- ed to the ``google-cloud-python `` checkout root
194+ directory (it contains ``tox.ini ``), invoke the ``tox `` console script.
195+ This will read the ``tox.ini `` file and execute the tests on multiple
196+ Python versions and platforms; while it runs, it creates a `` virtualenv `` for
197+ each version/platform combination. For example::
183198
184199 $ sudo --set-home /usr/bin/pip install tox
185200 $ cd ${HOME}/hack-on-google-cloud-python/
186201 $ /usr/bin/tox
187202
203+ .. _Using a Development Checkout : #using-a-development-checkout
204+
188205Running System Tests
189206--------------------
190207
0 commit comments