Skip to content

Commit f63f616

Browse files
authored
chore: update readme and ci (#5)
2 parents bb065c8 + 675931a commit f63f616

File tree

7 files changed

+77
-83
lines changed

7 files changed

+77
-83
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,19 @@ on:
33
push:
44
branches-ignore:
55
- main
6+
paths-ignore:
7+
- "docs/**"
8+
- "*.rst"
69
pull_request:
7-
branches-ignore:
8-
- master
10+
branches:
11+
- main
12+
paths-ignore:
13+
- "docs/**"
14+
- "*.rst"
15+
16+
env:
17+
UV_SYSTEM_PYTHON: 1
18+
919
jobs:
1020
test:
1121
if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.base.repo.full_name == github.repository) }}
@@ -47,9 +57,9 @@ jobs:
4757
- name: Install requirements
4858
run: make deps
4959
- name: Check style
50-
run: make check
60+
run: make _check
5161
- name: Run tests
52-
run: make testall
62+
run: make _testall
5363
- name: Upload Coverage
5464
run: uvx coveralls --service=github
5565
env:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ up:
66
@uv lock --upgrade
77

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

1111
_style:
1212
@ruff format $(checkfiles)

README.rst

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
asyncodbc
22
=========
3-
.. image:: https://travis-ci.com/tortoise/asyncodbc.svg?branch=main
4-
:target: https://travis-ci.com/tortoise/asyncodbc
3+
.. image:: https://github.com/tortoise/asyncodbc/actions/workflows/ci.yml/badge.svg?branch=main
4+
:target: https://github.com/tortoise/asyncodbc/actions?query=workflow:ci
55
.. image:: https://coveralls.io/repos/tortoise/asyncodbc/badge.svg?branch=main&service=github
66
:target: https://coveralls.io/github/tortoise/asyncodbc?branch=main
77
.. image:: https://img.shields.io/pypi/v/asyncodbc.svg
@@ -40,9 +40,6 @@ Properties are unchanged, so ``conn.prop`` is correct as well as
4040
import asyncodbc
4141
4242
43-
loop = asyncio.get_event_loop()
44-
45-
4643
async def test_example():
4744
dsn = 'Driver=SQLite;Database=sqlite.db'
4845
conn = await asyncodbc.connect(dsn=dsn, loop=loop)
@@ -56,7 +53,7 @@ Properties are unchanged, so ``conn.prop`` is correct as well as
5653
await cur.close()
5754
await conn.close()
5855
59-
loop.run_until_complete(test_example())
56+
asyncio.run(test_example())
6057
6158
6259
Connection Pool
@@ -69,9 +66,6 @@ Connection pooling is ported from aiopg_ and relies on PEP492_ features:
6966
import asyncodbc
7067
7168
72-
loop = asyncio.get_event_loop()
73-
74-
7569
async def test_pool():
7670
dsn = 'Driver=SQLite;Database=sqlite.db'
7771
pool = await asyncodbc.create_pool(dsn=dsn, loop=loop)
@@ -86,7 +80,7 @@ Connection pooling is ported from aiopg_ and relies on PEP492_ features:
8680
pool.close()
8781
await pool.wait_closed()
8882
89-
loop.run_until_complete(test_pool())
83+
asyncio.run(test_pool())
9084
9185
9286
Context Managers
@@ -100,9 +94,6 @@ protocol:
10094
import asyncodbc
10195
10296
103-
loop = asyncio.get_event_loop()
104-
105-
10697
async def test_example():
10798
dsn = 'Driver=SQLite;Database=sqlite.db'
10899
@@ -114,7 +105,7 @@ protocol:
114105
print(val)
115106
print(val.age)
116107
117-
loop.run_until_complete(test_example())
108+
asyncio.run(test_example())
118109
119110
120111
Installation
@@ -134,21 +125,13 @@ then::
134125
Run tests
135126
---------
136127

137-
For testing purposes you need to install docker_ and the development
138-
requirements::
128+
For testing purposes you need to install the test group requirements::
139129

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

145132
Then just execute::
146133

147-
$ make docker_build
148-
$ make docker_test
149-
150-
The test will automatically pull images and build containers with
151-
the required databases.
134+
$ make test_mssql
152135

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

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Please feel free to file an issue on `bug tracker
3939
<https://github.com/tortoise/asyncodbc/issues>`_ if you have found a bug
4040
or have some suggestion for library improvement.
4141

42-
The library uses `Travis <https://travis-ci.org/tortoise/asyncodbc>`_ for
42+
The library uses `Github Action <https://github.com/tortoise/asyncodbc/actions?query=workflow:ci>`_ for
4343
Continious Integration and `Coveralls
4444
<https://coveralls.io/r/tortoise/asyncodbc?branch=main>`_ for
4545
coverage reports.

docs/tuning.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Configuration Tuning
1515

1616
TheadPoolExecutor
1717

18-
When using ``aoiodbc.create_pool`` it is considered a
18+
When using ``asyncodbc.create_pool`` it is considered a
1919
good practice to use ``ThreadPoolExecutor`` from
2020
``concurrent.futures`` to create worker threads that
2121
are dedicated for database work allowing default threads

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ include = ["LICENSE", "README.rst"]
4545

4646
[tool.pytest.ini_options]
4747
asyncio_mode = "auto"
48+
asyncio_default_fixture_loop_scope = "session"
4849

4950
[tool.flake8]
5051
ignore = "E501,W503,DAR101,DAR201,DAR402"

0 commit comments

Comments
 (0)