Skip to content

Commit 410c345

Browse files
authored
Fix github workflow (#101)
* Remove tabs * Fix flake8 errors * Add quotes around the requirements file * Install the package before testing it * Rework testing to debug problems - Split install and test - Run tests only on python 2.7 * Runs tests on python 3.6 * Run tests on 3.7
1 parent b72ed5d commit 410c345

File tree

10 files changed

+36
-28
lines changed

10 files changed

+36
-28
lines changed

.github/workflows/test.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
tests:
1111
strategy:
1212
matrix:
13-
python-version: [2.7, 3.3, 3.4, 3.6, 3.7]
13+
python-version: [3.6, 3.7]
1414
os: [windows-2019]
1515
runs-on: ${{ matrix.os }}
1616
steps:
@@ -19,26 +19,32 @@ jobs:
1919
uses: actions/setup-python@v2
2020
with:
2121
python-version: ${{ matrix.python-version }}
22-
architecture: 'x64'
22+
architecture: 'x64'
23+
- name: Install on ${{ matrix.python-version }} 64-bit
24+
run: |
25+
pip install -e .
26+
pip install -r "test-requirements.txt"
27+
pip --version
2328
- name: Test on ${{ matrix.python-version }} 64-bit
2429
run: |
25-
pip install -q -rtest-requirements.txt
26-
pip --version
27-
coverage run -p -m haas -v win32ctypes
28-
pip install --upgrade cffi
29-
coverage run -p -m haas -v win32ctypes
30+
coverage run -m haas -v win32ctypes
31+
pip install --upgrade cffi
32+
coverage run -m haas -v win32ctypes
3033
- name: Set up Python ${{ matrix.python-version }}
3134
uses: actions/setup-python@v2
3235
with:
3336
python-version: ${{ matrix.python-version }}
34-
architecture: 'x86'
37+
architecture: 'x86'
38+
- name: Install on ${{ matrix.python-version }} 32-bit
39+
run: |
40+
pip install -e .
41+
pip install -r "test-requirements.txt"
42+
pip --version
3543
- name: test on ${{ matrix.python-version }} 32-bit
3644
run: |
37-
pip install -q -rtest-requirements.txt
38-
pip --version
39-
coverage run -p -m haas -v win32ctypes
40-
pip install --upgrade cffi
41-
coverage run -p -m haas -v win32ctypes
45+
coverage run -p -m haas -v win32ctypes
46+
pip install --upgrade cffi
47+
coverage run -p -m haas -v win32ctypes
4248
- uses: actions/upload-artifact@v2
4349
with:
4450
name: Upload Coverage info
@@ -55,4 +61,3 @@ jobs:
5561
run: python -m pip install flake8
5662
- name: Lint codebase
5763
run: python -m flake8 win32ctypes/
58-

win32ctypes/core/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
# Setup module redirection based on the backend
2929

30+
3031
class BackendLoader(Loader):
3132

3233
def __init__(self, redirect_module):
@@ -61,6 +62,7 @@ def find_module(self, fullname, path=None):
6162
else:
6263
return None
6364

65+
6466
sys.meta_path.append(BackendFinder([
6567
'_dll', '_authentication', '_time',
6668
'_common', '_resource', '_nl_support',

win32ctypes/core/cffi/_resource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
BOOL WINAPI EndUpdateResourceW(HANDLE hUpdate, BOOL fDiscard);
4040
BOOL WINAPI UpdateResourceW(HANDLE hUpdate, LPCTSTR lpType, LPCTSTR lpName, WORD wLanguage, LPVOID lpData, DWORD cbData);
4141
42-
""")
42+
""") # noqa
4343

4444

4545
def ENUMRESTYPEPROC(callback):

win32ctypes/core/cffi/_system_information.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424

2525
def _GetWindowsDirectory():
2626
buffer = ffi.new(MAX_PATH_BUF)
27-
l = dlls.kernel32.GetWindowsDirectoryW(buffer, MAX_PATH)
28-
return ffi.unpack(buffer, l)
27+
directory = dlls.kernel32.GetWindowsDirectoryW(buffer, MAX_PATH)
28+
return ffi.unpack(buffer, directory)
2929

3030

3131
def _GetSystemDirectory():
3232
buffer = ffi.new(MAX_PATH_BUF)
33-
l = dlls.kernel32.GetSystemDirectoryW(buffer, MAX_PATH)
34-
return ffi.unpack(buffer, l)
33+
directory = dlls.kernel32.GetSystemDirectoryW(buffer, MAX_PATH)
34+
return ffi.unpack(buffer, directory)

win32ctypes/core/compat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ def is_integer(i):
2020
text_type = str
2121
else:
2222
def is_text(s):
23-
return isinstance(s, unicode)
23+
return isinstance(s, unicode) # noqa
2424

2525
def is_bytes(b):
2626
return isinstance(b, (bytes, str))
2727

2828
def is_integer(i):
29-
return isinstance(i, (int, long))
29+
return isinstance(i, (int, long)) # noqa
3030

31-
text_type = unicode
31+
text_type = unicode # noqa

win32ctypes/pywintypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# LICENSE.txt
77
#
88
import warnings
9-
from win32ctypes.pywin32.pywintypes import *
9+
from win32ctypes.pywin32.pywintypes import * # noqa
1010

1111
warnings.warn(
1212
"Please use 'from win32ctypes.pywin32 import pywintypes'",

win32ctypes/tests/compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def run(self, result=None):
7272
result.errors = []
7373
for error in errors:
7474
if skip_error in error[1]:
75-
print ('Skipped')
75+
print('Skipped')
7676
else:
7777
result.errors.append(error)
7878
return result

win32ctypes/tests/test_win32cred.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121

2222
# find the pywin32 version
2323
version_file = os.path.join(
24-
os.path.dirname(os.path.dirname(win32cred.__file__)), 'pywin32.version.txt')
24+
os.path.dirname(
25+
os.path.dirname(win32cred.__file__)), 'pywin32.version.txt')
2526
if os.path.exists(version_file):
2627
with open(version_file) as handle:
2728
pywin32_build = handle.read().strip()
@@ -32,7 +33,7 @@
3233
class TestCred(compat.TestCase):
3334

3435
@unittest.skipIf(
35-
pywin32_build == "223" and sys.version_info[:2] == (3,7),
36+
pywin32_build == "223" and sys.version_info[:2] == (3, 7),
3637
"pywin32 version 223 bug with CredRead (mhammond/pywin32#1232)")
3738
def test_write_to_pywin32(self):
3839
username = u"john"

win32ctypes/win32api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# LICENSE.txt
77
#
88
import warnings
9-
from win32ctypes.pywin32.win32api import *
9+
from win32ctypes.pywin32.win32api import * # noqa
1010

1111
warnings.warn(
1212
"Please use 'from win32ctypes.pywin32 import win32api'",

win32ctypes/win32cred.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# LICENSE.txt
77
#
88
import warnings
9-
from win32ctypes.pywin32.win32cred import *
9+
from win32ctypes.pywin32.win32cred import * # noqa
1010

1111
warnings.warn(
1212
"Please use 'from win32ctypes.pywin32 import win32cred'",

0 commit comments

Comments
 (0)