Skip to content

Commit 3b6a82f

Browse files
edhzszcarlzogh
authored andcommitted
Initial Python RIC Implementation
1 parent 1c1baf9 commit 3b6a82f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+5347
-8
lines changed

.dockerignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.git
2+
3+
**/build/
4+
**/node_modules/
5+
**/dist/
6+
7+
test/integration/*
8+
!test/integration/resources/
9+
!test/integration/test-handlers/

.gitignore

+145
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
generated.docker-compose.*.yml
2+
3+
test/integration/resources/init
4+
5+
node_modules/
6+
*.tsbuildinfo
7+
8+
# Byte-compiled / optimized / DLL files
9+
__pycache__/
10+
*.py[cod]
11+
*$py.class
12+
13+
# C extensions
14+
*.so
15+
16+
# Distribution / packaging
17+
.Python
18+
build/
19+
develop-eggs/
20+
dist/
21+
downloads/
22+
eggs/
23+
.eggs/
24+
lib/
25+
lib64/
26+
parts/
27+
sdist/
28+
var/
29+
wheels/
30+
share/python-wheels/
31+
*.egg-info/
32+
.installed.cfg
33+
*.egg
34+
MANIFEST
35+
36+
# PyInstaller
37+
# Usually these files are written by a python script from a template
38+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
39+
*.manifest
40+
*.spec
41+
42+
# Installer logs
43+
pip-log.txt
44+
pip-delete-this-directory.txt
45+
46+
# Unit test / coverage reports
47+
htmlcov/
48+
.tox/
49+
.nox/
50+
.coverage
51+
.coverage.*
52+
.cache
53+
nosetests.xml
54+
coverage.xml
55+
*.cover
56+
*.py,cover
57+
.hypothesis/
58+
.pytest_cache/
59+
cover/
60+
61+
# Translations
62+
*.mo
63+
*.pot
64+
65+
# Django stuff:
66+
*.log
67+
local_settings.py
68+
db.sqlite3
69+
db.sqlite3-journal
70+
71+
# Flask stuff:
72+
instance/
73+
.webassets-cache
74+
75+
# Scrapy stuff:
76+
.scrapy
77+
78+
# Sphinx documentation
79+
docs/_build/
80+
81+
# PyBuilder
82+
.pybuilder/
83+
target/
84+
85+
# Jupyter Notebook
86+
.ipynb_checkpoints
87+
88+
# IPython
89+
profile_default/
90+
ipython_config.py
91+
92+
# pyenv
93+
# For a library or package, you might want to ignore these files since the code is
94+
# intended to run in multiple environments; otherwise, check them in:
95+
# .python-version
96+
97+
# pipenv
98+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
99+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
100+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
101+
# install all needed dependencies.
102+
#Pipfile.lock
103+
104+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
105+
__pypackages__/
106+
107+
# Celery stuff
108+
celerybeat-schedule
109+
celerybeat.pid
110+
111+
# SageMath parsed files
112+
*.sage.py
113+
114+
# Environments
115+
.env
116+
.venv
117+
env/
118+
venv/
119+
ENV/
120+
env.bak/
121+
venv.bak/
122+
123+
# Spyder project settings
124+
.spyderproject
125+
.spyproject
126+
127+
# Rope project settings
128+
.ropeproject
129+
130+
# mkdocs documentation
131+
/site
132+
133+
# mypy
134+
.mypy_cache/
135+
.dmypy.json
136+
dmypy.json
137+
138+
# Pyre type checker
139+
.pyre/
140+
141+
# pytype static type analyzer
142+
.pytype/
143+
144+
# Cython debug symbols
145+
cython_debug/

.pre-commit-config.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
repos:
2+
- repo: https://github.com/python/black
3+
rev: 19.3b0
4+
hooks:
5+
- id: black
6+
language_version: python3.7
7+
exclude_types: ['markdown', 'ini', 'toml', 'rst']

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ To send us a pull request, please:
3636
5. Send us a pull request, answering any default questions in the pull request interface.
3737
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
3838

39-
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
39+
GitHub provides some additional documentation on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
4040
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
4141

4242

MANIFEST.in

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
include README.md
2+
include LICENSE
3+
include THIRD-PARTY-LICENSES
4+
include requirements/base.txt
5+
include awslambdaric/runtime_client.cpp
6+
recursive-include scripts *
7+
recursive-include deps *
8+
9+
prune tests

Makefile

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
.PHONY: target
2+
target:
3+
$(info ${HELP_MESSAGE})
4+
@exit 0
5+
6+
.PHONY: init
7+
init:
8+
pip3 install -r requirements/base.txt -r requirements/dev.txt
9+
10+
.PHONY: test
11+
test: check-format
12+
pytest --cov awslambdaric --cov-report term-missing --cov-fail-under 90 test
13+
14+
.PHONY: setup-codebuild-agent
15+
setup-codebuild-agent:
16+
docker build -t codebuild-agent - < test/integration/codebuild-local/Dockerfile.agent
17+
18+
.PHONY: test-smoke
19+
test-smoke: setup-codebuild-agent
20+
CODEBUILD_IMAGE_TAG=codebuild-agent test/integration/codebuild-local/test_one.sh test/integration/codebuild/buildspec.os.alpine.1.yml alpine 3.12 3.8
21+
22+
.PHONY: test-integ
23+
test-integ: setup-codebuild-agent
24+
CODEBUILD_IMAGE_TAG=codebuild-agent test/integration/codebuild-local/test_all.sh test/integration/codebuild/.
25+
26+
.PHONY: check-security
27+
check-security:
28+
bandit -r awslambdaric
29+
30+
.PHONY: format
31+
format:
32+
black setup.py awslambdaric/ test/
33+
34+
.PHONY: check-format
35+
check-format:
36+
black --check setup.py awslambdaric/ test/
37+
38+
# Command to run everytime you make changes to verify everything works
39+
.PHONY: dev
40+
dev: init test
41+
42+
# Verifications to run before sending a pull request
43+
.PHONY: pr
44+
pr: init check-format check-security dev test-smoke
45+
46+
.PHONY: clean
47+
clean:
48+
rm -rf dist
49+
rm -rf awslambdaric.egg-info
50+
51+
.PHONY: build
52+
build: clean
53+
BUILD=true python3 setup.py sdist
54+
55+
define HELP_MESSAGE
56+
57+
Usage: $ make [TARGETS]
58+
59+
TARGETS
60+
check-security Run bandit to find security issues.
61+
format Run black to automatically update your code to match our formatting.
62+
build Builds the package.
63+
clean Cleans the working directory by removing built artifacts.
64+
dev Run all development tests after a change.
65+
init Initialize and install the requirements and dev-requirements for this project.
66+
pr Perform all checks before submitting a Pull Request.
67+
test Run the Unit tests.
68+
69+
endef

0 commit comments

Comments
 (0)