Skip to content

Commit 75a70c6

Browse files
refactor requirements and fix coveralls
1 parent 44d0ef5 commit 75a70c6

File tree

6 files changed

+47
-17
lines changed

6 files changed

+47
-17
lines changed

.coveragerc

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
2+
# Docs: https://coverage.readthedocs.org/en/latest/config.html
3+
14
[run]
25
concurrency = gevent
36
omit =
47
steam/protobufs/*
58
steam/enums/*
9+
10+
branch = False
11+
12+
# If True, stores relative file paths in data file (needed for Github Actions).
13+
# Using this parameter requires coverage>=5.0
14+
relative_files = True

.github/workflows/testing_initiative.yml

+22-8
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,33 @@ jobs:
4848
run: python -c "import sys; print(sys.version)"
4949
- name: Install dependencies
5050
run: |
51-
pip install -r requirements.txt
52-
pip install coveralls
51+
make init
5352
- name: Run Tests
54-
env:
55-
PYTHONHASHSEED: "0"
5653
run: |
57-
pytest --cov=steam tests
58-
- name: Coveralls
54+
make test
55+
- name: Upload to Coveralls
5956
env:
6057
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
58+
COVERALLS_PARALLEL: true
59+
COVERALLS_FLAG_NAME: "${{ matrix.os }}_${{ matrix.python-version }}"
6260
run: |
63-
coveralls
61+
coveralls --service=github
62+
63+
coveralls:
64+
name: Finish Coveralls
65+
needs: test
66+
runs-on: ubuntu-latest
67+
container: python:3-slim
68+
steps:
69+
- name: Install coveralls
70+
run: |
71+
pip3 install --upgrade coveralls
72+
- name: Send coverage finish to coveralls.io
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
run: |
76+
coveralls --finish
77+
6478
build-docs:
6579
runs-on: ${{ matrix.os }}
6680
strategy:

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ help:
2525
@echo "$$HELPBODY"
2626

2727
init: init_docs
28-
pip install -r requirements.txt
28+
pip install -r dev_requirements.txt
2929

3030
init_docs:
3131
pip install sphinx==1.8.5 sphinx_rtd_theme
3232

3333
test:
3434
coverage erase
35-
PYTHONHASHSEED=0 pytest --cov=steam tests
35+
PYTHONHASHSEED=0 pytest --tb=short --cov-config .coveragerc --cov=steam tests
3636

3737
webauth_gen:
3838
rm -f vcr/webauth*

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ IRC: irc.freenode.net / #steamkit (`join via webchat <https://webchat.freenode.n
113113
:target: https://pypi.python.org/pypi/steam
114114
:alt: MIT License
115115

116-
.. |coverage| image:: https://scrutinizer-ci.com/g/ValvePython/steam/badges/coverage.png?b=master
117-
:target: https://scrutinizer-ci.com/g/ValvePython/steam/?branch=master
116+
.. |coverage| image:: https://img.shields.io/coveralls/ValvePython/steam/master.svg?style=flat
117+
:target: https://coveralls.io/r/ValvePython/steam?branch=master
118118
:alt: Test coverage
119119

120120
.. |sonar_maintainability| image:: https://sonarcloud.io/api/project_badges/measure?project=ValvePython_steam&metric=sqale_rating

dev_requirements.txt

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
-r requirements.txt
3+
4+
vcrpy==2.0.1
5+
mock==1.3.0
6+
7+
coverage>=5.0; python_version == '2.7' or python_version >= '3.5'
8+
pytest-cov>=2.7.0; python_version == '2.7' or python_version >= '3.5'
9+
10+
# coveralls 2.0 has removed support for Python 2.7 and 3.4
11+
git+https://github.com/andy-maier/coveralls-python.git@andy/add-py27#egg=coveralls; python_version == '2.7'
12+
coveralls>=2.1.2; python_version >= '3.5'

requirements.txt

-5
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,5 @@ gevent>=1.3.0
66
protobuf>=3.0.0
77
gevent-eventemitter>=2.1
88
enum34==1.1.2; python_version < '3.4'
9-
coverage==4.0.3
10-
pytest==3.2.1
11-
pytest-cov==2.5.1
12-
mock==1.3.0
139
PyYAML==5.1
14-
vcrpy==2.0.1
1510
cachetools>=3.0.0

0 commit comments

Comments
 (0)