Skip to content
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
18 changes: 14 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@ on:
push:
branches-ignore:
- main
paths-ignore:
- "docs/**"
- "*.rst"
pull_request:
branches-ignore:
- master
branches:
- main
paths-ignore:
- "docs/**"
- "*.rst"

env:
UV_SYSTEM_PYTHON: 1

jobs:
test:
if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.base.repo.full_name == github.repository) }}
Expand Down Expand Up @@ -47,9 +57,9 @@ jobs:
- name: Install requirements
run: make deps
- name: Check style
run: make check
run: make _check
- name: Run tests
run: make testall
run: make _testall
- name: Upload Coverage
run: uvx coveralls --service=github
env:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ up:
@uv lock --upgrade

deps:
@uv sync --inexact --all-extras --all-groups --no-group docs $(options)
@uv sync --all-extras --all-groups --no-group docs $(options)

_style:
@ruff format $(checkfiles)
Expand Down
33 changes: 8 additions & 25 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
asyncodbc
=========
.. image:: https://travis-ci.com/tortoise/asyncodbc.svg?branch=main
:target: https://travis-ci.com/tortoise/asyncodbc
.. image:: https://github.com/tortoise/asyncodbc/actions/workflows/ci.yml/badge.svg?branch=main
:target: https://github.com/tortoise/asyncodbc/actions?query=workflow:ci
.. image:: https://coveralls.io/repos/tortoise/asyncodbc/badge.svg?branch=main&service=github
:target: https://coveralls.io/github/tortoise/asyncodbc?branch=main
.. image:: https://img.shields.io/pypi/v/asyncodbc.svg
Expand Down Expand Up @@ -40,9 +40,6 @@ Properties are unchanged, so ``conn.prop`` is correct as well as
import asyncodbc


loop = asyncio.get_event_loop()


async def test_example():
dsn = 'Driver=SQLite;Database=sqlite.db'
conn = await asyncodbc.connect(dsn=dsn, loop=loop)
Expand All @@ -56,7 +53,7 @@ Properties are unchanged, so ``conn.prop`` is correct as well as
await cur.close()
await conn.close()

loop.run_until_complete(test_example())
asyncio.run(test_example())


Connection Pool
Expand All @@ -69,9 +66,6 @@ Connection pooling is ported from aiopg_ and relies on PEP492_ features:
import asyncodbc


loop = asyncio.get_event_loop()


async def test_pool():
dsn = 'Driver=SQLite;Database=sqlite.db'
pool = await asyncodbc.create_pool(dsn=dsn, loop=loop)
Expand All @@ -86,7 +80,7 @@ Connection pooling is ported from aiopg_ and relies on PEP492_ features:
pool.close()
await pool.wait_closed()

loop.run_until_complete(test_pool())
asyncio.run(test_pool())


Context Managers
Expand All @@ -100,9 +94,6 @@ protocol:
import asyncodbc


loop = asyncio.get_event_loop()


async def test_example():
dsn = 'Driver=SQLite;Database=sqlite.db'

Expand All @@ -114,7 +105,7 @@ protocol:
print(val)
print(val.age)

loop.run_until_complete(test_example())
asyncio.run(test_example())


Installation
Expand All @@ -134,21 +125,13 @@ then::
Run tests
---------

For testing purposes you need to install docker_ and the development
requirements::
For testing purposes you need to install the test group requirements::

$ pip install -r pyproject.toml --group test -e .

In order to simplify development you should install the provided docker container.
This way you don't need to install any databases or other system libraries, everything happens inside the container.
$ uv pip install -r pyproject.toml --group test -e .

Then just execute::

$ make docker_build
$ make docker_test

The test will automatically pull images and build containers with
the required databases.
$ make test_mssql

*NOTE:* Running tests requires Python 3.9 or higher.

Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Please feel free to file an issue on `bug tracker
<https://github.com/tortoise/asyncodbc/issues>`_ if you have found a bug
or have some suggestion for library improvement.

The library uses `Travis <https://travis-ci.org/tortoise/asyncodbc>`_ for
The library uses `Github Action <https://github.com/tortoise/asyncodbc/actions?query=workflow:ci>`_ for
Continious Integration and `Coveralls
<https://coveralls.io/r/tortoise/asyncodbc?branch=main>`_ for
coverage reports.
Expand Down
2 changes: 1 addition & 1 deletion docs/tuning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Configuration Tuning

TheadPoolExecutor

When using ``aoiodbc.create_pool`` it is considered a
When using ``asyncodbc.create_pool`` it is considered a
good practice to use ``ThreadPoolExecutor`` from
``concurrent.futures`` to create worker threads that
are dedicated for database work allowing default threads
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ include = ["LICENSE", "README.rst"]

[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"

[tool.flake8]
ignore = "E501,W503,DAR101,DAR201,DAR402"
Expand Down
Loading