Skip to content

Commit e7059e1

Browse files
Migrate to pyproject.toml
1 parent 57e70f5 commit e7059e1

File tree

6 files changed

+62
-52
lines changed

6 files changed

+62
-52
lines changed

Makefile

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ target:
55

66
.PHONY: init
77
init:
8-
pip3 install -r requirements/base.txt -r requirements/dev.txt
9-
8+
pip3 install -e .
109
.PHONY: test
1110
test: check-format
1211
pytest --cov awslambdaric --cov-report term-missing --cov-fail-under 90 tests
@@ -28,11 +27,11 @@ check-security:
2827
bandit -r awslambdaric
2928

3029
.PHONY: format
31-
format:
30+
format: init
3231
black setup.py awslambdaric/ tests/
3332

3433
.PHONY: check-format
35-
check-format:
34+
check-format: init
3635
black --check setup.py awslambdaric/ tests/
3736

3837
# Command to run everytime you make changes to verify everything works
@@ -52,7 +51,7 @@ clean:
5251

5352
.PHONY: build
5453
build: clean
55-
BUILD=true python3 setup.py sdist
54+
BUILD=true python3 -m build --sdist --wheel
5655

5756
define HELP_MESSAGE
5857

awslambdaric/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
"""
44

5-
__version__ = "2.0.12"
5+
import importlib.metadata
6+
7+
__version__ = importlib.metadata.version("awslambdaric")

pyproject.toml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[project]
2+
name = "awslambdaric"
3+
version = "2.0.12"
4+
description = "AWS Lambda Runtime Interface Client for Python"
5+
authors = [
6+
{ name = "Amazon Web Services" }
7+
]
8+
dependencies = [
9+
"simplejson>=3.18.4"
10+
]
11+
readme = "README.md"
12+
requires-python = ">= 3.8"
13+
14+
classifiers = [
15+
"Development Status :: 5 - Production/Stable",
16+
"Intended Audience :: Developers",
17+
"Natural Language :: English",
18+
"Programming Language :: Python :: 3",
19+
"Programming Language :: Python :: 3.6",
20+
"Programming Language :: Python :: 3.7",
21+
"Programming Language :: Python :: 3.8",
22+
"Programming Language :: Python :: 3.9",
23+
"Programming Language :: Python :: 3.10",
24+
"Programming Language :: Python :: 3.11",
25+
"Programming Language :: Python :: 3.12",
26+
"License :: OSI Approved :: Apache Software License",
27+
"Operating System :: OS Independent",
28+
]
29+
30+
[build-system]
31+
requires = ["setuptools>=61.0"]
32+
build-backend = "setuptools.build_meta"
33+
34+
[tool.setuptools.dynamic]
35+
version = {attr = "awslambdaric.VERSION"}
36+
37+
[project.optional-dependencies]
38+
dev = [
39+
"coverage>=4.4.0",
40+
"flake8>=3.3.0",
41+
"tox>=2.2.1",
42+
"pytest-cov>=2.4.0",
43+
"pylint>=1.7.2",
44+
"black>=20.8b0",
45+
"bandit>=1.6.2",
46+
47+
# Test requirements
48+
"pytest>=3.0.7",
49+
"mock>=2.0.0",
50+
"parameterized>=0.9.0",
51+
]
52+
53+
[project.urls]
54+
Repository = "https://github.com/aws/aws-lambda-python-runtime-interface-client"
55+
Issues = "https://github.com/aws/aws-lambda-python-runtime-interface-client/issues"

requirements/base.txt

-1
This file was deleted.

requirements/dev.txt

-12
This file was deleted.

setup.py

-33
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import platform
88
from subprocess import check_call, check_output
99
from setuptools import Extension, find_packages, setup
10-
from awslambdaric import __version__
1110

1211

1312
def get_curl_extra_linker_flags():
@@ -59,42 +58,10 @@ def read(*filenames, **kwargs):
5958
buf.append(f.read())
6059
return sep.join(buf)
6160

62-
63-
def read_requirements(req="base.txt"):
64-
content = read(os.path.join("requirements", req))
65-
return [
66-
line for line in content.split(os.linesep) if not line.strip().startswith("#")
67-
]
68-
69-
7061
setup(
71-
name="awslambdaric",
72-
version=__version__,
73-
author="Amazon Web Services",
74-
description="AWS Lambda Runtime Interface Client for Python",
75-
long_description=read("README.md"),
76-
long_description_content_type="text/markdown",
77-
url="https://github.com/aws/aws-lambda-python-runtime-interface-client",
7862
packages=find_packages(
7963
exclude=("tests", "tests.*", "docs", "examples", "versions")
8064
),
81-
install_requires=read_requirements("base.txt"),
82-
classifiers=[
83-
"Development Status :: 5 - Production/Stable",
84-
"Intended Audience :: Developers",
85-
"Natural Language :: English",
86-
"Programming Language :: Python :: 3",
87-
"Programming Language :: Python :: 3.6",
88-
"Programming Language :: Python :: 3.7",
89-
"Programming Language :: Python :: 3.8",
90-
"Programming Language :: Python :: 3.9",
91-
"Programming Language :: Python :: 3.10",
92-
"Programming Language :: Python :: 3.11",
93-
"Programming Language :: Python :: 3.12",
94-
"License :: OSI Approved :: Apache Software License",
95-
"Operating System :: OS Independent",
96-
],
97-
python_requires=">=3.6",
9865
ext_modules=get_runtime_client_extension(),
9966
test_suite="tests",
10067
)

0 commit comments

Comments
 (0)