Skip to content

Commit

Permalink
added version info to the logs (#130)
Browse files Browse the repository at this point in the history
* added version info to the logs

* added toml as dev dependency

* fixed version lock

* updated poetry lock

* updated the version to 0.10.2 in the init

* added message to the EVCC side as well

* reformatted evcc init
  • Loading branch information
tropxy authored Sep 8, 2022
1 parent 4905b97 commit e425147
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 39 deletions.
2 changes: 1 addition & 1 deletion iso15118/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.0"
__version__ = "0.10.2"
2 changes: 2 additions & 0 deletions iso15118/evcc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
from typing import Optional

from iso15118 import __version__
from iso15118.evcc.comm_session_handler import CommunicationSessionHandler
from iso15118.evcc.controller.interface import EVControllerInterface
from iso15118.evcc.evcc_settings import Config
Expand All @@ -24,6 +25,7 @@ def __init__(

async def start(self):
try:
logger.info(f"Starting 15118 version: {__version__}")
await self.start_session_handler()
except Exception as exc:
logger.error(f"EVCC terminated: {exc}")
Expand Down
3 changes: 2 additions & 1 deletion iso15118/secc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
from optparse import Option
from typing import Optional

from iso15118 import __version__
from iso15118.secc.comm_session_handler import CommunicationSessionHandler
from iso15118.secc.controller.interface import EVSEControllerInterface
from iso15118.secc.secc_settings import Config
Expand Down Expand Up @@ -30,6 +30,7 @@ def __init__(

async def start(self):
try:
logger.info(f"Starting 15118 version: {__version__}")
await self.start_session_handler()
except Exception as exc:
logger.error(f"SECC terminated: {exc}")
Expand Down
103 changes: 67 additions & 36 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ isort = "^5.10.1"
flake8 = "^4.0.1"
pytest-cov = "^3.0.0"
aiofile = "^3.7.4"
toml = "0.10.2"

[tool.isort]
profile = "black"
Expand Down
2 changes: 1 addition & 1 deletion template.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ RUN /venv/bin/pip install dist/*.whl
# This is not the ideal way to provide the certificate chain to the container, but for now it works
COPY --from=build /usr/src/app/iso15118/shared/pki/ /usr/src/app/iso15118/shared/pki/


RUN /venv/bin/pip install aiofile
# This will run the entrypoint script defined in the pyproject.toml
CMD /venv/bin/iso15118
14 changes: 14 additions & 0 deletions tests/test_version_pyproject_toml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from pathlib import Path

import toml

from iso15118 import __version__ as pkg_init_version


def test_versions_are_in_sync():
"""Checks if the pyproject.toml and package.__init__.py __version__ are in sync."""
path = Path(__file__).resolve().parents[1] / "pyproject.toml"
pyproject = toml.loads(open(str(path)).read())
pyproject_version = pyproject["tool"]["poetry"]["version"]

assert pkg_init_version == pyproject_version

0 comments on commit e425147

Please sign in to comment.