Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Release v0.1.13 #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 2, 2022
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
32 changes: 32 additions & 0 deletions 32 .github/workflows/execute_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Execute tests

on: push

jobs:
execute_tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9']
name: Python ${{ matrix.python-version }} tests
steps:
- uses: actions/checkout@v3

- name: Setup python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Print information
run: |
echo "python version $(python --version) running"
echo "pip version $(pip --version) running"

- name: Build
run: |
pip install wheel
python setup.py sdist bdist_wheel

- name: Test
run: |
python setup.py test
40 changes: 40 additions & 0 deletions 40 .github/workflows/push_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Push package to pypi

on:
pull_request:
types:
- closed
branches:
- release

env:
PYTHON_VERSION: "3.9"

jobs:
push_to_pypi:
if: github.event.pull_request.merged
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup python
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Print information
run: |
echo "python version $(python --version) running"
echo "pip version $(pip --version) running"

- name: Build
run: |
pip install wheel
python setup.py sdist bdist_wheel

- name: Deploy
env:
PYPI_USERNAME: "${{ secrets.PYPI_USERNAME }}"
PYPI_PASSWORD: "${{ secrets.PYPI_PASSWORD }}"
run: |
sh deploy.sh
4 changes: 4 additions & 0 deletions 4 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ target/

# Vitual Environments
venv/
.env/

# direnv
.envrc
18 changes: 18 additions & 0 deletions 18 CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,21 @@ Version 0.1.10
--------------

- Fix traceback output when exception happens.

Version 0.1.11
--------------

- Test on python 3.8.

Version 0.1.12
--------------

- Fix error when running on Windows with Python 3.

Version 0.1.13
--------------

- Drop support of Python 2.7.
- Various update and cleanup, add Python 3.9 support.
- Add __main__ file for using the package as a module.
- Implement tests via Github Actions.
2 changes: 1 addition & 1 deletion 2 LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

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

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions 8 README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# python-lambda-local

[![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)
[![wercker status](https://app.wercker.com/status/04f5bc5b7de3d5c6f13eb5b871035226/s "wercker status")](https://app.wercker.com/project/bykey/04f5bc5b7de3d5c6f13eb5b871035226)
[![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/)
[![PyPI version](https://badge.fury.io/py/python-lambda-local.svg)](https://badge.fury.io/py/python-lambda-local)

Run lambda function on local machine

## Prepare development environment

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

## Installation

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

``` bash
pip install rx
pip install rx==1.6.1
```

2. To call the lambda function above with your python code:
Expand Down
13 changes: 6 additions & 7 deletions 13 README.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
python-lambda-local
===================

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

Run lambda function on local machine

Prepare development environment
-------------------------------

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

Installation
------------
Expand Down Expand Up @@ -75,7 +74,7 @@ Suppose your project directory is like this:
│   │   ├── ... (package content of rx)
...
│   │   └── testscheduler.py
│   └── Rx-1.2.3.dist-info
│   └── Rx-1.6.1.dist-info
│   ├── DESCRIPTION.rst
│   ├── METADATA
│   ├── metadata.json
Expand Down Expand Up @@ -164,7 +163,7 @@ Sample

.. code:: bash

pip install rx
pip install rx==1.6.1

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

Expand All @@ -184,7 +183,7 @@ Sample

.. |Join the chat at https://gitter.im/HDE/python-lambda-local| image:: https://badges.gitter.im/Join%20Chat.svg
:target: https://gitter.im/HDE/python-lambda-local?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
.. |wercker status| image:: https://app.wercker.com/status/04f5bc5b7de3d5c6f13eb5b871035226/s
:target: https://app.wercker.com/project/bykey/04f5bc5b7de3d5c6f13eb5b871035226
.. |Github Actions status| image:: https://github.com/HDE/python-lambda-local/actions/workflows/execute_tests.yml/badge.svg
:target: https://github.com/HDE/python-lambda-local/actions/
.. |PyPI version| image:: https://badge.fury.io/py/python-lambda-local.svg
:target: https://badge.fury.io/py/python-lambda-local
6 changes: 0 additions & 6 deletions 6 deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,4 @@ password: ${PYPI_PASSWORD}
EOF

pip install twine

mkdir dist
cp build-py2/dist/* dist/
cp build-py37/dist/* dist/
cp build-py38/dist/* dist/

twine upload -r pypi dist/*
2 changes: 1 addition & 1 deletion 2 lambda_local/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'''
python-lambda-local: Main module

Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
Licensed under MIT.
'''

Expand Down
4 changes: 4 additions & 0 deletions 4 lambda_local/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from . import main

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion 2 lambda_local/context.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
Licensed under MIT.
'''
from __future__ import print_function
Expand Down
4 changes: 4 additions & 0 deletions 4 lambda_local/environment_variables.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
'''
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
Licensed under MIT.
'''
import json
import os

Expand Down
2 changes: 1 addition & 1 deletion 2 lambda_local/event.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
Licensed under MIT.
'''

Expand Down
2 changes: 1 addition & 1 deletion 2 lambda_local/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
Licensed under MIT.
'''

Expand Down
4 changes: 2 additions & 2 deletions 4 lambda_local/timeout.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'''
Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
Licensed under MIT.
'''

import signal
import threading
from contextlib import contextmanager
from six.moves import _thread
import _thread


class TimeoutException(Exception):
Expand Down
12 changes: 5 additions & 7 deletions 12 setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'''
python-lambda-local: Run lambda function in python on local machine.

Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
Licensed under MIT.
'''
import io
Expand All @@ -23,11 +23,9 @@ def run_tests(self):
sys.exit(pytest.main(self.test_args))


version = "0.1.12"
version = "0.1.13"

TEST_REQUIRE = ['pytest']
if sys.version_info[0] == 2:
TEST_REQUIRE = ['pytest==4.6.3']

setup(name="python-lambda-local",
version=version,
Expand All @@ -37,14 +35,14 @@ def run_tests(self):
'Development Status :: 3 - Alpha',
'Operating System :: POSIX',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'License :: OSI Approved :: MIT License'
],
keywords="AWS Lambda",
author="YANG Xudong",
author_email="xudong.yang@hennge.com",
author="YANG Xudong, Iskandar Setiadi",
author_email="iskandar.setiadi@hennge.com",
url="https://github.com/HDE/python-lambda-local",
license="MIT",
packages=find_packages(exclude=['examples', 'tests']),
Expand Down
2 changes: 1 addition & 1 deletion 2 tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
Organize tests into files, each named xxx_test.py
Read more here: http://pytest.org/

Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
Licensed under MIT
'''
2 changes: 1 addition & 1 deletion 2 tests/basic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Write each test as a function named test_<something>.
Read more here: http://pytest.org/

Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
Licensed under MIT
'''

Expand Down
2 changes: 1 addition & 1 deletion 2 tests/test_direct_invocations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Meant for use with py.test.

Copyright 2015-2019 HENNGE K.K. (formerly known as HDE, Inc.)
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
Licensed under MIT
'''
import json
Expand Down
4 changes: 4 additions & 0 deletions 4 tests/test_environment_variables.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
'''
Copyright 2015-2022 HENNGE K.K. (formerly known as HDE, Inc.)
Licensed under MIT.
'''
import os

from lambda_local.environment_variables import set_environment_variables
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.