Skip to content
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

Migrate to pyproject.toml #158

Closed
wants to merge 4 commits into from
Closed
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
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
4 changes: 3 additions & 1 deletion awslambdaric/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we stick with 3.6?

python_requires=">=3.6",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's technically not supported anymore. I am not sure. We can do either.


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"
1 change: 0 additions & 1 deletion requirements/base.txt

This file was deleted.

12 changes: 0 additions & 12 deletions requirements/dev.txt

This file was deleted.

33 changes: 0 additions & 33 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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",
)
Loading