Skip to content

Commit 2a64d13

Browse files
committed
backported to Python 3.5
1 parent 4d54cf7 commit 2a64d13

File tree

8 files changed

+34
-11
lines changed

8 files changed

+34
-11
lines changed

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ sudo: required
22
language: generic
33
matrix:
44
include:
5+
- os: linux
6+
language: python
7+
python: "3.5"
8+
env: TRAVIS_JDK_VERSION=oraclejdk9
59
- os: linux
610
language: python
711
python: "3.6"
@@ -22,6 +26,11 @@ matrix:
2226
language: python
2327
python: "3.7-dev"
2428
env: TRAVIS_JDK_VERSION=oraclejdk9
29+
- os: osx
30+
language: generic
31+
env:
32+
- TRAVIS_PYTHON_VERSION="3.5.4"
33+
- TRAVIS_JDK_VERSION=oraclejdk8
2534
- os: osx
2635
language: generic
2736
env:

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ dependencies
223223

224224
Java XML generator for OFP and all of its dependencies.
225225

226-
Python version >= 3.6.
226+
Python version >= 3.5.
227227

228228
Python libraries as specified in `<requirements.txt>`_.
229229

appveyor.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ version: "{build}"
22

33
environment:
44
matrix:
5+
- ARCHITECTURE: "x86"
6+
PYTHON_VERSION: "3.5"
7+
PYTHON: "C:\\Python35"
8+
JAVA_VERSION: "jdk8"
9+
JAVA: "C:\\Program Files (x86)\\Java\\jdk1.8.0"
10+
ANT: "1.10.1"
11+
- ARCHITECTURE: "x64"
12+
PYTHON_VERSION: "3.5"
13+
PYTHON: "C:\\Python35-x64"
14+
JAVA_VERSION: "jdk8"
15+
JAVA: "C:\\Program Files\\Java\\jdk1.8.0"
16+
ANT: "1.10.1"
517
- ARCHITECTURE: "x86"
618
PYTHON_VERSION: "3.6"
719
PYTHON: "C:\\Python36"

open_fortran_parser/ofc_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def execute_compiler(
4242
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
4343

4444
if output_path is not None:
45-
with open(output_path, 'wb') as output_file:
45+
with open(str(output_path), 'wb') as output_file:
4646
output_file.write(result.stdout)
4747

4848
return result

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ class Package(setup_boilerplate.Package):
1111
description = 'Python wrapper for XML output generator for Open Fortran Parser'
1212
download_url = 'https://github.com/mbdevpl/open-fortran-parser-xml'
1313
classifiers = [
14-
'Development Status :: 1 - Planning',
14+
'Development Status :: 3 - Alpha',
1515
'Environment :: Console',
1616
'Intended Audience :: Developers',
1717
'Intended Audience :: Science/Research',
1818
'License :: OSI Approved :: Apache Software License',
1919
'Natural Language :: English',
2020
'Operating System :: POSIX',
21+
'Programming Language :: Python :: 3.5',
2122
'Programming Language :: Python :: 3.6',
2223
'Programming Language :: Python :: 3 :: Only',
2324
'Topic :: Education',

test/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
if java_config['options'] is None:
1414
java_config['options'] = []
1515
java_config['options'].append(
16-
f'-javaagent:{str(JACOCO_PATH)}=excludes={":".join(JACOCO_EXCLUDES)}')
16+
'-javaagent:{}=excludes={}'.format(str(JACOCO_PATH), ':'.join(JACOCO_EXCLUDES)))

test/test_apps.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ def test_miranda_io(self):
3636
all_miranda_io_src_paths)
3737

3838
def test_flash(self):
39-
flash_relative_repo_path = pathlib.Path('..', 'flash-subset')
40-
flash_src_dir = _HERE.parent.joinpath(flash_relative_repo_path,
41-
'FLASH4.4', 'source').resolve()
39+
flash_relative_repo_path = pathlib.Path('..', 'flash-subset', 'FLASH4.4')
40+
try:
41+
flash_src_dir = _HERE.parent.joinpath(flash_relative_repo_path, 'source').resolve()
42+
except FileNotFoundError:
43+
self.skipTest('FLASH directory not found') # in Python 3.5
4244
if not flash_src_dir.is_dir():
4345
self.skipTest('FLASH directory not found')
4446
tested_flash_kernel_paths = [

test/test_compatibility.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ def all_fortran_paths(root_path: pathlib.Path):
2424
all_input_paths = []
2525
for extension in itertools.chain(
2626
*[(_, _.upper()) for _ in ('.f', '.f90', '.f03', '.f08', '.h')]):
27-
input_paths = root_path.glob(
28-
f'**/*{extension}')
27+
input_paths = root_path.glob('**/*{}'.format(extension))
2928
for input_path in input_paths:
3029
input_path = input_path.resolve()
3130
all_input_paths.append(input_path)
@@ -155,14 +154,14 @@ def check_cases_and_report(
155154
else:
156155
self.fail('{} {}'.format(type(result), result))
157156

158-
with open(report_path, 'w') as report_file:
157+
with open(str(report_path), 'w') as report_file:
159158
print('<path>{}</path>'.format(input_path), file=report_file)
160159
if hasattr(result, 'stderr') and result.stderr:
161160
print('<stderr>', file=report_file)
162161
print(result.stderr.decode().rstrip(), file=report_file)
163162
print('</stderr>', file=report_file)
164163
print('<code>', file=report_file)
165-
with open(input_path) as fortran_file:
164+
with open(str(input_path)) as fortran_file:
166165
print(fortran_file.read(), file=report_file)
167166
print('</code>', file=report_file)
168167
if isinstance(result, ET.Element):

0 commit comments

Comments
 (0)