Skip to content

Commit

Permalink
Prepare for (pre) release: v1.0.0a8 (#139)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Nusnus authored Jan 2, 2024
1 parent 7f1114c commit b30bfcb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ description = "Pytest plugin for Celery"
homepage = "https://github.com/celery/pytest-celery"
license = "BSD"
name = "pytest-celery"
version = "1.0.0a7"
version = "1.0.0a8"

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

[tool.poetry.dependencies]
python = ">= 3.8,<4.0"
Expand Down Expand Up @@ -163,5 +165,10 @@ source = ["src"]
omit = ["tests"]

[tool.coverage.report]
exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:", "except ImportError:"]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"except ImportError:",
'__version__ = ".*"',
]
omit = ["*/python?.?/*", "*/site-packages/*", "*/pypy/*"]
5 changes: 3 additions & 2 deletions src/pytest_celery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# flake8: noqa


__version__ = "1.0.0a7" # pragma: no cover
__version__ = "1.0.0a8"


import re
Expand Down Expand Up @@ -49,10 +49,11 @@

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

0 comments on commit b30bfcb

Please sign in to comment.