diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 3a1f201..0000000 --- a/.coveragerc +++ /dev/null @@ -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 - diff --git a/.woodpecker/tests.yml b/.woodpecker/tests.yml index 27eb062..c01b64d 100644 --- a/.woodpecker/tests.yml +++ b/.woodpecker/tests.yml @@ -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 diff --git a/conftest.py b/conftest.py deleted file mode 100644 index e69de29..0000000 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f12e089 --- /dev/null +++ b/pyproject.toml @@ -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 + + diff --git a/setup.py b/setup.py deleted file mode 100644 index f2e591c..0000000 --- a/setup.py +++ /dev/null @@ -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", -)