Skip to content

Commit e696a82

Browse files
authored
Merge pull request scylladb#5 from riptano/oss-next
Unify DSE and OSS drivers
2 parents 551dffb + 2be3116 commit e696a82

File tree

150 files changed

+14787
-1410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+14787
-1410
lines changed

CHANGELOG.rst

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,89 @@ Features
77
* Allow passing ssl context for Twisted (PYTHON-1161)
88
* ssl context and cloud support for Eventlet (PYTHON-1162)
99
* Cloud Twisted support (PYTHON-1163)
10+
* Add additional_write_policy and read_repair to system schema parsing (PYTHON-1048)
11+
* Handle prepared id mismatch when repreparing on the fly (PYTHON-1124)
12+
* Remove *read_repair_chance table options (PYTHON-1140)
13+
* Flexible version parsing (PYTHON-1174)
14+
* Support NULL in collection deserializer (PYTHON-1123)
15+
* Avoid warnings about unspecified load balancing policy when connecting to a cloud cluster (PYTHON-1177)
16+
* Add Python 3.8 support (PYTHON-1189)
17+
* Add new DSE CQL keywords (PYTHON-1122)
18+
* [GRAPH] Ability to execute Fluent Graph queries asynchronously (PYTHON-1129)
1019
1120
Bug Fixes
1221
---------
1322
* re-raising the CQLEngineException will fail on Python 3 (PYTHON-1166)
23+
* asyncio message chunks can be processed discontinuously (PYTHON-1185)
24+
* Reconnect attempts persist after downed node removed from peers (PYTHON-1181)
1425
* Connection fails to validate ssl certificate hostname when SSLContext.check_hostname is set (PYTHON-1186)
1526
* ResponseFuture._set_result crashes on connection error when used with PrepareMessage (PYTHON-1187)
27+
* Insights fail to serialize the startup message when the SSL Context is from PyOpenSSL (PYTHON-1192)
28+
29+
Others
30+
------
31+
* The driver has a new dependency: geomet. It comes from the dse-driver unification and
32+
is used to support DSE geo types.
33+
34+
Deprecations
35+
------------
36+
37+
* DSELoadBalancingPolicy will be removed in the next major, consider using
38+
the DefaultLoadBalancingPolicy.
39+
40+
Merged from dse-driver:
41+
42+
Features
43+
--------
44+
45+
* Insights integration (PYTHON-1047)
46+
* Graph execution profiles should preserve their graph_source when graph_options is overridden (PYTHON-1021)
47+
* Add NodeSync metadata (PYTHON-799)
48+
* Add new NodeSync failure values (PYTHON-934)
49+
* DETERMINISTIC and MONOTONIC Clauses for Functions and Aggregates (PYTHON-955)
50+
* GraphOptions should show a warning for unknown parameters (PYTHON-819)
51+
* DSE protocol version 2 and continous paging backpressure (PYTHON-798)
52+
* GraphSON2 Serialization/Deserialization Support (PYTHON-775)
53+
* Add graph-results payload option for GraphSON format (PYTHON-773)
54+
* Create an AuthProvider for the DSE transitional mode (PYTHON-831)
55+
* Implement serializers for the Graph String API (PYTHON-778)
56+
* Provide deserializers for GraphSON types (PYTHON-782)
57+
* Add Graph DurationType support (PYTHON-607)
58+
* Support DSE DateRange type (PYTHON-668)
59+
* RLAC CQL output for materialized views (PYTHON-682)
60+
* Add Geom Types wkt deserializer
61+
* DSE Graph Client timeouts in custom payload (PYTHON-589)
62+
* Make DSEGSSAPIAuthProvider accept principal name (PYTHON-574)
63+
* Add config profiles to DSE graph execution (PYTHON-570)
64+
* DSE Driver version checking (PYTHON-568)
65+
* Distinct default timeout for graph queries (PYTHON-477)
66+
* Graph result parsing for known types (PYTHON-479,487)
67+
* Distinct read/write CL for graph execution (PYTHON-509)
68+
* Target graph analytics query to spark master when available (PYTHON-510)
69+
70+
Bug Fixes
71+
---------
72+
73+
* Continuous paging sessions raise RuntimeError when results are not entirely consumed (PYTHON-1054)
74+
* GraphSON Property deserializer should return a dict instead of a set (PYTHON-1033)
75+
* ResponseFuture.has_more_pages may hold the wrong value (PYTHON-946)
76+
* DETERMINISTIC clause in AGGREGATE misplaced in CQL generation (PYTHON-963)
77+
* graph module import cause a DLL issue on Windows due to its cythonizing failure (PYTHON-900)
78+
* Update date serialization to isoformat in graph (PYTHON-805)
79+
* DateRange Parse Error (PYTHON-729)
80+
* MontonicTimestampGenerator.__init__ ignores class defaults (PYTHON-728)
81+
* metadata.get_host returning None unexpectedly (PYTHON-709)
82+
* Sockets associated with sessions not getting cleaned up on session.shutdown() (PYTHON-673)
83+
* Resolve FQDN from ip address and use that as host passed to SASLClient (PYTHON-566)
84+
* Geospatial type implementations don't handle 'EMPTY' values. (PYTHON-481)
85+
* Correctly handle other types in geo type equality (PYTHON-508)
86+
87+
Other
88+
-----
89+
* Add tests around cqlengine and continuous paging (PYTHON-872)
90+
* Add an abstract GraphStatement to handle different graph statements (PYTHON-789)
91+
* Write documentation examples for DSE 2.0 features (PYTHON-732)
92+
* DSE_V1 protocol should not include all of protocol v5 (PYTHON-694)
1693

1794
3.20.2
1895
======
@@ -64,6 +141,7 @@ Bug Fixes
64141
* Call ConnectionException with correct kwargs (PYTHON-1117)
65142
* Can't connect to clusters built from source because version parsing doesn't handle 'x.y-SNAPSHOT' (PYTHON-1118)
66143
* Discovered node doesn´t honor the configured Cluster port on connection (PYTHON-1127)
144+
* Exception when use pk__token__gt filter In python 3.7 (PYTHON-1121)
67145

68146
Other
69147
-----

README-dev.rst

Lines changed: 116 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,33 @@ Releasing
22
=========
33
* Run the tests and ensure they all pass
44
* Update CHANGELOG.rst
5-
65
* Check for any missing entries
76
* Add today's date to the release section
87
* Update the version in ``cassandra/__init__.py``
9-
108
* For beta releases, use a version like ``(2, 1, '0b1')``
119
* For release candidates, use a version like ``(2, 1, '0rc1')``
1210
* When in doubt, follow PEP 440 versioning
1311
* Add the new version in ``docs.yaml``
14-
1512
* Commit the changelog and version changes, e.g. ``git commit -m'version 1.0.0'``
1613
* Tag the release. For example: ``git tag -a 1.0.0 -m 'version 1.0.0'``
1714
* 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/*
1922

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/*
2232

2333
* On pypi, make the latest GA the only visible version
2434
* Update the docs (see below)
@@ -27,6 +37,12 @@ Releasing
2737

2838
* After a beta or rc release, this should look like ``(2, 1, '0b1', 'post0')``
2939

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+
3046
* Commit and push
3147
* Update 'cassandra-test' branch to reflect new release
3248

@@ -80,45 +96,66 @@ directory and build from scratch::
8096

8197
rm -rf docs/_build/*
8298

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.
86104

87-
nosetests
105+
Dependencies
106+
------------
107+
Sphinx
108+
~~~~~~
109+
Installed as described above
88110

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.
90115

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::
92120

93-
You can run a specific test method like so::
121+
PATH=$PATH:<documentor repo>/bin python setup.py doc
94122

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::
96125

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
100128

101-
nosetests -w tests/unit/ --nocapture --nologcapture
129+
Then, browse to `localhost:8000 <http://localhost:8000>`_.
102130

103-
Use tee to capture logs and see them on your terminal::
131+
Tests
132+
=====
104133

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::
106137

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::
110147

111148
CASSANDRA_VERSION=2.0.9 nosetests -w tests/integration/standard
112149

113-
You can also specify a cassandra directory (to test unreleased versions)::
150+
Or you can specify a cassandra directory (to test unreleased versions)::
114151

115-
CASSANDRA_DIR=/home/thobbs/cassandra nosetests -w tests/integration/standard
152+
CASSANDRA_DIR=/home/thobbs/cassandra nosetests -w tests/integration/standard/
116153

117154
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::
120157

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
122159

123160
Specify a Protocol Version for Tests
124161
------------------------------------
@@ -127,20 +164,24 @@ it with the ``PROTOCOL_VERSION`` environment variable::
127164

128165
PROTOCOL_VERSION=3 nosetests -w tests/integration/standard
129166

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+
130177
Testing Multiple Python Versions
131178
--------------------------------
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
133180
TravisCI runs)::
134181

135182
tox
136183

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.
144185

145186
Running the Benchmarks
146187
======================
@@ -169,3 +210,42 @@ name to specify the built version::
169210
python setup.py egg_info -b-`git rev-parse --short HEAD` sdist --formats=zip
170211

171212
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

README.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
DataStax Python Driver for Apache Cassandra
2-
===========================================
1+
DataStax Driver for Apache Cassandra
2+
====================================
33

44
.. image:: https://travis-ci.org/datastax/python-driver.png?branch=master
55
:target: https://travis-ci.org/datastax/python-driver
66

7-
A modern, `feature-rich <https://github.com/datastax/python-driver#features>`_ and highly-tunable Python client library for Apache Cassandra (2.1+) using exclusively Cassandra's binary protocol and Cassandra Query Language v3.
7+
A modern, `feature-rich <https://github.com/datastax/python-driver#features>`_ and highly-tunable Python client library for Apache Cassandra (2.1+) and
8+
DataStax Enterprise (4.7+) using exclusively Cassandra's binary protocol and Cassandra Query Language v3.
89

9-
The driver supports Python 2.7, 3.4, 3.5, 3.6 and 3.7.
10-
11-
If you require compatibility with DataStax Enterprise, use the `DataStax Enterprise Python Driver <http://docs.datastax.com/en/developer/python-dse-driver/>`_.
10+
The driver supports Python 2.7, 3.4, 3.5, 3.6, 3.7 and 3.8.
1211

1312
**Note:** DataStax products do not support big-endian systems.
1413

@@ -28,6 +27,9 @@ Features
2827
* `Concurrent execution utilities <http://datastax.github.io/python-driver/api/cassandra/concurrent.html>`_
2928
* `Object mapper <http://datastax.github.io/python-driver/object_mapper.html>`_
3029
* `Connecting to DataStax Apollo database (cloud) <https://docs.datastax.com/en/developer/python-driver/latest/cloud/>`_
30+
* DSE Graph execution API
31+
* DSE Geometric type serialization
32+
* DSE PlainText and GSSAPI authentication
3133

3234
Installation
3335
------------
@@ -70,7 +72,7 @@ Getting Help
7072
------------
7173
Your best options for getting help with the driver are the
7274
`mailing list <https://groups.google.com/a/lists.datastax.com/forum/#!forum/python-driver-user>`_
73-
and the ``#datastax-drivers`` channel in the `DataStax Academy Slack <https://academy.datastax.com/slack>`_.
75+
and the `DataStax Community <https://community.datastax.com>`_.
7476

7577
License
7678
-------

0 commit comments

Comments
 (0)