Skip to content

Commit

Permalink
feat: bump versions
Browse files Browse the repository at this point in the history
  • Loading branch information
justmars committed Dec 2, 2023
1 parent f834106 commit ae92e34
Show file tree
Hide file tree
Showing 6 changed files with 513 additions and 664 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
python-version: ['3.11', '3.12']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
24 changes: 8 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,19 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: end-of-file-fixer
- id: trailing-whitespace
- id: name-tests-test
args: ["--django"]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.286
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.6
hooks:
# Run the linter.
- id: ruff
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
language_version: python3
args: [--preview]
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies:
- black==23.7.0
args: [--skip-errors]
args: [ --fix ]
# Run the formatter.
- id: ruff-format
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ Note: `pytest` will work only if no `.env` file exists with the included values.

## Changes

### Dec. 2, 2023

- Compatibility: python 3.12
- Compatibility: pydantic 2.5

### Initial

- Removed: _Django_ as a dependency
- Added: Instructions to create _Django_ custom storage class
- Added: `.enable_batch()`
Expand Down
12 changes: 6 additions & 6 deletions cloudflare_images/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import httpx
from pydantic import Field
from start_cloudflare import CF
from start_cloudflare import CF # type: ignore

DEFAULT = "imagedelivery.net"
HOST = f"https://{DEFAULT}"
Expand Down Expand Up @@ -32,24 +32,24 @@ class CloudflareImagesAPI(CF):
pydantic_core._pydantic_core.ValidationError: 3 validation errors for CloudflareImagesAPI
CF_ACCT_ID
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.3/v/missing
For further information visit https://errors.pydantic.dev/2.5/v/missing
CF_IMG_HASH
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.3/v/missing
For further information visit https://errors.pydantic.dev/2.5/v/missing
CF_IMG_TOKEN
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.3/v/missing
For further information visit https://errors.pydantic.dev/2.5/v/missing
>>> import os
>>> os.environ['CF_ACCT_ID'] = "ABC"
>>> cf = CloudflareImagesAPI() # will error out since still missing other values
Traceback (most recent call last):
pydantic_core._pydantic_core.ValidationError: 2 validation errors for CloudflareImagesAPI
CF_IMG_HASH
Field required [type=missing, input_value={'CF_ACCT_ID': 'ABC'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.3/v/missing
For further information visit https://errors.pydantic.dev/2.5/v/missing
CF_IMG_TOKEN
Field required [type=missing, input_value={'CF_ACCT_ID': 'ABC'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.3/v/missing
For further information visit https://errors.pydantic.dev/2.5/v/missing
>>> # we'll add all the values needed
>>> os.environ['CF_IMG_HASH'], os.environ['CF_IMG_TOKEN'] = "DEF", "XYZ"
>>> cf = CloudflareImagesAPI() # no longer errors out
Expand Down
Loading

0 comments on commit ae92e34

Please sign in to comment.