Skip to content
New issue

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

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

Already on GitHub? # to your account

sets mariadb as db, changes version retrieval #10

Merged
merged 5 commits into from
Sep 26, 2023
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
18 changes: 3 additions & 15 deletions punchpipe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
# version stuff copied from https://stackoverflow.com/a/17638236
from pkg_resources import get_distribution, DistributionNotFound
import os.path
# version guidance from https://stackoverflow.com/a/56331414
from importlib.metadata import version

try:
_dist = get_distribution('punchpipe')
# Normalize case for Windows systems
dist_loc = os.path.normcase(_dist.location)
here = os.path.normcase(__file__)
if not here.startswith(os.path.join(dist_loc, 'punchpipe')):
# not installed, but there is another version that *is*
raise DistributionNotFound
except DistributionNotFound:
__version__ = 'Please install punchpipe project with setup.py'
else:
__version__ = _dist.version
__version__ = version("punchpipe")
7 changes: 7 additions & 0 deletions punchpipe/controlsegment/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import pytest
from pytest_mock_resources import MysqlConfig


@pytest.fixture(scope='session')
def pmr_mysql_config():
return MysqlConfig(image='mariadb:latest')
7 changes: 7 additions & 0 deletions punchpipe/flows/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import pytest
from pytest_mock_resources import MysqlConfig


@pytest.fixture(scope='session')
def pmr_mysql_config():
return MysqlConfig(image='mariadb:latest')