Skip to content

Commit

Permalink
Update pydantic version, drop python 3.7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
monim67 committed Dec 12, 2023
1 parent b8624ff commit 071cbf7
Show file tree
Hide file tree
Showing 9 changed files with 518 additions and 587 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
needs: pre-build
strategy:
matrix:
python-version: ["3.9", "3.8", "3.7"]
python-version: ["3.11", "3.10", "3.9", "3.8"]
steps:
- uses: actions/checkout@v3

Expand Down
8 changes: 8 additions & 0 deletions .vscode/extensions.json
@@ -0,0 +1,8 @@
{
"recommendations": [
"ms-python.mypy-type-checker",
"ms-python.black-formatter",
"ms-python.isort",
"ms-python.python"
]
}
3 changes: 0 additions & 3 deletions .vscode/settings.json
@@ -1,7 +1,4 @@
{
"python.formatting.provider": "black",
"python.linting.mypyEnabled": true,
"python.linting.pydocstyleEnabled": true,
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"[python]": {
Expand Down
3 changes: 2 additions & 1 deletion README.rst
Expand Up @@ -18,7 +18,8 @@ Getting Started
Prerequisites
++++++++++++++++++++

- poetry = ^1.2.0a2
- python = ^3.8
- poetry = ^1.2.0

++++++++++++++++++++
Install
Expand Down
1,048 changes: 481 additions & 567 deletions poetry.lock

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions pyproject.toml
Expand Up @@ -11,15 +11,15 @@ keywords = ["poetry", "bump", "version", "plugin"]
classifiers = ["Typing :: Typed"]

[tool.poetry.dependencies]
python = "^3.7"
poetry = "^1.2.0a2"
python = "^3.8"
poetry = "^1.2.0"
typing-extensions = "*"
pydantic = "<2"
pydantic = "*"

[tool.poetry.group.build.dependencies]
black = "^22.3.0"
isort = "^5.10.1"
mypy = "^0.971"
mypy = "^1.7.1"
pydocstyle = {extras = ["toml"], version = "^6.1.1"}
pytest = "^7.1.3"
rstcheck = "^6.0.0.post1"
Expand All @@ -42,14 +42,14 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.black]
target_version = ["py37", "py38", "py39", "py310", "py311"]
target_version = ["py38", "py39", "py310", "py311"]

[tool.isort]
py_version = "37"
py_version = "38"
profile = "black"

[tool.mypy]
python_version = "3.7"
python_version = "3.8"
namespace_packages = true
strict = true

Expand Down Expand Up @@ -79,10 +79,12 @@ source = [
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = py{310,39,38,37}
envlist = py{312,311,310,39,38}
[testenv]
whitelist_externals = poetry
allowlist_externals =
poetry
poe
skip_install = true
commands =
poetry install --no-root --only build
Expand Down
5 changes: 4 additions & 1 deletion src/poetry_bumpversion/models.py
Expand Up @@ -3,7 +3,10 @@
from pathlib import Path
from typing import Dict, List

from pydantic import BaseModel
try:
from pydantic.v1 import BaseModel
except ModuleNotFoundError: # pragma: no cover
from pydantic import BaseModel # type: ignore

CURRENT_VERSION_MARKER = "{current_version}"
NEW_VERSION_MARKER = "{new_version}"
Expand Down
6 changes: 5 additions & 1 deletion src/poetry_bumpversion/plugin.py
Expand Up @@ -11,7 +11,11 @@
from poetry.console.commands.version import VersionCommand
from poetry.core.pyproject.toml import PyProjectTOML
from poetry.plugins.application_plugin import ApplicationPlugin
from pydantic import ValidationError

try:
from pydantic.v1 import ValidationError
except ModuleNotFoundError: # pragma: no cover
from pydantic import ValidationError # type: ignore

from .models import (
CURRENT_VERSION_MARKER,
Expand Down
8 changes: 5 additions & 3 deletions tests/pip-constraints.txt
@@ -1,3 +1,5 @@
django>=1.2.1 ; python_version >= "3.10"
poetry==1.2.1 ; python_version >= "3.8" and python_version < "3.10"
poetry==1.2.0 ; python_version < "3.8"
poetry>=1.7 ; python_version >= "3.12"
poetry>=1.6,<1.7 ; python_version >= "3.11" and python_version < "3.12"
poetry>=1.5,<1.6 ; python_version >= "3.10" and python_version < "3.11"
poetry>=1.4,<1.5 ; python_version >= "3.9" and python_version < "3.10"
poetry>=1.2,<1.3 ; python_version >= "3.8" and python_version < "3.9"

0 comments on commit 071cbf7

Please sign in to comment.