Skip to content

Commit bbffd9b

Browse files
authored
Fix Github Actions (#347)
* workflows: add a workflow_dispatch trigger to start workflows manually To be able to manually run a workflow from the Github web interface, add a workflow_dispatch trigger. Note that this does only work once this change has hit the default branch. * workflow: remove python 2.7 testing Python 2.7 is long obsolete, deprecated and not supported any more. Remove it from the tests. This test job is especially supposed to run on ubuntu-20.04, which doesn't have Python 2.7 any more. Without this patch, this workflow fails with: Warning: The support for python 2.7 will be removed on June 19. Related issue: actions/setup-python#672 Version 2.7 was not found in the local cache Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 20.04. The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json * setup.py: ignore flake8 warning about module import at top of file Flake8 is unhappy with us because we violate PEP8: rsc@leda:~/git/nodeenv$ flake8 --extend-ignore=E127 nodeenv.py tests setup.py setup.py:16:1: E402 module level import not at top of file Ignore this warning in this case. * nodeenv.py: do not compare types According to this flake8 error: (env) rsc@leda:~/git/nodeenv$ flake8 --extend-ignore=E127 nodeenv.py tests setup.py nodeenv.py:421:19: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()` we should not compare types but use isinstance() instead, which can handle subclasses as well. See https://www.flake8rules.com/rules/E721.html for details.
1 parent eaa9de9 commit bbffd9b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- master
77
pull_request:
8+
workflow_dispatch:
89

910
jobs:
1011
tests:
@@ -15,7 +16,6 @@ jobs:
1516
fail-fast: false
1617
matrix:
1718
python-version:
18-
- '2.7'
1919
- '3.7'
2020
- '3.8'
2121
- '3.9'

nodeenv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def writefile(dest, content, overwrite=True, append=False):
418418
Create file and write content in it
419419
"""
420420
content = to_utf8(content)
421-
if is_PY3 and type(content) != bytes:
421+
if is_PY3 and not isinstance(content, bytes):
422422
content = bytes(content, 'utf-8')
423423
if not os.path.exists(dest):
424424
logger.debug(' * Writing %s ... ', dest, extra=dict(continued=True))

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
sys.path.insert(0, '.')
1515

16-
from nodeenv import nodeenv_version
16+
from nodeenv import nodeenv_version # noqa: E402
1717

1818

1919
def read_file(file_name):

0 commit comments

Comments
 (0)