forked from Wavyzz/py-healthchecks.io
Compare commits
1 Commits
main
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b78e124a4e |
2
.github/workflows/pre-release.yml
vendored
2
.github/workflows/pre-release.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
|||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5.3.0
|
uses: actions/setup-python@v6.0.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: "3.10"
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5.3.0
|
uses: actions/setup-python@v6.0.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
- name: Install pip and poetry
|
- name: Install pip and poetry
|
||||||
|
|||||||
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python }}
|
- name: Set up Python ${{ matrix.python }}
|
||||||
uses: actions/setup-python@v5.3.0
|
uses: actions/setup-python@v6.0.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
|
|||||||
@@ -128,33 +128,33 @@ class CheckCreate(BaseModel):
|
|||||||
|
|
||||||
@field_validator("schedule")
|
@field_validator("schedule")
|
||||||
@classmethod
|
@classmethod
|
||||||
def validate_schedule(cls, value: str | None) -> str:
|
def validate_schedule(cls, value: str) -> str:
|
||||||
"""Validates that the schedule is a valid cron expression."""
|
"""Validates that the schedule is a valid cron expression."""
|
||||||
if value and not croniter.is_valid(value):
|
if not croniter.is_valid(value):
|
||||||
raise ValueError("Schedule is not a valid cron expression")
|
raise ValueError("Schedule is not a valid cron expression")
|
||||||
return value
|
return value
|
||||||
|
|
||||||
@field_validator("tz")
|
@field_validator("tz")
|
||||||
@classmethod
|
@classmethod
|
||||||
def validate_tz(cls, value: str | None) -> str:
|
def validate_tz(cls, value: str) -> str:
|
||||||
"""Validates that the timezone is a valid timezone string."""
|
"""Validates that the timezone is a valid timezone string."""
|
||||||
if value and value not in pytz.all_timezones:
|
if value not in pytz.all_timezones:
|
||||||
raise ValueError("Tz is not a valid timezone")
|
raise ValueError("Tz is not a valid timezone")
|
||||||
return value
|
return value
|
||||||
|
|
||||||
@field_validator("methods")
|
@field_validator("methods")
|
||||||
@classmethod
|
@classmethod
|
||||||
def validate_methods(cls, value: str | None) -> str:
|
def validate_methods(cls, value: str) -> str:
|
||||||
"""Validate that methods."""
|
"""Validate that methods."""
|
||||||
if value and value != "POST":
|
if value not in ("", "POST"):
|
||||||
raise ValueError("Methods is invalid, it should be either an empty string, None, or POST")
|
raise ValueError("Methods is invalid, it should be either an empty string or POST")
|
||||||
return ""
|
return value
|
||||||
|
|
||||||
@field_validator("unique")
|
@field_validator("unique")
|
||||||
@classmethod
|
@classmethod
|
||||||
def validate_unique(cls, value: List[Optional[str]] | None) -> List[Optional[str]]:
|
def validate_unique(cls, value: List[Optional[str]]) -> List[Optional[str]]:
|
||||||
"""Validate unique list."""
|
"""Validate unique list."""
|
||||||
for unique in value or []:
|
for unique in value:
|
||||||
if unique not in ("name", "tags", "timeout", "grace"):
|
if unique not in ("name", "tags", "timeout", "grace"):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Unique is not valid. Unique can only be name, tags, timeout, and grace or an empty list"
|
"Unique is not valid. Unique can only be name, tags, timeout, and grace or an empty list"
|
||||||
|
|||||||
Reference in New Issue
Block a user