Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: release 1.3.0 #480

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/python-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.9]
python-version: ['3.9']

steps:
- uses: actions/checkout@v2
Expand All @@ -29,8 +29,8 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/test.txt
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements/test.txt
- name: Start the Postgres service
run: |
docker compose -f postgres/docker-compose.yml up --build -d
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/python-package-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
env:
VERSION: 3.38.1
RELEASE: r1
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -e '.[testing]'
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
env:
VERSION: 3.38.1
RELEASE: r1
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements/test.txt
Expand Down
8 changes: 2 additions & 6 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ Changelog
Next
====

Version 1.3.1 - 2024-10-08
==========================

- Add support for Python 3.12, drop support for 3.8 (#478)

Version 1.3.0 - 2024-09-26
Version 1.3.0 - 2024-10-08
==========================

- New Postgres backend based on multicorn2 (#397)
- Add support for Python 3.12, drop support for 3.8 (#478)

Version 1.2.28 - 2024-09-11
===========================
Expand Down
11 changes: 10 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ And a command-line utility:
$ shillelagh
sql> SELECT * FROM a_table

There is also an `experimental backend <https://shillelagh.readthedocs.io/en/latest/postgres.html>`_ that uses Postgres with the `Multicorn2 <http://multicorn2.org/>`_ extension:
There is also an `experimental backend <https://shillelagh.readthedocs.io/en/latest/postgres.html>`_ that uses Postgres with the `Multicorn2 <http://multicorn2.org/>`_ extension. First, install the additional dependencies:

.. code-block:: bash

$ pip install 'shillelagh[multicorn]'
$ pip install 'multicorn @ git+https://github.com/pgsql-io/[email protected]'

Then run:

.. code-block:: python

Expand All @@ -66,6 +73,8 @@ There is also an `experimental backend <https://shillelagh.readthedocs.io/en/lat
database="examples",
)

Or:

.. code-block:: python

from sqlalchemy import create_engine
Expand Down
2 changes: 1 addition & 1 deletion docs/postgres.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Postgres backend
================

Since version 1.3 Shillelagh ships with an experimental backend that uses Postgres instead of SQLite. The backend implements a custom [pyscopg2](https://pypi.org/project/psycopg2/) cursor that automatically registers a foreign data wrapper (FDW) whenever a supported table is accessed. It's based on the [multicorn2](http://multicorn2.org/) extension and Python package.
Since version 1.3.0 Shillelagh ships with an experimental backend that uses Postgres instead of SQLite. The backend implements a custom [pyscopg2](https://pypi.org/project/psycopg2/) cursor that automatically registers a foreign data wrapper (FDW) whenever a supported table is accessed. It's based on the [multicorn2](http://multicorn2.org/) extension and Python package.

To use the backend you need to:

Expand Down
9 changes: 4 additions & 5 deletions examples/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
If you want to play with it Shillelagh has a `docker-compose.yml` file that will run
Postgres with the extension and the Python packages. Just run:

$ cd postgres/
$ docker compose up --build -d
$ docker compose -f postgres/docker-compose.yml up

Then you can run this script.
"""

from sqlalchemy import create_engine
from sqlalchemy import create_engine, text

# the backend uses psycopg2 under the hood, so any valid connection string for it will
# work; just replace the scheme with `shillelagh+multicorn2`
Expand All @@ -23,9 +22,9 @@
)
connection = engine.connect()

SQL = (
SQL = text(
'SELECT * FROM "https://docs.google.com/spreadsheets/d/'
'1LcWZMsdCl92g7nA-D6qGRqg1T5TiHyuKJUY1u9XAnsk/edit#gid=0"'
'1LcWZMsdCl92g7nA-D6qGRqg1T5TiHyuKJUY1u9XAnsk/edit#gid=0"',
)
for row in connection.execute(SQL):
print(row)
3 changes: 2 additions & 1 deletion postgres/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ RUN wget https://github.com/pgsql-io/multicorn2/archive/refs/tags/v2.5.tar.gz &&
# Create a virtual environment and install dependencies
RUN python3 -m venv /code/venv && \
/code/venv/bin/pip install --upgrade pip && \
/code/venv/bin/pip install -e '.[all]'
/code/venv/bin/pip install -e '.[all]' && \
/code/venv/bin/pip install 'multicorn @ git+https://github.com/pgsql-io/[email protected]'

# Set environment variable for PostgreSQL to use the virtual environment
ENV PATH="/code/venv/bin:$PATH"
Expand Down
1 change: 1 addition & 0 deletions requirements/test.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
-e file:.[testing]
multicorn @ git+https://github.com/pgsql-io/[email protected]
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ testing =
google-auth>=1.23.0
holidays>=0.23
html5lib>=1.1
multicorn @ git+https://github.com/pgsql-io/[email protected]
# multicorn @ git+https://github.com/pgsql-io/[email protected]
pandas>=1.2.2
pip-tools>=6.4.0
pre-commit>=2.13.0
Expand Down Expand Up @@ -113,7 +113,7 @@ all =
google-auth>=1.23.0
holidays>=0.23
html5lib>=1.1
multicorn @ git+https://github.com/pgsql-io/[email protected]
# multicorn @ git+https://github.com/pgsql-io/[email protected]
pandas>=1.2.2
prison>=0.2.1
prompt_toolkit>=3
Expand Down Expand Up @@ -158,7 +158,7 @@ htmltableapi =
html5lib>=1.1
pandas>=1.2.2
multicorn =
multicorn @ git+https://github.com/pgsql-io/[email protected]
# multicorn @ git+https://github.com/pgsql-io/[email protected]
psycopg2-binary>=2.9.9
pandasmemory =
pandas>=1.2.2
Expand Down
Loading