Skip to content

Commit abe4b74

Browse files
committed
Close #19 - Updated tests and project to Python 3.9
1 parent c511646 commit abe4b74

File tree

6 files changed

+22
-15
lines changed

6 files changed

+22
-15
lines changed

.github/workflows/python-test-dev.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name: Python Test Github Dev Version
44

55
on:
6-
[push, pull_request, discussion, issues]
6+
[push, pull_request, discussion, release, issues]
77

88
jobs:
99
test:
@@ -18,16 +18,17 @@ jobs:
1818
- name: Set up Python
1919
uses: actions/setup-python@v4
2020
with:
21-
python-version: '3.7'
21+
python-version: '3.9'
2222
- name: Install dependencies
2323
run: |
2424
cd howlongtobeatpy
2525
python -m pip install --upgrade pip
26-
pip install nose codecov
26+
pip install -U pytest
27+
pip install codecov
2728
pip install .
2829
- name: Test
2930
run: |
30-
nosetests howlongtobeatpy --with-coverage
31+
coverage run -m pytest -v && coverage report -m
3132
coverage xml
3233
- name: Upload Coverage codecov
3334
env:

.github/workflows/python-test-release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflows will test the released version of the API
22

3-
name: Python Test Released Published Version
3+
name: Python Test Scheduled
44

55
on:
66
release:
@@ -26,14 +26,15 @@ jobs:
2626
- name: Set up Python
2727
uses: actions/setup-python@v4
2828
with:
29-
python-version: '3.7'
29+
python-version: '3.9'
3030
- name: Install dependencies
3131
run: |
3232
python -m pip install --upgrade pip
33-
pip install howlongtobeatpy nose codecov
33+
pip install -U pytest
34+
pip install howlongtobeatpy codecov
3435
- name: Test
3536
run: |
36-
nosetests howlongtobeatpy --with-coverage
37+
coverage run -m pytest -v && coverage report -m
3738
coverage xml
3839
- name: Upload Coverage codecov
3940
env:

howlongtobeatpy/howlongtobeatpy/HTMLRequests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def get_search_request_headers():
3636
headers = {
3737
'content-type': 'application/json',
3838
'accept': '*/*',
39-
'User-Agent': ua.random,
39+
'User-Agent': ua.random.strip(),
4040
'referer': HTMLRequests.REFERER_HEADER
4141
}
4242
return headers

howlongtobeatpy/howlongtobeatpy/HowLongToBeat.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ---------------------------------------------------------------------
22
# IMPORTS
3+
import asyncio
4+
import platform
35

46
from .HTMLRequests import HTMLRequests, SearchModifiers
57
from .JSONResultParser import JSONResultParser
@@ -24,6 +26,9 @@ def __init__(self, input_minimum_similarity: float = 0.4):
2426
"""
2527
self.minimum_similarity = input_minimum_similarity
2628

29+
if platform.system() == 'Windows':
30+
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
31+
2732
# ------------------------------------------
2833
# (Standard) Search functions using game name
2934
# ------------------------------------------

howlongtobeatpy/setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
long_description = fh.read()
55

66
setup(name='howlongtobeatpy',
7-
version='1.0.3',
7+
version='1.0.5',
88
packages=find_packages(exclude=['tests']),
99
description='A Python API for How Long to Beat',
1010
long_description=long_description,
@@ -14,9 +14,9 @@
1414
license='MIT',
1515
keywords='howlongtobeat gaming steam uplay origin time length how long to beat',
1616
install_requires=[
17-
'aiohttp>=3.7.3',
18-
'requests>=2.25.1',
19-
'aiounittest>=1.4.0',
17+
'aiohttp>=3.8.3',
18+
'requests>=2.28.1',
19+
'aiounittest>=1.4.2',
2020
'fake_useragent>=1.1.0'
2121
],
2222
zip_safe=False)

sonar-project.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ sonar.organization=scrappycocco-github
22
sonar.projectKey=ScrappyCocco_HowLongToBeat-PythonAPI
33

44
sonar.projectName=HowLongToBeat-PythonAPI
5-
sonar.projectVersion=1.0.3
6-
sonar.python.version=3.6
5+
sonar.projectVersion=1.0.5
6+
sonar.python.version=3.9
77

88
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
99
# This property is optional if sonar.modules is set.

0 commit comments

Comments
 (0)