Skip to content

Commit 7b31fc7

Browse files
Merge pull request #1182 from adamtheturtle/windows
Add Windows support
2 parents 95c2b71 + 7737127 commit 7b31fc7

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

.appveyor.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
environment:
2+
matrix:
3+
- PYTHON: "C:\\Python37"
4+
5+
build: off
6+
install:
7+
- "%PYTHON%\\python.exe -m pip install --upgrade pip setuptools"
8+
- "%PYTHON%\\python.exe -m pip install --upgrade --editable .[dev]"
9+
test_script:
10+
- "%PYTHON%\\python.exe -m pytest -vvv --exitfirst tests/ --cov-fail-under 100 --cov src --cov tests"

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Changelog
66
Next
77
----
88

9+
* Add Windows support.
10+
911
2019.11.23.0
1012
------------
1113

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
VWS-Auth-Tools==2019.12.28.3
2+
func-timeout==4.3.5
23
requests==2.23.0
3-
timeout-decorator==0.4.1
44
urllib3==1.25.8

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[check-manifest]
22
ignore =
33
*.enc
4+
.appveyor.yml
45
.coveragerc
56
.isort.cfg
67
.markdownlint.json

src/vws/vws.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
from urllib.parse import urljoin
1212

1313
import requests
14+
from func_timeout import func_set_timeout
15+
from func_timeout.exceptions import FunctionTimedOut
1416
from requests import Response
15-
from timeout_decorator import timeout
1617
from vws_auth_tools import authorization_header, rfc_1123_date
1718

1819
from vws._result_codes import raise_for_result_code
@@ -321,17 +322,17 @@ def wait_for_target_processed(
321322
time sent to Vuforia.
322323
"""
323324

324-
@timeout(
325-
seconds=timeout_seconds,
326-
timeout_exception=TargetProcessingTimeout,
327-
)
325+
@func_set_timeout(timeout=timeout_seconds)
328326
def decorated() -> None:
329327
self._wait_for_target_processed(
330328
target_id=target_id,
331329
seconds_between_requests=seconds_between_requests,
332330
)
333331

334-
decorated()
332+
try:
333+
decorated()
334+
except FunctionTimedOut:
335+
raise TargetProcessingTimeout
335336

336337
def list_targets(self) -> List[str]:
337338
"""

0 commit comments

Comments
 (0)