Skip to content

Commit

Permalink
Merge branch 'master' into pr38
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Jan 5, 2024
2 parents 3a7ee3b + 7e5667d commit 197c467
Show file tree
Hide file tree
Showing 18 changed files with 224 additions and 120 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ jobs:
fail-fast: false
matrix:
python:
- '3.12'
- '3.11'
- '3.10'
- '3.9'
- '3.8'
- '3.7'
- '3.6'
- pypy3
- pypy-3.10
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand All @@ -39,7 +40,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.11'
- uses: actions/cache@v1
with:
path: ~/.cache/pip
Expand All @@ -56,7 +57,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.11'
- uses: actions/cache@v1
with:
path: ~/.cache/pip
Expand Down
20 changes: 9 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
---
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.2.1
rev: v3.15.0
hooks:
- id: pyupgrade
args: ["--py36-plus"]
args: ["--py38-plus"]
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.2.0
rev: v3.12.0
hooks:
- id: reorder-python-imports
args: ["--application-directories", "src"]
- repo: https://github.com/psf/black
rev: 19.10b0
rev: 23.9.1
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.0.292'
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-implicit-str-concat
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
rev: v4.5.0
hooks:
- id: check-byte-order-marker
- id: trailing-whitespace
Expand Down
7 changes: 7 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ python:
- requirements: docs/requirements.txt
sphinx:
builder: dirhtml
formats:
- pdf
- epub
build:
os: "ubuntu-22.04"
tools:
python: "3.11"
67 changes: 29 additions & 38 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,68 +1,59 @@
Changes
=======
Unreleased
----------

Version 0.x
-----------
- Allow to override the default blank value. (:pr:`38`)

Unreleased
Version 0.4.0
-------------

Released on January 4th, 2024

- Stop support for python 3.6 and 3.7. Start support for python3
3.11 and 3.12. (:pr:`41`)
- ``render_kw`` support (:pr:`42`)
- ``optgroup`` support (:pr:`44`)
- SQLAlchemy 2.0 support (:pr:`45`)

Version 0.3
-----------

Released on November 6th, 2021

- Wtforms 3 support. (`#35`_)
- SQLAlchemy 1.4 tests fixes. (`#34`_)
- Switched from Travis CI to Github Actions (`#33`_)
- Abandon deperecated validator. (`#32`_)
- Wtforms 3 support. (:pr:`35`)
- SQLAlchemy 1.4 tests fixes. (:pr:`34`)
- Switched from Travis CI to Github Actions (:pr:`33`)
- Abandon deperecated validator. (:pr:`32`)

Version 0.2
-----------

Released on June 21st, 2020

- Auto-generated ``DecimalField`` does not limit places for ``Float``
columns. (`#2`_)
- Add an example of using this library with Flask-SQAlchemy. (`#3`_)
columns. (:pr:`2`)
- Add an example of using this library with Flask-SQAlchemy. (:pr:`3`)
- Generating a form from a model copies any lists of validators
passed in ``field_args`` to prevent modifying a shared value across
forms. (`#5`_)
forms. (:pr:`5`)
- Don't add a ``Length`` validator when the column's length is not an
int. (`#6`_)
int. (:pr:`6`)
- Add ``QueryRadioField``, like ``QuerySelectField`` except
it renders a list of radio fields. Add ``QueryCheckboxField``, like
``QuerySelectMultipleField`` except it renders a list of checkbox
fields. (`#8`_)
fields. (:pr:`8`)
- Fix a compatibility issue with SQLAlchemy 2.1 that caused
``QuerySelectField`` to fail with a ``ValueError``. (`#9`_, `#10`_,
`#11`_)
``QuerySelectField`` to fail with a ``ValueError``. (:issue:`9`, :pr:`10`,
:pr:`11`)
- QuerySelectField.query allowing no results instead of falling back to
``query_factory``. (`#15`_)
- Explicitly check if db_session is None in converter. (`#17`_)
``query_factory``. (:pr:`15`)
- Explicitly check if db_session is None in converter. (:pr:`17`)
- Check for ``sqlalchemy.`` to avoid matching packages with names starting
with ``sqlalchemy`` (6237a0f_)
- Use SQLAlchemy's Column.doc for WTForm's Field.description (`#21`_)
- Stopped support for python < 3.5 and added a style pre-commit hook. (`#23`_)
- Documentation cleanup. (`#24`_)
- Use SQLAlchemy's Column.doc for WTForm's Field.description (:pr:`21`)
- Stopped support for python < 3.5 and added a style pre-commit hook. (:pr:`23`)
- Documentation cleanup. (:pr:`24`)

.. _#2: https://github.com/wtforms/wtforms-sqlalchemy/pull/2
.. _#3: https://github.com/wtforms/wtforms-sqlalchemy/pull/3
.. _#5: https://github.com/wtforms/wtforms-sqlalchemy/pull/5
.. _#6: https://github.com/wtforms/wtforms-sqlalchemy/pull/6
.. _#8: https://github.com/wtforms/wtforms-sqlalchemy/pull/8
.. _#9: https://github.com/wtforms/wtforms-sqlalchemy/issues/9
.. _#10: https://github.com/wtforms/wtforms-sqlalchemy/pull/10
.. _#11: https://github.com/wtforms/wtforms-sqlalchemy/pull/11
.. _#15: https://github.com/wtforms/wtforms-sqlalchemy/pull/15
.. _#17: https://github.com/wtforms/wtforms-sqlalchemy/pull/17
.. _6237a0f: https://github.com/wtforms/wtforms-sqlalchemy/commit/6237a0f9e53ec5f22048be7f129e29f7f1c58448
.. _#21: https://github.com/wtforms/wtforms-sqlalchemy/pull/21
.. _#23: https://github.com/wtforms/wtforms-sqlalchemy/pull/23
.. _#24: https://github.com/wtforms/wtforms-sqlalchemy/pull/24
.. _#32: https://github.com/wtforms/wtforms-sqlalchemy/pull/32
.. _#33: https://github.com/wtforms/wtforms-sqlalchemy/pull/33
.. _#34: https://github.com/wtforms/wtforms-sqlalchemy/pull/34
.. _#35: https://github.com/wtforms/wtforms-sqlalchemy/pull/35

Version 0.1
-----------
Expand Down
6 changes: 2 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
WTForms-SQLAlchemy
==================

.. image:: https://travis-ci.org/wtforms/wtforms-sqlalchemy.svg?branch=master
:target: https://travis-ci.org/wtforms/wtforms-sqlalchemy
.. image:: https://github.com/wtforms/wtforms-sqlalchemy/actions/workflows/tests.yaml/badge.svg
:target: https://github.com/wtforms/wtforms-sqlalchemy/actions/workflows/tests.yaml
.. image:: https://readthedocs.org/projects/wtforms-sqlalchemy/badge/?version=latest&style=flat
:target: https://wtforms-sqlalchemy.readthedocs.io

Expand All @@ -14,8 +14,6 @@ to install::

pip install WTForms-SQLAlchemy

Python 3.6 to 3.10 are supported.

An example using Flask is included in ``examples/flask``.

Features
Expand Down
4 changes: 4 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Changes
=======

.. include:: ../CHANGES.rst
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
),
ProjectLink("PyPI Releases", "https://pypi.org/project/WTForms-SQLAlchemy/"),
ProjectLink("Source Code", "https://github.com/wtforms/wtforms-sqlalchemy/"),
ProjectLink("Discord Chat", "https://discord.gg/F65P7Z9",),
ProjectLink(
"Discord Chat",
"https://discord.gg/F65P7Z9",
),
ProjectLink(
"Issue Tracker", "https://github.com/wtforms/wtforms-sqlalchemy/issues/"
),
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Contents:
:maxdepth: 2

wtforms_sqlalchemy
changes


Indices and tables
Expand Down
6 changes: 3 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Sphinx~=4.2.0
Pallets-Sphinx-Themes~=2.0.1
sphinx-issues~=1.2.0
Sphinx~=7.2.6
Pallets-Sphinx-Themes~=2.1.1
sphinx-issues~=3.0.1
sphinxcontrib-log-cabinet~=1.0.1
python-dateutil~=2.8.1
3 changes: 1 addition & 2 deletions examples/flask/basic.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from wtforms_sqlalchemy.orm import model_form

from flask import Flask
from flask import render_template
from flask import request
from flask_sqlalchemy import SQLAlchemy
from wtforms_sqlalchemy.orm import model_form

app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///sample_db.sqlite"
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[tool.coverage.run]
branch = true
source = ["wtforms_sqlalchemy", "tests"]

[tool.coverage.paths]
source = ["src", "*/site-packages"]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"except ImportError:",
]
14 changes: 6 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = WTForms-SQLAlchemy
version = 0.3
version = 0.4.0
url = http://github.com/wtforms/wtforms-sqlalchemy/
project_urls =
Documentation = https://wtforms-sqlalchemy.readthedocs.io/
Expand All @@ -21,23 +21,21 @@ classifiers =
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Topic :: Internet :: WWW/HTTP :: Dynamic Content
Topic :: Software Development :: Libraries :: Python Modules

[options]
packages = wtforms_sqlalchemy
include_package_data = true
python_requires = >= 3.6
python_requires = >= 3.8
install_requires =
WTForms>=1.0.5
SQLAlchemy>=0.7.10
tests_require = coverage
test_suite = tests.tests
WTForms>=3.1
SQLAlchemy>=1.4

[flake8]
# B = bugbear
Expand Down
3 changes: 0 additions & 3 deletions tests/requirements.txt

This file was deleted.

Loading

0 comments on commit 197c467

Please sign in to comment.