-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added initial setup files * Updated reviews
- Loading branch information
1 parent
653ed6d
commit fea50ab
Showing
24 changed files
with
680 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Check if setup.py is up to date | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
check_setup_py: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.8] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.1.4 | ||
- name: Poetry install | ||
run: poetry install | ||
- name: Run packaging update | ||
run: bash githooks/update_setup_py.sh | ||
- name: Show changes on working copy | ||
run: git status --porcelain=v1 -uno | ||
- name: Show diff on working copy | ||
run: git diff --cached; cat setup.py | ||
- name: Check if setup.py changed | ||
run: | | ||
[ -z "$(git status --porcelain=v1 -uno 2>/dev/null)" ] | ||
- name: Check if setup.py works | ||
run: pip install . |
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 @@ | ||
name: Run pytest tests | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
integration_tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.8] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.1.4 | ||
- name: Poetry install | ||
run: poetry install | ||
- name: Poetry build | ||
run: poetry build | ||
- name: Poetry run pytest integration tests | ||
run: poetry run pytest tests |
31 changes: 31 additions & 0 deletions
31
.github/workflows/release_droid_upload_github_release_assets.yml
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,31 @@ | ||
name: Release Droid - Upload GitHub Release Assets | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
upload_url: | ||
description: 'Upload URL' | ||
required: true | ||
|
||
|
||
jobs: | ||
release: | ||
strategy: | ||
matrix: | ||
python-version: [ 3.8 ] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.1.6 | ||
- name: Install Poetry | ||
run: poetry install | ||
- name: Build Poetry | ||
run: poetry build | ||
- name: Poetry run pytest integration tests | ||
run: poetry run pytest tests |
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,135 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# PyCharm | ||
.idea | ||
|
||
# Sphinx | ||
doc/_build |
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,3 @@ | ||
# Changelog | ||
|
||
* [0.1.0](changes_0.1.0.md) |
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,7 @@ | ||
# advanced-analytics-framework 0.1.0, released XXXX-XX-XX | ||
|
||
|
||
## Summary | ||
|
||
|
||
### Features |
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,20 @@ | ||
# Dependencies | ||
|
||
## Run Time Dependencies | ||
|
||
| Dependency | Purpose | License | | ||
|-------------------------------|----------------------------------|--------------------| | ||
| [Python 3][python] | Python version 3.6.1 and above | PSF | | ||
|
||
|
||
## Test Dependencies | ||
|
||
| Dependency | Purpose | License | | ||
|-------------------------------|-----------------------------------|-------------------| | ||
| [Pytest][pytest] | Testing framework | MIT | | ||
|
||
|
||
|
||
[python]: https://docs.python.org | ||
|
||
[pytest]: https://docs.pytest.org/en/stable/ |
Empty file.
Empty file.
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,7 @@ | ||
# Developer Guide | ||
|
||
|
||
In this developer guide we explain how you can build this project. | ||
|
||
* [building_documentation](building_documentation.md) | ||
|
Empty file.
Empty file.
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 @@ | ||
__version__ = '0.1.0' |
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,44 @@ | ||
#!/bin/bash | ||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" | ||
REPO_DIR=$(git rev-parse --show-toplevel) | ||
REPO_DIR="$(readlink -f "${REPO_DIR}")" | ||
GIT_DIR="$REPO_DIR/.git" | ||
GIT_DIR="$(readlink -f "${GIT_DIR}")" | ||
|
||
if [[ ! -d "$GIT_DIR" ]]; then | ||
echo "$GIT_DIR is not a git directory." >&2 | ||
exit 1 | ||
else | ||
GITHOOKS_PATH="$GIT_DIR/hooks" | ||
fi | ||
|
||
GITHOOKS_PATH="$(readlink -f "${GITHOOKS_PATH}")" | ||
|
||
copy_hook() { | ||
local SCRIPT_PATH="$SCRIPT_DIR/$1" | ||
local GITHOOK_PATH="$GITHOOKS_PATH/$2" | ||
local RELATIVE_PATH=$(realpath --relative-to="$GITHOOKS_PATH" "$SCRIPT_PATH") | ||
pushd "$GITHOOKS_PATH" > /dev/null | ||
if [ -e "$GITHOOK_PATH" ] || [ -L "$GITHOOK_PATH" ] | ||
then | ||
echo | ||
echo "Going to delete old hook $GITHOOK_PATH" | ||
rm "$GITHOOK_PATH" > /dev/null | ||
fi | ||
echo | ||
echo "Link hook to script" >&2 | ||
echo "Hook-Path: $GITHOOK_PATH" >&2 | ||
echo "Script-path: $SCRIPT_PATH" >&2 | ||
echo | ||
ln -s "$RELATIVE_PATH" "$2" > /dev/null | ||
chmod +x "$SCRIPT_PATH" > /dev/null | ||
popd > /dev/null | ||
} | ||
|
||
copy_hook pre-commit pre-commit | ||
copy_hook pre-commit post-rewrite | ||
copy_hook pre-push pre-push |
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,11 @@ | ||
#!/bin/bash | ||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
REPO_DIR=$(git rev-parse --show-toplevel) | ||
GITHOOKS_PATH="$REPO_DIR/githooks" | ||
pushd "$REPO_DIR" | ||
bash "$GITHOOKS_PATH/prohibit_commit_to_main.sh" | ||
bash "$GITHOOKS_PATH/update_setup_py.sh" | ||
popd |
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 @@ | ||
#!/bin/bash | ||
protected_branches=( master main ) | ||
for i in "${protected_branches[@]}" | ||
do | ||
|
||
protected_branch=$i | ||
|
||
policy='[Policy] Never push, force push or delete the '$protected_branch' branch! (Prevented with pre-push hook.)' | ||
|
||
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | ||
|
||
push_command=$(ps -ocommand= -p $PPID) | ||
|
||
is_destructive='force|delete|\-f' | ||
|
||
will_remove_protected_branch=':'$protected_branch | ||
|
||
do_exit(){ | ||
echo $policy | ||
exit 1 | ||
} | ||
|
||
if [[ $push_command =~ $is_destructive ]] && [ $current_branch = $protected_branch ]; then | ||
do_exit | ||
fi | ||
|
||
if [[ $push_command =~ $is_destructive ]] && [[ $push_command =~ $protected_branch ]]; then | ||
do_exit | ||
fi | ||
|
||
if [[ $push_command =~ $will_remove_protected_branch ]]; then | ||
do_exit | ||
fi | ||
|
||
if [[ $protected_branch == $current_branch ]]; then | ||
do_exit | ||
fi | ||
|
||
done | ||
|
||
unset do_exit | ||
|
||
exit 0 |
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,8 @@ | ||
#!/bin/sh | ||
|
||
branch="$(git rev-parse --abbrev-ref HEAD)" | ||
|
||
if [ "$branch" = "main" ] || [ "$branch" = "master" ]; then | ||
echo "You can't commit directly to main/master branch" | ||
exit 1 | ||
fi |
Oops, something went wrong.