Skip to content

Commit

Permalink
Change doc building, change restrictions on pydantic models
Browse files Browse the repository at this point in the history
  • Loading branch information
abondar committed May 14, 2024
1 parent b6680f1 commit 0a97707
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 29 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ jobs:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install and configure Poetry
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: gh-pages
on:
push:
branches:
- develop
workflow_dispatch:
release:
types:
- created
jobs:
publish:
runs-on: ubuntu-latest
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Changelog

.. rst-class:: emphasize-children

0.20
0.21
====

0.21.0
Expand All @@ -29,6 +29,11 @@ Fixed
Changed
^^^^^^^
- Change `utils.chunk` from function to return iterables lazily.
- Removed lower bound of id keys in generated pydantic models. (#1602)


0.20
====

0.20.1
------
Expand Down
25 changes: 6 additions & 19 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import json
import os
import re
import sys
from datetime import datetime

import importlib_metadata

sys.path.insert(0, os.path.abspath("."))
sys.path.insert(0, os.path.abspath(".."))

Expand All @@ -29,23 +29,8 @@
author = "Andrey Bondar & Nickolas Grigoriadis & long2ice"


def get_version():
verstrline = open("../tortoise/__init__.py", "rt").read()
mob = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", verstrline, re.M)
if mob:
return mob.group(1)
else:
raise RuntimeError("Unable to find version string")


def get_version_info():
with open("versions.json") as f:
versions = json.load(f)
return versions


# The short X.Y version
version = get_version()
version = importlib_metadata.version("tortoise-orm")
# The full version, including alpha/beta/rc tags
release = version

Expand Down Expand Up @@ -209,7 +194,9 @@ def get_version_info():
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
html_sidebars = {"**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]}
html_sidebars = {
"**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
}

# -- Options for HTMLHelp output ---------------------------------------------

Expand Down
6 changes: 3 additions & 3 deletions tortoise/fields/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(self, pk: bool = False, **kwargs: Any) -> None:
@property
def constraints(self) -> dict:
return {
"ge": 1 if self.generated or self.reference else -2147483648,
"ge": -2147483648,
"le": 2147483647,
}

Expand Down Expand Up @@ -120,7 +120,7 @@ def __init__(self, pk: bool = False, **kwargs: Any) -> None:
@property
def constraints(self) -> dict:
return {
"ge": 1 if self.generated or self.reference else -9223372036854775808,
"ge": -9223372036854775808,
"le": 9223372036854775807,
}

Expand Down Expand Up @@ -160,7 +160,7 @@ def __init__(self, pk: bool = False, **kwargs: Any) -> None:
@property
def constraints(self) -> dict:
return {
"ge": 1 if self.generated or self.reference else -32768,
"ge": -32768,
"le": 32767,
}

Expand Down

0 comments on commit 0a97707

Please sign in to comment.