Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit b0638bc

Browse files
authored
Add Makefile, setup.py, Pipfile, and configuration files (#9)
1 parent ba2bdcc commit b0638bc

File tree

10 files changed

+1352
-2
lines changed

10 files changed

+1352
-2
lines changed

.pylintrc

Lines changed: 481 additions & 0 deletions
Large diffs are not rendered by default.

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include README.md LICENSE NOTICE CONTRIBUTING.md CODE_OF_CONDUCT.md
2+
include Pipfile Pipfile.lock Makefile
3+
recursive-include tests *.py

Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
init:
2+
pip install pipenv --upgrade
3+
pipenv install --dev --skip-lock
4+
5+
test:
6+
# Run unit tests, fail if coverage falls below 85%
7+
pipenv run pytest --cov serverlessrepo --cov-report term-missing --cov-fail-under 85 tests/unit
8+
9+
flake:
10+
# Make sure code conforms to PEP8 standards
11+
pipenv run flake8 serverlessrepo
12+
pipenv run flake8 tests
13+
14+
lint:
15+
# Linter performs static analysis to catch latent bugs
16+
pipenv run pylint --rcfile .pylintrc serverlessrepo
17+
18+
# Command to run everytime you make changes to verify everything works
19+
build: flake lint test
20+
21+
# Verifications to run before sending a pull request
22+
pr: init build

Pipfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[dev-packages]
7+
pytest = "*"
8+
pytest-cov = "*"
9+
pylint = "*"
10+
mock = "*"
11+
"flake8" = "*"
12+
"flake8-docstrings" = "*"
13+
tox = "*"
14+
15+
[packages]
16+
serverlessrepo = {path = ".",extras = ["dev"],editable = true}

Pipfile.lock

Lines changed: 724 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

serverlessrepo/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
Common library for AWS Serverless Application Repository
33
"""
44

5-
from .publish import publish_application
6-
from .permission_helper import make_application_public, make_application_private, share_application_with_accounts
5+
from .publish import publish_application # noqa: F401
6+
from .permission_helper import ( # noqa: F401
7+
make_application_public,
8+
make_application_private,
9+
share_application_with_accounts
10+
)

serverlessrepo/__version__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
Serverlessrepo version and package meta-data.
3+
"""
4+
5+
__title__ = 'serverlessrepo'
6+
__version__ = '0.1.0'
7+
__license__ = 'Apache 2.0'
8+
__description__ = (
9+
'A Python library with convenience helpers for working '
10+
'with the AWS Serverless Application Repository.'
11+
)
12+
__url__ = 'https://github.com/awslabs/aws-serverlessrepo-python'
13+
__author__ = 'Amazon Web Services'
14+
__author_email__ = '<TBD>'

setup.cfg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[metadata]
2+
description-file = README.md
3+
license_file = LICENSE
4+
5+
[flake8]
6+
max-line-length = 120
7+
8+
[bdist_wheel]
9+
universal=1

setup.py

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
"""A setuptools based setup module."""
2+
3+
from io import open
4+
from os import path
5+
from setuptools import setup, find_packages
6+
7+
# Required packages for this module to work
8+
REQUIRED = [
9+
'pyyaml',
10+
'boto3',
11+
'six'
12+
]
13+
14+
# Optional packages for this module to work
15+
EXTRAS = {
16+
'dev': [
17+
'pytest',
18+
'pytest-cov',
19+
'pylint',
20+
'mock',
21+
'flake8',
22+
'flake8-docstrings'
23+
]
24+
}
25+
26+
here = path.abspath(path.dirname(__file__))
27+
28+
# Get the long description from the README file
29+
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
30+
long_description = '\n' + f.read()
31+
32+
about = {}
33+
with open(path.join(here, 'serverlessrepo', '__version__.py')) as f:
34+
exec(f.read(), about)
35+
36+
setup(
37+
name=about['__title__'],
38+
version=about['__version__'],
39+
description=about['__description__'],
40+
long_description=long_description,
41+
long_description_content_type='text/markdown',
42+
author=about['__author__'],
43+
author_email=about['__author_email__'],
44+
url=about['__url__'],
45+
license=about['__license__'],
46+
keywords="AWS Serverless Application Repository",
47+
packages=find_packages(exclude=['tests', 'docs']),
48+
# Support Python 2.7 and 3.6 or greater
49+
python_requires=(
50+
'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*'
51+
),
52+
install_requires=REQUIRED,
53+
extras_require=EXTRAS,
54+
classifiers=[
55+
'Development Status :: 4 - Beta',
56+
'Environment :: Console',
57+
'Environment :: Other Environment',
58+
'Intended Audience :: Developers',
59+
'Intended Audience :: Information Technology',
60+
'License :: OSI Approved :: Apache Software License',
61+
'Operating System :: OS Independent',
62+
'Programming Language :: Python',
63+
'Programming Language :: Python :: 2.7',
64+
'Programming Language :: Python :: 3.6',
65+
'Programming Language :: Python :: 3.7',
66+
'Topic :: Internet',
67+
'Topic :: Software Development :: Build Tools',
68+
'Topic :: Utilities',
69+
]
70+
)

tox.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[tox]
2+
envlist = py27, py36, py37
3+
4+
[testenv]
5+
whitelist_externals = make
6+
commands =
7+
make pr

0 commit comments

Comments
 (0)