Skip to content

Commit b040651

Browse files
committed
Create Makefile. Create python-package.yml
1 parent e594bb8 commit b040651

File tree

4 files changed

+74
-1
lines changed

4 files changed

+74
-1
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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: Python package
5+
6+
on: [push, pull_request]
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: [2.7,3.5,3.6,3.7, 3.8,3.9]
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Install dependencies
24+
run: |
25+
sudo apt-get update -qq
26+
sudo apt-get install -qq swig python-dev libxml2-dev libxmlsec1-dev
27+
make install-req
28+
make install-test
29+
30+
- name: Test
31+
run: |
32+
make pytest
33+
make pycodestyle
34+
make flake8
35+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ __pycache_
1414
/*.eg
1515
*.egg-info
1616
/eggs
17+
/.eggs
1718
/build
1819
/dist
1920
/venv
2021
.coverage
2122
.pypirc
2223
/.idea
2324
.mypy_cache/
25+
.pytest_cache
2426

2527
*.key
2628
*.crt

Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
PIP=pip
2+
FLAKE8=flake8
3+
PYTEST=pytest
4+
PYCODESTYLE=pycodestyle
5+
COVERAGE=coverage
6+
COVERAGE_CONFIG=tests/coverage.rc
7+
PEP8_CONFIG=tests/pep8.rc
8+
MAIN_SOURCE=src/onelogin/saml2
9+
DEMOS=demo-django demo-flask
10+
TESTS=tests/src/OneLogin/saml2_tests
11+
SOURCES=$(MAIN_SOURCE) $(DEMO) $(TESTS)
12+
13+
install-req:
14+
$(PIP) install --upgrade 'setuptools<45.0.0'
15+
$(PIP) install .
16+
17+
install-test:
18+
$(PIP) install -e ".[test]"
19+
20+
pytest:
21+
$(COVERAGE) run --source $(MAIN_SOURCE) --rcfile=$(COVERAGE_CONFIG) -m pytest
22+
$(COVERAGE) report -m --rcfile=$(COVERAGE_CONFIG)
23+
24+
pycodestyle:
25+
$(PYCODESTYLE) --ignore=E501,E731,W504 $(SOURCES) --config=$(PEP8_CONFIG)
26+
27+
flake8:
28+
$(FLAKE8) --ignore=E501,E731,W504 $(SOURCES)
29+
30+
clean:
31+
rm -rf .pytest_cache/
32+
rm -rf .eggs/
33+
find . -type d -name "__pycache__" -exec rm -r {} +
34+
find . -type d -name "*.egg-info" -exec rm -r {} +
35+
rm .coverage

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
'freezegun>=0.3.11, <=1.1.0',
5050
'pylint==1.9.4',
5151
'flake8>=3.6.0',
52-
'coveralls==1.5.1',
52+
'coveralls>=1.11.1',
53+
'pytest>=4.6',
5354
),
5455
},
5556
keywords='saml saml2 xmlsec django flask pyramid python3',

0 commit comments

Comments
 (0)