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

edgedb-python 1.6.1 #516

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7d63029
edgedb-python 1.1.0
fantix Nov 2, 2022
4b8bec6
remove references to unix-domain sockets
quinchs May 16, 2022
8b28947
Handle ErrorResponse in ping (#393)
fantix Nov 18, 2022
a2bec18
Output pretty error if possible (#399)
fantix Nov 18, 2022
26fb6d8
Disallow None in elements of array argument
fantix Nov 18, 2022
6bce57e
Codegen: allow providing a path after --file (#400)
fantix Nov 21, 2022
c4413a6
edgedb-python 1.2.0
fantix Nov 23, 2022
33a2f6a
CRF: unicode width
fantix Nov 23, 2022
df1f6fb
Add support for secret key (#405)
fantix Dec 28, 2022
076e8c8
Fix EDGEDB_CLOUD_PROFILE options layer
fantix Jan 10, 2023
65c9c37
Adjust cloud instance hostname derivation (#412)
elprans Jan 26, 2023
14363fb
Minor changes (#413)
0xsirsaif Jan 31, 2023
27e7a4f
Fix for cloud: auth key rename, and send SNI even when check_hostname…
fantix Feb 9, 2023
1b98324
edgedb-python 1.3.0
fantix Feb 9, 2023
ffe74a1
docs: add Code Generation to table of contents (#421)
AndreasPB Mar 14, 2023
5bc5699
Update for rules of instance names (#423)
fantix Mar 22, 2023
03e4012
Sync errors
fantix May 25, 2023
2de7e3f
Allow enums in array codec
fantix May 25, 2023
f1fa612
Prohibit concurrent operations on the same transaction object (#430)
fantix May 25, 2023
297de72
Fix state of transaction start
fantix Apr 20, 2023
e1ec16d
codegen: Handle non-identifier characters in enum values
fantix May 25, 2023
c40dc46
Update release CI (#436)
fantix May 26, 2023
045f127
edgedb-python 1.4.0
fantix May 26, 2023
272dc5f
Add --dir option to codegen for searching .edgeql files
fantix May 25, 2023
9cca5ef
Implement support for vector type (#439)
msullivan Jun 9, 2023
be886ec
Fix the vector tests to match the final PR (#440)
msullivan Jun 9, 2023
662a9e3
Lowercase org/instance name when computing Cloud instance DNS (#441)
elprans Jun 16, 2023
e6e6a56
Implement `database` config in project dir (#442)
tailhook Jun 16, 2023
4e435fa
Longer timeout to be less flaky as there's more in codegen test
fantix Jun 22, 2023
a9af426
edgedb-python 1.5.0
fantix Jun 21, 2023
9f44104
Implement support for new type descriptor protocol (#427)
elprans Jul 7, 2023
0db7ffb
Sync errors (#449)
elprans Jul 20, 2023
869f8d5
Don't depend on exact syntax errors in tests (#451)
msullivan Jul 24, 2023
3a59bf5
Fix an error in string representation of RelativeDuration. (#453)
vpetrovykh Jul 24, 2023
9160809
Add multirange support. (#452)
vpetrovykh Jul 25, 2023
8a4ed30
edgedb-python 1.6.0
msullivan Aug 9, 2023
ac3f130
Remove deprecated `test_suite` kwarg from `setuptools.setup()`
elprans Aug 2, 2024
7be5eb3
Fix test that broke due to error message change (#465)
msullivan Oct 6, 2023
368ed7a
ci: give repo write permission to the publish job (#505)
fantix Jun 19, 2024
1127555
edgedb-python v1.6.1
elprans Aug 2, 2024
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
15 changes: 10 additions & 5 deletions .github/workflows/install-edgedb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ shopt -s nullglob

srv="https://packages.edgedb.com"

curl -fL "${srv}/dist/x86_64-unknown-linux-musl/edgedb-cli" \
> "/usr/local/bin/edgedb"
curl -fL "${srv}/dist/$(uname -m)-unknown-linux-musl/edgedb-cli" \
> "/usr/bin/edgedb"

chmod +x "/usr/local/bin/edgedb"
chmod +x "/usr/bin/edgedb"

useradd --shell /bin/bash edgedb
if command -v useradd >/dev/null 2>&1; then
useradd --shell /bin/bash edgedb
else
# musllinux/alpine doesn't have useradd
adduser -s /bin/bash -D edgedb
fi

su -l edgedb -c "edgedb server install"
ln -s $(su -l edgedb -c "edgedb server info --latest --bin-path") \
"/usr/local/bin/edgedb-server"
"/usr/bin/edgedb-server"

edgedb-server --version
69 changes: 48 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches:
- "master"
- "ci"
- "[0-9]+.[0-9x]+*"
- "release/[0-9]+.x"
- "release/[0-9]+.[0-9]+.x"
paths:
- "edgedb/_version.py"

Expand Down Expand Up @@ -39,7 +40,7 @@ jobs:
mkdir -p dist/
echo "${VERSION}" > dist/VERSION

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
Expand All @@ -52,7 +53,7 @@ jobs:
PIP_DISABLE_PIP_VERSION_CHECK: 1

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 50
submodules: true
Expand All @@ -65,19 +66,43 @@ jobs:
pip install -U setuptools wheel pip
python setup.py sdist

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*.tar.*

build-wheels:
build-wheels-matrix:
needs: validate-release-request
runs-on: ubuntu-latest
outputs:
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- run: pip install cibuildwheel==2.19.2
- id: set-matrix
# Cannot test on Musl distros yet.
env:
CIBW_SKIP: "cp312-*"
run: |
MATRIX_INCLUDE=$(
{
cibuildwheel --print-build-identifiers --platform linux --arch x86_64,aarch64 | grep cp | grep many | jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \
&& cibuildwheel --print-build-identifiers --platform macos --arch x86_64,arm64 | grep cp | jq -nRc '{"only": inputs, "os": "macos-latest"}' \
&& cibuildwheel --print-build-identifiers --platform windows --arch AMD64 | grep cp | jq -nRc '{"only": inputs, "os": "windows-2019"}'
} | jq -sc
)
echo "include=$MATRIX_INCLUDE" >> $GITHUB_OUTPUT
build-wheels:
needs: build-wheels-matrix
runs-on: ${{ matrix.os }}
name: Build ${{ matrix.only }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
cibw_python: ["cp37-*", "cp38-*", "cp39-*", "cp310-*"]
cibw_arch: ["auto64"]
include: ${{ fromJson(needs.build-wheels-matrix.outputs.include) }}

defaults:
run:
Expand All @@ -87,32 +112,32 @@ jobs:
PIP_DISABLE_PIP_VERSION_CHECK: 1

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 50
submodules: true

- name: Setup WSL
if: ${{ steps.release.outputs.version == 0 && matrix.os == 'windows-2019' }}
uses: vampire/setup-wsl@v1
if: ${{ matrix.os == 'windows-2019' }}
uses: vampire/setup-wsl@v2
with:
wsl-shell-user: edgedb
additional-packages:
ca-certificates
curl

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2

- name: Install EdgeDB
uses: edgedb/setup-edgedb@v1

- uses: pypa/[email protected]
- uses: pypa/[email protected]
with:
only: ${{ matrix.only }}
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_BUILD: ${{ matrix.cibw_python }}
# Cannot test on Musl distros yet.
CIBW_SKIP: "*-musllinux*"
CIBW_ARCHS: ${{ matrix.cibw_arch }}
# EdgeDB doesn't run on CentOS 6, so use 2014 as baseline
CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux2014_x86_64"
CIBW_BEFORE_ALL_LINUX: >
.github/workflows/install-edgedb.sh
CIBW_TEST_EXTRAS: "test"
Expand All @@ -126,22 +151,24 @@ jobs:
&& chmod -R go+rX "$(dirname $(dirname $(dirname $PY)))"
&& su -l edgedb -c "EDGEDB_PYTHON_TEST_CODEGEN_CMD=$CODEGEN $PY {project}/tests/__init__.py"

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: dist
path: wheelhouse/*.whl

publish:
needs: [build-sdist, build-wheels]
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: false

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: dist
path: dist/
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,27 @@ jobs:
PIP_DISABLE_PIP_VERSION_CHECK: 1

strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
edgedb-version: [stable , nightly]
os: [ubuntu-latest, macos-latest, windows-2019]
os: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-2019]
loop: [asyncio, uvloop]
exclude:
# uvloop does not support windows
- loop: uvloop
os: windows-2019
# Python 3.7 on ubuntu-22.04 has a broken OpenSSL 3.0
- python-version: 3.7
os: ubuntu-latest
- python-version: 3.8
os: ubuntu-20.04
- python-version: 3.9
os: ubuntu-20.04
- python-version: 3.10
os: ubuntu-20.04
- python-version: 3.11
os: ubuntu-20.04

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -70,7 +82,7 @@ jobs:
server-version: ${{ matrix.edgedb-version }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
if: steps.release.outputs.version == 0
with:
python-version: ${{ matrix.python-version }}
Expand Down
27 changes: 13 additions & 14 deletions docs/api/asyncio_client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Client
.. py:function:: create_async_client(dsn=None, *, \
host=None, port=None, \
user=None, password=None, \
secret_key=None, \
database=None, \
timeout=60, \
concurrency=None)
Expand Down Expand Up @@ -44,26 +45,16 @@ Client
the :ref:`DSN Specification <ref_dsn>`.

:param host:
Database host address as one of the following:

- an IP address or a domain name;
- an absolute path to the directory containing the database
server Unix-domain socket (not supported on Windows);
- a sequence of any of the above, in which case the addresses
will be tried in order, and the host of the first successful
connection will be used for the whole connection pool.
Database host address as an IP address or a domain name;

If not specified, the following will be tried, in order:

- host address(es) parsed from the *dsn* argument,
- the value of the ``EDGEDB_HOST`` environment variable,
- on Unix, common directories used for EdgeDB Unix-domain
sockets: ``"/run/edgedb"`` and ``"/var/run/edgedb"``,
- ``"localhost"``.

:param port:
Port number to connect to at the server host
(or Unix-domain socket file extension). If multiple host
Port number to connect to at the server host. If multiple host
addresses were specified, this parameter may specify a
sequence of port numbers of the same length as the host sequence,
or it may specify a single port number to be used for all host
Expand Down Expand Up @@ -95,6 +86,14 @@ Client
other users and applications may be able to read it without needing
specific privileges.

:param secret_key:
Secret key to be used for authentication, if the server requires one.
If not specified, the value parsed from the *dsn* argument is used,
or the value of the ``EDGEDB_SECRET_KEY`` environment variable.
Note that the use of the environment variable is discouraged as
other users and applications may be able to read it without needing
specific privileges.

:param float timeout:
Connection timeout in seconds.

Expand Down Expand Up @@ -558,8 +557,8 @@ transaction), so we have to redo all the work done.
Generally it's recommended to not execute any long running
code within the transaction unless absolutely necessary.

Transactions allocate expensive server resources and having
too many concurrently running long-running transactions will
Transactions allocate expensive server resources, and having
too many concurrent long-running transactions will
negatively impact the performance of the DB server.

To rollback a transaction that is in progress raise an exception.
Expand Down
23 changes: 11 additions & 12 deletions docs/api/blocking_client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Client
.. py:function:: create_client(dsn=None, *, \
host=None, port=None, \
user=None, password=None, \
secret_key=None, \
database=None, \
timeout=60, \
concurrency=None)
Expand Down Expand Up @@ -44,26 +45,16 @@ Client
the :ref:`DSN Specification <ref_dsn>`.

:param host:
Database host address as one of the following:

- an IP address or a domain name;
- an absolute path to the directory containing the database
server Unix-domain socket (not supported on Windows);
- a sequence of any of the above, in which case the addresses
will be tried in order, and the host of the first successful
connection will be used for the whole connection pool.
Database host address as an IP address or a domain name;

If not specified, the following will be tried, in order:

- host address(es) parsed from the *dsn* argument,
- the value of the ``EDGEDB_HOST`` environment variable,
- on Unix, common directories used for EdgeDB Unix-domain
sockets: ``"/run/edgedb"`` and ``"/var/run/edgedb"``,
- ``"localhost"``.

:param port:
Port number to connect to at the server host
(or Unix-domain socket file extension). If multiple host
Port number to connect to at the server host. If multiple host
addresses were specified, this parameter may specify a
sequence of port numbers of the same length as the host sequence,
or it may specify a single port number to be used for all host
Expand Down Expand Up @@ -95,6 +86,14 @@ Client
other users and applications may be able to read it without needing
specific privileges.

:param secret_key:
Secret key to be used for authentication, if the server requires one.
If not specified, the value parsed from the *dsn* argument is used,
or the value of the ``EDGEDB_SECRET_KEY`` environment variable.
Note that the use of the environment variable is discouraged as
other users and applications may be able to read it without needing
specific privileges.

:param float timeout:
Connection timeout in seconds.

Expand Down
4 changes: 4 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ and :ref:`asyncio <edgedb-python-asyncio-api-reference>` implementations.

EdgeDB Python types documentation.

* :ref:`edgedb-python-codegen`

Python code generation command-line tool documentation.

* :ref:`edgedb-python-advanced`

Advanced usages of the state and optional customization.
Expand Down
4 changes: 2 additions & 2 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ types and vice versa. See :ref:`edgedb-python-datatypes` for details.
Client connection pools
-----------------------

For server-type type applications that handle frequent requests and need
the database connection for a short period time while handling a request,
For server-type applications that handle frequent requests and need
the database connection for a short period of time while handling a request,
the use of a connection pool is recommended. Both :py:class:`edgedb.Client`
and :py:class:`edgedb.AsyncIOClient` come with such a pool.

Expand Down
Loading
Loading