Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
name: Build documentation
name: CI / Docs

on:
push:
pull_request:
types: [opened, synchronize]

jobs:
build:
docs_build:
name: "Build"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: "3.12"

- name: Get full Python version
id: full-python-version
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Test python code
name: CI / Tests

on:
push:
pull_request:
types: [opened, synchronize]

jobs:
test:
name: "Tests"
tests:
name: "py${{ matrix.python-version }}"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
python-version: ['3.10', '3.11', '3.12', '3.13']
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Upload coverage
uses: codecov/codecov-action@v5

static-checks:
static_checks:
name: "Static checks"
runs-on: ubuntu-latest
steps:
Expand All @@ -72,7 +72,7 @@ jobs:
- name: "Setup Python"
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.10"

- name: Get full Python version
id: full-python-version
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
default_stages: [commit, push]
default_stages: [pre-commit, pre-push]
default_language_version:
# force all unspecified python hooks to run python3
python: python3
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ formats: all
build:
os: ubuntu-20.04
tools:
python: "3.9"
python: "3.10"
jobs:
post_create_environment:
- pip install poetry
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: python
sudo: false
matrix:
include:
- python: 3.9
- python: 3.10
- python: 3.11
- python: 3.12
Expand Down
16 changes: 7 additions & 9 deletions openapi_schema_validator/_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
from base64 import b64decode
from base64 import b64encode
from numbers import Number
from typing import Any
from typing import Union

from jsonschema._format import FormatChecker


def is_int32(instance: Any) -> bool:
def is_int32(instance: object) -> bool:
# bool inherits from int, so ensure bools aren't reported as ints
if isinstance(instance, bool):
return True
Expand All @@ -17,7 +15,7 @@ def is_int32(instance: Any) -> bool:
return ~(1 << 31) < instance < 1 << 31


def is_int64(instance: Any) -> bool:
def is_int64(instance: object) -> bool:
# bool inherits from int, so ensure bools aren't reported as ints
if isinstance(instance, bool):
return True
Expand All @@ -26,7 +24,7 @@ def is_int64(instance: Any) -> bool:
return ~(1 << 63) < instance < 1 << 63


def is_float(instance: Any) -> bool:
def is_float(instance: object) -> bool:
# bool inherits from int
if isinstance(instance, int):
return True
Expand All @@ -35,7 +33,7 @@ def is_float(instance: Any) -> bool:
return isinstance(instance, float)


def is_double(instance: Any) -> bool:
def is_double(instance: object) -> bool:
# bool inherits from int
if isinstance(instance, int):
return True
Expand All @@ -46,15 +44,15 @@ def is_double(instance: Any) -> bool:
return isinstance(instance, float)


def is_binary(instance: Any) -> bool:
def is_binary(instance: object) -> bool:
if not isinstance(instance, (str, bytes)):
return True
if isinstance(instance, str):
return False
return True


def is_byte(instance: Union[str, bytes]) -> bool:
def is_byte(instance: object) -> bool:
if not isinstance(instance, (str, bytes)):
return True
if isinstance(instance, str):
Expand All @@ -64,7 +62,7 @@ def is_byte(instance: Union[str, bytes]) -> bool:
return encoded == instance


def is_password(instance: Any) -> bool:
def is_password(instance: object) -> bool:
# A hint to UIs to obscure input
return True

Expand Down
Loading
Loading