Skip to main content

A small utility package

Project description

Common Utils

Continuous Integration

Continuous Integration

Virtual Environment

First, make a virtual environment with make_venv.sh:

curl -s -o make_venv.sh \
  https://raw.githubusercontent.com/gao-hongnan/common-utils/main/scripts/devops/make_venv.sh && \
bash make_venv.sh venv --pyproject --dev && \
source venv/bin/activate && \
rm make_venv.sh

Continue on error vs If Always

See here.

Run Bandit Security Check

bash ./scripts/devops/ci/ci_security_bandit.sh \
  --severity-level=low \
  --format=json \
  --output=bandit_results.json \
  common_utils

Run Linter Check

bash ./scripts/devops/ci/ci_linter_pylint.sh \
  --rcfile=pyproject.toml \
  --fail-under=10 \
  --score=yes \
  --output-format=json:pylint_results.json,colorized \
  common_utils

Run Formatter Black Check

bash ./scripts/devops/ci/ci_formatter_black.sh \
  --check \
  --diff \
  --color \
  --verbose \
  common_utils

Run Formatter Isort Check

bash ./scripts/devops/ci/ci_formatter_isort.sh \
  --check \
  --diff \
  --color \
  --verbose \
  common_utils

Run MyPy Type Check

bash ./scripts/devops/ci/ci_typing_mypy.sh \
  --config-file=pyproject.toml \
  common_utils \
  | tee mypy_results.log

Run Unit Test

Run Integration Test

Run System Test

Run Acceptance Test

See madewithml.

Run Data Test (Great Expectations)

Run Markdown Lint

npm install -g markdownlint-cli && \
touch .markdownlint.json && \
npm install --save-dev --save-exact prettier
# prettier
function pr() {
  if [ -z "$1" ]; then
    echo "Error: TARGET_DIR is mandatory."
    return 1
  fi

  TARGET_DIR="$1"
  prettier "$TARGET_DIR" --write \
    --prose-wrap always \
    --print-width 80 \
    --tab-width 4 \
    --use-tabs true
}
pr <TARGET_MARKDOWN_FILE>
markdownlint --fix <TARGET_MARKDOWN_FILE>

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gaohn-common-utils-0.0.112.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gaohn_common_utils-0.0.112-py3-none-any.whl (39.7 kB view details)

Uploaded Python 3

File details

Details for the file gaohn-common-utils-0.0.112.tar.gz.

File metadata

  • Download URL: gaohn-common-utils-0.0.112.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for gaohn-common-utils-0.0.112.tar.gz
Algorithm Hash digest
SHA256 6b90992bd1a93e66b6d83a8478094433e74e341107ab46e7e0639394779092a5
MD5 99e6f65a075068f27151ac00676a90a4
BLAKE2b-256 a7dd9ee5730b25493d7cac5a948ae6f7033925a73ce77c40c081e2e81c982d8a

See more details on using hashes here.

File details

Details for the file gaohn_common_utils-0.0.112-py3-none-any.whl.

File metadata

File hashes

Hashes for gaohn_common_utils-0.0.112-py3-none-any.whl
Algorithm Hash digest
SHA256 82e36614c4adb902ad5bc95092fd3076ace4ecd95acd6b5d0ccd9d8049f85722
MD5 42f9fa9c6d8727a8b48f23a9d5d8fecc
BLAKE2b-256 82d7dd98d2c364fb795fd1a611754ba70e24ebbf72fada449704524255959e55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page