- Install the
ms-python
extension. - Create a python virtual environment.
python -m venv venv
- Activate the virtual environment.
. venv/bin/activate
- Install the Jedi language server.
pip install jedi-language-server
- Create the vscode settings json file.
This file contains hidden or 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
from os import getenv | |
from io import StringIO | |
from gnupg import GPG | |
from dotenv import load_dotenv | |
# encrypted with `gpg -o .env.gpg -e --default-recipient-self .env` | |
with open("test.env.gpg", "rb") as f: | |
env_vars = GPG().decrypt_file(f) | |
if not env_vars.ok: |
This file contains hidden or 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
{ | |
"editor.formatOnSave": true, | |
"python.defaultInterpreterPath": "/Users/smoore/Develop/venv/bin/python3", | |
"python.languageServer": "Jedi", // requires: pip install jedi-language-server | |
"flake8.args": [ | |
"--max-line-length=88", | |
"--ignore=E203,E501,W503" | |
], | |
"black-formatter.args": [ | |
"--line-length", |
This file contains hidden or 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
#!/bin/bash | |
kubectl create job --from=cronjob/my-cron-job test-my-cron-job | |
kubectl wait --for=condition=complete --timeout=10s job/test-my-cron-job | |
echo "my-cron-job output:" | |
kubectl logs job/test-my-cron-job | |
kubectl delete job test-my-cron-job |
This file contains hidden or 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
--- | |
apiVersion: batch/v1 | |
kind: CronJob | |
metadata: | |
name: my-cron-job | |
spec: | |
schedule: "*/5 * * * *" | |
jobTemplate: | |
spec: | |
template: |