Skip to content

Commit 905d59b

Browse files
authored
Fixed meta fields to allow installing from PyPI and Git interchangeably (#142)
* Added more attributes to plugin __init__.py * Version from PyPI has v prefix but does not when installed from git - this makes both supported
1 parent 240dd71 commit 905d59b

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/pytest_celery/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77

88
__version__ = "1.0.0a10"
9+
__author__ = "Tomer Nosrati"
10+
__contact__ = "[email protected]"
11+
__homepage__ = "https://pytest-celery.readthedocs.io/"
12+
__docformat__ = "restructuredtext"
913

1014

1115
import re
@@ -49,7 +53,7 @@
4953

5054

5155
# Required for RTD to build
52-
_temp = re.match(r"(\d+)\.(\d+)\.(\d+)([a-zA-Z0-9]+)?", __version__).groups() # type: ignore
56+
_temp = re.match(r"v?(\d+)\.(\d+)\.(\d+)([a-zA-Z0-9]+)?", __version__).groups() # type: ignore
5357
VERSION = version_info = version_info_t(int(_temp[0]), int(_temp[1]), int(_temp[2]), _temp[3] or "", "")
5458
del _temp
5559
del re

tests/test_pytest_celery.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import pytest
2+
13
import pytest_celery
24

35

@@ -6,3 +8,16 @@ def test_version():
68
assert len(pytest_celery.VERSION) >= 3
79
pytest_celery.VERSION = (0, 3, 0)
810
assert pytest_celery.__version__.count(".") >= 2
11+
12+
13+
@pytest.mark.parametrize(
14+
"attr",
15+
[
16+
"__author__",
17+
"__contact__",
18+
"__homepage__",
19+
"__docformat__",
20+
],
21+
)
22+
def test_meta(attr):
23+
assert getattr(pytest_celery, attr, None)

0 commit comments

Comments
 (0)