@@ -2,23 +2,33 @@ Releasing
2
2
=========
3
3
* Run the tests and ensure they all pass
4
4
* Update CHANGELOG.rst
5
-
6
5
* Check for any missing entries
7
6
* Add today's date to the release section
8
7
* Update the version in ``cassandra/__init__.py ``
9
-
10
8
* For beta releases, use a version like ``(2, 1, '0b1') ``
11
9
* For release candidates, use a version like ``(2, 1, '0rc1') ``
12
10
* When in doubt, follow PEP 440 versioning
13
11
* Add the new version in ``docs.yaml ``
14
-
15
12
* Commit the changelog and version changes, e.g. ``git commit -m'version 1.0.0' ``
16
13
* Tag the release. For example: ``git tag -a 1.0.0 -m 'version 1.0.0' ``
17
14
* Push the tag and new ``master ``: ``git push origin 1.0.0 ; git push origin master ``
18
- * Upload the package to pypi::
15
+ * Update the `python-driver ` submodule of `python-driver-wheels `,
16
+ commit then push. This will trigger TravisCI and the wheels building.
17
+ * For a GA release, upload the package to pypi::
18
+
19
+ # Clean the working directory
20
+ python setup.py clean
21
+ rm dist/*
19
22
20
- python setup.py register
21
- python setup.py sdist upload
23
+ # Build the source distribution
24
+ python setup.py sdist
25
+
26
+ # Download all wheels from the jfrog repository and copy them in
27
+ # the dist/ directory
28
+ cp /path/to/wheels/*.whl dist/
29
+
30
+ # Upload all files
31
+ twine upload dist/*
22
32
23
33
* On pypi, make the latest GA the only visible version
24
34
* Update the docs (see below)
@@ -27,6 +37,12 @@ Releasing
27
37
28
38
* After a beta or rc release, this should look like ``(2, 1, '0b1', 'post0') ``
29
39
40
+ * After the release has been tagged, add a section to docs.yaml with the new tag ref::
41
+
42
+ versions:
43
+ - name: <version name>
44
+ ref: <release tag>
45
+
30
46
* Commit and push
31
47
* Update 'cassandra-test' branch to reflect new release
32
48
@@ -80,45 +96,66 @@ directory and build from scratch::
80
96
81
97
rm -rf docs/_build/*
82
98
83
- Running the Tests
84
- =================
85
- In order for the extensions to be built and used in the test, run::
99
+ Documentor
100
+ ==========
101
+ We now also use another tool called Documentor with Sphinx source to build docs.
102
+ This gives us versioned docs with nice integrated search. This is a private tool
103
+ of DataStax.
86
104
87
- nosetests
105
+ Dependencies
106
+ ------------
107
+ Sphinx
108
+ ~~~~~~
109
+ Installed as described above
88
110
89
- You can run a specific test module or package like so::
111
+ Documentor
112
+ ~~~~~~~~~~
113
+ Clone and setup Documentor as specified in `the project <https://github.com/riptano/documentor#installation-and-quick-start >`_.
114
+ This tool assumes Ruby, bundler, and npm are present.
90
115
91
- nosetests -w tests/unit/
116
+ Building
117
+ --------
118
+ The setup script expects documentor to be in the system path. You can either add it permanently or run with something
119
+ like this::
92
120
93
- You can run a specific test method like so::
121
+ PATH=$PATH:<documentor repo>/bin python setup.py doc
94
122
95
- nosetests -w tests/unit/test_connection.py:ConnectionTest.test_bad_protocol_version
123
+ The docs will not display properly just browsing the filesystem in a browser. To view the docs as they would be in most
124
+ web servers, use the SimpleHTTPServer module::
96
125
97
- Seeing Test Logs in Real Time
98
- -----------------------------
99
- Sometimes it's useful to output logs for the tests as they run::
126
+ cd docs/_build/
127
+ python -m SimpleHTTPServer
100
128
101
- nosetests -w tests/unit/ --nocapture --nologcapture
129
+ Then, browse to ` localhost:8000 < http://localhost:8000 >`_.
102
130
103
- Use tee to capture logs and see them on your terminal::
131
+ Tests
132
+ =====
104
133
105
- nosetests -w tests/unit/ --nocapture --nologcapture 2>&1 | tee test.log
134
+ Running Unit Tests
135
+ ------------------
136
+ Unit tests can be run like so::
106
137
107
- Specifying a Cassandra Version for Integration Tests
108
- ----------------------------------------------------
109
- You can specify a cassandra version with the ``CASSANDRA_VERSION `` environment variable::
138
+ nosetests -w tests/unit/
139
+
140
+ You can run a specific test method like so::
141
+
142
+ nosetests -w tests/unit/test_connection.py:ConnectionTest.test_bad_protocol_version
143
+
144
+ Running Integration Tests
145
+ -------------------------
146
+ In order to run integration tests, you must specify a version to run using the ``CASSANDRA_VERSION `` or ``DSE_VERSION `` environment variable::
110
147
111
148
CASSANDRA_VERSION=2.0.9 nosetests -w tests/integration/standard
112
149
113
- You can also specify a cassandra directory (to test unreleased versions)::
150
+ Or you can specify a cassandra directory (to test unreleased versions)::
114
151
115
- CASSANDRA_DIR=/home/thobbs/cassandra nosetests -w tests/integration/standard
152
+ CASSANDRA_DIR=/home/thobbs/cassandra nosetests -w tests/integration/standard/
116
153
117
154
Specifying the usage of an already running Cassandra cluster
118
- ----------------------------------------------------
119
- The test will start the appropriate Cassandra clusters when necessary but if you don't want this to happen because a Cassandra cluster is already running the flag ``USE_CASS_EXTERNAL `` can be used, for example:
155
+ ------------------------------------------------------------
156
+ The test will start the appropriate Cassandra clusters when necessary but if you don't want this to happen because a Cassandra cluster is already running the flag ``USE_CASS_EXTERNAL `` can be used, for example::
120
157
121
- USE_CASS_EXTERNAL=1 python setup.py nosetests -w tests/integration/standard
158
+ USE_CASS_EXTERNAL=1 CASSANDRA_VERSION=2.0.9 nosetests -w tests/integration/standard
122
159
123
160
Specify a Protocol Version for Tests
124
161
------------------------------------
@@ -127,20 +164,24 @@ it with the ``PROTOCOL_VERSION`` environment variable::
127
164
128
165
PROTOCOL_VERSION=3 nosetests -w tests/integration/standard
129
166
167
+ Seeing Test Logs in Real Time
168
+ -----------------------------
169
+ Sometimes it's useful to output logs for the tests as they run::
170
+
171
+ nosetests -w tests/unit/ --nocapture --nologcapture
172
+
173
+ Use tee to capture logs and see them on your terminal::
174
+
175
+ nosetests -w tests/unit/ --nocapture --nologcapture 2>&1 | tee test.log
176
+
130
177
Testing Multiple Python Versions
131
178
--------------------------------
132
- If you want to test all of python 2.7, 3.4, 3.5, 3.6 and pypy, use tox (this is what
179
+ If you want to test all of python 2.7, 3.4, 3.5, 3.6, 3.7, and pypy, use tox (this is what
133
180
TravisCI runs)::
134
181
135
182
tox
136
183
137
- By default, tox only runs the unit tests because I haven't put in the effort
138
- to get the integration tests to run on TravicCI. However, the integration
139
- tests should work locally. To run them, edit the following line in tox.ini::
140
-
141
- commands = {envpython} setup.py build_ext --inplace nosetests --verbosity=2 tests/unit/
142
-
143
- and change ``tests/unit/ `` to ``tests/ ``.
184
+ By default, tox only runs the unit tests.
144
185
145
186
Running the Benchmarks
146
187
======================
@@ -169,3 +210,42 @@ name to specify the built version::
169
210
python setup.py egg_info -b-`git rev-parse --short HEAD` sdist --formats=zip
170
211
171
212
The file (``dist/cassandra-driver-<version spec>.zip ``) is packaged with Cassandra in ``cassandra/lib/cassandra-driver-internal-only*zip ``.
213
+
214
+ Releasing an EAP
215
+ ================
216
+
217
+ An EAP release is only uploaded on a private server and it is not published on pypi.
218
+
219
+ * Clean the environment::
220
+
221
+ python setup.py clean
222
+
223
+ * Package the source distribution::
224
+
225
+ python setup.py sdist
226
+
227
+ * Test the source distribution::
228
+
229
+ pip install dist/cassandra-driver-<version>.tar.gz
230
+
231
+ * Upload the package on the EAP download server.
232
+ * Build the documentation::
233
+
234
+ python setup.py doc
235
+
236
+ * Upload the docs on the EAP download server.
237
+
238
+ Adding a New Python Runtime Support
239
+ ===================================
240
+
241
+ * Add the new python version to our jenkins image:
242
+ https://github.com/riptano/openstack-jenkins-drivers/
243
+
244
+ * Add the new python version in job-creator:
245
+ https://github.com/riptano/job-creator/
246
+
247
+ * Run the tests and ensure they all pass
248
+ * also test all event loops
249
+
250
+ * Update the wheels building repo to support that version:
251
+ https://github.com/riptano/python-dse-driver-wheels
0 commit comments