Skip to content

Commit

Permalink
Use pyproject.toml (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pr0Ger authored Apr 17, 2022
1 parent 5e4a938 commit aac4bd3
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 95 deletions.
37 changes: 22 additions & 15 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ local Pipeline(py_version) = {
steps: [
{
name: "test",
image: "python:" + py_version,
image: "pr0ger/baseimage:base.python-" + py_version + "-bullseye",
commands: [
"pip install .[tests]",
"pytest"
"poetry install -v",
"poetry run pytest"
]
}
]
Expand All @@ -20,24 +20,24 @@ local Pipeline(py_version) = {
steps: [
{
name: "mypy",
image: "pr0ger/drone-pytools",
pull: "always",
settings: {
linter: "mypy",
},
image: "pr0ger/baseimage:base.python-3.9-bullseye",
commands: [
"poetry install -v",
"mypy apns2"
]
},
{
name: "pycodestyle",
image: "pr0ger/drone-pytools",
settings: {
linter: "pycodestyle",
},
image: "pr0ger/baseimage:base.python-3.9-bullseye",
commands: [
"pycodestyle apns2"
]
},
],
},
Pipeline("3.6"),
Pipeline("3.7"),
Pipeline("3.8"),
Pipeline("3.9"),
{
kind: "pipeline",
name: "upload release",
Expand All @@ -46,20 +46,27 @@ local Pipeline(py_version) = {
status: ['success'],
},
depends_on: [
"tests (Python 3.6)",
"tests (Python 3.7)",
"tests (Python 3.8)",
"tests (Python 3.9)",
],
steps: [
{
name: "build",
image: "pr0ger/baseimage:base.python-3.9-bullseye",
commands: [
"poetry build -vvv"
],
},
{
name: "publish",
image: "plugins/pypi",
settings: {
distributions: ["sdist", "bdist_wheel"],
username: "Pr0Ger",
password: {
from_secret: "pypi_password"
},
skip_build: false,
},
},
],
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ coverage.xml

# Virtualenv
venv/

# Poetry
poetry.lock
9 changes: 0 additions & 9 deletions .pylintrc

This file was deleted.

60 changes: 60 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[build-system]
requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool]
[tool.poetry]
name = "apns2"
version = "0.7.1"
description = "A python library for interacting with the Apple Push Notification Service via HTTP/2 protocol"
readme = 'README.md'
authors = [
"Sergey Petrov <[email protected]>"
]
license = "MIT"

classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Software Development :: Libraries"
]

[tool.poetry.dependencies]
python = ">=3.7"
cryptography = ">=1.7.2"
hyper = ">=0.7"
pyjwt = ">=2.0.0"

[tool.poetry.dev-dependencies]
pytest = "*"
freezegun = "*"

[tool.mypy]
python_version = "3.7"
strict = true

[tool.pylint.design]
max-args = 10
max-attributes = 10

[tool.pylint.format]
max-line-length = 120

[tool.pylint.'messages control']
disable = "missing-docstring, too-few-public-methods, locally-disabled, invalid-name"

[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py37, py38, py39
isolated_build = True
[testenv]
whitelist_externals = poetry
commands =
poetry install -v
poetry run pytest {posargs}
"""
28 changes: 0 additions & 28 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,33 +1,5 @@
[bdist_wheel]
universal=1

[mypy]
python_version = 3.6

# Dynamic typing
disallow_subclassing_any = True
disallow_any_generics = True

# Untyped definitions and calls
disallow_untyped_calls = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
check_untyped_defs = True
disallow_untyped_decorators = True

# None and Optional handling
no_implicit_optional = True

# Warnings
warn_redundant_casts = True
warn_unused_ignores = True
no_warn_no_return = True
warn_return_any = True
warn_unreachable = True

# Other strictness checks
strict_equality = True
no_implicit_reexport = True

[pycodestyle]
max-line-length = 160
34 changes: 0 additions & 34 deletions setup.py

This file was deleted.

9 changes: 0 additions & 9 deletions tox.ini

This file was deleted.

0 comments on commit aac4bd3

Please sign in to comment.