diff --git a/.gitignore b/.gitignore index 7d44098..74b6043 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ __pycache__/ # Distribution / packaging .Python -env/ +*env/ build/ develop-eggs/ dist/ @@ -57,3 +57,10 @@ docs/_build/ # PyBuilder target/ + +# PyCharm +.idea/ + +# Emacs backup files +*~ + diff --git a/.travis.yml b/.travis.yml index 06e0eba..68db636 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,9 @@ sudo: false python: - '3.6' install: -- pip install -r requirements.txt -- pip install -r dev-requirements.txt +- pip install --upgrade pip==19.0.3 +- pip install poetry +- poetry install - pip install coveralls script: - pytest --cov aws_lambda -v tests diff --git a/LICENSE b/LICENSE index af7219c..e7ea0e0 100644 --- a/LICENSE +++ b/LICENSE @@ -19,3 +19,24 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +================================================================================ +Portions of this software are based in part on the work of Nick Ficano. +Use that earlier work requires inclusion of this additional notice, +which continues to apply to those portions: + +ISC License + +Copyright (c) 2016, Nick Ficano + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/Makefile b/Makefile index ed7320a..3aa3945 100644 --- a/Makefile +++ b/Makefile @@ -26,8 +26,7 @@ lint: flake8 python-lambda tests release: clean - python setup.py sdist upload - python setup.py bdist_wheel upload + poetry publish install: clean - python setup.py install + poetry install diff --git a/README.rst b/README.rst index c1c47bb..5bbbe87 100644 --- a/README.rst +++ b/README.rst @@ -1,11 +1,14 @@ -======== -python-λ -======== +================= +python-lambda-4dn +================= +(python-λ forked for 4DN-DCIC projects) +--------------------------------------- -.. image:: https://img.shields.io/pypi/v/python-lambda.svg + +.. image:: https://img.shields.io/pypi/v/python-lambda-4dn.svg :alt: Pypi - :target: https://pypi.python.org/pypi/python-lambda/ + :target: https://pypi.python.org/pypi/python-lambda-4dn/ .. image:: https://travis-ci.org/4dn-dcic/python-lambda.svg?branch=master :alt: Build Status @@ -15,34 +18,88 @@ python-λ :alt: Coverage :target: https://coveralls.io/github/4dn-dcic/python-lambda?branch=master -Python-lambda is a toolset for developing and deploying *serverless* Python code in AWS Lambda. +This is a toolset for developing and deploying *serverless* Python code in AWS Lambda. + +.. Important:: -Important -======================= -This is a FORK of the original Python-lambda package by Nick Ficano. -It will NOT be updated regularly and is frozen per our projects needs. + This is a FORK of Nick Ficano's `Python-lambda `_ + package. It will NOT be updated regularly and is frozen for the needs of projects at the + `4D Nucleome Data Coordination and Integration Center (4DN-DCIC) + `_. Description =========== -AWS Lambda is a service that allows you to write Python, Java, or Node.js code that gets executed in response to events like http requests or files uploaded to S3. +AWS Lambda is a service that allows you to write Python, Java, or Node.js code that +gets executed in response to events like http requests or files uploaded to S3. + +Working with Lambda is relatively easy, but the process of bundling and deploying your code +is not as simple as it could be. + +The *Python-Lambda* library takes away the guess work of developing your Python-Lambda +services by providing you a toolset to streamline the annoying parts. + +Important Legal Notice +====================== -Working with Lambda is relatively easy, but the process of bundling and deploying your code is not as simple as it could be. +The original `Python-lambda `_ is licensed under +an ISC license. `The version of that license active at time of the fork is here +`_. +Github's summary of that license describes it as: -The *Python-Lambda* library takes away the guess work of developing your Python-Lambda services by providing you a toolset to streamline the annoying parts. + A permissive license lets people do anything with your code with proper attribution + and without warranty. The ISC license is functionally equivalent to the BSD 2-Clause + and MIT licenses, removing some language that is no longer necessary. -Requirements -============ +Since our derivative work is covered under the MIT license, and on a theory +that the underlying license is equivalent to the MIT license, +we shorthand our licensing requirements as just "MIT" because that's more consistent +with how we describe licensing for other 4DN-DCIC software. +However, for the properly formal legal detail, +please refer to our actual `LICENSE `_. + +System Requirements +=================== * Python 3.6 * Pip (Any should work) * Virtualenv (>=15.0.0) -* Virtualenvwrapper (>=4.7.1) + +Setting Up a Virtual Environment (OPTIONAL) +=========================================== + +This is optional. +If you do not create a virtual environment, Poetry will make one for you. +But there are still good reasons you might want to make your own, so here +are three ways to do it: + +* If you have virtualenvwrapper that knows to use Python 3.6:: + + mkvirtualenv myenv + +* If you have virtualenv but not virtualenvwrapper, and you have python3.6 in your ``PATH``:: + + virtualenv myenv -p python3.6 + +* If you are using ``pyenv`` to control what environment you use:: + + pyenv exec python -m venv myenv + + +Installing Poetry in a Virtual Environment +========================================== + +Once you have created a virtual environment, or have decided to just let Poetry handle that, +install with poetry:: + + poetry install + Getting Started =============== -Using this library is intended to be as straightforward as possible. Code for a very simple lambda used in the tests is reproduced below. +Using this library is intended to be as straightforward as possible. +Code for a very simple lambda used in the tests is reproduced below. .. code:: python @@ -57,11 +114,13 @@ Using this library is intended to be as straightforward as possible. Code for a 'description': 'Test lambda' } - def handler(event, context): return 'Hello! My input event is %s' % event -This code illustrates the two things required to create a lambda. The first is ``config``, which specifies metadata for AWS. One important thing to note in here is the ``role`` field. This must be a IAM role with Lambda permissions - the one in this example is ours. The second is the ``handler`` function. This is the actual code that is executed. +This code illustrates the two things required to create a lambda. The first is ``config``, +which specifies metadata for AWS. One important thing to note in here is the ``role`` field. +This must be a IAM role with Lambda permissions - the one in this example is ours. +The second is the ``handler`` function. This is the actual code that is executed. Given this code in ``example_function.py`` you would deploy this function like so: @@ -75,14 +134,34 @@ Given this code in ``example_function.py`` you would deploy this function like s requirements_fpath='path/to/requirements', extra_config={'optional_arguments_for': 'boto3'}) -And that's it! You've deployed a simple lambda function. You can navigate to the AWS console to create a test event to trigger it or you can invoke it directly using Boto3. +And that's it! You've deployed a simple lambda function. You can navigate to the AWS +console to create a test event to trigger it or you can invoke it directly using Boto3. Advanced Usage ============== -Many of the options specified in the above code block when it came to actually deploying the function are not used. These become more useful as you want to make more complicated lambda functions. The ideal way to incorporate dependencies into lambda functions is by providing a ``requirements.txt`` file. We rely on ``pip`` to install these packages and have found it to be very reliable. While it is also possible to specify local modules as well through ``package_objects``, doing so is not recommended because those modules must be specified at the top level of the repository in order to work out of the box. There is a comment on this topic in ``example_function_package.py`` with code on how to handle it. +Many of the options specified in the above code block when it came to actually +deploying the function are not used. These become more useful as you want to make more +complicated lambda functions. The ideal way to incorporate dependencies into lambda functions +is by providing a ``requirements.txt`` file. We rely on ``pip`` to install these packages +and have found it to be very reliable. While it is also possible to specify local modules +as well through ``package_objects``, doing so is not recommended because those modules +must be specified at the top level of the repository in order to work out of the box. +There is a comment on this topic in ``example_function_package.py`` +with code on how to handle it. Tests ======== -Tests can be found in the ``test_aws_lambda.py``. Using the tests as a guide to develop your lambdas is probably a good idea. You can also see how to invoke the lambdas directly from Python (and interpret the response). +Tests can be found in the ``test_aws_lambda.py``. Using the tests as a guide to develop +your lambdas is probably a good idea. You can also see how to invoke the lambdas directly +from Python (and interpret the response). You can invoke all of this by just doing:: + + pytest + +The usual ``pytest`` arguments are permited. For example, to invoke an individual test, +mention its name. To see verbose output, use ``-v``; or use ``-vv`` for extra-verbose output, +as in:: + + pytest -vv -k test_deploy_lambda_with_package_and_requirements + diff --git a/aws_lambda/_version.py b/aws_lambda/_version.py index 8256eeb..8af8d78 100644 --- a/aws_lambda/_version.py +++ b/aws_lambda/_version.py @@ -1,4 +1,7 @@ """Version information.""" +import pkg_resources + +# Information in this file is now superseded by the pyproject.toml file. # The following line *must* be the last in the module, exactly as formatted: -__version__ = "1.0.1" +__version__ = pkg_resources.get_distribution('python-lambda-4dn').version diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100644 index db73586..0000000 --- a/dev-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -pytest==5.2.2 -pytest-cov==2.8.1 diff --git a/dev-requirements.txt.DISABLED b/dev-requirements.txt.DISABLED new file mode 100644 index 0000000..a6128e4 --- /dev/null +++ b/dev-requirements.txt.DISABLED @@ -0,0 +1,4 @@ +pytest>=3.0.5,<4 +pytest-cov>=2.3.1,<3 +# pygments is only needed by PyCharm to render the README +pygments>=2 diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..7e11d8b --- /dev/null +++ b/poetry.lock @@ -0,0 +1,349 @@ +[[package]] +category = "dev" +description = "Atomic file writes." +name = "atomicwrites" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "1.3.0" + +[[package]] +category = "dev" +description = "Classes Without Boilerplate" +name = "attrs" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "19.3.0" + +[package.extras] +azure-pipelines = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "pytest-azurepipelines"] +dev = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "sphinx", "pre-commit"] +docs = ["sphinx", "zope.interface"] +tests = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] + +[[package]] +category = "main" +description = "The AWS SDK for Python" +name = "boto3" +optional = false +python-versions = "*" +version = "1.12.15" + +[package.dependencies] +botocore = ">=1.15.15,<1.16.0" +jmespath = ">=0.7.1,<1.0.0" +s3transfer = ">=0.3.0,<0.4.0" + +[[package]] +category = "main" +description = "Low-level, data-driven core of boto 3." +name = "botocore" +optional = false +python-versions = "*" +version = "1.15.15" + +[package.dependencies] +docutils = ">=0.10,<0.16" +jmespath = ">=0.7.1,<1.0.0" +python-dateutil = ">=2.1,<3.0.0" + +[package.dependencies.urllib3] +python = "<3.4.0 || >=3.5.0" +version = ">=1.20,<1.26" + +[[package]] +category = "dev" +description = "Cross-platform colored terminal text." +marker = "sys_platform == \"win32\"" +name = "colorama" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +version = "0.4.3" + +[[package]] +category = "dev" +description = "Code coverage measurement for Python" +name = "coverage" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" +version = "5.0.3" + +[package.extras] +toml = ["toml"] + +[[package]] +category = "main" +description = "Docutils -- Python Documentation Utilities" +name = "docutils" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +version = "0.15.2" + +[[package]] +category = "dev" +description = "Read metadata from Python packages" +marker = "python_version < \"3.8\"" +name = "importlib-metadata" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" +version = "1.5.0" + +[package.dependencies] +zipp = ">=0.5" + +[package.extras] +docs = ["sphinx", "rst.linker"] +testing = ["packaging", "importlib-resources"] + +[[package]] +category = "main" +description = "JSON Matching Expressions" +name = "jmespath" +optional = false +python-versions = "*" +version = "0.9.5" + +[[package]] +category = "dev" +description = "More routines for operating on iterables, beyond itertools" +name = "more-itertools" +optional = false +python-versions = ">=3.5" +version = "8.2.0" + +[[package]] +category = "dev" +description = "plugin and hook calling mechanisms for python" +name = "pluggy" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "0.13.1" + +[package.dependencies] +[package.dependencies.importlib-metadata] +python = "<3.8" +version = ">=0.12" + +[package.extras] +dev = ["pre-commit", "tox"] + +[[package]] +category = "dev" +description = "library with cross-python path, ini-parsing, io, code, log facilities" +name = "py" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "1.8.1" + +[[package]] +category = "dev" +description = "Pygments is a syntax highlighting package written in Python." +name = "pygments" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +version = "2.5.2" + +[[package]] +category = "dev" +description = "pytest: simple powerful testing with Python" +name = "pytest" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "3.10.1" + +[package.dependencies] +atomicwrites = ">=1.0" +attrs = ">=17.4.0" +colorama = "*" +more-itertools = ">=4.0.0" +pluggy = ">=0.7" +py = ">=1.5.0" +setuptools = "*" +six = ">=1.10.0" + +[[package]] +category = "dev" +description = "Pytest plugin for measuring coverage." +name = "pytest-cov" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "2.8.1" + +[package.dependencies] +coverage = ">=4.4" +pytest = ">=3.6" + +[package.extras] +testing = ["fields", "hunter", "process-tests (2.0.2)", "six", "virtualenv"] + +[[package]] +category = "main" +description = "Extensions to the standard Python datetime module" +name = "python-dateutil" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +version = "2.8.1" + +[package.dependencies] +six = ">=1.5" + +[[package]] +category = "main" +description = "An Amazon S3 Transfer Manager" +name = "s3transfer" +optional = false +python-versions = "*" +version = "0.3.3" + +[package.dependencies] +botocore = ">=1.12.36,<2.0a.0" + +[[package]] +category = "main" +description = "Python 2 and 3 compatibility utilities" +name = "six" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +version = "1.14.0" + +[[package]] +category = "main" +description = "HTTP library with thread-safe connection pooling, file post, and more." +marker = "python_version != \"3.4\"" +name = "urllib3" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" +version = "1.25.8" + +[package.extras] +brotli = ["brotlipy (>=0.6.0)"] +secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"] +socks = ["PySocks (>=1.5.6,<1.5.7 || >1.5.7,<2.0)"] + +[[package]] +category = "dev" +description = "Backport of pathlib-compatible object wrapper for zip files" +marker = "python_version < \"3.8\"" +name = "zipp" +optional = false +python-versions = ">=3.6" +version = "3.1.0" + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] +testing = ["jaraco.itertools", "func-timeout"] + +[metadata] +content-hash = "12e01b03db000db2532149f75270ee1202843cc5c55fc8e928b18f3e89e6bd35" +python-versions = ">=3.6,<3.7" + +[metadata.files] +atomicwrites = [ + {file = "atomicwrites-1.3.0-py2.py3-none-any.whl", hash = "sha256:03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4"}, + {file = "atomicwrites-1.3.0.tar.gz", hash = "sha256:75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6"}, +] +attrs = [ + {file = "attrs-19.3.0-py2.py3-none-any.whl", hash = "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c"}, + {file = "attrs-19.3.0.tar.gz", hash = "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"}, +] +boto3 = [ + {file = "boto3-1.12.15-py2.py3-none-any.whl", hash = "sha256:2eb7dd99d92bb094a1fcc5eb50162b304977f238c25557bfee98e25cba18ffc1"}, + {file = "boto3-1.12.15.tar.gz", hash = "sha256:d9406222f2442171e3a8a8da6e3b0cc780eed6ca835832bb993726d21914708b"}, +] +botocore = [ + {file = "botocore-1.15.15-py2.py3-none-any.whl", hash = "sha256:0347c44d3913ed0a818f83e0c317120f07c150a63ca4167ad3b4b55240a26f42"}, + {file = "botocore-1.15.15.tar.gz", hash = "sha256:857ec0be8aabd3591b0cca382bce723c0802d48ac0f0e8798ce305af93112a24"}, +] +colorama = [ + {file = "colorama-0.4.3-py2.py3-none-any.whl", hash = "sha256:7d73d2a99753107a36ac6b455ee49046802e59d9d076ef8e47b61499fa29afff"}, + {file = "colorama-0.4.3.tar.gz", hash = "sha256:e96da0d330793e2cb9485e9ddfd918d456036c7149416295932478192f4436a1"}, +] +coverage = [ + {file = "coverage-5.0.3-cp27-cp27m-macosx_10_12_x86_64.whl", hash = "sha256:cc1109f54a14d940b8512ee9f1c3975c181bbb200306c6d8b87d93376538782f"}, + {file = "coverage-5.0.3-cp27-cp27m-macosx_10_13_intel.whl", hash = "sha256:be18f4ae5a9e46edae3f329de2191747966a34a3d93046dbdf897319923923bc"}, + {file = "coverage-5.0.3-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:3230d1003eec018ad4a472d254991e34241e0bbd513e97a29727c7c2f637bd2a"}, + {file = "coverage-5.0.3-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:e69215621707119c6baf99bda014a45b999d37602cb7043d943c76a59b05bf52"}, + {file = "coverage-5.0.3-cp27-cp27m-win32.whl", hash = "sha256:1daa3eceed220f9fdb80d5ff950dd95112cd27f70d004c7918ca6dfc6c47054c"}, + {file = "coverage-5.0.3-cp27-cp27m-win_amd64.whl", hash = "sha256:51bc7710b13a2ae0c726f69756cf7ffd4362f4ac36546e243136187cfcc8aa73"}, + {file = "coverage-5.0.3-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:9bea19ac2f08672636350f203db89382121c9c2ade85d945953ef3c8cf9d2a68"}, + {file = "coverage-5.0.3-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:5012d3b8d5a500834783689a5d2292fe06ec75dc86ee1ccdad04b6f5bf231691"}, + {file = "coverage-5.0.3-cp35-cp35m-macosx_10_12_x86_64.whl", hash = "sha256:d513cc3db248e566e07a0da99c230aca3556d9b09ed02f420664e2da97eac301"}, + {file = "coverage-5.0.3-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:3dbb72eaeea5763676a1a1efd9b427a048c97c39ed92e13336e726117d0b72bf"}, + {file = "coverage-5.0.3-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:15cf13a6896048d6d947bf7d222f36e4809ab926894beb748fc9caa14605d9c3"}, + {file = "coverage-5.0.3-cp35-cp35m-win32.whl", hash = "sha256:fca1669d464f0c9831fd10be2eef6b86f5ebd76c724d1e0706ebdff86bb4adf0"}, + {file = "coverage-5.0.3-cp35-cp35m-win_amd64.whl", hash = "sha256:1e44a022500d944d42f94df76727ba3fc0a5c0b672c358b61067abb88caee7a0"}, + {file = "coverage-5.0.3-cp36-cp36m-macosx_10_13_x86_64.whl", hash = "sha256:b26aaf69713e5674efbde4d728fb7124e429c9466aeaf5f4a7e9e699b12c9fe2"}, + {file = "coverage-5.0.3-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:722e4557c8039aad9592c6a4213db75da08c2cd9945320220634f637251c3894"}, + {file = "coverage-5.0.3-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:7afad9835e7a651d3551eab18cbc0fdb888f0a6136169fbef0662d9cdc9987cf"}, + {file = "coverage-5.0.3-cp36-cp36m-win32.whl", hash = "sha256:25dbf1110d70bab68a74b4b9d74f30e99b177cde3388e07cc7272f2168bd1477"}, + {file = "coverage-5.0.3-cp36-cp36m-win_amd64.whl", hash = "sha256:c312e57847db2526bc92b9bfa78266bfbaabac3fdcd751df4d062cd4c23e46dc"}, + {file = "coverage-5.0.3-cp37-cp37m-macosx_10_13_x86_64.whl", hash = "sha256:a8b8ac7876bc3598e43e2603f772d2353d9931709345ad6c1149009fd1bc81b8"}, + {file = "coverage-5.0.3-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:527b4f316e6bf7755082a783726da20671a0cc388b786a64417780b90565b987"}, + {file = "coverage-5.0.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:d649dc0bcace6fcdb446ae02b98798a856593b19b637c1b9af8edadf2b150bea"}, + {file = "coverage-5.0.3-cp37-cp37m-win32.whl", hash = "sha256:cd60f507c125ac0ad83f05803063bed27e50fa903b9c2cfee3f8a6867ca600fc"}, + {file = "coverage-5.0.3-cp37-cp37m-win_amd64.whl", hash = "sha256:c60097190fe9dc2b329a0eb03393e2e0829156a589bd732e70794c0dd804258e"}, + {file = "coverage-5.0.3-cp38-cp38-macosx_10_13_x86_64.whl", hash = "sha256:d7008a6796095a79544f4da1ee49418901961c97ca9e9d44904205ff7d6aa8cb"}, + {file = "coverage-5.0.3-cp38-cp38-manylinux1_i686.whl", hash = "sha256:ea9525e0fef2de9208250d6c5aeeee0138921057cd67fcef90fbed49c4d62d37"}, + {file = "coverage-5.0.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:c62a2143e1313944bf4a5ab34fd3b4be15367a02e9478b0ce800cb510e3bbb9d"}, + {file = "coverage-5.0.3-cp38-cp38m-win32.whl", hash = "sha256:b0840b45187699affd4c6588286d429cd79a99d509fe3de0f209594669bb0954"}, + {file = "coverage-5.0.3-cp38-cp38m-win_amd64.whl", hash = "sha256:76e2057e8ffba5472fd28a3a010431fd9e928885ff480cb278877c6e9943cc2e"}, + {file = "coverage-5.0.3-cp39-cp39m-win32.whl", hash = "sha256:b63dd43f455ba878e5e9f80ba4f748c0a2156dde6e0e6e690310e24d6e8caf40"}, + {file = "coverage-5.0.3-cp39-cp39m-win_amd64.whl", hash = "sha256:da93027835164b8223e8e5af2cf902a4c80ed93cb0909417234f4a9df3bcd9af"}, + {file = "coverage-5.0.3.tar.gz", hash = "sha256:77afca04240c40450c331fa796b3eab6f1e15c5ecf8bf2b8bee9706cd5452fef"}, +] +docutils = [ + {file = "docutils-0.15.2-py2-none-any.whl", hash = "sha256:9e4d7ecfc600058e07ba661411a2b7de2fd0fafa17d1a7f7361cd47b1175c827"}, + {file = "docutils-0.15.2-py3-none-any.whl", hash = "sha256:6c4f696463b79f1fb8ba0c594b63840ebd41f059e92b31957c46b74a4599b6d0"}, + {file = "docutils-0.15.2.tar.gz", hash = "sha256:a2aeea129088da402665e92e0b25b04b073c04b2dce4ab65caaa38b7ce2e1a99"}, +] +importlib-metadata = [ + {file = "importlib_metadata-1.5.0-py2.py3-none-any.whl", hash = "sha256:b97607a1a18a5100839aec1dc26a1ea17ee0d93b20b0f008d80a5a050afb200b"}, + {file = "importlib_metadata-1.5.0.tar.gz", hash = "sha256:06f5b3a99029c7134207dd882428a66992a9de2bef7c2b699b5641f9886c3302"}, +] +jmespath = [ + {file = "jmespath-0.9.5-py2.py3-none-any.whl", hash = "sha256:695cb76fa78a10663425d5b73ddc5714eb711157e52704d69be03b1a02ba4fec"}, + {file = "jmespath-0.9.5.tar.gz", hash = "sha256:cca55c8d153173e21baa59983015ad0daf603f9cb799904ff057bfb8ff8dc2d9"}, +] +more-itertools = [ + {file = "more-itertools-8.2.0.tar.gz", hash = "sha256:b1ddb932186d8a6ac451e1d95844b382f55e12686d51ca0c68b6f61f2ab7a507"}, + {file = "more_itertools-8.2.0-py3-none-any.whl", hash = "sha256:5dd8bcf33e5f9513ffa06d5ad33d78f31e1931ac9a18f33d37e77a180d393a7c"}, +] +pluggy = [ + {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, + {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, +] +py = [ + {file = "py-1.8.1-py2.py3-none-any.whl", hash = "sha256:c20fdd83a5dbc0af9efd622bee9a5564e278f6380fffcacc43ba6f43db2813b0"}, + {file = "py-1.8.1.tar.gz", hash = "sha256:5e27081401262157467ad6e7f851b7aa402c5852dbcb3dae06768434de5752aa"}, +] +pygments = [ + {file = "Pygments-2.5.2-py2.py3-none-any.whl", hash = "sha256:2a3fe295e54a20164a9df49c75fa58526d3be48e14aceba6d6b1e8ac0bfd6f1b"}, + {file = "Pygments-2.5.2.tar.gz", hash = "sha256:98c8aa5a9f778fcd1026a17361ddaf7330d1b7c62ae97c3bb0ae73e0b9b6b0fe"}, +] +pytest = [ + {file = "pytest-3.10.1-py2.py3-none-any.whl", hash = "sha256:3f193df1cfe1d1609d4c583838bea3d532b18d6160fd3f55c9447fdca30848ec"}, + {file = "pytest-3.10.1.tar.gz", hash = "sha256:e246cf173c01169b9617fc07264b7b1316e78d7a650055235d6d897bc80d9660"}, +] +pytest-cov = [ + {file = "pytest-cov-2.8.1.tar.gz", hash = "sha256:cc6742d8bac45070217169f5f72ceee1e0e55b0221f54bcf24845972d3a47f2b"}, + {file = "pytest_cov-2.8.1-py2.py3-none-any.whl", hash = "sha256:cdbdef4f870408ebdbfeb44e63e07eb18bb4619fae852f6e760645fa36172626"}, +] +python-dateutil = [ + {file = "python-dateutil-2.8.1.tar.gz", hash = "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c"}, + {file = "python_dateutil-2.8.1-py2.py3-none-any.whl", hash = "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a"}, +] +s3transfer = [ + {file = "s3transfer-0.3.3-py2.py3-none-any.whl", hash = "sha256:2482b4259524933a022d59da830f51bd746db62f047d6eb213f2f8855dcb8a13"}, + {file = "s3transfer-0.3.3.tar.gz", hash = "sha256:921a37e2aefc64145e7b73d50c71bb4f26f46e4c9f414dc648c6245ff92cf7db"}, +] +six = [ + {file = "six-1.14.0-py2.py3-none-any.whl", hash = "sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c"}, + {file = "six-1.14.0.tar.gz", hash = "sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a"}, +] +urllib3 = [ + {file = "urllib3-1.25.8-py2.py3-none-any.whl", hash = "sha256:2f3db8b19923a873b3e5256dc9c2dedfa883e33d87c690d9c7913e1f40673cdc"}, + {file = "urllib3-1.25.8.tar.gz", hash = "sha256:87716c2d2a7121198ebcb7ce7cccf6ce5e9ba539041cfbaeecfb641dc0bf6acc"}, +] +zipp = [ + {file = "zipp-3.1.0-py3-none-any.whl", hash = "sha256:aa36550ff0c0b7ef7fa639055d797116ee891440eac1a56f378e2d3179e0320b"}, + {file = "zipp-3.1.0.tar.gz", hash = "sha256:c599e4d75c98f6798c509911d08a22e6c021d074469042177c8c86fb92eefd96"}, +] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e96a2db --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,44 @@ +[tool.poetry] +name = "python-lambda-4dn" +version = "2.0.0b2" +description = "A forked version of python-lambda for 4DN-DCIC use in packaging and deploying lambda functions." +authors = ["4DN-DCIC Team "] +license = "MIT" +keywords = ["python-lambda"] +readme = "README.rst" +homepage = "https://github.com/4dn-dcic/python-lambda" +repository = "https://github.com/4dn-dcic/python-lambda" +packages = [ + { include="aws_lambda", from="." } +] +classifiers = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Natural Language :: English', + 'Programming Language :: Python :: 3.6', +] +include = [ + # The history file is unreferenced and empty. -kmp 12-Mar-2020 + # "HISTORY.rst", + "LICENSE", +] + +[tool.poetry.dependencies] +python = ">=3.6,<3.7" +"botocore" = ">=1.13.7,<2" +"boto3" = ">=1.10.7,<2" +"docutils" = ">=0.14,<0.16" +"six" = ">=1.12.0,<2" + +[tool.poetry.dev-dependencies] +# This (coveralls) is installed by .travis.yml. Should we depend on it here? -kmp 6-Mar-2020 +# "coveralls" = ">=1.11.1,<2" +"pytest" = ">=3.0.5,<4" +"pytest-cov" = ">=2.3.1,<3" +# pygments is only needed by PyCharm to render the README +"pygments" = ">=2" + +[build-system] +requires = ["poetry>=0.12"] +build-backend = "poetry.masonry.api" diff --git a/pytest.ini b/pytest.ini index 03777c0..e4afc0e 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,4 +1,7 @@ [pytest] +addopts = + --pyargs tests + -p tests markers = unit: marks tests that are unit integration: marks tests that are integration diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 7db506f..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -botocore==1.13.7 -boto3==1.10.7 -docutils>=0.14 -six==1.12.0 diff --git a/requirements.txt.DISABLED b/requirements.txt.DISABLED new file mode 100644 index 0000000..458c6ba --- /dev/null +++ b/requirements.txt.DISABLED @@ -0,0 +1,4 @@ +botocore>=1.13.7,<2 +boto3>=1.10.7,<2 +docutils>=0.14,<0.16 +six>=1.12.0,<2 diff --git a/setup.py b/setup.py.DISABLED similarity index 100% rename from setup.py rename to setup.py.DISABLED