Testing direct imports of all simpleflow python files to detect circular dependencies for botify-labs/simpleflow#420
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
#!/usr/bin/env bash | |
# Copied from https://get.qovery.com/ | |
# Adapted with https://github.com/Qovery/qovery-cli/issues/159 to support ARM | |
# Stored in the repo because we don't like to "curl | bash" | |
set -e | |
set +x | |
echo "##################################" |
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
class Poetry < Formula | |
include Language::Python::Virtualenv | |
desc "Python package management tool" | |
homepage "https://python-poetry.org/" | |
url "https://files.pythonhosted.org/packages/e0/c8/09e126761651e291ab54db1b1d6983c64a1cf67b8b25ce9c806db23e16ab/poetry-1.1.15.tar.gz" | |
sha256 "a373848fd205f31b2f6bee6b87a201ea1e09ca573a2f40d0991539f564cedffd" | |
license "MIT" | |
head "https://github.com/python-poetry/poetry.git", branch: "master" |
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
gp() { | |
current_branch=$(git rev-parse --abbrev-ref HEAD) | |
if echo "$current_branch" | grep -qE '^(master|main|devel)$'; then | |
read "answer?You're about to push to a MAIN branch, are you sure? [y/N] " | |
if ! echo "$answer" | grep -qE '^y'; then | |
echo "aborting..." | |
return | |
fi | |
fi | |
git push origin HEAD |
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
def pod_status_from_spec(spec) | |
# translated from: https://github.com/kubernetes/kubernetes/blob/a9f6b93b62a98598913180c640ab044c85a6718b/pkg/printers/internalversion/printers.go#L695-L781 | |
# related issue: https://github.com/kubernetes/kubernetes/issues/22839 | |
metadata = spec.fetch("metadata") | |
pod_status = spec.fetch("status") | |
reason = pod_status.fetch("phase") | |
restarts = 0 | |
if pod_status["reason"] | |
# unsure about this, the go code is opaque |
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
class PirateForm(ModelForm): | |
class Meta: | |
model = Pirate | |
fields = ("name", "is_captain") | |
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) | |
self.cleanup_missing_keys(kwargs.get("data")) | |
def cleanup_missing_keys(self, data): |
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
{% if user.name == "Alice" %} | |
<input type=hidden name=is_captain value=false> | |
<input type=checkbox name=is_captain id=id_is_captain {% if object.is_captain %}checked{% endif %}> | |
{% else %} | |
{{ object.is_captain|yesno:"Yes,No" }} <i>(must be admin to edit)</i> | |
{% endif %} |
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
... | |
{% if form.can_edit_captain_field() %} | |
<input type=checkbox name=is_captain id=id_is_captain {% if object.is_captain %}checked{% endif %}> | |
{% else %} | |
... |
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
{# Keep this condition in sync with PirateForm #} | |
{% if user.name == "Alice" %} | |
<input type=checkbox name=is_captain id=id_is_captain {% if object.is_captain %}checked{% endif %}> | |
{% else %} |
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
<p> | |
{{ form.name.errors }} | |
<label for=id_name>Name:</label> | |
{{ form.name }} | |
</p> | |
<p> | |
{{ form.is_captain.errors }} | |
<label for=id_is_captain>Is Captain?:</label> | |
{% if user.name == "Alice" %} | |
<input type=checkbox name=is_captain id=id_is_captain {% if object.is_captain %}checked{% endif %}> |
NewerOlder