Packaged autophotographer and added tests and test pipelines
Some checks failed
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/test Pipeline failed

This commit is contained in:
Oscar Blue 2022-04-28 22:17:20 +01:00
parent 74875553d5
commit f35bd80767
9 changed files with 58 additions and 1 deletions

View file

@ -9,4 +9,9 @@ pipeline:
commands: commands:
- python3.8 -m pip install mypy - python3.8 -m pip install mypy
- mypy src/ - mypy src/
+branches: dev isort:
image: python:3.8
commands:
- python3.8 -m pip install isort
- isort --diff src/
branches: dev

8
.woodpecker/.test.yml Normal file
View file

@ -0,0 +1,8 @@
pipeline:
unit-tests:
image: python:3.8
commands:
- python3.8 -m pip install -r ./requirements_dev.txt -r ./requirements.txt
- python3.8 -m pip install -e .
- pytest test/ -v
branches: dev

3
pyproject.toml Normal file
View file

@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools >= 43.0.0", "wheel"]
build-backend = "setuptools.build_meta"

4
requirements_dev.txt Normal file
View file

@ -0,0 +1,4 @@
flake8==4.0.1
pytest==7.1.2
pytest-cov==3.0.0
mypy==0.950

26
setup.cfg Normal file
View file

@ -0,0 +1,26 @@
[metadata]
name = autophotographer
description = Select aesthetic frames from a video file
long_description = README.md
author = Oscar Pocock
author_email = osp1@aber.ac.uk
license = GPLv3+
license_files = LICENSE.txt
[options]
packages =
autophotographer
python_requires = >=3.8
package_dir =
=src
zip_safe = no
[options.extras_require]
testing =
flake8>=4.0
pytest>=7.1
pytest-cov>=3.0
mypy>=0.950
[flake8]
max-line-length = 160

3
setup.py Normal file
View file

@ -0,0 +1,3 @@
from setuptools import setup
if __name__ == "__main__":
setup()

2
test/pytest.ini Normal file
View file

@ -0,0 +1,2 @@
[pytest]
addopts = "--cov=autophotographer"

View file

@ -0,0 +1,6 @@
from autophotographer import autophotographer_main
import pytest
def test_load_config_nonexistent_file():
with pytest.raises(FileNotFoundError):
autophotographer_main.load_config("blahblahblah")

View file