Skip to content

Commit b30bfcb

Browse files
authored
Prepare for (pre) release: v1.0.0a8 (#139)
* Reverted version checking changes * Added comment to explain what happened to avoid repeating in the future * Removed comment from the line where __version__ is defined * Improved version replacing * Disable __version__ from code cov * Bumping version from 1.0.0a7 to 1.0.0a8
1 parent 7f1114c commit b30bfcb

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

pyproject.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ description = "Pytest plugin for Celery"
6161
homepage = "https://github.com/celery/pytest-celery"
6262
license = "BSD"
6363
name = "pytest-celery"
64-
version = "1.0.0a7"
64+
version = "1.0.0a8"
6565

6666
[tool.poetry_bumpversion.file."src/pytest_celery/__init__.py"]
67+
search = '__version__ = "{current_version}"'
68+
replace = '__version__ = "{new_version}"'
6769

6870
[tool.poetry.dependencies]
6971
python = ">= 3.8,<4.0"
@@ -163,5 +165,10 @@ source = ["src"]
163165
omit = ["tests"]
164166

165167
[tool.coverage.report]
166-
exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:", "except ImportError:"]
168+
exclude_lines = [
169+
"pragma: no cover",
170+
"if TYPE_CHECKING:",
171+
"except ImportError:",
172+
'__version__ = ".*"',
173+
]
167174
omit = ["*/python?.?/*", "*/site-packages/*", "*/pypy/*"]

src/pytest_celery/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# flake8: noqa
66

77

8-
__version__ = "1.0.0a7" # pragma: no cover
8+
__version__ = "1.0.0a8"
99

1010

1111
import re
@@ -49,10 +49,11 @@
4949

5050
# bumpversion can only search for {current_version}
5151
# so we have to parse the version here.
52-
match = re.match(r"(\d+)\.(\d+)\.(\d+)([a-zA-Z]+[0-9]*)?", __version__)
52+
match = re.match(r"(\d+)\.(\d+)\.(\d+)(.+)?", __version__)
5353
if match:
5454
_temp = match.groups()
5555
else:
56+
# Comments are not allowed in the same line as the version string.
5657
raise ValueError(f"The version string '{__version__}' does not match the expected pattern.")
5758
VERSION = version_info = version_info_t(int(_temp[0]), int(_temp[1]), int(_temp[2]), _temp[3] or "", "")
5859
del _temp

0 commit comments

Comments
 (0)