{"id":13534348,"url":"https://github.com/datastax/python-driver","last_synced_at":"2025-10-19T05:56:16.820Z","repository":{"id":38857759,"uuid":"11262602","full_name":"datastax/python-driver","owner":"datastax","description":"DataStax Python Driver for Apache Cassandra","archived":false,"fork":false,"pushed_at":"2024-11-12T21:49:22.000Z","size":21178,"stargazers_count":1403,"open_issues_count":23,"forks_count":551,"subscribers_count":75,"default_branch":"master","last_synced_at":"2025-05-07T20:29:00.342Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datastax.png","metadata":{"files":{"readme":"README-dev.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security.rst","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-07-08T19:02:31.000Z","updated_at":"2025-05-02T10:34:02.000Z","dependencies_parsed_at":"2023-10-14T22:46:52.828Z","dependency_job_id":"f92121ab-6800-4b4a-920c-685cec668c86","html_url":"https://github.com/datastax/python-driver","commit_stats":{"total_commits":4972,"total_committers":201,"mean_commits":"24.736318407960198","dds":0.7765486725663717,"last_synced_commit":"c5bed09bf03cd1ceb7780572043713f946da8cd8"},"previous_names":[],"tags_count":89,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastax%2Fpython-driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastax%2Fpython-driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastax%2Fpython-driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastax%2Fpython-driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datastax","download_url":"https://codeload.github.com/datastax/python-driver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254227603,"owners_count":22035667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T07:01:31.003Z","updated_at":"2025-10-19T05:56:16.813Z","avatar_url":"https://github.com/datastax.png","language":"Python","readme":"Releasing\n=========\n* Run the tests and ensure they all pass\n* Update CHANGELOG.rst\n  * Check for any missing entries\n  * Add today's date to the release section\n* Update the version in ``cassandra/__init__.py``\n  * For beta releases, use a version like ``(2, 1, '0b1')``\n  * For release candidates, use a version like ``(2, 1, '0rc1')``\n  * When in doubt, follow PEP 440 versioning\n* Add the new version in ``docs.yaml``\n* Commit the changelog and version changes, e.g. ``git commit -m'version 1.0.0'``\n* Tag the release.  For example: ``git tag -a 1.0.0 -m 'version 1.0.0'``\n* Push the tag and new ``master``: ``git push origin 1.0.0 ; git push origin master``\n* Update the `python-driver` submodule of `python-driver-wheels`,\n  commit then push. This will trigger TravisCI and the wheels building.\n* For a GA release, upload the package to pypi::\n\n    # Clean the working directory\n    python setup.py clean\n    rm dist/*\n\n    # Build the source distribution\n    python setup.py sdist\n\n    # Download all wheels from the jfrog repository and copy them in\n    # the dist/ directory\n    cp /path/to/wheels/*.whl dist/\n\n    # Upload all files\n    twine upload dist/*\n\n* On pypi, make the latest GA the only visible version\n* Update the docs (see below)\n* Append a 'postN' string to the version tuple in ``cassandra/__init__.py``\n  so that it looks like ``(x, y, z, 'postN')``\n\n  * After a beta or rc release, this should look like ``(2, 1, '0b1', 'post0')``\n\n* After the release has been tagged, add a section to docs.yaml with the new tag ref::\n\n    versions:\n      - name: \u003cversion name\u003e\n        ref: \u003crelease tag\u003e\n\n* Commit and push\n* Update 'cassandra-test' branch to reflect new release\n\n    * this is typically a matter of merging or rebasing onto master\n    * test and push updated branch to origin\n\n* Update the JIRA versions: https://datastax-oss.atlassian.net/plugins/servlet/project-config/PYTHON/versions\n\n  * add release dates and set version as \"released\"\n\n* Make an announcement on the mailing list\n\nBuilding the Docs\n=================\nSphinx is required to build the docs. You probably want to install through apt,\nif possible::\n\n    sudo apt-get install python-sphinx\n\npip may also work::\n\n    sudo pip install -U Sphinx\n\nTo build the docs, run::\n\n    python setup.py doc\n\nUpload the Docs\n=================\n\nThis is deprecated. The docs is now only published on https://docs.datastax.com.\n\nTo upload the docs, checkout the ``gh-pages`` branch and copy the entire\ncontents all of ``docs/_build/X.Y.Z/*`` into the root of the ``gh-pages`` branch\nand then push that branch to github.\n\nFor example::\n\n    git checkout 1.0.0\n    python setup.py doc\n    git checkout gh-pages\n    cp -R docs/_build/1.0.0/* .\n    git add --update  # add modified files\n    # Also make sure to add any new documentation files!\n    git commit -m 'Update docs (version 1.0.0)'\n    git push origin gh-pages\n\nIf docs build includes errors, those errors may not show up in the next build unless\nyou have changed the files with errors.  It's good to occassionally clear the build\ndirectory and build from scratch::\n\n    rm -rf docs/_build/*\n\nDocumentor\n==========\nWe now also use another tool called Documentor with Sphinx source to build docs.\nThis gives us versioned docs with nice integrated search. This is a private tool\nof DataStax.\n\nDependencies\n------------\nSphinx\n~~~~~~\nInstalled as described above\n\nDocumentor\n~~~~~~~~~~\nClone and setup Documentor as specified in `the project \u003chttps://github.com/riptano/documentor#installation-and-quick-start\u003e`_.\nThis tool assumes Ruby, bundler, and npm are present.\n\nBuilding\n--------\nThe setup script expects documentor to be in the system path. You can either add it permanently or run with something\nlike this::\n\n    PATH=$PATH:\u003cdocumentor repo\u003e/bin python setup.py doc\n\nThe docs will not display properly just browsing the filesystem in a browser. To view the docs as they would be in most\nweb servers, use the SimpleHTTPServer module::\n\n    cd docs/_build/\n    python -m SimpleHTTPServer\n\nThen, browse to `localhost:8000 \u003chttp://localhost:8000\u003e`_.\n\nTests\n=====\n\nRunning Unit Tests\n------------------\nUnit tests can be run like so::\n\n    pytest tests/unit/\n\nYou can run a specific test method like so::\n\n    pytest tests/unit/test_connection.py::ConnectionTest::test_bad_protocol_version\n\nRunning Integration Tests\n-------------------------\nIn order to run integration tests, you must specify a version to run using the ``CASSANDRA_VERSION`` or ``DSE_VERSION`` environment variable::\n\n    CASSANDRA_VERSION=2.0.9 pytest tests/integration/standard\n\nOr you can specify a cassandra directory (to test unreleased versions)::\n\n    CASSANDRA_DIR=/path/to/cassandra pytest tests/integration/standard/\n\nSpecifying the usage of an already running Cassandra cluster\n------------------------------------------------------------\nThe 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::\n\n    USE_CASS_EXTERNAL=1 CASSANDRA_VERSION=2.0.9 pytest tests/integration/standard\n\nSpecify a Protocol Version for Tests\n------------------------------------\nThe protocol version defaults to 1 for cassandra 1.2 and 2 otherwise.  You can explicitly set\nit with the ``PROTOCOL_VERSION`` environment variable::\n\n    PROTOCOL_VERSION=3 pytest tests/integration/standard\n\nTesting Multiple Python Versions\n--------------------------------\nUse tox to test all of Python 3.9 through 3.13 and pypy (this is what TravisCI runs)::\n\n    tox\n\nBy default, tox only runs the unit tests.\n\nRunning the Benchmarks\n======================\nThere needs to be a version of cassandra running locally so before running the benchmarks, if ccm is installed:\n\t\n\tccm create benchmark_cluster -v 3.0.1 -n 1 -s\n\nTo run the benchmarks, pick one of the files under the ``benchmarks/`` dir and run it::\n\n    python benchmarks/future_batches.py\n\nThere are a few options.  Use ``--help`` to see them all::\n\n    python benchmarks/future_batches.py --help\n\nPackaging for Cassandra\n=======================\nA source distribution is included in Cassandra, which uses the driver internally for ``cqlsh``.\nTo package a released version, checkout the tag and build a source zip archive::\n\n    python setup.py sdist --formats=zip\n\nIf packaging a pre-release (untagged) version, it is useful to include a commit hash in the archive\nname to specify the built version::\n\n    python setup.py egg_info -b-`git rev-parse --short HEAD` sdist --formats=zip\n\nThe file (``dist/cassandra-driver-\u003cversion spec\u003e.zip``) is packaged with Cassandra in ``cassandra/lib/cassandra-driver-internal-only*zip``.\n\nReleasing an EAP\n================\n\nAn EAP release is only uploaded on a private server and it is not published on pypi.\n\n* Clean the environment::\n\n    python setup.py clean\n\n* Package the source distribution::\n\n    python setup.py sdist\n\n* Test the source distribution::\n\n    pip install dist/cassandra-driver-\u003cversion\u003e.tar.gz\n\n* Upload the package on the EAP download server.\n* Build the documentation::\n\n    python setup.py doc\n\n* Upload the docs on the EAP download server.\n\nAdding a New Python Runtime Support\n===================================\n\n* Add the new python version to our jenkins image:\n  https://github.com/riptano/openstack-jenkins-drivers/\n\n* Add the new python version in the Jenkinsfile and TravisCI configs as appropriate\n\n* Run the tests and ensure they all pass\n  * also test all event loops\n\n* Update the wheels building repo to support that version:\n  https://github.com/datastax/python-driver-wheels\n","funding_links":[],"categories":["Database Drivers","资源列表","Database Clients","数据库 Drivers","Python","数据库驱动程序","Database Drivers [🔝](#readme)","Packages","Libraries and Clients","Awesome Python"],"sub_categories":["数据库驱动","Libraries","Database Drivers","ASGI Servers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatastax%2Fpython-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatastax%2Fpython-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatastax%2Fpython-driver/lists"}