Skip to content

Commit e1f6a29

Browse files
File structure from MinosPackage #1
0 parents  commit e1f6a29

23 files changed

+686
-0
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
charset = utf-8
11+
end_of_line = lf
12+
13+
[*.bat]
14+
indent_style = tab
15+
end_of_line = crlf
16+
17+
[LICENSE]
18+
insert_final_newline = false
19+
20+
[Makefile]
21+
indent_style = tab
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: '3.x'
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install setuptools wheel twine
23+
- name: Build and publish
24+
env:
25+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
26+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
27+
run: |
28+
python setup.py sdist bdist_wheel
29+
twine upload dist/*

.github/workflows/python-tests.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
on:
2+
push:
3+
branches: [ main ]
4+
pull_request:
5+
branches: [ main ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: [3.9]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi
24+
python setup.py install
25+
- name: Test with pytest
26+
run: |
27+
make test
28+
- name: Generate coverage report
29+
run: |
30+
make coverage
31+
- name: Codecov
32+
uses: codecov/[email protected]
33+
with:
34+
token: ${{ secrets.CODECOV_TOKEN }}
35+
files: ./coverage.xml
36+
fail_ci_if_error: true

.gitignore

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
58+
# Flask stuff:
59+
instance/
60+
.webassets-cache
61+
62+
# Scrapy stuff:
63+
.scrapy
64+
65+
# Sphinx documentation
66+
docs/_build/
67+
68+
# PyBuilder
69+
target/
70+
71+
# Jupyter Notebook
72+
.ipynb_checkpoints
73+
74+
# pyenv
75+
.python-version
76+
77+
# celery beat schedule file
78+
celerybeat-schedule
79+
80+
# SageMath parsed files
81+
*.sage.py
82+
83+
# dotenv
84+
.env
85+
86+
# virtualenv
87+
.venv
88+
venv/
89+
ENV/
90+
91+
# Spyder project settings
92+
.spyderproject
93+
.spyproject
94+
95+
# Rope project settings
96+
.ropeproject
97+
98+
# mkdocs documentation
99+
/site
100+
101+
# mypy
102+
.mypy_cache/
103+
104+
# IDE settings
105+
.vscode/
106+
107+
.idea

AUTHORS.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
=======
2+
Credits
3+
=======
4+
5+
Development Lead
6+
----------------
7+
8+
* Vladyslav Fenchak <[email protected]>
9+
10+
Contributors
11+
------------
12+
13+
None yet. Why not be the first?

HISTORY.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
=======
2+
History
3+
=======
4+
5+
0.0.1 (2021-05-13)
6+
------------------
7+
8+
* First release on PyPI.

MANIFEST.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
include AUTHORS.rst
2+
include HISTORY.rst
3+
include README.rst
4+
5+
recursive-include tests *
6+
recursive-exclude * __pycache__
7+
recursive-exclude * *.py[co]
8+
9+
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif

Makefile

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
.PHONY: clean clean-test clean-pyc clean-build docs help
2+
.DEFAULT_GOAL := help
3+
4+
define BROWSER_PYSCRIPT
5+
import os, webbrowser, sys
6+
7+
from urllib.request import pathname2url
8+
9+
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
10+
endef
11+
export BROWSER_PYSCRIPT
12+
13+
define PRINT_HELP_PYSCRIPT
14+
import re, sys
15+
16+
for line in sys.stdin:
17+
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
18+
if match:
19+
target, help = match.groups()
20+
print("%-20s %s" % (target, help))
21+
endef
22+
export PRINT_HELP_PYSCRIPT
23+
24+
BROWSER := python -c "$$BROWSER_PYSCRIPT"
25+
aws_password := $(shell aws codeartifact get-authorization-token --domain pip-clariteia --domain-owner 785264909821 --query authorizationToken --output text)
26+
aws_repo_url := $(shell aws codeartifact get-repository-endpoint --domain pip-clariteia --domain-owner 785264909821 --repository minos --format pypi --query repositoryEndpoint --output text)
27+
28+
help:
29+
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
30+
31+
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
32+
33+
clean-build: ## remove build artifacts
34+
rm -fr build/
35+
rm -fr dist/
36+
rm -fr .eggs/
37+
find . -name '*.egg-info' -exec rm -fr {} +
38+
find . -name '*.egg' -exec rm -f {} +
39+
40+
clean-pyc: ## remove Python file artifacts
41+
find . -name '*.pyc' -exec rm -f {} +
42+
find . -name '*.pyo' -exec rm -f {} +
43+
find . -name '*~' -exec rm -f {} +
44+
find . -name '__pycache__' -exec rm -fr {} +
45+
46+
clean-test: ## remove test and coverage artifacts
47+
rm -fr .tox/
48+
rm -f .coverage
49+
rm -fr htmlcov/
50+
rm -fr .pytest_cache
51+
52+
lint: ## check style with flake8
53+
flake8 minos tests
54+
55+
test: ## run tests quickly with the default Python
56+
pytest
57+
58+
test-all: ## run tests on every Python version with tox
59+
tox
60+
61+
coverage: ## check code coverage quickly with the default Python
62+
coverage run --source minos -m pytest
63+
coverage report -m
64+
coverage html
65+
$(BROWSER) htmlcov/index.html
66+
67+
docs: ## generate Sphinx HTML documentation, including API docs
68+
rm -f docs/api_gateway.rst
69+
rm -f docs/modules.rst
70+
sphinx-apidoc -o docs/ api_gateway
71+
$(MAKE) -C docs clean
72+
$(MAKE) -C docs html
73+
$(BROWSER) docs/_build/html/index.html
74+
75+
servedocs: docs ## compile the docs watching for changes
76+
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
77+
78+
release: dist ## package and upload a release
79+
twine upload --repository-url $(aws_repo_url) --username aws --password $(aws_password) dist/*
80+
81+
dist: clean ## builds source and wheel package
82+
python setup.py sdist
83+
python setup.py bdist_wheel
84+
ls -l dist
85+
86+
install: clean ## install the package to the active Python's site-packages
87+
python setup.py install

README.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
===========
2+
API Gateway
3+
===========
4+
5+
Minos Boilerplate contains all the boilerplate you need to create a Minos Python package.
6+
7+
Features
8+
--------
9+
10+
* TODO
11+
12+
Credits
13+
-------
14+
15+
This package was created with Cookiecutter_ and the `clariteia/minos-pypackage`_ project template.
16+
17+
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
18+
.. _`clariteia/minos-pypackage`: https://bitbucket.org/clariteia-devs/minos-pypackage/src/master/

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = python -msphinx
7+
SPHINXPROJ = api_gateway
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

0 commit comments

Comments
 (0)