Dev zone/Reports: Difference between revisions
Line 33: | Line 33: | ||
for dir in $(find tools -type d -name src); do | for dir in $(find tools -type d -name src); do | ||
if [ "$full_path" = "" ]; then | if [ "$full_path" = "" ]; then | ||
full_path="$current_dir/$dir" | |||
else | else | ||
full_path="$full_path:$current_dir/$dir" | |||
fi | fi | ||
done | done |
Latest revision as of 13:09, 14 September 2025
The Nasqueron internal reports repository is a monorepo containing SQL queries and tools to produce reports about Nasqueron internal data.
Python tools
Configure PYTHONPATH
Python allows to develop several packages at the same time providing all the src/ folders to your PYTHONPATH variables.
First, ensure you don't have any module installed through .whl running pip freeze
. If you see something like nasqueron-reports==0.1.0
, it comes from package auto detection and it's fine and will use your local code. What is not fine is a long line with wheel archive.
Then, include every tools/*/src include in your path. The environment script takes care of that.
Environment script
You can use this environment configuration script for sh, bash and zsh:
#!/bin/sh
export DB_USERNAME=someuser
export DB_PASSWORD=somepass
export VAULT_ADDR=https://localhost:8200
# -------------------------------------------------------------
# Python paths
#
# Modules are in tools/*/src
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
current_dir=$(pwd)
full_path=""
# shellcheck disable=SC2044
for dir in $(find tools -type d -name src); do
if [ "$full_path" = "" ]; then
full_path="$current_dir/$dir"
else
full_path="$full_path:$current_dir/$dir"
fi
done
if [ "$PYTHONPATH" != "$full_path" ]; then
if [ "$PYTHONPATH" = "" ]; then
export PYTHONPATH="$full_path"
else
export PYTHONPATH="$PYTHONPATH:$full_path"
fi
fi
If you call it .env, you can use source .env
, but your IDE could complain it contains shell stuff if it has support for dotenv files. Override file type as shell script or save it under another name.