diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6d0f4436..f57f0277 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -30,6 +30,7 @@ jobs: fail-fast: false matrix: language: [ python ] + python-version: ['3.13'] steps: - name: Checkout @@ -38,15 +39,15 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.11 - architecture: x64 - cache: 'pip' - cache-dependency-path: | - setup.py + python-version: ${{ matrix.python-version }} - - name: Install uv - uses: astral-sh/setup-uv@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v6 with: + cache-dependency-glob: | + setup.py + cache-suffix: ${{ matrix.python-version }} + enable-cache: true version: "latest" - name: Initialize CodeQL diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index cd5fa37f..95025896 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -25,16 +25,19 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} + + - name: Set up Python uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: 'setup.py' - - name: Install uv - uses: astral-sh/setup-uv@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v6 with: + cache-dependency-glob: | + setup.py + cache-suffix: ${{ matrix.python-version }} + enable-cache: true version: "latest" - name: Invoke tests diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eca585dc..eb561b91 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,12 @@ on: push jobs: pypi: name: Build & publish package to pypi - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ['ubuntu-latest'] + python-version: ['3.11'] if: startsWith(github.event.ref, 'refs/tags') steps: - uses: actions/checkout@v4 @@ -14,13 +19,15 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.11' - cache: 'pip' - cache-dependency-path: 'setup.py' + python-version: ${{ matrix.python-version }} - - name: Install uv - uses: astral-sh/setup-uv@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v6 with: + cache-dependency-glob: | + setup.py + cache-suffix: ${{ matrix.python-version }} + enable-cache: true version: "latest" - name: Build package diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 16ed304a..1ef3f550 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-22.04'] - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] cratedb-version: ['nightly'] # To save resources, only verify the most recent Python versions on macOS. @@ -40,16 +40,19 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} + + - name: Set up Python uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: setup.py - - name: Install uv - uses: astral-sh/setup-uv@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v6 with: + cache-dependency-glob: | + setup.py + cache-suffix: ${{ matrix.python-version }} + enable-cache: true version: "latest" - name: Invoke tests diff --git a/docs/blobs.rst b/docs/blobs.rst index 365865eb..48c6cf06 100644 --- a/docs/blobs.rst +++ b/docs/blobs.rst @@ -8,11 +8,6 @@ The CrateDB Python client library provides full access to the powerful :ref:`blob storage capabilities ` of your CrateDB cluster. -.. rubric:: Table of contents - -.. contents:: - :local: - Get a blob container ==================== diff --git a/docs/build.json b/docs/build.json index 5647caf4..5de7837b 100644 --- a/docs/build.json +++ b/docs/build.json @@ -1,5 +1,5 @@ { "schemaVersion": 1, "label": "docs build", - "message": "2.1.1" + "message": "2.1.2" } diff --git a/docs/by-example/client.rst b/docs/by-example/client.rst index 6e8f08df..a06e1036 100644 --- a/docs/by-example/client.rst +++ b/docs/by-example/client.rst @@ -7,12 +7,6 @@ Python. This section of the documentation outlines different methods to connect to the database cluster, as well as how to run basic inquiries to the database, and closing the connection again. -.. rubric:: Table of Contents - -.. contents:: - :local: - - Connect to a database ===================== diff --git a/docs/by-example/connection.rst b/docs/by-example/connection.rst index 108166a3..c678d079 100644 --- a/docs/by-example/connection.rst +++ b/docs/by-example/connection.rst @@ -9,12 +9,6 @@ The examples use an instance of ``ClientMocked`` instead of a real ``Client`` instance. This allows us to verify the examples without needing a real database connection. -.. rubric:: Table of Contents - -.. contents:: - :local: - - connect() ========= diff --git a/docs/by-example/cursor.rst b/docs/by-example/cursor.rst index bfb9e693..86979fc3 100644 --- a/docs/by-example/cursor.rst +++ b/docs/by-example/cursor.rst @@ -8,12 +8,6 @@ behaviors of the ``crate.client.cursor.Cursor`` object. The example code uses ``ClientMocked`` and ``set_next_response`` for demonstration purposes, so they don't need a real database connection. -.. rubric:: Table of Contents - -.. contents:: - :local: - - Introduction ============ diff --git a/docs/by-example/http.rst b/docs/by-example/http.rst index 5afd3dee..44ba3608 100644 --- a/docs/by-example/http.rst +++ b/docs/by-example/http.rst @@ -2,12 +2,6 @@ HTTP client =========== -.. rubric:: Table of Contents - -.. contents:: - :local: - - Introduction ============ diff --git a/docs/by-example/https.rst b/docs/by-example/https.rst index 4bbd408e..b82db341 100644 --- a/docs/by-example/https.rst +++ b/docs/by-example/https.rst @@ -7,12 +7,6 @@ HTTPS connection support This documentation section outlines different options to connect to CrateDB using SSL/TLS. -.. rubric:: Table of Contents - -.. contents:: - :local: - - Introduction ============ diff --git a/docs/by-example/index.rst b/docs/by-example/index.rst index d6c0d2ec..5cf1f06f 100644 --- a/docs/by-example/index.rst +++ b/docs/by-example/index.rst @@ -4,10 +4,6 @@ By example ########## -This part of the documentation enumerates different kinds of examples how to -use the CrateDB Python DBAPI HTTP client for standards-based database -conversations, and the proprietary BLOB interfaces. - The examples in this section are all about CrateDB's `Python DB API`_ interface, the plain HTTP API interface, and a convenience interface for working with :ref:`blob tables `. It details attributes, diff --git a/docs/connect.rst b/docs/connect.rst index 944fe263..36e4dd54 100644 --- a/docs/connect.rst +++ b/docs/connect.rst @@ -10,18 +10,13 @@ Connect to CrateDB `Python Database API Specification v2.0`_ (PEP 249). For help using the `SQLAlchemy`_ dialect, consult the - :ref:`SQLAlchemy dialect documentation `. + :ref:`SQLAlchemy dialect documentation `. .. SEEALSO:: Supplementary information about the CrateDB Database API client can be found in the :ref:`data types appendix `. -.. rubric:: Table of contents - -.. contents:: - :local: - .. _single-node: Connect to a single node diff --git a/docs/data-types.rst b/docs/data-types.rst index 146bf5b3..90fd9234 100644 --- a/docs/data-types.rst +++ b/docs/data-types.rst @@ -6,11 +6,6 @@ Data types The data types of the :ref:`CrateDB DBAPI database API client `. -.. rubric:: Table of contents - -.. contents:: - :local: - .. _data-types-db-api: Database API client diff --git a/docs/getting-started.rst b/docs/getting-started.rst index a2847a41..c510ef8d 100644 --- a/docs/getting-started.rst +++ b/docs/getting-started.rst @@ -7,11 +7,6 @@ Getting started Learn how to install and get started with the Python client library for `CrateDB`_. -.. rubric:: Table of contents - -.. contents:: - :local: - Install ======= diff --git a/docs/index-all.rst b/docs/index-all.rst index 85a508e9..5d9244d5 100644 --- a/docs/index-all.rst +++ b/docs/index-all.rst @@ -16,7 +16,6 @@ CrateDB Python Client -- all pages connect query blobs - sqlalchemy data-types by-example/index other-options diff --git a/docs/index.rst b/docs/index.rst index 67415c94..ca9b5ff6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,12 +4,6 @@ CrateDB Python Client ##################### -.. rubric:: Table of contents - -.. contents:: - :local: - :depth: 1 - ************ Introduction @@ -64,7 +58,7 @@ Connect to CrateDB instance running on ``localhost``. from pprint import pp query = "SELECT country, mountain, coordinates, height FROM sys.summits ORDER BY country;" - + with client.connect("localhost:4200", username="crate") as connection: cursor = connection.cursor() cursor.execute(query) @@ -95,12 +89,11 @@ please consult the :ref:`data-types` documentation page. data-types - Migration Notes =============== -The :ref:`CrateDB dialect ` for `SQLAlchemy`_ is provided -by the `sqlalchemy-cratedb`_ package. +The :ref:`CrateDB dialect ` for `SQLAlchemy`_ is +provided by the `sqlalchemy-cratedb`_ package. If you are migrating from previous versions of ``crate[sqlalchemy]<1.0.0``, you will find that the newer releases ``crate>=1.0.0`` no longer include the @@ -133,53 +126,17 @@ Examples by-example/index -******************* -Project information -******************* - -Resources -========= -- `Source code `_ -- `Documentation `_ -- `Python Package Index (PyPI) `_ +.. seealso:: -Contributions -============= -The CrateDB Python client library is an open source project, and is `managed on -GitHub`_. -Every kind of contribution, feedback, or patch, is much welcome. `Create an -issue`_ or submit a patch if you think we should include a new feature, or to -report or fix a bug. + The CrateDB Python client library is an open source project and is `managed + on GitHub`_. Contributions, feedback, or patches are highly welcome! -Development -=========== -In order to setup a development environment on your workstation, please head -over to the `development sandbox`_ documentation. When you see the software -tests succeed, you should be ready to start hacking. -Page index -========== -The full index for all documentation pages can be inspected at :ref:`index-all`. - -License -======= -The project is licensed under the terms of the Apache 2.0 license, like -`CrateDB itself `_, see `LICENSE`_. - - -.. _Apache Superset: https://github.com/apache/superset -.. _Crash CLI: https://crate.io/docs/crate/crash/ .. _CrateDB: https://crate.io/products/cratedb .. _CrateDB Cloud: https://console.cratedb.cloud/ -.. _CrateDB source: https://github.com/crate/crate -.. _Create an issue: https://github.com/crate/crate-python/issues +.. _Crash CLI: https://crate.io/docs/crate/crash/ .. _Dask: https://en.wikipedia.org/wiki/Dask_(software) -.. _development sandbox: https://github.com/crate/crate-python/blob/main/DEVELOP.rst .. _cratedb-examples repository: https://github.com/crate/cratedb-examples -.. _FIWARE QuantumLeap data historian: https://github.com/orchestracities/ngsi-timeseries-api -.. _GeoJSON: https://geojson.org/ -.. _GeoJSON geometry objects: https://tools.ietf.org/html/rfc7946#section-3.1 -.. _LICENSE: https://github.com/crate/crate-python/blob/main/LICENSE .. _managed on GitHub: https://github.com/crate/crate-python .. _migrate to sqlalchemy-cratedb: https://cratedb.com/docs/sqlalchemy-cratedb/migrate-from-crate-client.html .. _pandas: https://en.wikipedia.org/wiki/Pandas_(software) diff --git a/docs/query.rst b/docs/query.rst index 00da8170..c7d91194 100644 --- a/docs/query.rst +++ b/docs/query.rst @@ -10,18 +10,13 @@ Query CrateDB `Python Database API Specification v2.0`_ (PEP 249). For help using the `SQLAlchemy`_ dialect, consult - :ref:`the SQLAlchemy dialect documentation `. + :ref:`the SQLAlchemy dialect documentation `. .. SEEALSO:: Supplementary information about the CrateDB Database API client can be found in the :ref:`data types appendix `. -.. rubric:: Table of contents - -.. contents:: - :local: - .. _cursor: Using a cursor diff --git a/docs/sqlalchemy.rst b/docs/sqlalchemy.rst deleted file mode 100644 index caf5ca8d..00000000 --- a/docs/sqlalchemy.rst +++ /dev/null @@ -1,17 +0,0 @@ -.. _sqlalchemy-support: -.. _using-sqlalchemy: - -================== -SQLAlchemy support -================== - -`SQLAlchemy`_ is the most popular `Object-Relational Mapping`_ (ORM) library -for Python. - -The `SQLAlchemy`_ CrateDB dialect is provided by the `sqlalchemy-cratedb`_ -package. - - -.. _Object-Relational Mapping: https://en.wikipedia.org/wiki/Object-relational_mapping -.. _SQLAlchemy: https://www.sqlalchemy.org/ -.. _sqlalchemy-cratedb: https://github.com/crate-workbench/sqlalchemy-cratedb diff --git a/requirements.txt b/requirements.txt index f8de725a..8935d351 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,4 @@ +setuptools<80.3 +urllib3<2.4 zc.buildout==3.3 zope.interface==6.4.post2 diff --git a/setup.py b/setup.py index 15591f88..647fe360 100644 --- a/setup.py +++ b/setup.py @@ -67,14 +67,14 @@ def read(path): 'backports.zoneinfo<1; python_version<"3.9"', "certifi", "createcoverage>=1,<2", - "mypy<1.15", - "poethepoet<0.33", - "ruff<0.10", + "mypy<1.17", + "poethepoet<1", + "ruff<0.12", "stopit>=1.1.2,<2", "pytz", "zc.customdoctests>=1.0.1,<2", "zope.testing>=4,<6", - "zope.testrunner>=5,<7", + "zope.testrunner>=5,<8", ], }, python_requires=">=3.6",