[2.1.7] - 2022-06-22
## [2.1.7] - 2022-06-22 ### Added - tox version testing - New pre-release tests - Build info's with hatch - [Pypi](https://pypi.org/project/manga-dlp/) build with hatch - Pypi section in `README.md` - [Snyk](https://app.snyk.io/org/olofvndrhr-t6h/project/aae9609d-a4e4-41f8-b1ac-f2561b2ad4e3) test results in `README.md` ### Changed - Moved code from `manga-dlp.py` to `input.py` for uniformity - The default entrypoint is now `mangadlp.input:main`
This commit is contained in:
commit
76edd6080c
14 changed files with 280 additions and 77 deletions
|
@ -1,17 +1,25 @@
|
|||
[bumpversion]
|
||||
current_version = 2.1.6
|
||||
current_version = 2.1.7
|
||||
commit = True
|
||||
tag = False
|
||||
serialize = {major}.{minor}.{patch}
|
||||
|
||||
[bumpversion:file:pyproject.toml]
|
||||
search = {current_version}
|
||||
replace = {new_version}
|
||||
search = version = "{current_version}"
|
||||
replace = version = "{new_version}"
|
||||
|
||||
[bumpversion:file:manga-dlp.py]
|
||||
search = {current_version}
|
||||
replace = {new_version}
|
||||
search = MDLP_VERSION = "{current_version}"
|
||||
replace = MDLP_VERSION = "{new_version}"
|
||||
|
||||
[bumpversion:file:mangadlp/input.py]
|
||||
search = MDLP_VERSION = "{current_version}"
|
||||
replace = MDLP_VERSION = "{new_version}"
|
||||
|
||||
[bumpversion:file:.woodpecker/test_docker.yml]
|
||||
search = BUILD_VERSION={current_version}
|
||||
replace = BUILD_VERSION={new_version}
|
||||
|
||||
[bumpversion:file:.woodpecker/test_release.yml]
|
||||
search = {current_version}
|
||||
replace = {new_version}
|
||||
|
|
42
.woodpecker/publish_build.yml
Normal file
42
.woodpecker/publish_build.yml
Normal file
|
@ -0,0 +1,42 @@
|
|||
#############
|
||||
# build app #
|
||||
#############
|
||||
# branch: master
|
||||
# event: tag
|
||||
|
||||
depends_on:
|
||||
- tests
|
||||
|
||||
clone:
|
||||
git:
|
||||
when:
|
||||
#branch: master
|
||||
event: tag
|
||||
image: woodpeckerci/plugin-git
|
||||
|
||||
pipeline:
|
||||
|
||||
# build wheel and dist
|
||||
build-pypi:
|
||||
when:
|
||||
#branch: master
|
||||
event: tag
|
||||
image: cr.44net.ch/drone-plugins/test
|
||||
pull: true
|
||||
commands:
|
||||
- hatch build
|
||||
|
||||
# release pypi
|
||||
release-pypi:
|
||||
when:
|
||||
#branch: master
|
||||
event: tag
|
||||
image: cr.44net.ch/drone-plugins/test
|
||||
pull: true
|
||||
secrets:
|
||||
- source: pypi_username
|
||||
target: HATCH_PYPI_USER
|
||||
- source: pypi_token
|
||||
target: HATCH_PYPI_AUTH
|
||||
commands:
|
||||
- hatch publish
|
|
@ -69,4 +69,3 @@ pipeline:
|
|||
from_secret: cr-dhub-username
|
||||
password:
|
||||
from_secret: cr-dhub-key
|
||||
|
||||
|
|
47
.woodpecker/test_build.yml
Normal file
47
.woodpecker/test_build.yml
Normal file
|
@ -0,0 +1,47 @@
|
|||
##################
|
||||
# test build app #
|
||||
##################
|
||||
# branch: master
|
||||
# event: pull_request
|
||||
|
||||
depends_on:
|
||||
- tests
|
||||
|
||||
clone:
|
||||
git:
|
||||
when:
|
||||
branch: master
|
||||
event: pull_request
|
||||
image: woodpeckerci/plugin-git
|
||||
|
||||
pipeline:
|
||||
|
||||
# build wheel and dist
|
||||
test-build-pypi:
|
||||
when:
|
||||
branch: master
|
||||
event: pull_request
|
||||
image: cr.44net.ch/drone-plugins/test
|
||||
pull: true
|
||||
commands:
|
||||
- hatch build
|
||||
|
||||
# # test code with different python versions - amd64
|
||||
# test-tox-amd64:
|
||||
# when:
|
||||
# branch: master
|
||||
# event: pull_request
|
||||
# image: cr.44net.ch/drone-plugins/test:1-linux-amd64
|
||||
# pull: true
|
||||
# commands:
|
||||
# - tox
|
||||
#
|
||||
# # test code with different python versions - arm64
|
||||
# test-tox-arm64:
|
||||
# when:
|
||||
# branch: master
|
||||
# event: pull_request
|
||||
# image: cr.44net.ch/drone-plugins/test:1-linux-arm64
|
||||
# pull: true
|
||||
# commands:
|
||||
# - tox
|
|
@ -1,6 +1,6 @@
|
|||
#######################
|
||||
# build docker images #
|
||||
#######################
|
||||
############################
|
||||
# test build docker images #
|
||||
############################
|
||||
# branch: master
|
||||
# event: pull_request
|
||||
|
||||
|
@ -17,7 +17,7 @@ clone:
|
|||
pipeline:
|
||||
|
||||
# build docker image for amd64 - x86
|
||||
dryrun-build-amd64:
|
||||
test-build-amd64:
|
||||
when:
|
||||
branch: master
|
||||
event: pull_request
|
||||
|
@ -29,11 +29,11 @@ pipeline:
|
|||
platforms: linux/amd64
|
||||
dockerfile: docker/Dockerfile.amd64
|
||||
auto_tag: true
|
||||
auto_tag_suffix: linux-amd64
|
||||
build_args: BUILD_VERSION=${CI_COMMIT_TAG}
|
||||
auto_tag_suffix: linux-amd64-test
|
||||
build_args: BUILD_VERSION=2.1.7
|
||||
|
||||
# build docker image for arm64
|
||||
dryrun-build-arm64:
|
||||
test-build-arm64:
|
||||
when:
|
||||
branch: master
|
||||
event: pull_request
|
||||
|
@ -45,6 +45,5 @@ pipeline:
|
|||
platforms: linux/arm64
|
||||
dockerfile: docker/Dockerfile.arm64
|
||||
auto_tag: true
|
||||
auto_tag_suffix: linux-arm64
|
||||
build_args: BUILD_VERSION=${CI_COMMIT_TAG}
|
||||
|
||||
auto_tag_suffix: linux-arm64-test
|
||||
build_args: BUILD_VERSION=2.1.7
|
39
.woodpecker/test_release.yml
Normal file
39
.woodpecker/test_release.yml
Normal file
|
@ -0,0 +1,39 @@
|
|||
########################
|
||||
# test publish release #
|
||||
########################
|
||||
# branch: master
|
||||
# event: pull_request
|
||||
|
||||
depends_on:
|
||||
- tests
|
||||
|
||||
clone:
|
||||
git:
|
||||
when:
|
||||
branch: master
|
||||
event: pull_request
|
||||
image: woodpeckerci/plugin-git
|
||||
|
||||
pipeline:
|
||||
|
||||
# create release tar
|
||||
test-create-release-tar:
|
||||
when:
|
||||
branch: master
|
||||
event: pull_request
|
||||
image: cr.44net.ch/baseimages/debian-base
|
||||
pull: true
|
||||
commands:
|
||||
- tar -czf manga-dlp-2.1.7.tar.gz --files-from=release-files.txt
|
||||
- tar -tzf manga-dlp-2.1.7.tar.gz
|
||||
|
||||
# create release-notes
|
||||
test-create-release-notes:
|
||||
when:
|
||||
branch: master
|
||||
event: pull_request
|
||||
image: cr.44net.ch/baseimages/debian-base
|
||||
pull: true
|
||||
commands:
|
||||
- bash get_release_notes.sh 2.1.7
|
||||
- cat RELEASENOTES.md
|
|
@ -59,4 +59,3 @@ pipeline:
|
|||
sonar_token:
|
||||
from_secret: sq-44net-token
|
||||
usingProperties: true
|
||||
|
||||
|
|
17
CHANGELOG.md
17
CHANGELOG.md
|
@ -9,6 +9,23 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|||
|
||||
- Add support for more sites
|
||||
|
||||
## [2.1.7] - 2022-06-22
|
||||
|
||||
### Added
|
||||
|
||||
- tox version testing
|
||||
- New pre-release tests
|
||||
- Build info's with hatch
|
||||
- [Pypi](https://pypi.org/project/manga-dlp/) build with hatch
|
||||
- Pypi section in `README.md`
|
||||
- [Snyk](https://app.snyk.io/org/olofvndrhr-t6h/project/aae9609d-a4e4-41f8-b1ac-f2561b2ad4e3) test results
|
||||
in `README.md`
|
||||
|
||||
### Changed
|
||||
|
||||
- Moved code from `manga-dlp.py` to `input.py` for uniformity
|
||||
- The default entrypoint is now `mangadlp.input:main`
|
||||
|
||||
## [2.1.6] - 2022-06-21
|
||||
|
||||
### Fixed
|
||||
|
|
20
README.md
20
README.md
|
@ -4,7 +4,7 @@
|
|||
|
||||
#### CI/CD:
|
||||
|
||||
[![status-badge](https://ci.44net.ch/api/badges/olofvndrhr/manga-dlp/status.svg)](https://ci.44net.ch/olofvndrhr/manga-dlp)
|
||||
[![status-badge](https://img.shields.io/drone/build/olofvndrhr/manga-dlp?label=tests&server=https%3A%2F%2Fci.44net.ch)](https://ci.44net.ch/olofvndrhr/manga-dlp)
|
||||
[![Last Release](https://img.shields.io/github/release-date/olofvndrhr/manga-DLP?label=last%20release)](https://github.com/olofvndrhr/manga-dlp/releases)
|
||||
[![Version](https://img.shields.io/github/v/release/olofvndrhr/manga-dlp?label=version&sort=semver)](https://github.com/olofvndrhr/manga-dlp/releases)
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
|||
[![Quality Gate Status](https://sonarqube.44net.ch/api/project_badges/measure?project=olofvndrhr%3Amanga-dlp&metric=alert_status&token=f9558470580eea5b4899cf33f190eee16011346d)](https://sonarqube.44net.ch/dashboard?id=olofvndrhr%3Amanga-dlp)
|
||||
[![Coverage](https://sonarqube.44net.ch/api/project_badges/measure?project=olofvndrhr%3Amanga-dlp&metric=coverage&token=f9558470580eea5b4899cf33f190eee16011346d)](https://sonarqube.44net.ch/dashboard?id=olofvndrhr%3Amanga-dlp)
|
||||
[![Bugs](https://sonarqube.44net.ch/api/project_badges/measure?project=olofvndrhr%3Amanga-dlp&metric=bugs&token=f9558470580eea5b4899cf33f190eee16011346d)](https://sonarqube.44net.ch/dashboard?id=olofvndrhr%3Amanga-dlp)
|
||||
[![Security](https://img.shields.io/snyk/vulnerabilities/github/olofvndrhr/manga-dlp)](https://app.snyk.io/org/olofvndrhr-t6h/project/aae9609d-a4e4-41f8-b1ac-f2561b2ad4e3)
|
||||
|
||||
#### Meta:
|
||||
|
||||
|
@ -22,7 +23,7 @@
|
|||
[![Tests](https://img.shields.io/badge/tests-pytest-yellow)](https://github.com/pytest-dev/pytest/)
|
||||
[![Coverage generation](https://img.shields.io/badge/coverage-coveragepy-green)](https://github.com/nedbat/coveragepy)
|
||||
[![License - MIT](https://img.shields.io/badge/license-MIT-9400d3.svg)](https://snyk.io/learn/what-is-mit-license/)
|
||||
|
||||
[![Compatibility](https://img.shields.io/pypi/pyversions/manga-dlp)](https://pypi.org/project/manga-dlp/)
|
||||
---
|
||||
|
||||
## Description
|
||||
|
@ -67,9 +68,17 @@ python manga-dlp.py <options>
|
|||
python3 manga-dlp.py <options>
|
||||
```
|
||||
|
||||
### With pip (pypi)
|
||||
### With pip ([pypi](https://pypi.org/project/manga-dlp/))
|
||||
|
||||
(not yet done)
|
||||
```sh
|
||||
python3 -m pip install manga-dlp # download the package from pypi
|
||||
|
||||
python3 -m mangadlp <args> # start the script as a module
|
||||
OR
|
||||
manga-dlp <args> # call script directly
|
||||
OR
|
||||
mangadlp <args> # call script directly
|
||||
```
|
||||
|
||||
### With docker
|
||||
|
||||
|
@ -226,5 +235,6 @@ If you encounter any bugs, also just open a issue with a description of the prob
|
|||
--> [Dockerhub](https://hub.docker.com/repository/docker/olofvndrhr/manga-dlp)
|
||||
- <del>Automate release</del>
|
||||
--> Done with woodpecker-ci
|
||||
- Make pypi package
|
||||
- <del>Make pypi package</del>
|
||||
--> Done with release [2.1.7](https://pypi.org/project/manga-dlp/)
|
||||
- Add more supported sites
|
||||
|
|
52
manga-dlp.py
52
manga-dlp.py
|
@ -1,52 +1,6 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from mangadlp.input import get_args
|
||||
|
||||
MDLP_VERSION = "2.1.6"
|
||||
|
||||
|
||||
def get_input():
|
||||
print(f"manga-dlp version: {MDLP_VERSION}")
|
||||
print("Enter details of the manga you want to download:")
|
||||
while True:
|
||||
try:
|
||||
url_uuid = str(input("Url or UUID: "))
|
||||
readlist = str(input("List with links (optional): "))
|
||||
language = str(input("Language: ")) or "en"
|
||||
list_chapters = str(input("List chapters? y/N: "))
|
||||
if list_chapters.lower() != "y" or list_chapters.lower() != "yes":
|
||||
chapters = str(input("Chapters: "))
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(1)
|
||||
except:
|
||||
continue
|
||||
else:
|
||||
break
|
||||
|
||||
args = [
|
||||
"python3",
|
||||
"manga-dlp.py",
|
||||
"-l",
|
||||
language,
|
||||
"-c",
|
||||
chapters,
|
||||
]
|
||||
if url_uuid:
|
||||
args.append("-u")
|
||||
args.append(url_uuid)
|
||||
if readlist:
|
||||
args.append("--read")
|
||||
args.append(readlist)
|
||||
if list_chapters.lower() == "y" or list_chapters.lower() == "yes":
|
||||
args.append("--list")
|
||||
|
||||
# start script again with the arguments
|
||||
subprocess.call(args)
|
||||
from mangadlp.input import main
|
||||
|
||||
MDLP_VERSION = "2.1.7"
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) > 1:
|
||||
get_args()
|
||||
else:
|
||||
get_input()
|
||||
main()
|
||||
|
|
6
mangadlp/__main__.py
Normal file
6
mangadlp/__main__.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
import sys
|
||||
|
||||
from mangadlp.input import main
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
|
@ -1,10 +1,11 @@
|
|||
import argparse
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import mangadlp.app as app
|
||||
|
||||
MDLP_VERSION = "2.1.6"
|
||||
MDLP_VERSION = "2.1.7"
|
||||
|
||||
|
||||
def check_args(args):
|
||||
|
@ -52,6 +53,45 @@ def call_app(args):
|
|||
mdlp.get_manga()
|
||||
|
||||
|
||||
def get_input():
|
||||
print(f"manga-dlp version: {MDLP_VERSION}")
|
||||
print("Enter details of the manga you want to download:")
|
||||
while True:
|
||||
try:
|
||||
url_uuid = str(input("Url or UUID: "))
|
||||
readlist = str(input("List with links (optional): "))
|
||||
language = str(input("Language: ")) or "en"
|
||||
list_chapters = str(input("List chapters? y/N: "))
|
||||
if list_chapters.lower() != "y" or list_chapters.lower() != "yes":
|
||||
chapters = str(input("Chapters: "))
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(1)
|
||||
except:
|
||||
continue
|
||||
else:
|
||||
break
|
||||
|
||||
args = [
|
||||
"python3",
|
||||
"manga-dlp.py",
|
||||
"-l",
|
||||
language,
|
||||
"-c",
|
||||
chapters,
|
||||
]
|
||||
if url_uuid:
|
||||
args.append("-u")
|
||||
args.append(url_uuid)
|
||||
if readlist:
|
||||
args.append("--read")
|
||||
args.append(readlist)
|
||||
if list_chapters.lower() == "y" or list_chapters.lower() == "yes":
|
||||
args.append("--list")
|
||||
|
||||
# start script again with the arguments
|
||||
subprocess.call(args)
|
||||
|
||||
|
||||
def get_args():
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Script to download mangas from various sites"
|
||||
|
@ -151,5 +191,12 @@ def get_args():
|
|||
check_args(args)
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) > 1:
|
||||
get_args()
|
||||
else:
|
||||
get_input()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
get_args()
|
||||
main()
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
version = "2.1.6"
|
||||
version = "2.1.7"
|
||||
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"
|
||||
authors = [
|
||||
{ name = "Ivan Schaller", email = "ivan@schaller.sh" },
|
||||
]
|
||||
keywords = [
|
||||
"manga",
|
||||
"downloader",
|
||||
|
@ -31,7 +36,8 @@ Tracker = "https://github.com/olofvndrhr/manga-dlp/issues"
|
|||
Source = "https://github.com/olofvndrhr/manga-dlp"
|
||||
|
||||
[project.scripts]
|
||||
hatch = "mangadlp.input:get_args"
|
||||
mangadlp = "mangadlp.input:main"
|
||||
manga-dlp = "mangadlp.input:main"
|
||||
|
||||
# isort config
|
||||
[tool.isort]
|
||||
|
@ -81,4 +87,21 @@ exclude_lines = [
|
|||
]
|
||||
ignore_errors = true
|
||||
|
||||
[tool.hatch.build]
|
||||
ignore-vcs = true
|
||||
|
||||
[tool.hatch.build.targets.sdist]
|
||||
include = ["mangadlp"]
|
||||
exclude = [
|
||||
"docker",
|
||||
".tox",
|
||||
".mypy_cache"
|
||||
]
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
include = ["mangadlp"]
|
||||
exclude = [
|
||||
"docker",
|
||||
".tox",
|
||||
".mypy_cache"
|
||||
]
|
||||
|
|
13
tox.ini
Normal file
13
tox.ini
Normal file
|
@ -0,0 +1,13 @@
|
|||
[tox]
|
||||
envlist = py38, py39, py310
|
||||
isolated_build = True
|
||||
|
||||
[testenv]
|
||||
deps =
|
||||
pytest
|
||||
coverage
|
||||
-rrequirements.txt
|
||||
|
||||
commands =
|
||||
pytest -x --basetemp="{envtmpdir}" {posargs}
|
||||
|
Loading…
Reference in a new issue