More file re-arrangement, concentrating on running from source

With `import eddn.core.Validator` and the like it was actually picking
up the egg versions of the files, not local ones.

Currently this will run as per:

cd src/eddn
python Gateway.py --config ~/.local/share/eddn/dev/config.json

# Conflicts:
#	src/eddn/schemas/fssbodysignals-README.md
#	src/eddn/schemas/fssbodysignals-v1.0.json
#	src/eddn/schemas/fsssignaldiscovered-README.md
#	src/eddn/schemas/fsssignaldiscovered-v1.0.json
This commit is contained in:
Athanasius committed 2022-08-18 15:20:18 +01:00
1 parent d36e45873d
commit 47ae96ddc1
37 files changed
+24 -21

No files matched your search

+6 -6
View File
@@ -84,7 +84,7 @@ setup(
package_dir={"": "src"},
# This includes them for the running code, but that doesn't help
# serve them up for reference.
data_files=[("eddn/src/schemas", glob.glob("src/schemas/*.json"))],
data_files=[("eddn/schemas", glob.glob("src/eddn/schemas/*.json"))],
# Yes, we pin versions. With python2.7 the latest pyzmq will NOT
# work, for instance.
install_requires=[
@@ -99,10 +99,10 @@ setup(
],
entry_points={
"console_scripts": [
"eddn-gateway = Gateway:main",
"eddn-relay = Relay:main",
"eddn-monitor = Monitor:main",
"eddn-bouncer = Bouncer:main",
"eddn-gateway = eddn.Gateway:main",
"eddn-relay = eddn.Relay:main",
"eddn-monitor = eddn.Monitor:main",
"eddn-bouncer = eddn.Bouncer:main",
],
},
)
@@ -220,7 +220,7 @@ except OSError:
pass
shutil.copytree(
"src/schemas",
"src/eddn/schemas",
SHARE_EDDN_FILES / "schemas",
copy_function=shutil.copyfile, # type: ignore
)
+5 -14
View File
@@ -20,8 +20,9 @@ from gevent import monkey
from pkg_resources import resource_string
from zmq import PUB as ZMQ_PUB
from eddn.conf.Settings import Settings, load_config
from eddn.core.Validator import ValidationSeverity, Validator
from conf.Settings import Settings, load_config
from core.Validator import ValidationSeverity, Validator
from core.logger import logger
monkey.patch_all()
import bottle # noqa: E402
@@ -30,18 +31,8 @@ from bottle import Bottle, request, response # noqa: E402
bottle.BaseRequest.MEMFILE_MAX = 1024 * 1024 # 1MiB, default is/was 100KiB
app = Bottle()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
__logger_channel = logging.StreamHandler()
__logger_formatter = logging.Formatter("%(asctime)s - %(levelname)s - Gateway - %(module)s:%(lineno)d: %(message)s")
__logger_formatter.default_time_format = "%Y-%m-%d %H:%M:%S"
__logger_formatter.default_msec_format = "%s.%03d"
__logger_channel.setFormatter(__logger_formatter)
logger.addHandler(__logger_channel)
logger.info("Made logger")
# This socket is used to push market data out to the Announcers over ZeroMQ.
zmq_context = zmq.Context()
sender = zmq_context.socket(ZMQ_PUB)
@@ -49,8 +40,8 @@ sender = zmq_context.socket(ZMQ_PUB)
validator = Validator()
# This import must be done post-monkey-patching!
from eddn.core.StatsCollector import StatsCollector # noqa: E402
from eddn.core.EDDNWSGIHandler import EDDNWSGIHandler
from core.StatsCollector import StatsCollector # noqa: E402
from core.EDDNWSGIHandler import EDDNWSGIHandler
stats_collector = StatsCollector()
stats_collector.start()
File renamed without changes.
View File
File renamed without changes.
+1 -1
View File
@@ -5,7 +5,7 @@ from typing import Dict
import simplejson
from eddn.conf.Version import __version__ as version
from conf.Version import __version__ as version
class _Settings(object):
+12
View File
@@ -0,0 +1,12 @@
"""Common logging setup."""
# vim: tw=120 wm=120 ts=4 sw=4 smarttab smartindent expandtab
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
__logger_channel = logging.StreamHandler()
__logger_formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(filename)s - %(module)s:%(lineno)d: %(message)s")
__logger_formatter.default_time_format = "%Y-%m-%d %H:%M:%S"
__logger_formatter.default_msec_format = "%s.%03d"
__logger_channel.setFormatter(__logger_formatter)
logger.addHandler(__logger_channel)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.