Skip to content

Commit 7b3199b

Browse files
Merge pull request #79 from HDE/master
Release v0.1.13
2 parents 9e87bfb + 602e127 commit 7b3199b

21 files changed

+131
-130
lines changed

.github/workflows/execute_tests.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Execute tests
2+
3+
on: push
4+
5+
jobs:
6+
execute_tests:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ['3.7', '3.8', '3.9']
11+
name: Python ${{ matrix.python-version }} tests
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Setup python
16+
uses: actions/setup-python@v3
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
20+
- name: Print information
21+
run: |
22+
echo "python version $(python --version) running"
23+
echo "pip version $(pip --version) running"
24+
25+
- name: Build
26+
run: |
27+
pip install wheel
28+
python setup.py sdist bdist_wheel
29+
30+
- name: Test
31+
run: |
32+
python setup.py test

.github/workflows/push_to_pypi.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Push package to pypi
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
branches:
8+
- release
9+
10+
env:
11+
PYTHON_VERSION: "3.9"
12+
13+
jobs:
14+
push_to_pypi:
15+
if: github.event.pull_request.merged
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Setup python
21+
uses: actions/setup-python@v3
22+
with:
23+
python-version: ${{ env.PYTHON_VERSION }}
24+
25+
- name: Print information
26+
run: |
27+
echo "python version $(python --version) running"
28+
echo "pip version $(pip --version) running"
29+
30+
- name: Build
31+
run: |
32+
pip install wheel
33+
python setup.py sdist bdist_wheel
34+
35+
- name: Deploy
36+
env:
37+
PYPI_USERNAME: "${{ secrets.PYPI_USERNAME }}"
38+
PYPI_PASSWORD: "${{ secrets.PYPI_PASSWORD }}"
39+
run: |
40+
sh deploy.sh

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,7 @@ target/
6161

6262
# Vitual Environments
6363
venv/
64+
.env/
65+
66+
# direnv
67+
.envrc

CHANGELOG.txt

+18
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,21 @@ Version 0.1.10
5252
--------------
5353

5454
- Fix traceback output when exception happens.
55+
56+
Version 0.1.11
57+
--------------
58+
59+
- Test on python 3.8.
60+
61+
Version 0.1.12
62+
--------------
63+
64+
- Fix error when running on Windows with Python 3.
65+
66+
Version 0.1.13
67+
--------------
68+
69+
- Drop support of Python 2.7.
70+
- Various update and cleanup, add Python 3.9 support.
71+
- Add __main__ file for using the package as a module.
72+
- Implement tests via Github Actions.

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
3+
Copyright (c) 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# python-lambda-local
22

33
[![Join the chat at https://gitter.im/HDE/python-lambda-local](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/HDE/python-lambda-local?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4-
[![wercker status](https://app.wercker.com/status/04f5bc5b7de3d5c6f13eb5b871035226/s "wercker status")](https://app.wercker.com/project/bykey/04f5bc5b7de3d5c6f13eb5b871035226)
4+
[![Github Actions status](https://github.com/HDE/python-lambda-local/actions/workflows/execute_tests.yml/badge.svg)](https://github.com/HDE/python-lambda-local/actions/)
55
[![PyPI version](https://badge.fury.io/py/python-lambda-local.svg)](https://badge.fury.io/py/python-lambda-local)
66

77
Run lambda function on local machine
88

99
## Prepare development environment
1010

11-
Please use a newly created virtualenv of Python 2.7 or Python 3.7.
11+
Please use a newly created virtualenv of Python 3.7+.
1212

1313
## Installation
1414

@@ -68,7 +68,7 @@ Suppose your project directory is like this:
6868
│   │   ├── ... (package content of rx)
6969
...
7070
│   │   └── testscheduler.py
71-
│   └── Rx-1.2.3.dist-info
71+
│   └── Rx-1.6.1.dist-info
7272
│   ├── DESCRIPTION.rst
7373
│   ├── METADATA
7474
│   ├── metadata.json
@@ -147,7 +147,7 @@ Call a handler function `func` with given `event`, `context` and custom `environ
147147
1. Make sure the 3rd party libraries used in the AWS Lambda function can be imported.
148148

149149
``` bash
150-
pip install rx
150+
pip install rx==1.6.1
151151
```
152152

153153
2. To call the lambda function above with your python code:

README.rst

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
python-lambda-local
22
===================
33

4-
|Join the chat at https://gitter.im/HDE/python-lambda-local| |wercker
5-
status| |PyPI version|
4+
|Join the chat at https://gitter.im/HDE/python-lambda-local| |Github Actions status| |PyPI version|
65

76
Run lambda function on local machine
87

98
Prepare development environment
109
-------------------------------
1110

12-
Please use a newly created virtualenv of Python 2.7 or Python 3.7.
11+
Please use a newly created virtualenv of Python 3.7+.
1312

1413
Installation
1514
------------
@@ -75,7 +74,7 @@ Suppose your project directory is like this:
7574
│   │   ├── ... (package content of rx)
7675
...
7776
│   │   └── testscheduler.py
78-
│   └── Rx-1.2.3.dist-info
77+
│   └── Rx-1.6.1.dist-info
7978
│   ├── DESCRIPTION.rst
8079
│   ├── METADATA
8180
│   ├── metadata.json
@@ -164,7 +163,7 @@ Sample
164163

165164
.. code:: bash
166165
167-
pip install rx
166+
pip install rx==1.6.1
168167
169168
2. To call the lambda function above with your python code:
170169

@@ -184,7 +183,7 @@ Sample
184183
185184
.. |Join the chat at https://gitter.im/HDE/python-lambda-local| image:: https://badges.gitter.im/Join%20Chat.svg
186185
:target: https://gitter.im/HDE/python-lambda-local?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
187-
.. |wercker status| image:: https://app.wercker.com/status/04f5bc5b7de3d5c6f13eb5b871035226/s
188-
:target: https://app.wercker.com/project/bykey/04f5bc5b7de3d5c6f13eb5b871035226
186+
.. |Github Actions status| image:: https://github.com/HDE/python-lambda-local/actions/workflows/execute_tests.yml/badge.svg
187+
:target: https://github.com/HDE/python-lambda-local/actions/
189188
.. |PyPI version| image:: https://badge.fury.io/py/python-lambda-local.svg
190189
:target: https://badge.fury.io/py/python-lambda-local

deploy.sh

-6
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,4 @@ password: ${PYPI_PASSWORD}
1212
EOF
1313

1414
pip install twine
15-
16-
mkdir dist
17-
cp build-py2/dist/* dist/
18-
cp build-py37/dist/* dist/
19-
cp build-py38/dist/* dist/
20-
2115
twine upload -r pypi dist/*

lambda_local/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'''
22
python-lambda-local: Main module
33
4-
Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
4+
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
55
Licensed under MIT.
66
'''
77

lambda_local/__main__.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from . import main
2+
3+
if __name__ == "__main__":
4+
main()

lambda_local/context.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'''
2-
Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
2+
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
33
Licensed under MIT.
44
'''
55
from __future__ import print_function

lambda_local/environment_variables.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
'''
2+
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
3+
Licensed under MIT.
4+
'''
15
import json
26
import os
37

lambda_local/event.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'''
2-
Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
2+
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
33
Licensed under MIT.
44
'''
55

lambda_local/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'''
2-
Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
2+
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
33
Licensed under MIT.
44
'''
55

lambda_local/timeout.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
'''
2-
Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
2+
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
33
Licensed under MIT.
44
'''
55

66
import signal
77
import threading
88
from contextlib import contextmanager
9-
from six.moves import _thread
9+
import _thread
1010

1111

1212
class TimeoutException(Exception):

setup.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'''
22
python-lambda-local: Run lambda function in python on local machine.
33
4-
Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
4+
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
55
Licensed under MIT.
66
'''
77
import io
@@ -23,11 +23,9 @@ def run_tests(self):
2323
sys.exit(pytest.main(self.test_args))
2424

2525

26-
version = "0.1.12"
26+
version = "0.1.13"
2727

2828
TEST_REQUIRE = ['pytest']
29-
if sys.version_info[0] == 2:
30-
TEST_REQUIRE = ['pytest==4.6.3']
3129

3230
setup(name="python-lambda-local",
3331
version=version,
@@ -37,14 +35,14 @@ def run_tests(self):
3735
'Development Status :: 3 - Alpha',
3836
'Operating System :: POSIX',
3937
'Programming Language :: Python',
40-
'Programming Language :: Python :: 2.7',
4138
'Programming Language :: Python :: 3.7',
4239
'Programming Language :: Python :: 3.8',
40+
'Programming Language :: Python :: 3.9',
4341
'License :: OSI Approved :: MIT License'
4442
],
4543
keywords="AWS Lambda",
46-
author="YANG Xudong",
47-
author_email="xudong.yang@hennge.com",
44+
author="YANG Xudong, Iskandar Setiadi",
45+
author_email="iskandar.setiadi@hennge.com",
4846
url="https://github.com/HDE/python-lambda-local",
4947
license="MIT",
5048
packages=find_packages(exclude=['examples', 'tests']),

tests/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
Organize tests into files, each named xxx_test.py
66
Read more here: http://pytest.org/
77
8-
Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
8+
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
99
Licensed under MIT
1010
'''

tests/basic_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Write each test as a function named test_<something>.
66
Read more here: http://pytest.org/
77
8-
Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
8+
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
99
Licensed under MIT
1010
'''
1111

tests/test_direct_invocations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
Meant for use with py.test.
66
7-
Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
7+
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
88
Licensed under MIT
99
'''
1010
import json

tests/test_environment_variables.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
'''
2+
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
3+
Licensed under MIT.
4+
'''
15
import os
26

37
from lambda_local.environment_variables import set_environment_variables

0 commit comments

Comments
 (0)