Skip to content

Commit c62ac44

Browse files
GH-28: Write the unit tests and setup CI (GH-36)
* Fix the JSON thumbnail when `--base` is given * Add PyAV to the dependency list * Fix the relative path issue of `listdir` * Add .avi (ordinary) and .ogv (stream) videos for tests * Write unit tests for primary workflows
1 parent 7fd16c6 commit c62ac44

34 files changed

+417
-1396
lines changed

.github/workflows/tests.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Tests
2+
3+
on:
4+
- pull_request
5+
6+
jobs:
7+
test:
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ ubuntu-latest, windows-latest, macOS-latest ]
12+
python-version: [ "3.7", "3.8", "3.9" ]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install tox tox-gh-actions
24+
- name: Test with tox
25+
run: tox

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
*/package-lock.json
2-
*/node_modules
3-
*/build
1+
.idea
2+
.tox

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Thumbnails <img src="https://github.com/pysnippet.png" align="right" height="64" />
22

3+
[![PyPI](https://img.shields.io/pypi/v/thumbnails.svg)](https://pypi.org/project/thumbnails/)
4+
[![Tests](https://github.com/pysnippet/thumbnails/actions/workflows/tests.yml/badge.svg)](https://github.com/pysnippet/thumbnails/actions/workflows/tests.yml)
35
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ab5414af4c9546fe97ad64365e2a66f0)](https://www.codacy.com?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=pysnippet/thumbnails&amp;utm_campaign=Badge_Grade)
46
[![License](https://img.shields.io/pypi/l/thumbnails.svg)](https://github.com/pysnippet/thumbnails/blob/master/LICENSE)
57

@@ -28,6 +30,30 @@ Video.js also can handle **JSON** formatted thumbnails' metadata, and this tool
2830
thumbnails --help
2931
```
3032

33+
[//]: # (TODO: usage for CLI and python API)
34+
35+
## Development
36+
37+
Install the dependencies:
38+
```bash
39+
python3 -m pip install -r requirements.txt
40+
```
41+
42+
Install the development dependencies:
43+
```bash
44+
python3 -m pip install -r requirements-dev.txt
45+
```
46+
47+
Install the package in editable mode:
48+
```bash
49+
python3 -m pip install -e .
50+
```
51+
52+
Run the tests to ensure everything is working before opening a PR:
53+
```bash
54+
tox
55+
```
56+
3157
## Contribute
3258

3359
Everyone is welcome to contribute to this project. Please read the [contribution guidelines](https://github.com/pysnippet/instructions#readme)

plyr/README.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

plyr/package.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

plyr/plyr.conf

Lines changed: 0 additions & 13 deletions
This file was deleted.

plyr/public/index.html

Lines changed: 0 additions & 11 deletions
This file was deleted.

plyr/src/index.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[build-system]
2+
requires = ["setuptools>=42.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.pytest.ini_options]
6+
testpaths = ["tests"]
7+
filterwarnings = ["ignore::DeprecationWarning"]

requirements-dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tox==3.24.3
2+
pytest==6.2.5

0 commit comments

Comments
 (0)