Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ jobs:
# Only updates file if it has changed
selective_file_copy() {
# Receives a single file path as argument
SHA_SRC=$(sha1sum "$DEVOPS_DIR"/"$1" | awk '{print $1}')
SHA_DST=$(sha1sum "$1" 2>/dev/null | awk '{print $1}' || :)
if [ "$SHA_SRC" != "$SHA_DST" ]; then
# SHA_SRC=$(sha1sum "$DEVOPS_DIR/$1" | awk '{print $1}')
# SHA_DST=$(sha1sum "$1" 2>/dev/null | awk '{print $1}' || :)
# if [ "$SHA_SRC" != "$SHA_DST" ]; then
if ! (cmp "$DEVOPS_DIR/$1" "$1"); then
echo "Copying: $1"
cp "$DEVOPS_DIR/$1" "$1"
git add "$1"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/notebooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ jobs:
pip install .
pip install pytest nbmake

- name: "Test notebooks: pytest --nbmake"
run: pytest --nbmake -- **/*ipynb
- name: "Testing notebooks"
run: |
echo "Testing notebooks using: pytest --nbmake -- **/test_*.ipynb"
pytest --nbmake -- **/test_*.ipynb

- name: Upload logs as artefacts
if: always()
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Temporary devops repo
.devops
/.devops

# Twine temporary files
package-lock.json
Expand Down Expand Up @@ -103,8 +103,8 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/
/.pybuilder/
/target/

# Jupyter Notebook
.ipynb_checkpoints
Expand Down
18 changes: 10 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ repos:
- id: markdownlint
args: ["--fix"]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
hooks:
- id: black
- id: black-jupyter
# - repo: https://github.com/psf/black-pre-commit-mirror
# rev: 24.4.2
# hooks:
# - id: black
# - id: black-jupyter

# - repo: https://github.com/tomcatling/black-nb
# rev: '0.7'
Expand Down Expand Up @@ -105,14 +105,16 @@ repos:
args: ["--profile", "black"]

- repo: https://github.com/Mateusz-Grzelinski/actionlint-py
rev: v1.6.27.13
rev: v1.7.0.14
hooks:
- id: actionlint

- repo: https://github.com/pycqa/flake8
rev: "7.0.0"
hooks:
- id: flake8
additional_dependencies:
- pep8-naming

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
Expand All @@ -125,11 +127,11 @@ repos:
hooks:
- id: mypy
verbose: true
args: [--show-error-codes]
args: ["--show-error-codes", "--install-types", "--non-interactive"]
additional_dependencies: ["pytest", "types-requests"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.3
rev: v0.4.4
hooks:
- id: ruff
files: ^(scripts|tests|custom_components)/.+\.py$
Expand Down
565 changes: 564 additions & 1 deletion dbt/essd_transform/target/catalog.json

Large diffs are not rendered by default.

6,669 changes: 6,668 additions & 1 deletion dbt/essd_transform/target/manifest.json

Large diffs are not rendered by default.

28 changes: 27 additions & 1 deletion dbt/essd_transform/target/run_results.json
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.4.9", "generated_at": "2024-04-27T21:04:33.680984Z", "invocation_id": "f0d647fc-2b0a-4cbc-b556-5e5c8c5e267c", "env": {}}, "results": [], "elapsed_time": 0.0, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/michael/Documents/GitHub", "send_anonymous_usage_stats": true, "quiet": false, "no_print": false, "cache_selected_only": false, "indirect_selection": "eager", "which": "test", "rpc_method": "test"}}
{
"metadata": {
"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json",
"dbt_version": "1.4.9",
"generated_at": "2024-04-27T21:04:33.680984Z",
"invocation_id": "f0d647fc-2b0a-4cbc-b556-5e5c8c5e267c",
"env": {}
},
"results": [],
"elapsed_time": 0.0,
"args": {
"write_json": true,
"use_colors": true,
"printer_width": 80,
"version_check": true,
"partial_parse": true,
"static_parser": true,
"profiles_dir": "/Users/michael/Documents/GitHub",
"send_anonymous_usage_stats": true,
"quiet": false,
"no_print": false,
"cache_selected_only": false,
"indirect_selection": "eager",
"which": "test",
"rpc_method": "test"
}
}
16 changes: 13 additions & 3 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SOURCE_FILE="bootstrap.yaml"
WGET_URL="https://raw.githubusercontent.com/os-climate/devops-toolkit/main/.github/workflows/$SOURCE_FILE"
AUTOMATION_BRANCH="update-devops-tooling"
DEVOPS_DIR=".devops"
FETCH_MODE="wget"

### Checks ###

Expand All @@ -21,14 +22,17 @@ fi

WGET_CMD=$(which wget)
if [ ! -x "$WGET_CMD" ]; then
echo "WGET command was NOT found in PATH"; exit 1
echo "WGET command was NOT found in PATH; using CURL"
FETCH_MODE="curl"
fi

MKTEMP_CMD=$(which mktemp)
if [ ! -x "$MKTEMP_CMD" ]; then
echo "MKTEMP command was NOT found in PATH"; exit 1
fi



SHELL_SCRIPT=$(mktemp -t script-XXXXXXXX.sh)

### Functions ###
Expand Down Expand Up @@ -95,9 +99,15 @@ if [ -f "$SOURCE_FILE" ]; then
echo "Removing existing copy of: $SOURCE_FILE"
rm "$SOURCE_FILE"
fi
echo "Pulling latest DevOps bootstrap workflow from:"
echo "Pulling latest DevOps bootstrap YAML from:"
echo " $WGET_URL"
"$WGET_CMD" -q "$WGET_URL"
if [ "$FETCH_MODE" = "wget" ]; then
"$WGET_CMD" -q "$WGET_URL" > /dev/null 2>&1
fi
if [ ! -f "$SOURCE_FILE" ]; then
echo "Attempting to retrieve YAML file with CURL"
curl "$WGET_URL" > "$SOURCE_FILE"
fi

# The section below extracts shell code from the YAML file
echo "Extracting shell code from: $SOURCE_FILE"
Expand Down