Skip to content

Commit aac4bd3

Browse files
authored
Use pyproject.toml (Pr0Ger#96)
1 parent 5e4a938 commit aac4bd3

File tree

7 files changed

+85
-95
lines changed

7 files changed

+85
-95
lines changed

.drone.jsonnet

+22-15
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ local Pipeline(py_version) = {
44
steps: [
55
{
66
name: "test",
7-
image: "python:" + py_version,
7+
image: "pr0ger/baseimage:base.python-" + py_version + "-bullseye",
88
commands: [
9-
"pip install .[tests]",
10-
"pytest"
9+
"poetry install -v",
10+
"poetry run pytest"
1111
]
1212
}
1313
]
@@ -20,24 +20,24 @@ local Pipeline(py_version) = {
2020
steps: [
2121
{
2222
name: "mypy",
23-
image: "pr0ger/drone-pytools",
24-
pull: "always",
25-
settings: {
26-
linter: "mypy",
27-
},
23+
image: "pr0ger/baseimage:base.python-3.9-bullseye",
24+
commands: [
25+
"poetry install -v",
26+
"mypy apns2"
27+
]
2828
},
2929
{
3030
name: "pycodestyle",
31-
image: "pr0ger/drone-pytools",
32-
settings: {
33-
linter: "pycodestyle",
34-
},
31+
image: "pr0ger/baseimage:base.python-3.9-bullseye",
32+
commands: [
33+
"pycodestyle apns2"
34+
]
3535
},
3636
],
3737
},
38-
Pipeline("3.6"),
3938
Pipeline("3.7"),
4039
Pipeline("3.8"),
40+
Pipeline("3.9"),
4141
{
4242
kind: "pipeline",
4343
name: "upload release",
@@ -46,20 +46,27 @@ local Pipeline(py_version) = {
4646
status: ['success'],
4747
},
4848
depends_on: [
49-
"tests (Python 3.6)",
5049
"tests (Python 3.7)",
5150
"tests (Python 3.8)",
51+
"tests (Python 3.9)",
5252
],
5353
steps: [
54+
{
55+
name: "build",
56+
image: "pr0ger/baseimage:base.python-3.9-bullseye",
57+
commands: [
58+
"poetry build -vvv"
59+
],
60+
},
5461
{
5562
name: "publish",
5663
image: "plugins/pypi",
5764
settings: {
58-
distributions: ["sdist", "bdist_wheel"],
5965
username: "Pr0Ger",
6066
password: {
6167
from_secret: "pypi_password"
6268
},
69+
skip_build: false,
6370
},
6471
},
6572
],

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ coverage.xml
4444

4545
# Virtualenv
4646
venv/
47+
48+
# Poetry
49+
poetry.lock

.pylintrc

-9
This file was deleted.

pyproject.toml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[build-system]
2+
requires = ["poetry_core>=1.0.0"]
3+
build-backend = "poetry.core.masonry.api"
4+
5+
[tool]
6+
[tool.poetry]
7+
name = "apns2"
8+
version = "0.7.1"
9+
description = "A python library for interacting with the Apple Push Notification Service via HTTP/2 protocol"
10+
readme = 'README.md'
11+
authors = [
12+
"Sergey Petrov <[email protected]>"
13+
]
14+
license = "MIT"
15+
16+
classifiers = [
17+
"Development Status :: 4 - Beta",
18+
"License :: OSI Approved :: MIT License",
19+
"Programming Language :: Python :: 3.7",
20+
"Programming Language :: Python :: 3.8",
21+
"Programming Language :: Python :: 3.9",
22+
"Topic :: Software Development :: Libraries"
23+
]
24+
25+
[tool.poetry.dependencies]
26+
python = ">=3.7"
27+
cryptography = ">=1.7.2"
28+
hyper = ">=0.7"
29+
pyjwt = ">=2.0.0"
30+
31+
[tool.poetry.dev-dependencies]
32+
pytest = "*"
33+
freezegun = "*"
34+
35+
[tool.mypy]
36+
python_version = "3.7"
37+
strict = true
38+
39+
[tool.pylint.design]
40+
max-args = 10
41+
max-attributes = 10
42+
43+
[tool.pylint.format]
44+
max-line-length = 120
45+
46+
[tool.pylint.'messages control']
47+
disable = "missing-docstring, too-few-public-methods, locally-disabled, invalid-name"
48+
49+
[tool.tox]
50+
legacy_tox_ini = """
51+
[tox]
52+
envlist = py37, py38, py39
53+
isolated_build = True
54+
55+
[testenv]
56+
whitelist_externals = poetry
57+
commands =
58+
poetry install -v
59+
poetry run pytest {posargs}
60+
"""

setup.cfg

-28
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,5 @@
11
[bdist_wheel]
22
universal=1
33

4-
[mypy]
5-
python_version = 3.6
6-
7-
# Dynamic typing
8-
disallow_subclassing_any = True
9-
disallow_any_generics = True
10-
11-
# Untyped definitions and calls
12-
disallow_untyped_calls = True
13-
disallow_untyped_defs = True
14-
disallow_incomplete_defs = True
15-
check_untyped_defs = True
16-
disallow_untyped_decorators = True
17-
18-
# None and Optional handling
19-
no_implicit_optional = True
20-
21-
# Warnings
22-
warn_redundant_casts = True
23-
warn_unused_ignores = True
24-
no_warn_no_return = True
25-
warn_return_any = True
26-
warn_unreachable = True
27-
28-
# Other strictness checks
29-
strict_equality = True
30-
no_implicit_reexport = True
31-
324
[pycodestyle]
335
max-line-length = 160

setup.py

-34
This file was deleted.

tox.ini

-9
This file was deleted.

0 commit comments

Comments
 (0)