Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ on: [push, pull_request]
jobs:
python-linting:
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10']

steps:
- uses: actions/checkout@v2

- name: set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: ${{ matrix.python-version }}

- name: install Python packages
run: |
Expand All @@ -18,4 +22,10 @@ jobs:

- name: Run flake8 to verify PEP8-compliance of Python code
run: |
flake8
# don't check py2vs3/py3.py when testing with Python 2, and vice versa
if [[ "${{ matrix.python-version }}" =~ "2." ]]; then
py_excl=py3
else
py_excl=py2
fi
flake8 --exclude ./easybuild/tools/py2vs3/${py_excl}.py
11 changes: 5 additions & 6 deletions easybuild/framework/easyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1485,12 +1485,11 @@ def make_module_req(self):
if key in keys_requiring_files:
# only retain paths that contain at least one file
recursive = keys_requiring_files[key]
retained_paths = [
path
for path, fullpath in ((path, os.path.join(self.installdir, path)) for path in paths)
if os.path.isdir(fullpath)
and dir_contains_files(fullpath, recursive=recursive)
]
retained_paths = []
for pth in paths:
fullpath = os.path.join(self.installdir, pth)
if os.path.isdir(fullpath) and dir_contains_files(fullpath, recursive=recursive):
retained_paths.append(pth)
if retained_paths != paths:
self.log.info("Only retaining paths for %s that contain at least one file: %s -> %s",
key, paths, retained_paths)
Expand Down
2 changes: 1 addition & 1 deletion easybuild/tools/configobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -2023,7 +2023,7 @@ def write(self, outfile=None, section=None):
# might need to encode
# NOTE: This will *screw* UTF16, each line will start with the BOM
if self.encoding:
out = [line.encode(self.encoding) for line in out]
out = [lne.encode(self.encoding) for lne in out]
if (self.BOM and ((self.encoding is None) or
(BOM_LIST.get(self.encoding.lower()) == 'utf_8'))):
# Add the UTF8 BOM
Expand Down