This repository has been archived by the owner on Dec 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update/add docs * add more package infrastructure
- Loading branch information
1 parent
3bcd073
commit 61f0c13
Showing
19 changed files
with
245 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.. include:: ../CODE_OF_CONDUCT.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.. include:: ../CONFIG_FORMAT.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.. include:: ../CONTRIBUTING.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Public API | ||
========== | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
|
||
pipeformer.deploy | ||
pipeformer.identifiers | ||
pipeformer.input_handling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
sphinx>=1.3.0 | ||
sphinx_rtd_theme | ||
sphinx-autodoc-typehints | ||
sphinxcontrib-spelling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.. include:: ../RESOURCES.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Python/dev-tools | ||
tox | ||
pyenv | ||
cpython | ||
CPython | ||
|
||
# Project-specific | ||
pipeformer | ||
|
||
# AWS | ||
arn | ||
aws | ||
buildspec | ||
cmk | ||
codebuild | ||
codepipeline | ||
iam | ||
|
||
# GitHub tags | ||
wontfix | ||
|
||
# General dev words | ||
arg | ||
args | ||
config | ||
changelog | ||
github | ||
plugin | ||
pre | ||
runtimes | ||
util | ||
utils | ||
versioning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.. include:: ../VERSIONING.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright 2018 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. | ||
"""pipeformer.""" | ||
import uuid | ||
from typing import Iterator, Optional | ||
|
||
from .deploy import Deployer | ||
from .identifiers import __version__ | ||
from .internal.arg_parsing import parse_args | ||
from .internal.logging_utils import setup_logger | ||
from .internal.structures import Config | ||
|
||
__all__ = ("__version__", "cli") | ||
|
||
|
||
def cli(raw_args: Optional[Iterator[str]] = None): | ||
"""CLI entry point. Processes arguments, sets up the key provider, and processes requested action. | ||
:returns: Execution return value intended for ``sys.exit()`` | ||
""" | ||
args = parse_args(raw_args) | ||
|
||
setup_logger(args.verbosity, args.quiet) | ||
|
||
# 1. parse config file | ||
project = Config.from_file(args.config) | ||
|
||
# TODO: Use a better prefix | ||
prefix = "pipeformer-" + str(uuid.uuid4()).split("-")[-1] | ||
|
||
project_deployer = Deployer(project=project, stack_prefix=prefix) | ||
|
||
project_deployer.deploy_standalone() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2018 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. | ||
"""Unique identifiers used by pipeformer.""" | ||
__all__ = ("__version__", "LOGGER_NAME") | ||
__version__ = "0.0.1" | ||
LOGGER_NAME = "pipeformer" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[MESSAGE CONTROL] | ||
# Disabling messages that either we don't care about we intentionally break. | ||
disable = | ||
bad-continuation, # we let black handle this | ||
ungrouped-imports, # we let black handle this | ||
no-member, # breaks with attrs | ||
too-few-public-methods, # does not allow data classes | ||
no-else-return, # we omit this on purpose for brevity where it would add no value | ||
attribute-defined-outside-init, # breaks with attrs_post_init | ||
redefined-outer-name, # we do this on purpose in multiple places | ||
|
||
[BASIC] | ||
# Allow function names up to 50 characters | ||
function-rgx = [a-z_][a-z0-9_]{2,50}$ | ||
# Allow method names up to 50 characters | ||
method-rgx = [a-z_][a-z0-9_]{2,50}$ | ||
# Allow class attribute names up to 50 characters | ||
# Whitelist class attribute names: | ||
class-attribute-rgx = (([A-Za-z_][A-Za-z0-9_]{2,50}|(__.*__))$) | ||
# Whitelist attribute names: | ||
attr-rgx = ([a-z_][a-z0-9_]{2,30}$) | ||
# Whitelist argument names: iv | ||
argument-rgx = ([a-z_][a-z0-9_]{2,30}$)|(^iv$) | ||
# Whitelist variable names: iv | ||
variable-rgx = ([a-z_][a-z0-9_]{2,30}$)|(^iv$) | ||
|
||
[VARIABLES] | ||
additional-builtins = raw_input | ||
|
||
[DESIGN] | ||
max-args = 10 | ||
|
||
[FORMAT] | ||
max-line-length = 120 | ||
|
||
[REPORTS] | ||
msg-template = {path}:{line}: [{msg_id}({symbol}), {obj}] {msg} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[MESSAGES CONTROL] | ||
# Disabling messages that we either don't care about for tests or are necessary to break for tests. | ||
disable = | ||
bad-continuation, # we let black handle this | ||
ungrouped-imports, # we let black handle this | ||
no-member, # breaks with attrs | ||
invalid-name, # naming in tests often need to violate many common rules | ||
too-few-public-methods, # common when setting up mock classes | ||
redefined-outer-name, # raises false positives with fixtures | ||
missing-docstring, # we don't write docstrings for tests | ||
abstract-class-instantiated, # we do this on purpose to test that they are enforced | ||
duplicate-code, # unit tests for similar things tend to be similar | ||
protected-access, # raised when calling _ methods | ||
abstract-method, # we do this on purpose to test that they are enforced | ||
unused-argument, # raised when patches are needed but not called | ||
no-self-use, # raised when pytest tests are grouped in classes | ||
too-many-public-methods, # raised when pytest tests are grouped in classes | ||
|
||
[VARIABLES] | ||
additional-builtins = raw_input | ||
|
||
[DESIGN] | ||
max-args = 10 | ||
|
||
[FORMAT] | ||
max-line-length = 120 | ||
|
||
[REPORTS] | ||
msg-template = {path}:{line}: [{msg_id}({symbol}), {obj}] {msg} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
mock | ||
pytest>=3.3.1 | ||
pytest-cov | ||
pytest-mock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
# Verify that tests can be successfully run from the source build. | ||
# | ||
# NOTE: Humans should not run this file directly. If you want to run this check, run "tox -e sourcebuildcheck". | ||
|
||
WORKINGDIR=$1 | ||
DISTDIR=$2 | ||
|
||
echo "Locating the source build and copying it into the working directory." | ||
DISTFILE=`ls $DISTDIR/pipeformer-*.tar.gz | tail -1` | ||
cp $DISTFILE $WORKINGDIR | ||
DISTFILE=`ls $WORKINGDIR/pipeformer-*.tar.gz | tail -1` | ||
|
||
echo "Extracting the source build." | ||
cd $WORKINGDIR | ||
tar xzvf $DISTFILE | ||
rm $DISTFILE | ||
EXTRACTEDDIR=`ls | tail -1` | ||
cd $EXTRACTEDDIR | ||
|
||
echo "Installing requirements from extracted source build." | ||
pip install -r test/requirements.txt | ||
pip install -e . | ||
|
||
echo "Running tests from extracted source build." | ||
pytest --cov pipeformer -m local |