move tool config to pyproject.toml
All checks were successful
ci/woodpecker/push/tests Pipeline was successful

This commit is contained in:
Ivan Schaller 2022-06-21 12:52:09 +02:00
parent 78da547898
commit 372bea6189
5 changed files with 87 additions and 60 deletions

View file

@ -1,28 +0,0 @@
# .coveragerc to control coverage.py
[run]
branch = True
source = mangadlp
[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about missing debug-only code:
def __repr__
if self\.debug
# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
# Don't complain about abstract methods, they aren't run:
@(abc\.)?abstractmethod
ignore_errors = True

View file

@ -29,14 +29,14 @@ pipeline:
image: 'cr.44net.ch/drone-plugins/test'
pull: true
commands:
- isort --skip-gitignore --line-length 88 --profile black --check-only --diff .
- isort --check-only --diff .
# check static typing - python
test-mypy:
image: 'cr.44net.ch/drone-plugins/test'
pull: true
commands:
- mypy --install-types --non-interactive --show-error-context --show-column-numbers --show-error-codes --ignore-missing-imports mangadlp/
- mypy --install-types --non-interactive mangadlp/
# test code and generate coverage report
test-coverage-pytest:
@ -45,7 +45,7 @@ pipeline:
commands:
- pip install -r requirements.txt
- coverage erase
- coverage run -m pytest --verbose --exitfirst
- coverage run
- coverage xml -i
# analyse code with sonarqube and upload it

View file

84
pyproject.toml Normal file
View file

@ -0,0 +1,84 @@
[project]
version = "2.1.5"
name = "manga-dlp"
description = "A cli manga downloader"
readme = "README.md"
license = "MIT"
requires-python = ">=3.8"
author = "Ivan Schaller"
author_email = "ivan@schaller.sh"
keywords = [
"manga",
"downloader",
"mangadex",
]
classifiers = [
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
dependencies = [
"requests>=2.24.0",
]
dynamic = ["version"]
[project.urls]
Homepage = "https://github.com/olofvndrhr/manga-dlp"
History = "https://github.com/olofvndrhr/manga-dlp/commits/master"
Tracker = "https://github.com/olofvndrhr/manga-dlp/issues"
Source = "https://github.com/olofvndrhr/manga-dlp"
[project.scripts]
hatch = "mangadlp.input:get_args"
# isort config
[tool.isort]
py_version = 39
skip_gitignore = true
line_length = 88
profile = "black"
multi_line_output = 3
include_trailing_comma = true
use_parentheses = true
# mypy config
[tool.mypy]
python_version = "3.9"
disallow_untyped_defs = false
follow_imports = "normal"
ignore_missing_imports = true
warn_no_return = false
warn_unused_ignores = true
show_error_context = true
show_column_numbers = true
show_error_codes = true
# coverage.py config
[tool.coverage.run]
source = ["mangadlp"]
branch = true
command_line = "-m pytest --verbose --exitfirst"
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about missing debug-only code:
"def __repr__",
"if self.debug",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
# Don't complain about abstract methods, they aren't run:
"@(abc.)?abstractmethod",
]
ignore_errors = true

View file

@ -1,29 +0,0 @@
from pathlib import Path
import setuptools
readme = Path("README.md")
long_description = readme.read_text()
setuptools.setup(
name="manga-dlp",
version="2.1.5",
author="Ivan Schaller",
author_email="ivan@schaller.sh",
description="A cli manga downloader",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/olofvndrhr/manga-dlp",
project_urls={
"Bug Tracker": "https://github.com/olofvndrhr/manga-dlp/issues",
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
package_dir={"": "mangadlp"},
packages=setuptools.find_packages(where="mangadlp"),
py_modules=["manga-dlp"],
python_requires=">=3.6",
)