Skip to content

Commit 1c1a94c

Browse files
authored
Create python-package.yml (#35)
* Create python-package.yml * add numpy to dependencies * add pylint and pytest files from paderbox * add mock test dependency * github action: set OMP_NUM_THREADS and MKL_NUM_THREADS * fix github action file * add codecov * rename github action * adjust pytest.ini for lazy_datset * add codecov and GH Action badge
1 parent 8e87927 commit 1c1a94c

File tree

5 files changed

+62
-2
lines changed

5 files changed

+62
-2
lines changed
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Run python tests
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [3.6, 3.7, 3.8]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install flake8 pytest pytest-cov codecov
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
pip install .[all]
32+
- name: Lint with flake8
33+
run: |
34+
# stop the build if there are Python syntax errors or undefined names
35+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38+
- name: Test with pytest
39+
run: |
40+
pytest
41+
env:
42+
OMP_NUM_THREADS: 1
43+
MKL_NUM_THREADS: 1
44+
- name: Codecov
45+
run: |
46+
codecov

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# lazy_dataset
22

33
[![Build Status](https://travis-ci.org/fgnt/lazy_dataset.svg?branch=master)](https://travis-ci.org/fgnt/lazy_dataset)
4+
![Build GH Actions](https://github.com/fgnt/lazy_dataset/workflows/.github/workflows/run_python_tests.yml/badge.svg)
5+
[![codecov.io](https://codecov.io/github/fgnt/lazy_dataset/coverage.svg?branch=master)](https://codecov.io/github/fgnt/lazy_dataset?branch=master)
46
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/fgnt/lazy_dataset/blob/master/LICENSE)
57

68
Lazy_dataset is a helper to deal with large datasets that do not fit into memory.

pylint.cfg

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[MESSAGES CONTROL]
2+
# R0914 Too many local variables
3+
# R0915 Too many statements
4+
# R0913 Too many arguments
5+
disable=R0914,R0915,R0913,E1101,C0103,R0902

pytest.ini

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[pytest]
2+
addopts =
3+
--doctest-modules
4+
--doctest-continue-on-failure
5+
--cov=lazy_dataset
6+
--cov-report=xml
7+
--cov-report=html

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424

2525
# What packages are required for this module to be executed?
2626
REQUIRED = [
27-
# 'requests', 'maya', 'records',
27+
'numpy',
2828
]
2929

3030
# What packages are optional?
3131
EXTRAS = {
3232
'cache': ['humanfriendly', 'psutil', 'diskcache'],
33-
# 'fancy feature': ['django'],
33+
'test': ['mock'],
3434
}
3535

3636
# The rest you shouldn't have to touch too much :)

0 commit comments

Comments
 (0)