Skip to content

Commit 7fe9671

Browse files
authored
Merge pull request #141 from awslabs/develop
chore: Version 0.6.0 Release
2 parents fc4f20c + 557214b commit 7fe9671

File tree

27 files changed

+205
-129
lines changed

27 files changed

+205
-129
lines changed

.appveyor.yml

Lines changed: 114 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,130 @@
11
version: 1.0.{build}
2-
image: Visual Studio 2017
2+
image:
3+
- Visual Studio 2017
4+
- Ubuntu
35

46
environment:
57
GOPATH: c:\gopath
68
GOVERSION: 1.11
79
GRADLE_OPTS: -Dorg.gradle.daemon=false
10+
nodejs_version: "8.10.0"
811

912
matrix:
1013

1114
- PYTHON: "C:\\Python27-x64"
15+
PYTHON_VERSION: '2.7.16'
16+
PYTHON_ARCH: '64'
17+
LINE_COVERAGE: '91'
18+
NEW_FLAKE8: 0
19+
JAVA_HOME: "C:\\Program Files\\Java\\jdk11"
1220
- PYTHON: "C:\\Python36-x64"
21+
PYTHON_VERSION: '3.6.8'
22+
PYTHON_ARCH: '64'
23+
LINE_COVERAGE: '91'
24+
NEW_FLAKE8: 0
25+
JAVA_HOME: "C:\\Program Files\\Java\\jdk11"
1326
- PYTHON: "C:\\Python37-x64"
27+
PYTHON_VERSION: '3.7.4'
28+
PYTHON_ARCH: '64'
29+
LINE_COVERAGE: '91'
30+
NEW_FLAKE8: 0
31+
JAVA_HOME: "C:\\Program Files\\Java\\jdk11"
32+
- PYTHON: "C:\\Python38-x64"
33+
PYTHON_VERSION: '3.8.0'
34+
PYTHON_ARCH: '64'
35+
LINE_COVERAGE: '72'
36+
NEW_FLAKE8: 1
37+
JAVA_HOME: "C:\\Program Files\\Java\\jdk11"
1438

1539

1640
build: off
1741

18-
install:
19-
# To run Nodejs workflow integ tests
20-
- ps: Install-Product node 8.10
21-
22-
- "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PYTHON%\\bin;%PATH%"
23-
- "%PYTHON%\\python.exe -m pip install -r requirements/dev.txt"
24-
- "%PYTHON%\\python.exe -m pip install -e ."
25-
- "set PATH=C:\\Ruby25-x64\\bin;%PATH%"
26-
- "gem --version"
27-
- "gem install bundler -v 1.17.3"
28-
- "bundler --version"
29-
- "echo %PATH%"
30-
31-
# setup go
32-
- rmdir c:\go /s /q
33-
- "choco install golang"
34-
- "choco install bzr"
35-
- "choco install dep"
36-
- setx PATH "C:\go\bin;C:\gopath\bin;C:\Program Files (x86)\Bazaar\;C:\Program Files\Mercurial;%PATH%;"
37-
- "go version"
38-
- "go env"
39-
40-
# setup Gradle
41-
- "choco install gradle"
42-
43-
# Echo final Path
44-
- "echo %PATH%"
45-
46-
test_script:
47-
- "%PYTHON%\\python.exe -m pytest --cov aws_lambda_builders --cov-report term-missing tests/unit tests/functional"
48-
- "%PYTHON%\\python.exe -m pytest tests/integration"
42+
for:
43+
-
44+
matrix:
45+
only:
46+
- image: Visual Studio 2017
47+
48+
install:
49+
# To run Nodejs workflow integ tests
50+
- ps: Install-Product node 8.10
51+
52+
- "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PYTHON%\\bin;%PATH%"
53+
- "%PYTHON%\\python.exe -m pip install -r requirements/dev.txt"
54+
- "%PYTHON%\\python.exe -m pip install -e ."
55+
- "set PATH=C:\\Ruby25-x64\\bin;%PATH%"
56+
- "gem --version"
57+
- "gem install bundler -v 1.17.3"
58+
- "bundler --version"
59+
- "echo %PATH%"
60+
61+
# setup go
62+
- rmdir c:\go /s /q
63+
- "choco install golang"
64+
- "choco install bzr"
65+
- "choco install dep"
66+
- setx PATH "C:\go\bin;C:\gopath\bin;C:\Program Files (x86)\Bazaar\;C:\Program Files\Mercurial;%PATH%;"
67+
- "go version"
68+
- "go env"
69+
70+
# setup Gradle
71+
- "choco install gradle"
72+
73+
# Echo final Path
74+
- "echo %PATH%"
75+
76+
test_script:
77+
- "%PYTHON%\\python.exe -m pytest --cov aws_lambda_builders --cov-report term-missing tests/unit tests/functional"
78+
- "%PYTHON%\\python.exe -m pytest tests/integration"
79+
80+
-
81+
matrix:
82+
only:
83+
- image: Ubuntu
84+
85+
install:
86+
- sh: "JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64"
87+
- sh: "PATH=$JAVA_HOME/bin:$PATH"
88+
- sh: "source ${HOME}/venv${PYTHON_VERSION}/bin/activate"
89+
- sh: "rvm use 2.5"
90+
- sh: "nvm install ${nodejs_version}"
91+
- sh: "npm install [email protected] -g"
92+
- sh: "npm -v"
93+
- sh: "echo $PATH"
94+
- sh: "java --version"
95+
96+
# Install latest gradle
97+
- sh: "sudo apt-get -y remove gradle"
98+
- sh: "sudo apt-get install go-dep"
99+
- sh: "wget https://services.gradle.org/distributions/gradle-5.5-bin.zip -P /tmp"
100+
- sh: "sudo unzip -d /opt/gradle /tmp/gradle-*.zip"
101+
- sh: "PATH=/opt/gradle/gradle-5.5/bin:$PATH"
102+
103+
build_script:
104+
- "python -c \"import sys; print(sys.executable)\""
105+
- "LAMBDA_BUILDERS_DEV=1 pip install -e \".[dev]\""
106+
107+
test_script:
108+
- "LAMBDA_BUILDERS_DEV=1 pytest --cov aws_lambda_builders --cov-report term-missing --cov-fail-under ${LINE_COVERAGE} tests/unit tests/functional"
109+
- "pylint --rcfile .pylintrc aws_lambda_builders"
110+
111+
# Runs only in Linux
112+
- "LAMBDA_BUILDERS_DEV=1 pytest -vv tests/integration"
113+
114+
-
115+
matrix:
116+
only:
117+
- OLD_FLAKE8: 1
118+
119+
test_script:
120+
- "flake8 lambda_builders"
121+
- "flake8 tests/unit tests/integration"
122+
123+
-
124+
matrix:
125+
only:
126+
- NEW_FLAKE8: 0
127+
128+
test_script:
129+
- "flake8 lambda_builders"
130+
- "flake8 tests/unit tests/integration --extend-ignore=W504"

.pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ confidence=
5959
# --enable=similarities". If you want to run only the classes checker, but have
6060
# no Warning level messages displayed, use"--disable=all --enable=classes
6161
# --disable=W"
62-
disable=R0201,W0613,I0021,I0020,W1618,W1619,R0902,R0903,W0231,W0611,R0913,W0703,C0330,R0204,I0011,R0904,C0301
62+
# R0205,W0107,R1705,R1710,R1719,R1720,R1714 are all disable due to a forced upgrade to support python3.8
63+
disable=R0201,W0613,I0021,I0020,W1618,W1619,R0902,R0903,W0231,W0611,R0913,W0703,C0330,R0204,I0011,R0904,C0301, R0205,W0107,R1705,R1710,R1719,R1720,R1714
6364

6465

6566
[REPORTS]

.travis.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ integ-test:
1616
flake:
1717
# Make sure code conforms to PEP8 standards
1818
flake8 lambda_builders
19-
flake8 tests/unit tests/integration
19+
flake8 tests/unit tests/integration --extend-ignore=W504
2020

2121
lint:
2222
# Liner performs static analysis to catch latent bugs

aws_lambda_builders/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
22
AWS Lambda Builder Library
33
"""
4-
__version__ = '0.5.0'
4+
__version__ = '0.6.0'
55
RPC_PROTOCOL_VERSION = "0.3"

aws_lambda_builders/workflows/java_gradle/gradle_validator.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,25 @@ class GradleValidator(object):
1414
VERSION_STRING_WARNING = "%s failed to return a version string using the '-v' option. The workflow is unable to " \
1515
"check that the version of the JVM used is compatible with AWS Lambda."
1616

17-
MAJOR_VERSION_WARNING = "%s is using a JVM with major version %s which is newer than 8 that is supported by AWS " \
17+
MAJOR_VERSION_WARNING = "%s is using a JVM with major version %s which is newer than %s that is supported by AWS " \
1818
"Lambda. The compiled function code may not run in AWS Lambda unless the project has " \
19-
"been configured to be compatible with Java 8 using 'targetCompatibility' in Gradle."
19+
"been configured to be compatible with Java %s using 'targetCompatibility' in Gradle."
2020

21-
def __init__(self, os_utils=None, log=None):
21+
def __init__(self, runtime, os_utils=None, log=None):
2222
self.language = 'java'
2323
self._valid_binary_path = None
24+
self._runtime = runtime
2425
self.os_utils = OSUtils() if not os_utils else os_utils
2526
self.log = LOG if not log else log
2627

2728
def validate(self, gradle_path):
2829
jvm_mv = self._get_major_version(gradle_path)
2930

31+
language_version = self._runtime.replace('java', '')
32+
3033
if jvm_mv:
31-
if int(jvm_mv) > 8:
32-
self.log.warning(self.MAJOR_VERSION_WARNING, gradle_path, jvm_mv)
34+
if int(jvm_mv) > int(language_version):
35+
self.log.warning(self.MAJOR_VERSION_WARNING, gradle_path, jvm_mv, language_version, language_version)
3336
else:
3437
self.log.warning(self.VERSION_STRING_WARNING, gradle_path)
3538

aws_lambda_builders/workflows/java_gradle/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def get_resolvers(self):
5555
return [GradleResolver(executable_search_paths=self.executable_search_paths)]
5656

5757
def get_validators(self):
58-
return [GradleValidator(self.os_utils)]
58+
return [GradleValidator(self.runtime, self.os_utils)]
5959

6060
@property
6161
def build_output_dir(self):

aws_lambda_builders/workflows/java_maven/maven_validator.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,25 @@ class MavenValidator(object):
1414
VERSION_STRING_WARNING = "%s failed to return a version string using the '-v' option. The workflow is unable to " \
1515
"check that the version of the JVM used is compatible with AWS Lambda."
1616

17-
MAJOR_VERSION_WARNING = "%s is using a JVM with major version %s which is newer than 8 that is supported by AWS " \
17+
MAJOR_VERSION_WARNING = "%s is using a JVM with major version %s which is newer than %s that is supported by AWS " \
1818
"Lambda. The compiled function code may not run in AWS Lambda unless the project has " \
19-
"been configured to be compatible with Java 8 using 'maven.compiler.target' in Maven."
19+
"been configured to be compatible with Java %s using 'maven.compiler.target' in Maven."
2020

21-
def __init__(self, os_utils=None, log=None):
21+
def __init__(self, runtime, os_utils=None, log=None):
2222
self.language = 'java'
2323
self._valid_binary_path = None
24+
self._runtime = runtime
2425
self.os_utils = OSUtils() if not os_utils else os_utils
2526
self.log = LOG if not log else log
2627

2728
def validate(self, maven_path):
2829
jvm_mv = self._get_major_version(maven_path)
2930

31+
language_version = self._runtime.replace('java', '')
32+
3033
if jvm_mv:
31-
if int(jvm_mv) > 8:
32-
self.log.warning(self.MAJOR_VERSION_WARNING, maven_path, jvm_mv)
34+
if int(jvm_mv) > int(language_version):
35+
self.log.warning(self.MAJOR_VERSION_WARNING, maven_path, jvm_mv, language_version, language_version)
3336
else:
3437
self.log.warning(self.VERSION_STRING_WARNING, maven_path)
3538

aws_lambda_builders/workflows/java_maven/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ def get_resolvers(self):
5555
return [MavenResolver(executable_search_paths=self.executable_search_paths)]
5656

5757
def get_validators(self):
58-
return [MavenValidator(self.os_utils)]
58+
return [MavenValidator(self.runtime, self.os_utils)]

aws_lambda_builders/workflows/python_pip/compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def pip_import_string(python_exe):
2323
return 'from pip import main'
2424
# Pip changed their import structure again in 19.3
2525
# https://github.com/pypa/pip/commit/09fd200
26-
elif pip_major_version >= 19 and pip_minor_version >= 3:
26+
elif (pip_major_version, pip_minor_version) >= (19, 3):
2727
return 'from pip._internal.main import main'
2828
else:
2929
return 'from pip._internal import main'

0 commit comments

Comments
 (0)