Commit 4cd6804a authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

fixed bug in misc controller

parent d9ff64c3
Pipeline #4877 failed with stages
in 43 seconds
...@@ -62,7 +62,6 @@ test: ...@@ -62,7 +62,6 @@ test:
> /config.py > /config.py
&& export FRACTALIS_CONFIG=/config.py && export FRACTALIS_CONFIG=/config.py
&& celery worker -D -A fractalis:celery -l debug --concurrency=1 && celery worker -D -A fractalis:celery -l debug --concurrency=1
&& pip3 install -r requirements.txt
&& pytest tests && pytest tests
" "
dependencies: dependencies:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
in any of the other categories.""" in any of the other categories."""
import logging import logging
import pkg_resources import re
from typing import Tuple from typing import Tuple
from flask import Blueprint, jsonify, Response from flask import Blueprint, jsonify, Response
...@@ -14,5 +14,7 @@ logger = logging.getLogger(__name__) ...@@ -14,5 +14,7 @@ logger = logging.getLogger(__name__)
@misc_blueprint.route('/version', methods=['GET']) @misc_blueprint.route('/version', methods=['GET'])
def get_version() -> Tuple[Response, int]: def get_version() -> Tuple[Response, int]:
version = pkg_resources.require('fractalis')[0].version with open('setup.py') as setup_file:
text = setup_file.read()
version = re.search(r'version=\'(\d+\.\d+\.\d+)\',', text).group(1)
return jsonify({'version': version}), 201 return jsonify({'version': version}), 201
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment