Matthew Kutarna commited on
Commit
bd3f7ed
1 Parent(s): 8f3a9fc

Updating tests, formatting, structure (#2)

Browse files

* Added MIT license file

* Added dummy test file for CI

* Added gitignore file and exploration notebook

* Adding pytest, pytest-cov, flake8

* Deleted jupyter notebook

Files changed (6) hide show
  1. .coveragerc +20 -0
  2. .flake8 +6 -0
  3. .github/workflows/python-app.yml +3 -3
  4. .gitignore +127 -0
  5. pytest.ini +4 -0
  6. tests/test_dummy.py +1 -1
.coveragerc ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # .coveragec for audiobook_gen
3
+
4
+ [run]
5
+ # data_file = put a coverage file name here!!!
6
+
7
+ [report]
8
+ # Regexes for lines to exclude from consideration
9
+ exclude_lines =
10
+ # Have to re-enable the standard pragma
11
+ pragma: no cover
12
+ omit =
13
+ tests/*
14
+ notesbooks/*
15
+
16
+ [html]
17
+ # directory = put a directory here!!!!
18
+
19
+ [tool:pytest]
20
+ addopts = --cov=audiobook_gen --cov-report html
.flake8 CHANGED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ [flake8]
2
+ max-line-length = 120
3
+ max-complexity = 18
4
+ exclude =
5
+ notebooks/*
6
+ */.ipynb_checkpoints/*
.github/workflows/python-app.yml CHANGED
@@ -26,7 +26,7 @@ jobs:
26
  - name: Install dependencies
27
  run: |
28
  python -m pip install --upgrade pip
29
- pip install flake8 pytest
30
  if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31
  - name: Lint with flake8
32
  run: |
@@ -34,6 +34,6 @@ jobs:
34
  flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35
  # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36
  flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37
- - name: Test with pytest
38
  run: |
39
- pytest
 
26
  - name: Install dependencies
27
  run: |
28
  python -m pip install --upgrade pip
29
+ pip install flake8 pytest pytest-cov
30
  if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31
  - name: Lint with flake8
32
  run: |
 
34
  flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35
  # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36
  flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37
+ - name: Test and coverage with pytest and pytest-cov
38
  run: |
39
+ pytest --cov-config=.coveragerc --cov=audiobook_gen tests/
.gitignore CHANGED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Gemfile.lock
2
+ collect_env.py
3
+ tmp*
4
+ Untitled*.ipynb
5
+ *.bak
6
+ token
7
+ .idea/
8
+ docs/
9
+ conda/
10
+ tmp/
11
+
12
+ tags
13
+ *~
14
+ ~*
15
+ *.swp
16
+ .gitconfig
17
+ # Byte-compiled / optimized / DLL files
18
+ __pycache__/
19
+ **/__pycache__/
20
+ *.py[cod]
21
+ *$py.class
22
+
23
+ # C extensions
24
+ *.so
25
+
26
+ # Distribution / packaging
27
+ .Python
28
+ build/
29
+ develop-eggs/
30
+ dist/
31
+ downloads/
32
+ eggs/
33
+ .eggs/
34
+ lib/
35
+ lib64/
36
+ parts/
37
+ sdist/
38
+ var/
39
+ wheels/
40
+ *.egg-info/
41
+ .installed.cfg
42
+ *.egg
43
+ MANIFEST
44
+
45
+ # PyInstaller
46
+ # Usually these files are written by a python script from a template
47
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
48
+ *.manifest
49
+ *.spec
50
+
51
+ # Installer logs
52
+ pip-log.txt
53
+ pip-delete-this-directory.txt
54
+
55
+ # Unit test / coverage reports
56
+ htmlcov/
57
+ .tox/
58
+ .coverage
59
+ .coverage.*
60
+ .cache
61
+ nosetests.xml
62
+ coverage.xml
63
+ *.cover
64
+ .hypothesis/
65
+ .pytest_cache/
66
+
67
+ # Translations
68
+ *.mo
69
+ *.pot
70
+
71
+ # Django stuff:
72
+ *.log
73
+ local_settings.py
74
+ db.sqlite3
75
+
76
+ # Flask stuff:
77
+ instance/
78
+ .webassets-cache
79
+
80
+ # Scrapy stuff:
81
+ .scrapy
82
+
83
+ # Sphinx documentation
84
+ docs/_build/
85
+
86
+ # PyBuilder
87
+ target/
88
+
89
+ # Jupyter Notebook
90
+ .ipynb_checkpoints
91
+ **/.ipynb_checkpoints
92
+
93
+ # pyenv
94
+ .python-version
95
+
96
+ .vscode/
97
+
98
+ # celery beat schedule file
99
+ celerybeat-schedule
100
+
101
+ # SageMath parsed files
102
+ *.sage.py
103
+
104
+ # Environments
105
+ .env
106
+ .venv
107
+ env/
108
+ venv/
109
+ ENV/
110
+ env.bak/
111
+ venv.bak/
112
+
113
+ # Spyder project settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope project settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+
126
+ # Mac stuff
127
+ .DS_Store
pytest.ini ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # pytest.ini
2
+ [pytest]
3
+ testpaths =
4
+ tests
tests/test_dummy.py CHANGED
@@ -1,2 +1,2 @@
1
  def test_dummy():
2
- assert 1 == 1
 
1
  def test_dummy():
2
+ assert 1 == 1