Skip to content

Commit

Permalink
Merge pull request #1 from rstevens011/master
Browse files Browse the repository at this point in the history
Initial Source Commit
  • Loading branch information
rstevens011 committed Mar 8, 2019
2 parents 6b3ed9c + 94daa3c commit a84fc92
Show file tree
Hide file tree
Showing 24 changed files with 1,481 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .gitignore
@@ -0,0 +1,21 @@
*~
*#
*.swp
__pycache__/
*.py[cod]
*$py.class
*.egg-info/
/.coverage
/.coverage.*
/.cache
/doc/_autosummary/
/build
*.iml
dist/
.eggs/
.pytest_cache/
.python-version
.tox/
venv/
env/
version.txt
44 changes: 44 additions & 0 deletions .pylintrc
@@ -0,0 +1,44 @@
[MASTER]

[MESSAGES CONTROL]
disable = I0011, # locally-disabled
R0903 # too-few-public-methods

[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html
output-format=colorized


[FORMAT]
# Maximum number of characters on a single line.
max-line-length=120
# Maximum number of lines in a module
#max-module-lines=1000

[BASIC]
good-names=
i,
e,
logger

[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=5
# Ignore comments when computing similarities.
ignore-comments=yes
# Ignore docstrings when computing similarities.
ignore-docstrings=yes

[VARIABLES]
# Tells whether we should check for unused import in __init__ files.
init-import=yes

[LOGGING]
# Apply logging string format checks to calls on these modules.
logging-modules=
logging

[TYPECHECK]
ignored-modules=
distutils
4 changes: 2 additions & 2 deletions NOTICE
@@ -1,2 +1,2 @@
AWS Secrets Manager Python caching client
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
AWS Secrets Manager Python Caching Client
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
8 changes: 8 additions & 0 deletions dev-requirements.txt
@@ -0,0 +1,8 @@
pytest<3.8.0
pytest-cov
pytest-sugar
codecov>=1.4.0
pylint>1.9.4
isort>=4.3.4
sphinx>=1.8.4
setuptools_scm>=3.2
4 changes: 4 additions & 0 deletions doc/_templates/autosummary/module.rst
@@ -0,0 +1,4 @@
{{ fullname }}
{{ underline }}

.. automodule:: {{ fullname }}
52 changes: 52 additions & 0 deletions doc/conf.py
@@ -0,0 +1,52 @@
from datetime import datetime
from setuptools_scm import get_version
import os
import shutil

version = get_version(root='..')
project = u'AWS Secrets Manager Python Caching Client'

# If you use autosummary, this ensures that any stale autogenerated files are
# cleaned up first.
if os.path.exists('_autosummary'):
print("cleaning up stale autogenerated files...")
shutil.rmtree('_autosummary')

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.coverage',
'sphinx.ext.doctest',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

source_suffix = '.rst' # The suffix of source filenames.
master_doc = 'index' # The master toctree document.

copyright = u'%s, Amazon.com' % datetime.now().year

# The full version, including alpha/beta/rc tags.
release = version

# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_trees = ['_build', '_templates']

pygments_style = 'sphinx'

autoclass_content = "both"
autodoc_default_flags = ['show-inheritance', 'members', 'undoc-members']
autodoc_member_order = 'bysource'

html_theme = 'haiku'
html_static_path = ['_static']
htmlhelp_basename = '%sdoc' % project

# autosummary
autosummary_generate = True
22 changes: 22 additions & 0 deletions doc/index.rst
@@ -0,0 +1,22 @@
AWS Secrets Manager Python Caching Client
=========================================

This package provides a client-side caching implementation for AWS Secrets Manager

Modules
_______

.. autosummary::
:toctree: _autosummary

.. Add/replace module names you want documented here
aws_secretsmanager_caching



Indices and tables
__________________

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
1 change: 1 addition & 0 deletions requirements.txt
@@ -0,0 +1 @@
botocore>=1.12
30 changes: 30 additions & 0 deletions setup.cfg
@@ -0,0 +1,30 @@
[tool:pytest]
xfail_strict = true
addopts =
--verbose
--doctest-modules
--cov aws_secretsmanager_caching
--cov-fail-under 90
--cov-report term-missing
test

[aliases]
test=pytest

[metadata]
description-file = README.md
license_file = LICENSE

[flake8]
max-line-length = 120
select = C,E,F,W,B
# C812, W503 clash with black
ignore = C812,W503
exclude = venv,.venv,.tox,dist,doc,build,*.egg

[isort]
line_length = 120
multi_line_output = 5
include_trailing_comma = true
force_grid_wrap = 0
combine_as_imports = true
27 changes: 27 additions & 0 deletions setup.py
@@ -0,0 +1,27 @@
from setuptools import setup, find_packages

setup(
name="aws_secretsmanager_caching",
description="Client-side AWS Secrets Manager caching library",
url="https://aws.amazon.com/secrets-manager/",
author="Amazon Web Services",
author_email="aws-secretsmanager-dev@amazon.com",
packages=find_packages(where="src", exclude=("test",)),
package_dir={"": "src"},
classifiers=[
'Development Status :: 5 - Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7'
],
keywords='secretsmanager secrets manager development cache caching client',
use_scm_version={
'write_to': 'version.txt'
},
python_requires='>3.5',
install_requires=['botocore'],
setup_requires=['pytest-runner', 'setuptools-scm'],
tests_require=['pytest', 'pytest-cov', 'pytest-sugar', 'codecov']

)
18 changes: 18 additions & 0 deletions src/aws_secretsmanager_caching/__init__.py
@@ -0,0 +1,18 @@
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
"""High level AWS Secrets Manager caching client."""
from aws_secretsmanager_caching.config import SecretCacheConfig
from aws_secretsmanager_caching.decorators import InjectKeywordedSecretString, InjectSecretString
from aws_secretsmanager_caching.secret_cache import SecretCache

__all__ = ["SecretCache", "SecretCacheConfig", "InjectSecretString", "InjectKeywordedSecretString"]
21 changes: 21 additions & 0 deletions src/aws_secretsmanager_caching/cache/__init__.py
@@ -0,0 +1,21 @@
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
"""Internal Implementation Details
.. warning::
No guarantee is provided on the modules and APIs within this
namespace staying consistent. Directly reference at your own risk.
"""
from aws_secretsmanager_caching.cache.items import SecretCacheItem, SecretCacheObject, SecretCacheVersion
from aws_secretsmanager_caching.cache.lru import LRUCache

__all__ = ["SecretCacheObject", "SecretCacheItem", "SecretCacheVersion", "LRUCache"]

0 comments on commit a84fc92

Please sign in to comment.