Skip to content

Commit 6c9a012

Browse files
authored
switch setup.py to pyproject.toml with poetry (#186)
* switch setup.py to pyproject.toml with poetry
1 parent b2d65b1 commit 6c9a012

File tree

5 files changed

+42
-69
lines changed

5 files changed

+42
-69
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
.DS_Store
22
.idea/
33

4-
# Local config
5-
tests.json
6-
74
# Byte-compiled / optimized / DLL files
85
__pycache__/
96
*.py[cod]
@@ -61,3 +58,6 @@ docs/_build/
6158
# PyBuilder
6259
target/
6360

61+
# poetry
62+
poetry.lock
63+

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,21 @@ http://peewee-async.readthedocs.io
106106

107107
Developing
108108
----------
109-
Install dependencies:
109+
Install dependencies using pip:
110+
110111
```pip install -e .[develop]```
111112

113+
Or using [poetry](https://python-poetry.org/docs/):
114+
115+
```poetry install -E develop```
116+
117+
112118
Run databases:
119+
113120
```docker-compose up -d```
114121

115122
Run tests:
123+
116124
```pytest tests -v -s```
117125

118126
Discuss

peewee_async.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import uuid
2121
import warnings
2222

23+
import importlib_metadata
2324
import peewee
2425
from playhouse.db_url import register_database
2526

@@ -45,7 +46,8 @@
4546
except AttributeError:
4647
asyncio_current_task = asyncio.Task.current_task
4748

48-
__version__ = '0.8.1'
49+
__version__ = importlib_metadata.version("peewee-async")
50+
4951

5052
__all__ = [
5153
# High level API ###

pyproject.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[tool.poetry]
2+
name = "peewee-async"
3+
version = '0.8.1'
4+
description = "Asynchronous interface for peewee ORM powered by asyncio."
5+
authors = ["Alexey Kinev <rudy@05bit.com>", "Gorshkov Nikolay(contributor) <nogamemorebrain@gmail.com>"]
6+
readme = "README.md"
7+
8+
[tool.poetry.dependencies]
9+
python = "^3.7"
10+
peewee = "^3.15.4"
11+
12+
aiopg = { version = "^1.4.0", optional = true }
13+
aiomysql = { version = "^0.2.0", optional = true }
14+
cryptography = { version = "^41.0.3", optional = true }
15+
pytest = { version = "^7.4.1", optional = true }
16+
pytest-asyncio = { version = "^0.21.1", optional = true }
17+
importlib-metadata= { version = "^6.7.0", optional = true }
18+
19+
20+
[tool.poetry.extras]
21+
postgresql = ["aiopg"]
22+
mysql = ["aiomysql", "cryptography"]
23+
develop = ["aiopg", "aiomysql", "cryptography", "importlib-metadata", "pytest", "pytest-asyncio"]
24+
25+
[build-system]
26+
requires = ["poetry-core"]
27+
build-backend = "poetry.core.masonry.api"

setup.py

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)