Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump poetry.core.__version__ with test coverage #367

Merged
merged 2 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/poetry/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
from pathlib import Path


__version__ = "1.1.0a7"
# this cannot presently be replaced with importlib.metadata.version as when building
# itself, poetry-core is not available as an installed distribution.
__version__ = "1.1.0b1"

__vendor_site__ = (Path(__file__).parent / "_vendor").as_posix()

Expand Down
2 changes: 1 addition & 1 deletion src/poetry/core/masonry/builders/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

wheel_file_template = """\
Wheel-Version: 1.0
Generator: poetry {version}
Generator: poetry-core {version}
Root-Is-Purelib: {pure_lib}
Tag: {tag}
"""
Expand Down
10 changes: 5 additions & 5 deletions tests/masonry/builders/test_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_wheel_c_extension() -> None:
re.match(
f"""(?m)^\
Wheel-Version: 1.0
Generator: poetry {__version__}
Generator: poetry-core {__version__}
Root-Is-Purelib: false
Tag: cp[23]_?\\d+-cp[23]_?\\d+m?u?-.+
$""",
Expand Down Expand Up @@ -137,7 +137,7 @@ def test_wheel_c_extension_with_no_setup() -> None:
re.match(
f"""(?m)^\
Wheel-Version: 1.0
Generator: poetry {__version__}
Generator: poetry-core {__version__}
Root-Is-Purelib: false
Tag: cp[23]_?\\d+-cp[23]_?\\d+m?u?-.+
$""",
Expand Down Expand Up @@ -192,7 +192,7 @@ def test_wheel_c_extension_src_layout() -> None:
re.match(
f"""(?m)^\
Wheel-Version: 1.0
Generator: poetry {__version__}
Generator: poetry-core {__version__}
Root-Is-Purelib: false
Tag: cp[23]_?\\d+-cp[23]_?\\d+m?u?-.+
$""",
Expand Down Expand Up @@ -247,7 +247,7 @@ def test_complete() -> None:
wheel_data
== f"""\
Wheel-Version: 1.0
Generator: poetry {__version__}
Generator: poetry-core {__version__}
Root-Is-Purelib: true
Tag: py3-none-any
"""
Expand Down Expand Up @@ -371,7 +371,7 @@ def test_complete_no_vcs() -> None:
wheel_data
== f"""\
Wheel-Version: 1.0
Generator: poetry {__version__}
Generator: poetry-core {__version__}
Root-Is-Purelib: true
Tag: py3-none-any
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/masonry/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_prepare_metadata_for_build_wheel() -> None:
"""
wheel_data = f"""\
Wheel-Version: 1.0
Generator: poetry {__version__}
Generator: poetry-core {__version__}
Root-Is-Purelib: true
Tag: py3-none-any
"""
Expand Down
11 changes: 11 additions & 0 deletions tests/test_core_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from __future__ import annotations

from pathlib import Path

from poetry.core import __version__
from poetry.core.pyproject.toml import PyProjectTOML


def test_version_is_synced() -> None:
pyproject = PyProjectTOML(Path(__file__).parent.parent.joinpath("pyproject.toml"))
assert __version__ == pyproject.poetry_config.get("version")