Clean up build script. Mention Py3.7+ in READMY

* Refactored .gitlab-ci.yml to use external scripts to reduce redundancy
* Added a package stage to the build file. Not yet complete, needs more work.
* Added a bit more meat to pyproject.toml
This commit is contained in:
Allan Mertner 2022-12-12 13:29:43 +00:00
parent 1cebfa9248
commit 719cf5db45
8 changed files with 66 additions and 36 deletions

14
.gitignore vendored
View File

@ -1,21 +1,21 @@
# Lazy User Related #
######################
cache/*
cache
cache.db*
Logs/*
lazylibrarian.db*
version.txt
*.log
.idea/*
.vscode/*
.vscode
venv/*
client*
git_helper.sh
update-version.sh
startlazy.sh
*.code-workspace
unittests/Logs/*
unittests/cache/*
unittests/Logs
unittests/cache
python_version.txt
# Bookstrap related #
@ -39,6 +39,8 @@ python_version.txt
packages
*.deb
*.rpm
dist
*.egg-info/
# IDE specific #
######################
@ -49,7 +51,8 @@ packages
*.cproject
*.tmproj
*.tmproject
.cache/*
.cache
.pytest_cache
# Pytest specific #
######################
@ -58,6 +61,7 @@ packages
lltest.xml
llmintest.xml
cov*.xml
prof
# OS generated files #
######################

View File

@ -11,10 +11,7 @@ default:
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
# Minimal modules
- python -m pip install charset_normalizer certifi idna
# Testing modules
- python -m pip install pytest mock pytest_order pytest-cov coverage
- scripts/ci/install-required-modules.sh
artifacts:
when: always
@ -26,48 +23,46 @@ default:
stages:
- test
- package
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
unittest_allmodules:
test_all_mods:
stage: test
script:
# Install optional modules
- python -m pip install pillow lxml soupsieve Levenshtein apprise requests pyopenssl urllib3
- coverage run --source=lazylibrarian/ -m pytest --junitxml=lltest.xml ./unittests/test*.py
- coverage report
- coverage xml
- scripts/ci/install-optional-modules.sh
- scripts/ci/runtests.sh
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
unittest_minimalmodules:
test_min_mods:
stage: test
script:
# Remove optional modules if they are there
- python -m pip uninstall pillow lxml soupsieve Levenshtein apprise requests pyopenssl urllib3 -y
- coverage run --source=lazylibrarian/ -m pytest --junitxml=lltest.xml ./unittests/test*.py
- coverage report
- coverage xml
- scripts/ci/remove-optional-modules.sh
- scripts/ci/runtests.sh
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
unittest_allmodules-earliest:
test_all_mods-earliest:
image: python:3.7 # Will be end of life on 24 June 2023
stage: test
script:
# Install optional modules
- python -m pip install pillow lxml soupsieve Levenshtein apprise requests pyopenssl urllib3
- coverage run --source=lazylibrarian/ -m pytest --junitxml=lltest.xml ./unittests/test*.py --verbose
- coverage report
- coverage xml
- scripts/ci/install-optional-modules.sh
- scripts/ci/runtests.sh
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
unittest_minimalmodules-earliest:
test_min_mods-earliest:
image: python:3.7 # Will be end of life on 24 June 2023
stage: test
script:
# Remove optional modules if they are there
- python -m pip uninstall pillow lxml soupsieve Levenshtein apprise requests pyopenssl urllib3 -y
- coverage run --source=lazylibrarian/ -m pytest --junitxml=lltest.xml ./unittests/test*.py --verbose
- coverage report
- coverage xml
- scripts/ci/remove-optional-modules.sh
- scripts/ci/runtests.sh
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
build_latest:
stage: package
script:
- python3 -m build
artifacts:
paths:
- dist/

View File

@ -33,7 +33,7 @@ LazyLibrarian runs by default on port 5299 at http://localhost:5299
Linux / Mac OS X:
* Install Python 2 v2.6 or higher, or Python 3 v3.5 or higher
* Install Python 3 v3.7 or higher - later is better
* Git clone/extract LL wherever you like
* Run `python LazyLibrarian.py -d` or `python LazyLibrarian.py --daemon` to start in daemon mode
* Fill in all the config (see the docs)

View File

@ -10,7 +10,10 @@ name = "LazyLibrarian"
version = "2022.12.05"
description = "LazyLibrarian is a SickBeard, CouchPotato, Headphones-like application for ebooks, audiobooks and magazines"
readme = "README.md"
requires-python = ">=3.5"
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Python :: 3",
]
dependencies = [
'bs4',
@ -32,6 +35,9 @@ dependencies = [
'deluge_client',
]
[project.urls]
"Documentation" = "https://lazylibrarian.gitlab.io/"
"Issue Tracker" = "https://gitlab.com/LazyLibrarian/LazyLibrarian/-/issues"
# Config file for pytest
[tool.pytest.ini_options]
@ -41,4 +47,4 @@ filterwarnings = [
'''ignore:'cgi' is deprecated''',
# Ignore numerous warnings from cherrypy
"ignore::DeprecationWarning: invalid escape sequence"
]
]

View File

@ -0,0 +1,5 @@
#!/bin/sh
# Script called by gitlab CI engine during test phases
# Installs optional python modules
python3 -m pip install pillow lxml soupsieve Levenshtein apprise requests pyopenssl urllib3

View File

@ -0,0 +1,8 @@
#!/bin/bash
# Script called by gitlab CI engine during test phases
# Installs python modules required for LL and unit testing
# Minimal modules
python3 -m pip install charset_normalizer certifi idna
# Build/testing modules
python3 -m pip install pytest mock pytest_order pytest-cov coverage pytest-profiling build

View File

@ -0,0 +1,5 @@
#!/bin/sh
# Script called by gitlab CI engine during test phases
# Removes optional python modules if they are there
python3 -m pip uninstall pillow lxml soupsieve Levenshtein apprise requests pyopenssl urllib3 -y

7
scripts/ci/runtests.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# Script called by gitlab CI engine during test phases
coverage run --source=lazylibrarian/ -m pytest --junitxml=lltest.xml ./unittests/test*.py
#coverage run --source=lazylibrarian/ -m pytest --profile -v --junitxml=lltest.xml ./unittests/test*.py
coverage report
coverage xml