Skip to content

Commit 1d3c1bc

Browse files
committed
initial package setup
1 parent dc15b81 commit 1d3c1bc

14 files changed

+507
-2
lines changed

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
*.egg-info
2+
*.pyc
3+
*.pyo
4+
*~
5+
.DS_Store
6+
.tox
7+
/.cache*
8+
/.coverage*
9+
/build
10+
/doc/generated/*
11+
/runpy
12+
__pycache__
13+
build
14+
dist
15+
docs/build
16+
.python-version
17+
.mypy_cache
18+
.hypothesis
19+
.pytest_cache

CHANGELOG.rst

Whitespace-only changes.

MANIFEST.in

Whitespace-only changes.

README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

README.rst

Whitespace-only changes.

doc/conf.py

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# pylint: disable=invalid-name
2+
"""Sphinx configuration."""
3+
from datetime import datetime
4+
import io
5+
import os
6+
import re
7+
8+
VERSION_RE = re.compile(r'''__version__ = ['"]([0-9.]+)['"]''')
9+
HERE = os.path.abspath(os.path.dirname(__file__))
10+
11+
12+
def read(*args):
13+
"""Reads complete file contents."""
14+
return io.open(os.path.join(HERE, *args), encoding='utf-8').read()
15+
16+
17+
def get_release():
18+
"""Reads the release (full three-part version number) from this module."""
19+
init = read('..', 'src', 'dynamodb_encryption_sdk', 'identifiers.py')
20+
return VERSION_RE.search(init).group(1)
21+
22+
23+
def get_version():
24+
"""Reads the version (MAJOR.MINOR) from this module."""
25+
_release = get_release()
26+
split_version = _release.split('.')
27+
if len(split_version) == 3:
28+
return '.'.join(split_version[:2])
29+
return _release
30+
31+
32+
project = u'dynamodb-encryption-sdk-python'
33+
version = get_version()
34+
release = get_release()
35+
36+
# Add any Sphinx extension module names here, as strings. They can be extensions
37+
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
38+
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
39+
'sphinx.ext.intersphinx', 'sphinx.ext.todo',
40+
'sphinx.ext.coverage', 'sphinx.ext.autosummary',
41+
'sphinx.ext.napoleon']
42+
napoleon_include_special_with_doc = False
43+
44+
# Add any paths that contain templates here, relative to this directory.
45+
templates_path = ['_templates']
46+
47+
source_suffix = '.rst' # The suffix of source filenames.
48+
master_doc = 'index' # The master toctree document.
49+
50+
copyright = u'%s, Amazon' % datetime.now().year # pylint: disable=redefined-builtin
51+
52+
# List of directories, relative to source directory, that shouldn't be searched
53+
# for source files.
54+
exclude_trees = ['_build']
55+
56+
pygments_style = 'sphinx'
57+
58+
autoclass_content = "both"
59+
autodoc_default_flags = ['show-inheritance', 'members']
60+
autodoc_member_order = 'bysource'
61+
62+
html_theme = 'sphinx_rtd_theme'
63+
html_static_path = ['_static']
64+
htmlhelp_basename = '%sdoc' % project
65+
66+
# Example configuration for intersphinx: refer to the Python standard library.
67+
intersphinx_mapping = {'http://docs.python.org/': None}
68+
69+
# autosummary
70+
autosummary_generate = True

doc/index.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
.. include:: ../README.rst
2+
3+
*******
4+
Modules
5+
*******
6+
7+
.. autosummary::
8+
:toctree: generated
9+
10+
.. Add/replace module names you want documented here
11+
dynamodb_encryption_sdk
12+
dynamodb_encryption_sdk.exceptions
13+
dynamodb_encryption_sdk.identifiers
14+
dynamodb_encryption_sdk.structures
15+
dynamodb_encryption_sdk.encrypted
16+
dynamodb_encryption_sdk.encrypted.client
17+
dynamodb_encryption_sdk.encrypted.item
18+
dynamodb_encryption_sdk.encrypted.resource
19+
dynamodb_encryption_sdk.encrypted.table
20+
dynamodb_encryption_sdk.material_providers
21+
dynamodb_encryption_sdk.material_providers.aws_kms
22+
dynamodb_encryption_sdk.material_providers.static
23+
dynamodb_encryption_sdk.material_providers.wrapped
24+
dynamodb_encryption_sdk.material_providers.store
25+
dynamodb_encryption_sdk.materials
26+
dynamodb_encryption_sdk.materials.raw
27+
dynamodb_encryption_sdk.materials.wrapped
28+
dynamodb_encryption_sdk.internal
29+
dynamodb_encryption_sdk.internal.defaults
30+
dynamodb_encryption_sdk.internal.dynamodb_types
31+
dynamodb_encryption_sdk.internal.identifiers
32+
dynamodb_encryption_sdk.internal.str_ops
33+
dynamodb_encryption_sdk.internal.utils
34+
dynamodb_encryption_sdk.internal.crypto
35+
dynamodb_encryption_sdk.internal.crypto.jce_bridge
36+
dynamodb_encryption_sdk.internal.crypto.jce_bridge.authentication
37+
dynamodb_encryption_sdk.internal.crypto.jce_bridge.encryption
38+
dynamodb_encryption_sdk.internal.crypto.jce_bridge.primitives
39+
dynamodb_encryption_sdk.internal.crypto.authentication
40+
dynamodb_encryption_sdk.internal.crypto.encryption
41+
dynamodb_encryption_sdk.internal.formatting
42+
dynamodb_encryption_sdk.internal.formatting.deserialize
43+
dynamodb_encryption_sdk.internal.formatting.deserialize.attribute
44+
dynamodb_encryption_sdk.internal.formatting.serialize
45+
dynamodb_encryption_sdk.internal.formatting.serialize.attribute
46+
dynamodb_encryption_sdk.internal.formatting.material_description
47+
dynamodb_encryption_sdk.internal.formatting.transform
48+
49+
.. include:: ../CHANGELOG.rst

doc/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sphinx>=1.3.0
2+
sphinx_rtd_theme

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
boto3>=1.4.4
2+
cryptography>=1.8.1
3+
attrs>=16.3.0
4+
wrapt>=1.10.11
5+
typing>=3.6.2

setup.cfg

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[wheel]
2+
universal = 1
3+
4+
[metadata]
5+
license_file = LICENSE
6+
7+
[coverage:run]
8+
branch = True
9+
10+
[coverage:report]
11+
show_missing = True
12+
13+
[mypy]
14+
ignore_missing_imports = True
15+
16+
[tool:pytest]
17+
markers =
18+
local: superset of unit and functional (does not require network access)
19+
unit: mark test as a unit test (does not require network access)
20+
functional: mark test as a functional test (does not require network access)
21+
integ: mark a test as an integration test (requires network access)
22+
slow: mark a test as being known to take a long time to complete (order 5s < t < 60s)
23+
veryslow: mark a test as being known to take a very long time to complete (order t > 60s)
24+
nope: mark a test as being so slow that it should only be very infrequently (order t > 30m)
25+
log_level=NOTSET
26+
27+
# Flake8 Configuration
28+
[flake8]
29+
max_complexity = 10
30+
max_line_length = 120
31+
import_order_style = google
32+
application_import_names = dynamodb_encryption_sdk
33+
builtins = raw_input
34+
ignore =
35+
# Ignoring D205 and D400 because of false positives
36+
D205, D400,
37+
# Ignoring D401 pending discussion of imperative mood
38+
D401,
39+
# Ignoring D202 (no blank lines after function docstring) because mypy confuses flake8
40+
D202
41+
42+
43+
# Doc8 Configuration
44+
[doc8]
45+
max-line-length = 120

setup.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
"""DynamoDB Encryption SDK."""
2+
import io
3+
import os
4+
import re
5+
6+
from setuptools import find_packages, setup
7+
8+
VERSION_RE = re.compile(r'''__version__ = ['"]([0-9.]+)['"]''')
9+
HERE = os.path.abspath(os.path.dirname(__file__))
10+
11+
12+
def read(*args):
13+
"""Reads complete file contents."""
14+
return io.open(os.path.join(HERE, *args), encoding='utf-8').read()
15+
16+
17+
def get_version():
18+
"""Reads the version from this module."""
19+
init = read('src', 'dynamodb_encryption_sdk', 'identifiers.py')
20+
return VERSION_RE.search(init).group(1)
21+
22+
23+
def get_requirements():
24+
"""Reads the requirements file."""
25+
requirements = read('requirements.txt')
26+
return [r for r in requirements.strip().splitlines()]
27+
28+
29+
setup(
30+
name='dynamodb-encryption-sdk',
31+
version=get_version(),
32+
packages=find_packages('src'),
33+
package_dir={'': 'src'},
34+
url='http://dynamodb-encryption-sdk.readthedocs.io/en/latest/',
35+
author='Amazon Web Services',
36+
author_email='[email protected]',
37+
maintainer='Amazon Web Services',
38+
long_description=read('README.rst'),
39+
keywords='aws-encryption-sdk aws kms encryption dynamodb',
40+
data_files=[
41+
'README.rst',
42+
'CHANGELOG.rst',
43+
'LICENSE',
44+
'requirements.txt'
45+
],
46+
license='Apache License 2.0',
47+
install_requires=get_requirements(),
48+
classifiers=[
49+
'Development Status :: 5 - Production/Stable',
50+
'Intended Audience :: Developers',
51+
'Natural Language :: English',
52+
'License :: OSI Approved :: Apache Software License',
53+
'Programming Language :: Python',
54+
'Programming Language :: Python :: 2',
55+
'Programming Language :: Python :: 2.7',
56+
'Programming Language :: Python :: 3',
57+
'Programming Language :: Python :: 3.4',
58+
'Programming Language :: Python :: 3.5',
59+
'Programming Language :: Python :: 3.6',
60+
'Programming Language :: Python :: Implementation :: CPython',
61+
'Topic :: Security',
62+
'Topic :: Security :: Cryptography'
63+
]
64+
)

src/pylintrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[BASIC]
2+
# Allow function names up to 50 characters
3+
function-rgx = [a-z_][a-z0-9_]{2,50}$
4+
5+
[DESIGN]
6+
max-args = 10
7+
8+
[FORMAT]
9+
max-line-length = 120
10+
11+
[REPORTS]
12+
msg-template = {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}

test/pylintrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[MESSAGES CONTROL]
2+
# Disabling messages that we either don't care about
3+
# for tests or are necessary to break for tests.
4+
#
5+
# C0103 : invalid-name (we prefer long, descriptive, names for tests)
6+
# C0111 : missing-docstring (we don't write docstrings for tests)
7+
# E1101 : no-member (raised on patched objects with mock checks)
8+
# R0801 : duplicate-code (unit tests for similar things tend to be similar)
9+
# W0212 : protected-access (raised when calling _ methods)
10+
# W0621 : redefined-outer-name (raised when using pytest-mock)
11+
# W0613 : unused-argument (raised when patches are needed but not called)
12+
disable = C0103, C0111, E1101, R0801, W0212, W0621, W0613
13+
14+
[DESIGN]
15+
max-args = 10
16+
17+
[FORMAT]
18+
max-line-length = 120
19+
20+
[REPORTS]
21+
msg-template = {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}

0 commit comments

Comments
 (0)