Compare commits
26 commits
Author | SHA1 | Date | |
---|---|---|---|
cb70268966 | |||
98b14838e8 | |||
4911f02303 | |||
5a04db3cd4 | |||
fe8b36c705 | |||
1ceaff2d67 | |||
f8422f7670 | |||
f7fa583735 | |||
5afd538dcd | |||
ee8a34b760 | |||
0dc7e2f60d | |||
a1bd82778f | |||
ae4b796469 | |||
3950cd1927 | |||
4a2e90ddda | |||
e1276b5be9 | |||
8d652d6732 | |||
0d0e45f800 | |||
01a56734f2 | |||
ed2dfd414c | |||
85e57aec2e | |||
b66cf11f95 | |||
4eeaa4f603 | |||
0e8f3768c2 | |||
1f73c306bd | |||
b20d442057 |
16 changed files with 334 additions and 328 deletions
|
@ -90,6 +90,7 @@ jobs:
|
|||
|
||||
- name: update dockerhub repo description
|
||||
uses: peter-evans/dockerhub-description@v3
|
||||
if: gitea.event_name != 'pull_request'
|
||||
with:
|
||||
repository: ${{ env.AUTHOR }}/${{ env.IMAGE }}
|
||||
short-description: ${{ github.event.repository.description }}
|
||||
|
|
|
@ -23,6 +23,7 @@ jobs:
|
|||
scan-code-py311:
|
||||
runs-on: python311
|
||||
if: gitea.event_name != 'pull_request'
|
||||
needs: [check-code-py38]
|
||||
steps:
|
||||
- name: checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
@ -36,7 +37,7 @@ jobs:
|
|||
run: hatch run default:cov
|
||||
|
||||
- name: run sonar-scanner
|
||||
uses: sonarsource/sonarqube-scan-action@v2.0.1
|
||||
uses: sonarsource/sonarqube-scan-action@v2.1.0
|
||||
env:
|
||||
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
|
||||
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
||||
|
@ -57,10 +58,12 @@ jobs:
|
|||
run: hatch run +py=3.8 lint:typing
|
||||
|
||||
- name: run tests
|
||||
if: gitea.event_name == 'pull_request'
|
||||
run: hatch run default:test
|
||||
|
||||
check-code-py39:
|
||||
runs-on: python39
|
||||
needs: [check-code-py38]
|
||||
steps:
|
||||
- name: checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
@ -75,10 +78,12 @@ jobs:
|
|||
run: hatch run +py=3.9 lint:typing
|
||||
|
||||
- name: run tests
|
||||
if: gitea.event_name == 'pull_request'
|
||||
run: hatch run default:test
|
||||
|
||||
check-code-py310:
|
||||
runs-on: python310
|
||||
needs: [check-code-py39]
|
||||
steps:
|
||||
- name: checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
@ -93,10 +98,12 @@ jobs:
|
|||
run: hatch run +py=3.10 lint:typing
|
||||
|
||||
- name: run tests
|
||||
if: gitea.event_name == 'pull_request'
|
||||
run: hatch run default:test
|
||||
|
||||
check-code-py311:
|
||||
runs-on: python311
|
||||
needs: [check-code-py310]
|
||||
steps:
|
||||
- name: checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
@ -111,4 +118,5 @@ jobs:
|
|||
run: hatch run +py=3.11 lint:typing
|
||||
|
||||
- name: run tests
|
||||
if: gitea.event_name == 'pull_request'
|
||||
run: hatch run default:test
|
||||
|
|
|
@ -30,27 +30,27 @@ jobs:
|
|||
- name: build package
|
||||
run: hatch build --clean
|
||||
|
||||
- name: read changelog
|
||||
id: changelog
|
||||
uses: juliangruber/read-file-action@v1
|
||||
with:
|
||||
path: ./CHANGELOG.md
|
||||
- name: get release notes
|
||||
id: release-notes
|
||||
uses: olofvndrhr/releasenote-gen@v1
|
||||
|
||||
- name: create gitea release
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
if: gitea.event_name != 'pull_request'
|
||||
with:
|
||||
title: ${{ gitea.ref_name }}
|
||||
body: ${{ steps.changelog.outputs.content }}
|
||||
body: ${{ steps.release-notes.outputs.releasenotes }}
|
||||
files: |-
|
||||
dist/**
|
||||
|
||||
- name: create github release
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: ncipollo/release-action@v1
|
||||
if: gitea.event_name != 'pull_request'
|
||||
with:
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
title: ${{ gitea.ref_name }}
|
||||
body: ${{ steps.changelog.outputs.content }}
|
||||
files: |-
|
||||
owner: olofvndrhr
|
||||
repo: manga-dlp
|
||||
name: ${{ gitea.ref_name }}
|
||||
body: ${{ steps.release-notes.outputs.releasenotes }}
|
||||
artifacts: |-
|
||||
dist/**
|
||||
|
|
18
.gitea/workflows/scheduled.yml
Normal file
18
.gitea/workflows/scheduled.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
name: run scheduled tests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 20 * * 6"
|
||||
|
||||
jobs:
|
||||
check-code-py311:
|
||||
runs-on: python311
|
||||
steps:
|
||||
- name: checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: install hatch
|
||||
run: pip install -U hatch
|
||||
|
||||
- name: run tests
|
||||
run: hatch run default:test
|
|
@ -1,4 +1,4 @@
|
|||
shellcheck 0.9.0
|
||||
shfmt 3.7.0
|
||||
just 1.23.0
|
||||
shellcheck 0.10.0
|
||||
shfmt 3.8.0
|
||||
just 1.25.2
|
||||
lefthook 1.4.6
|
||||
|
|
374
CHANGELOG.md
374
CHANGELOG.md
|
@ -7,458 +7,476 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
- Add support for more sites
|
||||
- Add support for more sites
|
||||
|
||||
## [2.4.1] - 2024-02-01
|
||||
|
||||
- same as 2.4.0
|
||||
|
||||
## [2.4.0] - 2024-02-01
|
||||
|
||||
### Fixed
|
||||
|
||||
- Some issues with Python3.8 compatibility
|
||||
|
||||
### Changed
|
||||
|
||||
- Moved build system from woodpecker-ci to gitea actions
|
||||
- Updated some dependencies
|
||||
- Updated the docker image
|
||||
- Switched from formatter/linter `black` to `ruff`
|
||||
- Switches typing from `pyright` to `mypy`
|
||||
|
||||
## [2.3.1] - 2023-03-12
|
||||
|
||||
### Added
|
||||
|
||||
- Added TypedDicts for type checkers and type annotation
|
||||
- Added TypedDicts for type checkers and type annotation
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed some typos in the README
|
||||
- Fixed some typos in the README
|
||||
|
||||
### Changed
|
||||
|
||||
- Switched from pylint/pylama/isort/autoflake to ruff
|
||||
- Switched from mypy to pyright and added strict type checking
|
||||
- Updated the api template
|
||||
- Switched from pylint/pylama/isort/autoflake to ruff
|
||||
- Switched from mypy to pyright and added strict type checking
|
||||
- Updated the api template
|
||||
|
||||
## [2.3.0] - 2023-02-15
|
||||
|
||||
### Added
|
||||
|
||||
- Metadata is now added to each chapter. Schema
|
||||
standard: [https://anansi-project.github.io/docs/comicinfo/schemas/v2.0](https://anansi-project.github.io/docs/comicinfo/schemas/v2.0)
|
||||
- Added `xmltodict` as a package requirement
|
||||
- Cache now also saves the manga title
|
||||
- New tests
|
||||
- More typo annotations for function, compatible with python3.8
|
||||
- File format checker if you use the MangaDLP class directly
|
||||
- Metadata is now added to each chapter. Schema
|
||||
standard: [https://anansi-project.github.io/docs/comicinfo/schemas/v2.0](https://anansi-project.github.io/docs/comicinfo/schemas/v2.0)
|
||||
- Added `xmltodict` as a package requirement
|
||||
- Cache now also saves the manga title
|
||||
- New tests
|
||||
- More typo annotations for function, compatible with python3.8
|
||||
- File format checker if you use the MangaDLP class directly
|
||||
|
||||
### Fixed
|
||||
|
||||
- API template typos
|
||||
- Some useless type annotations
|
||||
- API template typos
|
||||
- Some useless type annotations
|
||||
|
||||
### Changed
|
||||
|
||||
- Simplified the chapter info generation
|
||||
- Updated the license year
|
||||
- Updated the API template
|
||||
- Updated the API detection and removed it from the MangaDLP class
|
||||
- Simplified the chapter info generation
|
||||
- Updated the license year
|
||||
- Updated the API template
|
||||
- Updated the API detection and removed it from the MangaDLP class
|
||||
|
||||
## [2.2.20] - 2023-02-12
|
||||
|
||||
### Fixed
|
||||
|
||||
- Script now doesn't exit if multiple mangas were requested and one had an error
|
||||
- Script now doesn't exit if multiple mangas were requested and one had an error
|
||||
|
||||
## [2.2.19] - 2023-02-11
|
||||
|
||||
### Added
|
||||
|
||||
- First version of the chapter cache (very basic functionality)
|
||||
- First version of the chapter cache (very basic functionality)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed all exception re-raises to include the original stack trace
|
||||
- Fixed all exception re-raises to include the original stack trace
|
||||
|
||||
### Changed
|
||||
|
||||
- Simplified chapter download loop
|
||||
- Simplified chapter download loop
|
||||
|
||||
## [2.2.18] - 2023-01-21
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed manga titles on non english language
|
||||
- Fixed title & filename fixing to not use `ascii` but `uft8`
|
||||
- Fixed manga titles on non english language
|
||||
- Fixed title & filename fixing to not use `ascii` but `uft8`
|
||||
|
||||
### Added
|
||||
|
||||
- Fallback title to english of none was found in requested language
|
||||
- More debug logs
|
||||
- More tests
|
||||
- Fallback title to english of none was found in requested language
|
||||
- More debug logs
|
||||
- More tests
|
||||
|
||||
### Changed
|
||||
|
||||
- Now uses the first found alt-title. Before it was the last
|
||||
- Removed `sys.exit` in the api
|
||||
- Now uses the first found alt-title. Before it was the last
|
||||
- Removed `sys.exit` in the api
|
||||
|
||||
## [2.2.17] - 2023-01-15
|
||||
|
||||
### Fixed
|
||||
|
||||
- Set a timeout of 10 seconds for the api requests
|
||||
- Set a timeout of 10 seconds for the api requests
|
||||
|
||||
### Added
|
||||
|
||||
- `--name-format` and `--name-format-none` flags to add a custom naming scheme for the downloaded files. See
|
||||
docs: https://manga-dlp.ivn.sh/download/
|
||||
- More debug log messages
|
||||
- More tests for the custom naming scheme
|
||||
- More type hints
|
||||
- `--name-format` and `--name-format-none` flags to add a custom naming scheme for the downloaded files. See
|
||||
docs: https://manga-dlp.ivn.sh/download/
|
||||
- More debug log messages
|
||||
- More tests for the custom naming scheme
|
||||
- More type hints
|
||||
|
||||
### Changed
|
||||
|
||||
- Make `--format` a `click.Choice` option
|
||||
- In the `--format` option the leading dot is now invalid. `--format .cbz` -> `--format cbz`
|
||||
- Changed empty values from the api from None to an empty string
|
||||
- Minor code readability improvements
|
||||
- Make `--format` a `click.Choice` option
|
||||
- In the `--format` option the leading dot is now invalid. `--format .cbz` -> `--format cbz`
|
||||
- Changed empty values from the api from None to an empty string
|
||||
- Minor code readability improvements
|
||||
|
||||
## [2.2.16] - 2022-12-30
|
||||
|
||||
### Fixed
|
||||
|
||||
- Log level is now fixed and should not default to 0
|
||||
- Docker schedule should now work again
|
||||
- Log level is now fixed and should not default to 0
|
||||
- Docker schedule should now work again
|
||||
|
||||
### Changed
|
||||
|
||||
- Integrate logging logs to loguru via custom sink
|
||||
- Simplify docker shell scripts
|
||||
- Integrate logging logs to loguru via custom sink
|
||||
- Simplify docker shell scripts
|
||||
|
||||
## [2.2.15] - 2022-12-29
|
||||
|
||||
### Added
|
||||
|
||||
- `--warn` and `--loglevel` flags
|
||||
- `--warn` and `--loglevel` flags
|
||||
|
||||
### Removed
|
||||
|
||||
- Remove `--lean` and `--verbose` flags and remove custom log levels
|
||||
- Remove `--lean` and `--verbose` flags and remove custom log levels
|
||||
|
||||
### Changed
|
||||
|
||||
- Move from standard library logging to [loguru](https://loguru.readthedocs.io/en/stable/index.html)
|
||||
- Move from standard library argparse to [click](https://click.palletsprojects.com/en/8.1.x/)
|
||||
- Move from standard library logging to [loguru](https://loguru.readthedocs.io/en/stable/index.html)
|
||||
- Move from standard library argparse to [click](https://click.palletsprojects.com/en/8.1.x/)
|
||||
|
||||
## [2.2.14] - 2022-10-06
|
||||
|
||||
### Changed
|
||||
|
||||
- Changed logging format to ISO 8601
|
||||
- Small logging corrections
|
||||
- Changed logging format to ISO 8601
|
||||
- Small logging corrections
|
||||
|
||||
## [2.2.13] - 2022-08-15
|
||||
|
||||
### Added
|
||||
|
||||
- Option to run custom hooks before and after each chapter/manga download
|
||||
- _Tests for the new hooks_
|
||||
- _Docs for the new hooks_
|
||||
- _Tests for mkdocs generation_
|
||||
- Option to run custom hooks before and after each chapter/manga download
|
||||
- _Tests for the new hooks_
|
||||
- _Docs for the new hooks_
|
||||
- _Tests for mkdocs generation_
|
||||
|
||||
### Changed
|
||||
|
||||
- Verbose and Debug logging now have a space as a seperator between log level-name and log-level
|
||||
- APIs now have an attribute with their name (for the hooks) - `api.api_name`
|
||||
- Docs moved to Cloudflare pages (generated with mkdocs)
|
||||
- Verbose and Debug logging now have a space as a seperator between log level-name and log-level
|
||||
- APIs now have an attribute with their name (for the hooks) - `api.api_name`
|
||||
- Docs moved to Cloudflare pages (generated with mkdocs)
|
||||
|
||||
## [2.1.12] - 2022-07-25
|
||||
|
||||
### Fixed
|
||||
|
||||
- Image publishing with `hatch` on pypi should now work again
|
||||
- The schedule fixer for the new `.sh` schedule should now work correctly
|
||||
- Image publishing with `hatch` on pypi should now work again
|
||||
- The schedule fixer for the new `.sh` schedule should now work correctly
|
||||
|
||||
### Added
|
||||
|
||||
- More CI tests: `pylint`, `pylama` and `autoflake`
|
||||
- New function in `get_release_notes.sh` to get the latest version
|
||||
- Docstrings for `MangaDLP` and the api module `Mangadex`
|
||||
- More CI tests: `pylint`, `pylama` and `autoflake`
|
||||
- New function in `get_release_notes.sh` to get the latest version
|
||||
- Docstrings for `MangaDLP` and the api module `Mangadex`
|
||||
|
||||
### Changed
|
||||
|
||||
- CI workflow is now faster and runs natively on arm64 (before it was buildx/emulation)
|
||||
- `Pylint`/`pylama` code improvements
|
||||
- Version management is now done with `hatch` (in `__about__.py`)
|
||||
- CI workflow is now faster and runs natively on arm64 (before it was buildx/emulation)
|
||||
- `Pylint`/`pylama` code improvements
|
||||
- Version management is now done with `hatch` (in `__about__.py`)
|
||||
|
||||
## [2.1.11] - 2022-07-18
|
||||
|
||||
### Fixed
|
||||
|
||||
- The `--read` option now filters empty lines, so it will not generate an error anymore
|
||||
- An error which was caused by the interactive input method when you did not specify a chapter or to list them
|
||||
- Some typos
|
||||
- The `--read` option now filters empty lines, so it will not generate an error anymore
|
||||
- An error which was caused by the interactive input method when you did not specify a chapter or to list them
|
||||
- Some typos
|
||||
|
||||
### Added
|
||||
|
||||
- Options to configure the default schedule in the docker container via environment variables
|
||||
- Section the the docker [README.md](docker/README.md) for the new environment variables
|
||||
- `autoflake` test in `justfile`
|
||||
- Some more things which get logged
|
||||
- Options to configure the default schedule in the docker container via environment variables
|
||||
- Section the the docker [README.md](docker/README.md) for the new environment variables
|
||||
- `autoflake` test in `justfile`
|
||||
- Some more things which get logged
|
||||
|
||||
### Changed
|
||||
|
||||
- **BREAKING**: renamed the default schedule from `daily` to `daily.sh`. Don't forget to fix your bind-mounts to
|
||||
overwrite
|
||||
the default schedule
|
||||
- Added the `.sh` suffix to the s6 init scripts for better compatibility
|
||||
- Adjusted the new logging implementation. It shows now more info about the module the log is from, and some other
|
||||
improvements
|
||||
- **BREAKING**: renamed the default schedule from `daily` to `daily.sh`. Don't forget to fix your bind-mounts to
|
||||
overwrite
|
||||
the default schedule
|
||||
- Added the `.sh` suffix to the s6 init scripts for better compatibility
|
||||
- Adjusted the new logging implementation. It shows now more info about the module the log is from, and some other
|
||||
improvements
|
||||
|
||||
## [2.1.10] - 2022-07-14
|
||||
|
||||
### Fixed
|
||||
|
||||
- Removed some unused files
|
||||
- Removed some unused files
|
||||
|
||||
### Added
|
||||
|
||||
- `logger.py` for all log related settings and functions
|
||||
- `logger.py` for all log related settings and functions
|
||||
|
||||
### Changed
|
||||
|
||||
- Logging of output. The script now uses the `logging` library
|
||||
- Logging of output. The script now uses the `logging` library
|
||||
|
||||
## [2.1.9] - 2022-06-26
|
||||
|
||||
### Fixed
|
||||
|
||||
- Timeouts in tests, due to api limitations. Now added a wait time between tests
|
||||
- Pytest path
|
||||
- Timeouts in tests, due to api limitations. Now added a wait time between tests
|
||||
- Pytest path
|
||||
|
||||
### Added
|
||||
|
||||
- `--lean` flag for less output
|
||||
- [justfile](https://github.com/casey/just) for setting up a dev environment and testing the code
|
||||
- [asdf](https://github.com/asdf-vm/asdf) for version management
|
||||
- Dev requirements in [contrib/requirements_dev.txt](contrib/requirements_dev.txt)
|
||||
- `README` in [contrib](contrib)
|
||||
- `--lean` flag for less output
|
||||
- [justfile](https://github.com/casey/just) for setting up a dev environment and testing the code
|
||||
- [asdf](https://github.com/asdf-vm/asdf) for version management
|
||||
- Dev requirements in [contrib/requirements_dev.txt](contrib/requirements_dev.txt)
|
||||
- `README` in [contrib](contrib)
|
||||
|
||||
### Changed
|
||||
|
||||
- Handling of verbosity and logging. Now there are 4 types of verbosity: `normal`, `lean`, `verbose` and `debug`
|
||||
- CI/CD pipeline for testing and releases
|
||||
- Coverage testing now also done with `tox`
|
||||
- Default verbosity of docker container is now `--lean`
|
||||
- Reorganised [pyproject.toml](pyproject.toml)
|
||||
- Handling of verbosity and logging. Now there are 4 types of verbosity: `normal`, `lean`, `verbose` and `debug`
|
||||
- CI/CD pipeline for testing and releases
|
||||
- Coverage testing now also done with `tox`
|
||||
- Default verbosity of docker container is now `--lean`
|
||||
- Reorganised [pyproject.toml](pyproject.toml)
|
||||
|
||||
## [2.1.8] - 2022-06-22
|
||||
|
||||
### Fixed
|
||||
|
||||
- Interactive input
|
||||
- Interactive input
|
||||
|
||||
## [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`
|
||||
- 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`
|
||||
- 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
|
||||
|
||||
- Docker labels are now working
|
||||
- Global variables are now fully uppercase
|
||||
- Some errors with static types
|
||||
- Docker labels are now working
|
||||
- Global variables are now fully uppercase
|
||||
- Some errors with static types
|
||||
|
||||
### Added
|
||||
|
||||
- bump2version config for releases
|
||||
- More tests with: `mypy` and `isort`
|
||||
- New issue templates
|
||||
- bump2version config for releases
|
||||
- More tests with: `mypy` and `isort`
|
||||
- New issue templates
|
||||
|
||||
### Changed
|
||||
|
||||
- Release workflow now is based on configuration files
|
||||
- Switched from `setup.py` to `pyproject.toml`
|
||||
- `README.md` now has sorted badges
|
||||
- Imports are now sorted with `isort`
|
||||
- Static types are now checked with `mypy`
|
||||
- Release note generation is now simplified
|
||||
- Release workflow now is based on configuration files
|
||||
- Switched from `setup.py` to `pyproject.toml`
|
||||
- `README.md` now has sorted badges
|
||||
- Imports are now sorted with `isort`
|
||||
- Static types are now checked with `mypy`
|
||||
- Release note generation is now simplified
|
||||
|
||||
## [2.1.5] - 2022-06-18
|
||||
|
||||
### Fixed
|
||||
|
||||
- Image names now have a suffix, as some comic readers have problems with no
|
||||
suffix [fixes issue #2]
|
||||
- Image names now have a suffix, as some comic readers have problems with no
|
||||
suffix [fixes issue #2]
|
||||
|
||||
### Added
|
||||
|
||||
- `--format` section in the README
|
||||
- `--format` section in the README
|
||||
|
||||
## [2.1.4] - 2022-05-29
|
||||
|
||||
### Fixed
|
||||
|
||||
- Docker container now works again
|
||||
- Fixed cron in docker container
|
||||
- Docker container now works again
|
||||
- Fixed cron in docker container
|
||||
|
||||
### Changed
|
||||
|
||||
- Docker container scheduling is now more practical
|
||||
- Docker container scheduling is now more practical
|
||||
|
||||
## [2.1.3] - 2022-05-29
|
||||
|
||||
### Fixed
|
||||
|
||||
- Error-chapters and skipped-chapters list are now shown again
|
||||
- The Interactive input version now matches `--version`
|
||||
- Error-chapters and skipped-chapters list are now shown again
|
||||
- The Interactive input version now matches `--version`
|
||||
|
||||
### Added
|
||||
|
||||
- Ability to list chapters with interactive input
|
||||
- Ability to list chapters with interactive input
|
||||
|
||||
### Changed
|
||||
|
||||
- Replace `exit()` with `sys.exit()`
|
||||
- Renamed class methods to not look like dunder methods
|
||||
- Script execution moved from `os.system()` to `subprocess.call()`
|
||||
- Replace `exit()` with `sys.exit()`
|
||||
- Renamed class methods to not look like dunder methods
|
||||
- Script execution moved from `os.system()` to `subprocess.call()`
|
||||
|
||||
## [2.1.2] - 2022-05-20
|
||||
|
||||
### Fixed
|
||||
|
||||
- List chapters when none were specified
|
||||
- Typos
|
||||
- List chapters when none were specified
|
||||
- Typos
|
||||
|
||||
### Added
|
||||
|
||||
- Ability to download whole volumes
|
||||
- Ability to download whole volumes
|
||||
|
||||
### Changed
|
||||
|
||||
- Moved processing of list with links to input.py
|
||||
- Updated README for volume and chapter selection
|
||||
- Moved processing of list with links to input.py
|
||||
- Updated README for volume and chapter selection
|
||||
|
||||
## [2.1.1] - 2022-05-18
|
||||
|
||||
### Fixed
|
||||
|
||||
- Progress bar on verbose output
|
||||
- Sonarqube link for CI
|
||||
- A few typos
|
||||
- Removed unnecessary escapes from file rename regex
|
||||
- Progress bar on verbose output
|
||||
- Sonarqube link for CI
|
||||
- A few typos
|
||||
- Removed unnecessary escapes from file rename regex
|
||||
|
||||
### Added
|
||||
|
||||
- API template
|
||||
- API template
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated docker baseimage
|
||||
- Rewrote app.py to a class
|
||||
- Updated docker baseimage
|
||||
- Rewrote app.py to a class
|
||||
|
||||
## [2.1.0] - 2022-05-16
|
||||
|
||||
### Fixed
|
||||
|
||||
- Detection of files. Now it will skip them again
|
||||
- Detection of files. Now it will skip them again
|
||||
|
||||
### Added
|
||||
|
||||
- Ability to save the chapters as pdf (only on amd64/x86)
|
||||
- New output formats: rar, zip
|
||||
- Progress bar to show image download
|
||||
- Interactive input if no command line flags are given
|
||||
- Better KeyboardInterrupt handling
|
||||
- Better error handling
|
||||
- Removed duplicate code
|
||||
- Ability to save the chapters as pdf (only on amd64/x86)
|
||||
- New output formats: rar, zip
|
||||
- Progress bar to show image download
|
||||
- Interactive input if no command line flags are given
|
||||
- Better KeyboardInterrupt handling
|
||||
- Better error handling
|
||||
- Removed duplicate code
|
||||
|
||||
### Changed
|
||||
|
||||
- How the variables are used inside the script
|
||||
- Variables have now the same name as in other scripts (mostly)
|
||||
- Better retrying when a task fails
|
||||
- How the variables are used inside the script
|
||||
- Variables have now the same name as in other scripts (mostly)
|
||||
- Better retrying when a task fails
|
||||
|
||||
## [2.0.8] - 2022-05-13
|
||||
|
||||
### Changed
|
||||
|
||||
- Rewrote parts of script to be easier to maintain
|
||||
- Moved the input script to the base folder
|
||||
- Moved all arguments to a class
|
||||
- Docker container creation
|
||||
- Rewrote parts of script to be easier to maintain
|
||||
- Moved the input script to the base folder
|
||||
- Moved all arguments to a class
|
||||
- Docker container creation
|
||||
|
||||
## [2.0.7] - 2022-05-13
|
||||
|
||||
### Changed
|
||||
|
||||
- Changed CI/CD Platform from Drone-CI to Woodpecker-CI
|
||||
- Release title is now only the version
|
||||
- Changed CI/CD Platform from Drone-CI to Woodpecker-CI
|
||||
- Release title is now only the version
|
||||
|
||||
## [2.0.6] - 2022-05-11
|
||||
|
||||
### Fixed
|
||||
|
||||
- Filenames on windows (ntfs). Removed double quote from file and folder names
|
||||
- Filenames on windows (ntfs). Removed double quote from file and folder names
|
||||
|
||||
## [2.0.5] - 2022-05-11
|
||||
|
||||
### Fixed
|
||||
|
||||
- Better error handling on "KeyboardInterrupt"
|
||||
- Release notes now fixed
|
||||
- Better error handling on "KeyboardInterrupt"
|
||||
- Release notes now fixed
|
||||
|
||||
### Added
|
||||
|
||||
- New test cases
|
||||
- New test cases
|
||||
|
||||
## [2.0.4] - 2022-05-10
|
||||
|
||||
### Added
|
||||
|
||||
- New test cases for more coverage
|
||||
- Github release
|
||||
- Updated docker baseimage
|
||||
- New test cases for more coverage
|
||||
- Github release
|
||||
- Updated docker baseimage
|
||||
|
||||
## [2.0.3] - 2022-05-10
|
||||
|
||||
### Fixed
|
||||
|
||||
- Test cases now work again
|
||||
- Sonarqube settings
|
||||
- Test cases now work again
|
||||
- Sonarqube settings
|
||||
|
||||
### Added
|
||||
|
||||
- Coverage report in sonarqube
|
||||
- Gitea release
|
||||
- Coverage report in sonarqube
|
||||
- Gitea release
|
||||
|
||||
## [2.0.2] - 2022-05-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- Restart failed api requests
|
||||
- Added wait time for image gathering, as to stop api rate limiting from mangadex
|
||||
- "--wait" options now works properly again
|
||||
- Restart failed api requests
|
||||
- Added wait time for image gathering, as to stop api rate limiting from mangadex
|
||||
- "--wait" options now works properly again
|
||||
|
||||
## [2.0.1] - 2022-05-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- Regex for removing illegal characters in the filenames now doesn't remove quotes
|
||||
- Updated docker baseimage and fixed the mangadlp tag in it
|
||||
- Update license for 2022
|
||||
- Regex for removing illegal characters in the filenames now doesn't remove quotes
|
||||
- Updated docker baseimage and fixed the mangadlp tag in it
|
||||
- Update license for 2022
|
||||
|
||||
### Added
|
||||
|
||||
- Quick start section in README
|
||||
- Preperation for pypi
|
||||
- Quick start section in README
|
||||
- Preperation for pypi
|
||||
|
||||
## [2.0.0] - 2022-05-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- Support for new mangadex api
|
||||
- Support for new mangadex api
|
||||
|
||||
### Changed
|
||||
|
||||
- Code is now formatted with [black](https://github.com/psf/black)
|
||||
- Now also supports just the uuid for managex (not a full link)
|
||||
- Code is now formatted with [black](https://github.com/psf/black)
|
||||
- Now also supports just the uuid for managex (not a full link)
|
||||
|
|
52
README.md
52
README.md
|
@ -2,29 +2,23 @@
|
|||
|
||||
> Full docs: https://manga-dlp.ivn.sh
|
||||
|
||||
CI/CD
|
||||
|
||||
[![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=git%20release)](https://github.com/olofvndrhr/manga-dlp/releases)
|
||||
[![Version PyPi](https://img.shields.io/pypi/v/manga-dlp?label=pypi%20release)](https://pypi.org/project/manga-dlp/)
|
||||
|
||||
Code Analysis
|
||||
|
||||
[![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)
|
||||
[![Maintainability Rating](https://sonarqube.44net.ch/api/project_badges/measure?project=olofvndrhr%3Amanga-dlp&metric=sqale_rating&token=f9558470580eea5b4899cf33f190eee16011346d)](https://sonarqube.44net.ch/dashboard?id=olofvndrhr%3Amanga-dlp)
|
||||
[![Reliability Rating](https://sonarqube.44net.ch/api/project_badges/measure?project=olofvndrhr%3Amanga-dlp&metric=reliability_rating&token=f9558470580eea5b4899cf33f190eee16011346d)](https://sonarqube.44net.ch/dashboard?id=olofvndrhr%3Amanga-dlp)
|
||||
[![Security Rating](https://sonarqube.44net.ch/api/project_badges/measure?project=olofvndrhr%3Amanga-dlp&metric=security_rating&token=f9558470580eea5b4899cf33f190eee16011346d)](https://sonarqube.44net.ch/dashboard?id=olofvndrhr%3Amanga-dlp)
|
||||
|
||||
Meta
|
||||
|
||||
[![Code style](https://img.shields.io/badge/code%20style-black-black)](https://github.com/psf/black)
|
||||
[![Formatter](https://img.shields.io/badge/code%20style-ruff-black)](https://github.com/charliermarsh/ruff)
|
||||
[![Linter](https://img.shields.io/badge/linter-ruff-red)](https://github.com/charliermarsh/ruff)
|
||||
[![Types](https://img.shields.io/badge/types-pyright-blue)](https://github.com/microsoft/pyright)
|
||||
[![Types](https://img.shields.io/badge/types-mypy-blue)](https://github.com/python/mypy)
|
||||
[![Tests](https://img.shields.io/badge/tests-pytest%20%7C%20tox-yellow)](https://github.com/pytest-dev/pytest/)
|
||||
[![Coverage](https://img.shields.io/badge/coverage-coveragepy-green)](https://github.com/nedbat/coveragepy)
|
||||
[![License](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/)
|
||||
[![Compatibility](https://img.shields.io/badge/python-3.11-blue)]()
|
||||
|
||||
---
|
||||
|
||||
|
@ -42,19 +36,19 @@ you just want the folder with all the pictures use the flag `--format ""`.
|
|||
|
||||
## _Currently_ Supported sites
|
||||
|
||||
- [Mangadex.org](https://mangadex.org/)
|
||||
- [Mangadex.org](https://mangadex.org/)
|
||||
|
||||
## Features (not complete)
|
||||
|
||||
- Metadata support with [ComicInfo.xml](https://anansi-project.github.io/docs/comicinfo/intro)
|
||||
- Json caching
|
||||
- Custom hooks after/before each download
|
||||
- Custom chapter name format
|
||||
- Volume support
|
||||
- Multiple archive formats supported (cbz,cbr,zip,none)
|
||||
- Language selection
|
||||
- Download all chapters directly
|
||||
- And others...
|
||||
- Metadata support with [ComicInfo.xml](https://anansi-project.github.io/docs/comicinfo/intro)
|
||||
- Json caching
|
||||
- Custom hooks after/before each download
|
||||
- Custom chapter name format
|
||||
- Volume support
|
||||
- Multiple archive formats supported (cbz,cbr,zip,none)
|
||||
- Language selection
|
||||
- Download all chapters directly
|
||||
- And others...
|
||||
|
||||
## Usage
|
||||
|
||||
|
@ -146,10 +140,10 @@ If you encounter any bugs, also just open an issue with a description of the pro
|
|||
|
||||
## TODO's
|
||||
|
||||
- <del>Make docker container for easy distribution</del>
|
||||
--> [Dockerhub](https://hub.docker.com/r/olofvndrhr/manga-dlp)
|
||||
- <del>Automate release</del>
|
||||
--> Done with woodpecker-ci
|
||||
- <del>Make pypi package</del>
|
||||
--> Done with release [2.1.7](https://pypi.org/project/manga-dlp/)
|
||||
- Add more supported sites
|
||||
- <del>Make docker container for easy distribution</del>
|
||||
--> [Dockerhub](https://hub.docker.com/r/olofvndrhr/manga-dlp)
|
||||
- <del>Automate release</del>
|
||||
--> Done with woodpecker-ci
|
||||
- <del>Make pypi package</del>
|
||||
--> Done with release [2.1.7](https://pypi.org/project/manga-dlp/)
|
||||
- Add more supported sites
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from typing import Dict, List, Union
|
||||
from typing import Dict, List
|
||||
|
||||
from mangadlp.models import ChapterData, ComicInfo
|
||||
|
||||
|
@ -40,7 +40,7 @@ class YourAPI:
|
|||
self.manga_uuid = "abc"
|
||||
self.manga_title = "abc"
|
||||
self.chapter_list = ["1", "2", "2.1", "5", "10"]
|
||||
self.manga_chapter_data: dict[str, ChapterData] = { # example data
|
||||
self.manga_chapter_data: Dict[str, ChapterData] = { # example data
|
||||
"1": {
|
||||
"uuid": "abc",
|
||||
"volume": "1",
|
||||
|
@ -57,7 +57,7 @@ class YourAPI:
|
|||
},
|
||||
}
|
||||
# or with --forcevol
|
||||
self.manga_chapter_data: dict[str, ChapterData] = {
|
||||
self.manga_chapter_data: Dict[str, ChapterData] = {
|
||||
"1:1": {
|
||||
"uuid": "abc",
|
||||
"volume": "1",
|
||||
|
@ -72,7 +72,7 @@ class YourAPI:
|
|||
},
|
||||
}
|
||||
|
||||
def get_chapter_images(self, chapter: str, wait_time: float) -> list[str]:
|
||||
def get_chapter_images(self, chapter: str, wait_time: float) -> List[str]:
|
||||
"""Get chapter images as a list (full links).
|
||||
|
||||
Args:
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
#!/bin/bash
|
||||
# shellcheck disable=SC2016
|
||||
|
||||
# script to extract the release notes from the changelog
|
||||
|
||||
# show script help
|
||||
function show_help() {
|
||||
cat << EOF
|
||||
|
||||
Script to generate release-notes from a changelog (CHANGELOG.md)
|
||||
|
||||
Usage:
|
||||
./get_release_notes.sh <new_version>
|
||||
|
||||
|
||||
Example:
|
||||
./get_release_notes.sh "2.0.5"
|
||||
or
|
||||
./get_release_notes.sh "latest"
|
||||
|
||||
EOF
|
||||
exit 0
|
||||
}
|
||||
|
||||
# create changelog for release
|
||||
function get_release_notes() {
|
||||
local l_version="${1}"
|
||||
|
||||
printf 'Creating release-notes\n'
|
||||
# check for version
|
||||
if [[ -z "${l_version}" ]]; then
|
||||
printf 'You need to specify a version with $1\n'
|
||||
exit 1
|
||||
fi
|
||||
if [[ ${l_version,,} == "latest" ]]; then
|
||||
l_version="$(grep -o -E "^##\s\[[0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2}\]" CHANGELOG.md | head -n 1 | grep -o -E "[0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2}")"
|
||||
fi
|
||||
awk -v ver="[${l_version}]" \
|
||||
'/^## / { if (p) { exit }; if ($2 == ver) { p=1 } } p && NF' \
|
||||
'CHANGELOG.md' > 'RELEASENOTES.md'
|
||||
printf 'Done\n'
|
||||
}
|
||||
|
||||
# check options
|
||||
case "${1}" in
|
||||
'--help' | '-h' | 'help')
|
||||
show_help
|
||||
;;
|
||||
*)
|
||||
get_release_notes "${@}"
|
||||
;;
|
||||
esac
|
42
justfile
42
justfile
|
@ -6,7 +6,7 @@ set shell := ["bash", "-uc"]
|
|||
set dotenv-load
|
||||
|
||||
show_receipts:
|
||||
@just --list
|
||||
just --list
|
||||
|
||||
show_system_info:
|
||||
@echo "=================================="
|
||||
|
@ -18,58 +18,58 @@ show_system_info:
|
|||
@echo "=================================="
|
||||
|
||||
setup:
|
||||
@asdf install
|
||||
@lefthook install
|
||||
asdf install
|
||||
lefthook install
|
||||
|
||||
create_venv:
|
||||
@echo "creating venv"
|
||||
@python3 -m pip install --upgrade pip setuptools wheel
|
||||
@python3 -m venv venv
|
||||
python3 -m pip install --upgrade pip setuptools wheel
|
||||
python3 -m venv venv
|
||||
|
||||
install_deps:
|
||||
@echo "installing dependencies"
|
||||
@python3 -m hatch dep show requirements --project-only > /tmp/requirements.txt
|
||||
@pip3 install -r /tmp/requirements.txt
|
||||
python3 -m hatch dep show requirements --project-only > /tmp/requirements.txt
|
||||
pip3 install -r /tmp/requirements.txt
|
||||
|
||||
install_deps_dev:
|
||||
@echo "installing dev dependencies"
|
||||
@python3 -m hatch dep show requirements --project-only > /tmp/requirements.txt
|
||||
@python3 -m hatch dep show requirements --env-only >> /tmp/requirements.txt
|
||||
@pip3 install -r /tmp/requirements.txt
|
||||
python3 -m hatch dep show requirements --project-only > /tmp/requirements.txt
|
||||
python3 -m hatch dep show requirements --env-only >> /tmp/requirements.txt
|
||||
pip3 install -r /tmp/requirements.txt
|
||||
|
||||
create_reqs:
|
||||
@echo "creating requirements"
|
||||
@pipreqs --force --savepath requirements.txt src/mangadlp/
|
||||
pipreqs --force --savepath requirements.txt src/mangadlp/
|
||||
|
||||
test_shfmt:
|
||||
@find . -type f \( -name "**.sh" -and -not -path "./.**" -and -not -path "./venv**" \) -exec shfmt -d -i 4 -bn -ci -sr "{}" \+;
|
||||
find . -type f \( -name "**.sh" -and -not -path "./.**" -and -not -path "./venv**" \) -exec shfmt -d -i 4 -bn -ci -sr "{}" \+;
|
||||
|
||||
format_shfmt:
|
||||
@find . -type f \( -name "**.sh" -and -not -path "./.**" -and -not -path "./venv**" \) -exec shfmt -w -i 4 -bn -ci -sr "{}" \+;
|
||||
find . -type f \( -name "**.sh" -and -not -path "./.**" -and -not -path "./venv**" \) -exec shfmt -w -i 4 -bn -ci -sr "{}" \+;
|
||||
|
||||
lint:
|
||||
just show_system_info
|
||||
just test_shfmt
|
||||
@hatch run lint:style
|
||||
@hatch run lint:typing
|
||||
hatch run lint:style
|
||||
hatch run lint:typing
|
||||
|
||||
format:
|
||||
just show_system_info
|
||||
just format_shfmt
|
||||
@hatch run lint:fmt
|
||||
hatch run lint:fmt
|
||||
|
||||
check:
|
||||
just format
|
||||
just lint
|
||||
just format
|
||||
|
||||
test:
|
||||
@hatch run default:test
|
||||
hatch run default:test
|
||||
|
||||
coverage:
|
||||
@hatch run default:cov
|
||||
hatch run default:cov
|
||||
|
||||
build:
|
||||
@hatch build --clean
|
||||
hatch build --clean
|
||||
|
||||
run loglevel *flags:
|
||||
@hatch run mangadlp --loglevel {{loglevel}} {{flags}}
|
||||
hatch run mangadlp --loglevel {{loglevel}} {{flags}}
|
||||
|
|
|
@ -27,7 +27,7 @@ dependencies = [
|
|||
"click-option-group>=0.5.5",
|
||||
"xmltodict>=0.13.0",
|
||||
"img2pdf>=0.4.4",
|
||||
"pytz==2022.1",
|
||||
"pytz>=2022.1",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
|
@ -45,18 +45,18 @@ source = "regex_commit"
|
|||
path = "src/mangadlp/__about__.py"
|
||||
tag_sign = false
|
||||
|
||||
[tool.hatch.build]
|
||||
ignore-vcs = true
|
||||
|
||||
[tool.hatch.build.targets.sdist]
|
||||
packages = ["src/mangadlp"]
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/mangadlp"]
|
||||
|
||||
###
|
||||
### envs
|
||||
###
|
||||
|
||||
[tool.hatch.envs.default]
|
||||
python = "3.11"
|
||||
dependencies = [
|
||||
"pytest==7.4.3",
|
||||
"coverage==7.3.2",
|
||||
|
@ -76,17 +76,26 @@ python = ["3.8", "3.9", "3.10", "3.11"]
|
|||
[tool.hatch.envs.lint]
|
||||
detached = true
|
||||
dependencies = [
|
||||
"mypy==1.7.1",
|
||||
"ruff==0.1.7",
|
||||
"mypy==1.8.0",
|
||||
"ruff==0.2.2",
|
||||
]
|
||||
|
||||
[tool.hatch.envs.lint.scripts]
|
||||
typing = "mypy --non-interactive --install-types {args:src/mangadlp}"
|
||||
style = ["ruff check --diff {args:src/mangadlp}", "ruff format --check --diff {args:src/mangadlp}"]
|
||||
fmt = ["ruff format {args:src/mangadlp}", "ruff check --fix {args:src/mangadlp}", "style"]
|
||||
style = [
|
||||
"ruff check --diff {args:.}",
|
||||
"ruff format --check --diff {args:.}"
|
||||
]
|
||||
fmt = [
|
||||
"ruff check --fix {args:.}",
|
||||
"ruff format {args:.}",
|
||||
"style"
|
||||
]
|
||||
all = ["style", "typing"]
|
||||
|
||||
###
|
||||
### ruff
|
||||
###
|
||||
|
||||
[tool.ruff]
|
||||
target-version = "py38"
|
||||
|
@ -94,7 +103,6 @@ line-length = 100
|
|||
indent-width = 4
|
||||
fix = true
|
||||
show-fixes = true
|
||||
ignore-init-module-imports = true
|
||||
respect-gitignore = true
|
||||
src = ["src", "tests"]
|
||||
exclude = [
|
||||
|
@ -112,6 +120,7 @@ exclude = [
|
|||
"dist",
|
||||
"node_modules",
|
||||
"venv",
|
||||
"contrib"
|
||||
]
|
||||
|
||||
[tool.ruff.lint]
|
||||
|
@ -142,6 +151,7 @@ select = [
|
|||
"W",
|
||||
"YTT",
|
||||
]
|
||||
ignore-init-module-imports = true
|
||||
ignore = ["E501", "D103", "D100", "D102", "PLR2004", "D403", "ISC001", "FBT001", "FBT002", "FBT003", "W505"]
|
||||
unfixable = ["F401"]
|
||||
|
||||
|
@ -150,39 +160,42 @@ quote-style = "double"
|
|||
indent-style = "space"
|
||||
skip-magic-trailing-comma = false
|
||||
line-ending = "lf"
|
||||
docstring-code-format = true
|
||||
|
||||
[tool.ruff.per-file-ignores]
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"__init__.py" = ["D104"]
|
||||
"__about__.py" = ["D104", "F841"]
|
||||
"tests/**/*" = ["PLR2004", "S101", "TID252"]
|
||||
"tests/**/*" = ["PLR2004", "S101", "TID252", "T201", "ARG001", "S603", "S605"]
|
||||
|
||||
[tool.ruff.pyupgrade]
|
||||
[tool.ruff.lint.pyupgrade]
|
||||
keep-runtime-typing = true
|
||||
|
||||
[tool.ruff.isort]
|
||||
[tool.ruff.lint.isort]
|
||||
lines-after-imports = 2
|
||||
known-first-party = ["mangadlp"]
|
||||
|
||||
[tool.ruff.flake8-tidy-imports]
|
||||
[tool.ruff.lint.flake8-tidy-imports]
|
||||
ban-relative-imports = "all"
|
||||
|
||||
[tool.ruff.pylint]
|
||||
[tool.ruff.lint.pylint]
|
||||
max-branches = 24
|
||||
max-returns = 12
|
||||
max-statements = 100
|
||||
max-args = 15
|
||||
allow-magic-value-types = ["str", "bytes", "complex", "float", "int"]
|
||||
|
||||
[tool.ruff.mccabe]
|
||||
[tool.ruff.lint.mccabe]
|
||||
max-complexity = 15
|
||||
|
||||
[tool.ruff.pydocstyle]
|
||||
[tool.ruff.lint.pydocstyle]
|
||||
convention = "google"
|
||||
|
||||
[tool.ruff.pycodestyle]
|
||||
[tool.ruff.lint.pycodestyle]
|
||||
max-doc-length = 100
|
||||
|
||||
###
|
||||
### mypy
|
||||
###
|
||||
|
||||
[tool.mypy]
|
||||
#plugins = ["pydantic.mypy"]
|
||||
|
@ -204,16 +217,20 @@ show_error_context = true
|
|||
#init_typed = true
|
||||
#warn_required_dynamic_aliases = true
|
||||
|
||||
###
|
||||
### pytest
|
||||
###
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
pythonpath = ["src"]
|
||||
addopts = "--color=yes --exitfirst --verbose -ra"
|
||||
#addopts = "--color=yes --exitfirst --verbose -ra --capture=tee-sys"
|
||||
filterwarnings = [
|
||||
'ignore:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning',
|
||||
]
|
||||
|
||||
###
|
||||
### coverage
|
||||
###
|
||||
|
||||
[tool.coverage.run]
|
||||
source_pkgs = ["mangadlp", "tests"]
|
||||
|
@ -222,8 +239,8 @@ parallel = true
|
|||
omit = ["src/mangadlp/__about__.py"]
|
||||
|
||||
[tool.coverage.paths]
|
||||
testproj = ["src/mangadlp", "*/mangadlp/src/mangadlp"]
|
||||
tests = ["tests", "*/mangadlp/tests"]
|
||||
mangadlp = ["src/mangadlp", "*/manga-dlp/src/mangadlp"]
|
||||
tests = ["tests", "*/manga-dlp/tests"]
|
||||
|
||||
[tool.coverage.report]
|
||||
# Regexes for lines to exclude from consideration
|
||||
|
|
|
@ -1 +1 @@
|
|||
__version__ = "2.4.0"
|
||||
__version__ = "2.4.1"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import shutil
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
|
||||
import pytest
|
||||
import requests
|
||||
|
@ -18,7 +19,7 @@ def test_downloader():
|
|||
]
|
||||
chapter_path = Path("tests/test_folder1")
|
||||
chapter_path.mkdir(parents=True, exist_ok=True)
|
||||
images: list[str] = []
|
||||
images: List[str] = []
|
||||
downloader.download_chapter(urls, str(chapter_path), 2)
|
||||
for file in chapter_path.iterdir():
|
||||
images.append(file.name)
|
||||
|
|
|
@ -52,7 +52,7 @@ def test_no_volume():
|
|||
|
||||
def test_readin_list():
|
||||
list_file = "tests/test_list.txt"
|
||||
test_list = mdlpinput.readin_list(None, None, list_file)
|
||||
test_list = mdlpinput.readin_list(None, None, list_file)
|
||||
|
||||
assert test_list == [
|
||||
"https://mangadex.org/title/a96676e5-8ae2-425e-b549-7f15dd34a6d8/komi-san-wa-komyushou-desu",
|
||||
|
|
|
@ -389,11 +389,11 @@ def test_chapter_metadata():
|
|||
forcevol = False
|
||||
test = Mangadex(url_uuid, language, forcevol)
|
||||
chapter_metadata = test.create_metadata("1")
|
||||
manga_name = chapter_metadata["Series"]
|
||||
chapter_name = chapter_metadata["Title"]
|
||||
chapter_num = chapter_metadata["Number"]
|
||||
chapter_volume = chapter_metadata["Volume"]
|
||||
chapter_url = chapter_metadata["Web"]
|
||||
manga_name = chapter_metadata["Series"]
|
||||
chapter_name = chapter_metadata["Title"]
|
||||
chapter_num = chapter_metadata["Number"]
|
||||
chapter_volume = chapter_metadata["Volume"]
|
||||
chapter_url = chapter_metadata["Web"]
|
||||
|
||||
assert (manga_name, chapter_name, chapter_volume, chapter_num, chapter_url) == (
|
||||
"Komi-san wa Komyushou Desu",
|
||||
|
|
|
@ -3,6 +3,7 @@ import platform
|
|||
import shutil
|
||||
import time
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
|
||||
import pytest
|
||||
from pytest import MonkeyPatch
|
||||
|
@ -165,7 +166,7 @@ def test_full_with_input_skip_folder(wait_10s: MonkeyPatch):
|
|||
chapter_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
os.system(f"python3 {script_path} {command_args}")
|
||||
found_files: list[str] = []
|
||||
found_files: List[str] = []
|
||||
for file in chapter_path.iterdir():
|
||||
found_files.append(file.name)
|
||||
|
||||
|
|
Loading…
Reference in a new issue