diff --git a/Makefile b/Makefile index ff99587..2bbd62c 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,7 @@ target: .PHONY: init init: - pip3 install -r requirements/base.txt -r requirements/dev.txt - + pip install --user -e . .PHONY: test test: check-format pytest --cov awslambdaric --cov-report term-missing --cov-fail-under 90 tests @@ -28,11 +27,11 @@ check-security: bandit -r awslambdaric .PHONY: format -format: +format: init black setup.py awslambdaric/ tests/ .PHONY: check-format -check-format: +check-format: init black --check setup.py awslambdaric/ tests/ # Command to run everytime you make changes to verify everything works @@ -52,7 +51,7 @@ clean: .PHONY: build build: clean - BUILD=true python3 setup.py sdist + BUILD=true python -m build --sdist --wheel define HELP_MESSAGE diff --git a/awslambdaric/__init__.py b/awslambdaric/__init__.py index c0d8290..21bc685 100644 --- a/awslambdaric/__init__.py +++ b/awslambdaric/__init__.py @@ -2,4 +2,6 @@ Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. """ -__version__ = "2.0.12" +import importlib.metadata + +__version__ = importlib.metadata.version("awslambdaric") diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d300441 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,52 @@ +[project] +name = "awslambdaric" +version = "2.0.12" +description = "AWS Lambda Runtime Interface Client for Python" +authors = [ + { name = "Amazon Web Services" } +] +dependencies = [ + "simplejson>=3.18.4" +] +readme = "README.md" +requires-python = ">= 3.8" + +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", +] + +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project.optional-dependencies] +dev = [ + "coverage>=4.4.0", + "flake8>=3.3.0", + "tox>=2.2.1", + "pytest-cov>=2.4.0", + "pylint>=1.7.2", + "black>=20.8b0", + "bandit>=1.6.2", + + # Test requirements + "pytest>=3.0.7", + "mock>=2.0.0", + "parameterized>=0.9.0", +] + +[project.urls] +Repository = "https://github.com/aws/aws-lambda-python-runtime-interface-client" +Issues = "https://github.com/aws/aws-lambda-python-runtime-interface-client/issues" diff --git a/requirements/base.txt b/requirements/base.txt deleted file mode 100644 index 819c723..0000000 --- a/requirements/base.txt +++ /dev/null @@ -1 +0,0 @@ -simplejson>=3.18.4 diff --git a/requirements/dev.txt b/requirements/dev.txt deleted file mode 100644 index 68377ce..0000000 --- a/requirements/dev.txt +++ /dev/null @@ -1,12 +0,0 @@ -coverage>=4.4.0 -flake8>=3.3.0 -tox>=2.2.1 -pytest-cov>=2.4.0 -pylint>=1.7.2 -black>=20.8b0 -bandit>=1.6.2 - -# Test requirements -pytest>=3.0.7 -mock>=2.0.0 -parameterized>=0.9.0 \ No newline at end of file diff --git a/setup.py b/setup.py index 2544b21..7423da0 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,6 @@ import platform from subprocess import check_call, check_output from setuptools import Extension, find_packages, setup -from awslambdaric import __version__ def get_curl_extra_linker_flags(): @@ -59,42 +58,10 @@ def read(*filenames, **kwargs): buf.append(f.read()) return sep.join(buf) - -def read_requirements(req="base.txt"): - content = read(os.path.join("requirements", req)) - return [ - line for line in content.split(os.linesep) if not line.strip().startswith("#") - ] - - setup( - name="awslambdaric", - version=__version__, - author="Amazon Web Services", - description="AWS Lambda Runtime Interface Client for Python", - long_description=read("README.md"), - long_description_content_type="text/markdown", - url="https://github.com/aws/aws-lambda-python-runtime-interface-client", packages=find_packages( exclude=("tests", "tests.*", "docs", "examples", "versions") ), - install_requires=read_requirements("base.txt"), - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "Natural Language :: English", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "License :: OSI Approved :: Apache Software License", - "Operating System :: OS Independent", - ], - python_requires=">=3.6", ext_modules=get_runtime_client_extension(), test_suite="tests", )