Adding upstream version 4.6.0+dfsg.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
f3ad83a1a5
commit
167a3f8553
275 changed files with 30423 additions and 0 deletions
15
tests/providers/conftest.py
Normal file
15
tests/providers/conftest.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from collections.abc import Iterator
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def chdir(tmp_path: Path) -> Iterator[Path]:
|
||||
cwd = Path()
|
||||
os.chdir(tmp_path)
|
||||
yield tmp_path
|
||||
os.chdir(cwd)
|
20
tests/providers/test_base_provider.py
Normal file
20
tests/providers/test_base_provider.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from commitizen.config.base_config import BaseConfig
|
||||
from commitizen.exceptions import VersionProviderUnknown
|
||||
from commitizen.providers import get_provider
|
||||
from commitizen.providers.commitizen_provider import CommitizenProvider
|
||||
|
||||
|
||||
def test_default_version_provider_is_commitizen_config(config: BaseConfig):
|
||||
provider = get_provider(config)
|
||||
|
||||
assert isinstance(provider, CommitizenProvider)
|
||||
|
||||
|
||||
def test_raise_for_unknown_provider(config: BaseConfig):
|
||||
config.settings["version_provider"] = "unknown"
|
||||
with pytest.raises(VersionProviderUnknown):
|
||||
get_provider(config)
|
60
tests/providers/test_cargo_provider.py
Normal file
60
tests/providers/test_cargo_provider.py
Normal file
|
@ -0,0 +1,60 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from textwrap import dedent
|
||||
|
||||
import pytest
|
||||
|
||||
from commitizen.config.base_config import BaseConfig
|
||||
from commitizen.providers import get_provider
|
||||
from commitizen.providers.cargo_provider import CargoProvider
|
||||
|
||||
CARGO_TOML = """\
|
||||
[package]
|
||||
name = "whatever"
|
||||
version = "0.1.0"
|
||||
"""
|
||||
|
||||
CARGO_EXPECTED = """\
|
||||
[package]
|
||||
name = "whatever"
|
||||
version = "42.1"
|
||||
"""
|
||||
|
||||
CARGO_WORKSPACE_TOML = """\
|
||||
[workspace.package]
|
||||
name = "whatever"
|
||||
version = "0.1.0"
|
||||
"""
|
||||
|
||||
CARGO_WORKSPACE_EXPECTED = """\
|
||||
[workspace.package]
|
||||
name = "whatever"
|
||||
version = "42.1"
|
||||
"""
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"content, expected",
|
||||
(
|
||||
(CARGO_TOML, CARGO_EXPECTED),
|
||||
(CARGO_WORKSPACE_TOML, CARGO_WORKSPACE_EXPECTED),
|
||||
),
|
||||
)
|
||||
def test_cargo_provider(
|
||||
config: BaseConfig,
|
||||
chdir: Path,
|
||||
content: str,
|
||||
expected: str,
|
||||
):
|
||||
filename = CargoProvider.filename
|
||||
file = chdir / filename
|
||||
file.write_text(dedent(content))
|
||||
config.settings["version_provider"] = "cargo"
|
||||
|
||||
provider = get_provider(config)
|
||||
assert isinstance(provider, CargoProvider)
|
||||
assert provider.get_version() == "0.1.0"
|
||||
|
||||
provider.set_version("42.1")
|
||||
assert file.read_text() == dedent(expected)
|
20
tests/providers/test_commitizen_provider.py
Normal file
20
tests/providers/test_commitizen_provider.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from commitizen.config.base_config import BaseConfig
|
||||
from commitizen.providers.commitizen_provider import CommitizenProvider
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pytest_mock import MockerFixture
|
||||
|
||||
|
||||
def test_commitizen_provider(config: BaseConfig, mocker: MockerFixture):
|
||||
config.settings["version"] = "42"
|
||||
mock = mocker.patch.object(config, "set_key")
|
||||
|
||||
provider = CommitizenProvider(config)
|
||||
assert provider.get_version() == "42"
|
||||
|
||||
provider.set_version("43.1")
|
||||
mock.assert_called_once_with("version", "43.1")
|
47
tests/providers/test_composer_provider.py
Normal file
47
tests/providers/test_composer_provider.py
Normal file
|
@ -0,0 +1,47 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from textwrap import dedent
|
||||
|
||||
import pytest
|
||||
|
||||
from commitizen.config.base_config import BaseConfig
|
||||
from commitizen.providers import get_provider
|
||||
from commitizen.providers.composer_provider import ComposerProvider
|
||||
|
||||
COMPOSER_JSON = """\
|
||||
{
|
||||
"name": "whatever",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
"""
|
||||
|
||||
COMPOSER_EXPECTED = """\
|
||||
{
|
||||
"name": "whatever",
|
||||
"version": "42.1"
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"content, expected",
|
||||
((COMPOSER_JSON, COMPOSER_EXPECTED),),
|
||||
)
|
||||
def test_composer_provider(
|
||||
config: BaseConfig,
|
||||
chdir: Path,
|
||||
content: str,
|
||||
expected: str,
|
||||
):
|
||||
filename = ComposerProvider.filename
|
||||
file = chdir / filename
|
||||
file.write_text(dedent(content))
|
||||
config.settings["version_provider"] = "composer"
|
||||
|
||||
provider = get_provider(config)
|
||||
assert isinstance(provider, ComposerProvider)
|
||||
assert provider.get_version() == "0.1.0"
|
||||
|
||||
provider.set_version("42.1")
|
||||
assert file.read_text() == dedent(expected)
|
98
tests/providers/test_npm_provider.py
Normal file
98
tests/providers/test_npm_provider.py
Normal file
|
@ -0,0 +1,98 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from textwrap import dedent
|
||||
|
||||
import pytest
|
||||
|
||||
from commitizen.config.base_config import BaseConfig
|
||||
from commitizen.providers import get_provider
|
||||
from commitizen.providers.npm_provider import NpmProvider
|
||||
|
||||
NPM_PACKAGE_JSON = """\
|
||||
{
|
||||
"name": "whatever",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
"""
|
||||
|
||||
NPM_PACKAGE_EXPECTED = """\
|
||||
{
|
||||
"name": "whatever",
|
||||
"version": "42.1"
|
||||
}
|
||||
"""
|
||||
|
||||
NPM_LOCKFILE_JSON = """\
|
||||
{
|
||||
"name": "whatever",
|
||||
"version": "0.1.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "whatever",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"someotherpackage": {
|
||||
"version": "0.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
NPM_LOCKFILE_EXPECTED = """\
|
||||
{
|
||||
"name": "whatever",
|
||||
"version": "42.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "whatever",
|
||||
"version": "42.1"
|
||||
},
|
||||
"someotherpackage": {
|
||||
"version": "0.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"pkg_shrinkwrap_content, pkg_shrinkwrap_expected",
|
||||
((NPM_LOCKFILE_JSON, NPM_LOCKFILE_EXPECTED), (None, None)),
|
||||
)
|
||||
@pytest.mark.parametrize(
|
||||
"pkg_lock_content, pkg_lock_expected",
|
||||
((NPM_LOCKFILE_JSON, NPM_LOCKFILE_EXPECTED), (None, None)),
|
||||
)
|
||||
def test_npm_provider(
|
||||
config: BaseConfig,
|
||||
chdir: Path,
|
||||
pkg_lock_content: str,
|
||||
pkg_lock_expected: str,
|
||||
pkg_shrinkwrap_content: str,
|
||||
pkg_shrinkwrap_expected: str,
|
||||
):
|
||||
pkg = chdir / NpmProvider.package_filename
|
||||
pkg.write_text(dedent(NPM_PACKAGE_JSON))
|
||||
if pkg_lock_content:
|
||||
pkg_lock = chdir / NpmProvider.lock_filename
|
||||
pkg_lock.write_text(dedent(pkg_lock_content))
|
||||
if pkg_shrinkwrap_content:
|
||||
pkg_shrinkwrap = chdir / NpmProvider.shrinkwrap_filename
|
||||
pkg_shrinkwrap.write_text(dedent(pkg_shrinkwrap_content))
|
||||
config.settings["version_provider"] = "npm"
|
||||
|
||||
provider = get_provider(config)
|
||||
assert isinstance(provider, NpmProvider)
|
||||
assert provider.get_version() == "0.1.0"
|
||||
|
||||
provider.set_version("42.1")
|
||||
assert pkg.read_text() == dedent(NPM_PACKAGE_EXPECTED)
|
||||
if pkg_lock_content:
|
||||
assert pkg_lock.read_text() == dedent(pkg_lock_expected)
|
||||
if pkg_shrinkwrap_content:
|
||||
assert pkg_shrinkwrap.read_text() == dedent(pkg_shrinkwrap_expected)
|
43
tests/providers/test_pep621_provider.py
Normal file
43
tests/providers/test_pep621_provider.py
Normal file
|
@ -0,0 +1,43 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from textwrap import dedent
|
||||
|
||||
import pytest
|
||||
|
||||
from commitizen.config.base_config import BaseConfig
|
||||
from commitizen.providers import get_provider
|
||||
from commitizen.providers.pep621_provider import Pep621Provider
|
||||
|
||||
PEP621_TOML = """\
|
||||
[project]
|
||||
version = "0.1.0"
|
||||
"""
|
||||
|
||||
PEP621_EXPECTED = """\
|
||||
[project]
|
||||
version = "42.1"
|
||||
"""
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"content, expected",
|
||||
((PEP621_TOML, PEP621_EXPECTED),),
|
||||
)
|
||||
def test_cargo_provider(
|
||||
config: BaseConfig,
|
||||
chdir: Path,
|
||||
content: str,
|
||||
expected: str,
|
||||
):
|
||||
filename = Pep621Provider.filename
|
||||
file = chdir / filename
|
||||
file.write_text(dedent(content))
|
||||
config.settings["version_provider"] = "pep621"
|
||||
|
||||
provider = get_provider(config)
|
||||
assert isinstance(provider, Pep621Provider)
|
||||
assert provider.get_version() == "0.1.0"
|
||||
|
||||
provider.set_version("42.1")
|
||||
assert file.read_text() == dedent(expected)
|
43
tests/providers/test_poetry_provider.py
Normal file
43
tests/providers/test_poetry_provider.py
Normal file
|
@ -0,0 +1,43 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from textwrap import dedent
|
||||
|
||||
import pytest
|
||||
|
||||
from commitizen.config.base_config import BaseConfig
|
||||
from commitizen.providers import get_provider
|
||||
from commitizen.providers.poetry_provider import PoetryProvider
|
||||
|
||||
POETRY_TOML = """\
|
||||
[tool.poetry]
|
||||
version = "0.1.0"
|
||||
"""
|
||||
|
||||
POETRY_EXPECTED = """\
|
||||
[tool.poetry]
|
||||
version = "42.1"
|
||||
"""
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"content, expected",
|
||||
((POETRY_TOML, POETRY_EXPECTED),),
|
||||
)
|
||||
def test_cargo_provider(
|
||||
config: BaseConfig,
|
||||
chdir: Path,
|
||||
content: str,
|
||||
expected: str,
|
||||
):
|
||||
filename = PoetryProvider.filename
|
||||
file = chdir / filename
|
||||
file.write_text(dedent(content))
|
||||
config.settings["version_provider"] = "poetry"
|
||||
|
||||
provider = get_provider(config)
|
||||
assert isinstance(provider, PoetryProvider)
|
||||
assert provider.get_version() == "0.1.0"
|
||||
|
||||
provider.set_version("42.1")
|
||||
assert file.read_text() == dedent(expected)
|
138
tests/providers/test_scm_provider.py
Normal file
138
tests/providers/test_scm_provider.py
Normal file
|
@ -0,0 +1,138 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from commitizen.config.base_config import BaseConfig
|
||||
from commitizen.providers import get_provider
|
||||
from commitizen.providers.scm_provider import ScmProvider
|
||||
from tests.utils import (
|
||||
create_branch,
|
||||
create_file_and_commit,
|
||||
create_tag,
|
||||
merge_branch,
|
||||
switch_branch,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"tag_format,tag,expected_version",
|
||||
(
|
||||
# If tag_format is $version (the default), version_scheme.parser is used.
|
||||
# Its DEFAULT_VERSION_PARSER allows a v prefix, but matches PEP440 otherwise.
|
||||
("$version", "no-match-because-version-scheme-is-strict", "0.0.0"),
|
||||
("$version", "0.1.0", "0.1.0"),
|
||||
("$version", "v0.1.0", "0.1.0"),
|
||||
("$version", "v-0.1.0", "0.0.0"),
|
||||
# If tag_format is not None or $version, TAG_FORMAT_REGEXS are used, which are
|
||||
# much more lenient but require a v prefix.
|
||||
("v$version", "v0.1.0", "0.1.0"),
|
||||
("v$version", "no-match-because-no-v-prefix", "0.0.0"),
|
||||
# no match because not a valid version
|
||||
("v$version", "v-match-TAG_FORMAT_REGEXS", "0.0.0"),
|
||||
("version-$version", "version-0.1.0", "0.1.0"),
|
||||
("version-$version", "version-0.1", "0.1"),
|
||||
("version-$version", "version-0.1.0rc1", "0.1.0rc1"),
|
||||
("v$minor.$major.$patch", "v1.0.0", "0.1.0"),
|
||||
("version-$major.$minor.$patch", "version-0.1.0", "0.1.0"),
|
||||
("v$major.$minor$prerelease$devrelease", "v1.0rc1", "1.0rc1"),
|
||||
("v$major.$minor.$patch$prerelease$devrelease", "v0.1.0", "0.1.0"),
|
||||
("v$major.$minor.$patch$prerelease$devrelease", "v0.1.0rc1", "0.1.0rc1"),
|
||||
("v$major.$minor.$patch$prerelease$devrelease", "v1.0.0.dev0", "1.0.0.dev0"),
|
||||
),
|
||||
)
|
||||
@pytest.mark.usefixtures("tmp_git_project")
|
||||
def test_scm_provider(
|
||||
config: BaseConfig, tag_format: str, tag: str, expected_version: str
|
||||
):
|
||||
create_file_and_commit("test: fake commit")
|
||||
create_tag(tag)
|
||||
create_file_and_commit("test: fake commit")
|
||||
create_tag("should-not-match")
|
||||
|
||||
config.settings["version_provider"] = "scm"
|
||||
config.settings["tag_format"] = tag_format
|
||||
|
||||
provider = get_provider(config)
|
||||
assert isinstance(provider, ScmProvider)
|
||||
actual_version = provider.get_version()
|
||||
assert actual_version == expected_version
|
||||
|
||||
# Should not fail on set_version()
|
||||
provider.set_version("43.1")
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("tmp_git_project")
|
||||
def test_scm_provider_default_without_commits_and_tags(config: BaseConfig):
|
||||
config.settings["version_provider"] = "scm"
|
||||
|
||||
provider = get_provider(config)
|
||||
assert isinstance(provider, ScmProvider)
|
||||
assert provider.get_version() == "0.0.0"
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("tmp_git_project")
|
||||
def test_scm_provider_default_with_commits_and_tags(config: BaseConfig):
|
||||
config.settings["version_provider"] = "scm"
|
||||
|
||||
provider = get_provider(config)
|
||||
assert isinstance(provider, ScmProvider)
|
||||
assert provider.get_version() == "0.0.0"
|
||||
|
||||
create_file_and_commit("Initial state")
|
||||
create_tag("1.0.0")
|
||||
# create develop
|
||||
create_branch("develop")
|
||||
switch_branch("develop")
|
||||
|
||||
# add a feature to develop
|
||||
create_file_and_commit("develop: add beta feature1")
|
||||
assert provider.get_version() == "1.0.0"
|
||||
create_tag("1.1.0b0")
|
||||
|
||||
# create staging
|
||||
create_branch("staging")
|
||||
switch_branch("staging")
|
||||
create_file_and_commit("staging: Starting release candidate")
|
||||
assert provider.get_version() == "1.1.0b0"
|
||||
create_tag("1.1.0rc0")
|
||||
|
||||
# add another feature to develop
|
||||
switch_branch("develop")
|
||||
create_file_and_commit("develop: add beta feature2")
|
||||
assert provider.get_version() == "1.1.0b0"
|
||||
create_tag("1.2.0b0")
|
||||
|
||||
# add a hotfix to master
|
||||
switch_branch("master")
|
||||
create_file_and_commit("master: add hotfix")
|
||||
assert provider.get_version() == "1.0.0"
|
||||
create_tag("1.0.1")
|
||||
|
||||
# merge the hotfix to staging
|
||||
switch_branch("staging")
|
||||
merge_branch("master")
|
||||
|
||||
assert provider.get_version() == "1.1.0rc0"
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("tmp_git_project")
|
||||
def test_scm_provider_detect_legacy_tags(config: BaseConfig):
|
||||
config.settings["version_provider"] = "scm"
|
||||
config.settings["tag_format"] = "v${version}"
|
||||
config.settings["legacy_tag_formats"] = [
|
||||
"legacy-${version}",
|
||||
"old-${version}",
|
||||
]
|
||||
provider = get_provider(config)
|
||||
|
||||
create_file_and_commit("test: fake commit")
|
||||
create_tag("old-0.4.1")
|
||||
assert provider.get_version() == "0.4.1"
|
||||
|
||||
create_file_and_commit("test: fake commit")
|
||||
create_tag("legacy-0.4.2")
|
||||
assert provider.get_version() == "0.4.2"
|
||||
|
||||
create_file_and_commit("test: fake commit")
|
||||
create_tag("v0.5.0")
|
||||
assert provider.get_version() == "0.5.0"
|
97
tests/providers/test_uv_provider.py
Normal file
97
tests/providers/test_uv_provider.py
Normal file
|
@ -0,0 +1,97 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from commitizen.config.base_config import BaseConfig
|
||||
from commitizen.providers import get_provider
|
||||
from commitizen.providers.uv_provider import UvProvider
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pytest_regressions.file_regression import FileRegressionFixture
|
||||
|
||||
|
||||
PYPROJECT_TOML = """
|
||||
[project]
|
||||
name = "test-uv"
|
||||
version = "4.2.1"
|
||||
description = "Add your description here"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.13"
|
||||
dependencies = ["commitizen==4.2.1"]
|
||||
"""
|
||||
|
||||
UV_LOCK_SIMPLIFIED = """
|
||||
version = 1
|
||||
revision = 1
|
||||
requires-python = ">=3.13"
|
||||
|
||||
[[package]]
|
||||
name = "commitizen"
|
||||
version = "4.2.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "argcomplete" },
|
||||
{ name = "charset-normalizer" },
|
||||
{ name = "colorama" },
|
||||
{ name = "decli" },
|
||||
{ name = "jinja2" },
|
||||
{ name = "packaging" },
|
||||
{ name = "pyyaml" },
|
||||
{ name = "questionary" },
|
||||
{ name = "termcolor" },
|
||||
{ name = "tomlkit" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d8/a3/77ffc9aee014cbf46c84c9f156a1ddef2d4c7cfb87d567decf2541464245/commitizen-4.2.1.tar.gz", hash = "sha256:5255416f6d6071068159f0b97605777f3e25d00927ff157b7a8d01efeda7b952", size = 50645 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/57/ce/2f5d8ebe8376991b5f805e9f33d20c7f4c9ca6155bdbda761117dc41dff1/commitizen-4.2.1-py3-none-any.whl", hash = "sha256:a347889e0fe408c3b920a34130d8f35616be3ea8ac6b7b20c5b9aac19762661b", size = 72646 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "decli"
|
||||
version = "0.6.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/3d/a0/a4658f93ecb589f479037b164dc13c68d108b50bf6594e54c820749f97ac/decli-0.6.2.tar.gz", hash = "sha256:36f71eb55fd0093895efb4f416ec32b7f6e00147dda448e3365cf73ceab42d6f", size = 7424 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/bf/70/3ea48dc9e958d7d66c44c9944809181f1ca79aaef25703c023b5092d34ff/decli-0.6.2-py3-none-any.whl", hash = "sha256:2fc84106ce9a8f523ed501ca543bdb7e416c064917c12a59ebdc7f311a97b7ed", size = 7854 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "test-uv"
|
||||
version = "4.2.1"
|
||||
source = { virtual = "." }
|
||||
dependencies = [
|
||||
{ name = "commitizen" },
|
||||
]
|
||||
"""
|
||||
|
||||
|
||||
def test_uv_provider(
|
||||
config: BaseConfig, tmpdir, file_regression: FileRegressionFixture
|
||||
):
|
||||
with tmpdir.as_cwd():
|
||||
pyproject_toml_file = tmpdir / UvProvider.filename
|
||||
pyproject_toml_file.write_text(PYPROJECT_TOML, encoding="utf-8")
|
||||
|
||||
uv_lock_file = tmpdir / UvProvider.lock_filename
|
||||
uv_lock_file.write_text(UV_LOCK_SIMPLIFIED, encoding="utf-8")
|
||||
|
||||
config.settings["version_provider"] = "uv"
|
||||
|
||||
provider = get_provider(config)
|
||||
assert isinstance(provider, UvProvider)
|
||||
assert provider.get_version() == "4.2.1"
|
||||
|
||||
provider.set_version("100.100.100")
|
||||
assert provider.get_version() == "100.100.100"
|
||||
|
||||
updated_pyproject_toml_content = pyproject_toml_file.read_text(encoding="utf-8")
|
||||
updated_uv_lock_content = uv_lock_file.read_text(encoding="utf-8")
|
||||
|
||||
for content in (updated_pyproject_toml_content, updated_uv_lock_content):
|
||||
# updated project version
|
||||
assert "100.100.100" in content
|
||||
# commitizen version which was the same as project version and should not be affected
|
||||
assert "4.2.1" in content
|
||||
|
||||
file_regression.check(updated_pyproject_toml_content, extension=".toml")
|
||||
file_regression.check(updated_uv_lock_content, extension=".lock")
|
42
tests/providers/test_uv_provider/test_uv_provider.lock
Normal file
42
tests/providers/test_uv_provider/test_uv_provider.lock
Normal file
|
@ -0,0 +1,42 @@
|
|||
|
||||
version = 1
|
||||
revision = 1
|
||||
requires-python = ">=3.13"
|
||||
|
||||
[[package]]
|
||||
name = "commitizen"
|
||||
version = "4.2.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "argcomplete" },
|
||||
{ name = "charset-normalizer" },
|
||||
{ name = "colorama" },
|
||||
{ name = "decli" },
|
||||
{ name = "jinja2" },
|
||||
{ name = "packaging" },
|
||||
{ name = "pyyaml" },
|
||||
{ name = "questionary" },
|
||||
{ name = "termcolor" },
|
||||
{ name = "tomlkit" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d8/a3/77ffc9aee014cbf46c84c9f156a1ddef2d4c7cfb87d567decf2541464245/commitizen-4.2.1.tar.gz", hash = "sha256:5255416f6d6071068159f0b97605777f3e25d00927ff157b7a8d01efeda7b952", size = 50645 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/57/ce/2f5d8ebe8376991b5f805e9f33d20c7f4c9ca6155bdbda761117dc41dff1/commitizen-4.2.1-py3-none-any.whl", hash = "sha256:a347889e0fe408c3b920a34130d8f35616be3ea8ac6b7b20c5b9aac19762661b", size = 72646 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "decli"
|
||||
version = "0.6.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/3d/a0/a4658f93ecb589f479037b164dc13c68d108b50bf6594e54c820749f97ac/decli-0.6.2.tar.gz", hash = "sha256:36f71eb55fd0093895efb4f416ec32b7f6e00147dda448e3365cf73ceab42d6f", size = 7424 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/bf/70/3ea48dc9e958d7d66c44c9944809181f1ca79aaef25703c023b5092d34ff/decli-0.6.2-py3-none-any.whl", hash = "sha256:2fc84106ce9a8f523ed501ca543bdb7e416c064917c12a59ebdc7f311a97b7ed", size = 7854 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "test-uv"
|
||||
version = "100.100.100"
|
||||
source = { virtual = "." }
|
||||
dependencies = [
|
||||
{ name = "commitizen" },
|
||||
]
|
8
tests/providers/test_uv_provider/test_uv_provider.toml
Normal file
8
tests/providers/test_uv_provider/test_uv_provider.toml
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
[project]
|
||||
name = "test-uv"
|
||||
version = "100.100.100"
|
||||
description = "Add your description here"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.13"
|
||||
dependencies = ["commitizen==4.2.1"]
|
Loading…
Add table
Add a link
Reference in a new issue