Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

rename python package to 'synse_server' #262

Merged
merged 3 commits into from
Feb 4, 2019
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
8 changes: 0 additions & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#
# .dockerignore.default
#
# The dockerignore file used for default Synse Server image builds.
# By default, Synse Server includes the emulator. For a version of
# Synse Server without the emulator, use the 'slim' build.
#

# JetBrains (PyCharm, WebStorm, etc.)
.idea
*.iws
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# Synse Server
#

PKG_NAME := synse
PKG_VERSION := $(shell python -c "import synse ; print(synse.__version__)")
PKG_NAME := synse-server
PKG_VERSION := $(shell python -c "import synse_server ; print(synse_server.__version__)")
IMAGE_NAME := vaporio/synse-server
IMAGE_TAGS ?= latest local

HAS_TRANSLATIONS := $(shell find synse -name '*.mo')
HAS_TRANSLATIONS := $(shell find synse_server -name '*.mo')
HAS_PY36 := $(shell which python3.6 || python -V 2>&1 | grep 3.6 || python3 -V 2>&1 | grep 3.6)
HAS_PIP_COMPILE := $(shell which pip-compile)

Expand Down
2 changes: 1 addition & 1 deletion bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fi

image="${IMAGE_NAME}"
tags="${IMAGE_TAGS}"
version=$(python -c "import synse ; print(synse.__version__)")
version=$(python -c "import synse_server ; print(synse_server.__version__)")
build_date=$(date -u +%Y-%m-%dT%T 2> /dev/null)
git_commit=$(git rev-parse --short HEAD 2> /dev/null || true)

Expand Down
4 changes: 2 additions & 2 deletions bin/synse-server
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

set -o errexit -o pipefail

version="$(python -c "import synse ; print(synse.__version__)")"
version="$(python -c "import synse_server ; print(synse_server.__version__)")"

# name: -h, --help
# desc: Print usage information
Expand Down Expand Up @@ -125,4 +125,4 @@ do
done

# start synse
python synse
python synse_server
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ universal = 1
[isort]
not_skip = __init__.py
default_section = THIRDPARTY
known_first_party = synse,tests
known_first_party = synse_server,tests

[metadata]
license_file = LICENSE
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# Load the package's __init__.py file as a dictionary.
pkg = {}
with open(os.path.join(here, 'synse', '__init__.py')) as f:
with open(os.path.join(here, 'synse_server', '__init__.py')) as f:
exec(f.read(), pkg)

# Load the README
Expand All @@ -32,7 +32,7 @@
include_package_data=True,
package_data={
'': ['LICENSE'],
'synse': ['locale/*/LC_MESSAGES/*.mo'],
'synse_server': ['locale/*/LC_MESSAGES/*.mo'],
},
scripts=['bin/synse-server'],
python_requires='>=3.6',
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion synse/__main__.py → synse_server/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
$ python synse
"""

from synse.factory import make_app
from synse_server.factory import make_app

app = make_app()
app.run(
Expand Down
10 changes: 5 additions & 5 deletions synse/cache.py → synse_server/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import aiocache
import grpc

from synse import config, errors, utils
from synse.i18n import _
from synse.log import logger
from synse.plugin import Plugin, get_plugins, register_plugins
from synse.proto import util as putil
from synse_server import config, errors, utils
from synse_server.i18n import _
from synse_server.log import logger
from synse_server.plugin import Plugin, get_plugins, register_plugins
from synse_server.proto import util as putil

# The aiocache configuration
AIOCACHE = {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Command handler for the `capabilities` route."""

from synse import cache
from synse.i18n import _
from synse.log import logger
from synse.scheme.capabilities import CapabilitiesResponse
from synse_server import cache
from synse_server.i18n import _
from synse_server.log import logger
from synse_server.scheme.capabilities import CapabilitiesResponse


async def capabilities():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Command handler for the `config` route."""

from synse.scheme.config import ConfigResponse
from synse_server.scheme.config import ConfigResponse


async def config():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import datetime
from collections import OrderedDict

from synse import cache
from synse.commands.read import read
from synse.log import logger
from synse_server import cache
from synse_server.commands.read import read
from synse_server.log import logger


# TODO: Need a note in the configuration files about auto_fan relying on
Expand Down
8 changes: 4 additions & 4 deletions synse/commands/info.py → synse_server/commands/info.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Command handler for the `info` route."""

from synse import cache, errors
from synse.i18n import _
from synse.log import logger
from synse.scheme.info import InfoResponse
from synse_server import cache, errors
from synse_server.i18n import _
from synse_server.log import logger
from synse_server.scheme.info import InfoResponse


async def info(rack, board=None, device=None):
Expand Down
10 changes: 5 additions & 5 deletions synse/commands/plugins.py → synse_server/commands/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import grpc

from synse import plugin, utils
from synse.i18n import _
from synse.log import logger
from synse.proto import util
from synse.scheme.plugins import PluginsResponse
from synse_server import plugin, utils
from synse_server.i18n import _
from synse_server.log import logger
from synse_server.proto import util
from synse_server.scheme.plugins import PluginsResponse


async def get_plugins():
Expand Down
8 changes: 4 additions & 4 deletions synse/commands/read.py → synse_server/commands/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import grpc
from synse_grpc import api

from synse import cache, errors, plugin, utils
from synse.i18n import _
from synse.log import logger
from synse.scheme import ReadResponse
from synse_server import cache, errors, plugin, utils
from synse_server.i18n import _
from synse_server.log import logger
from synse_server.scheme import ReadResponse


async def read(rack, board, device):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import grpc

from synse import cache, errors, plugin
from synse.i18n import _
from synse.log import logger
from synse.scheme import ReadCachedResponse
from synse_server import cache, errors, plugin
from synse_server.i18n import _
from synse_server.log import logger
from synse_server.scheme import ReadCachedResponse


async def read_cached(start=None, end=None):
Expand Down
8 changes: 4 additions & 4 deletions synse/commands/scan.py → synse_server/commands/scan.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Command handler for the `scan` route."""

from synse import cache, errors, plugin
from synse.i18n import _
from synse.log import logger
from synse.scheme.scan import ScanResponse
from synse_server import cache, errors, plugin
from synse_server.i18n import _
from synse_server.log import logger
from synse_server.scheme.scan import ScanResponse


async def scan(rack=None, board=None, force=False):
Expand Down
2 changes: 1 addition & 1 deletion synse/commands/test.py → synse_server/commands/test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Command handler for the `test` route."""

from synse.scheme import TestResponse
from synse_server.scheme import TestResponse


async def test():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import grpc

from synse import cache, errors, plugin
from synse.i18n import _
from synse.log import logger
from synse.scheme import transaction as scheme
from synse_server import cache, errors, plugin
from synse_server.i18n import _
from synse_server.log import logger
from synse_server.scheme import transaction as scheme


async def check_transaction(transaction_id):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Command handler for the `version` route."""

from synse.scheme import VersionResponse
from synse_server.scheme import VersionResponse


async def version():
Expand Down
10 changes: 5 additions & 5 deletions synse/commands/write.py → synse_server/commands/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import grpc

from synse import cache, errors, plugin
from synse.i18n import _
from synse.log import logger
from synse.proto.client import WriteData
from synse.scheme.write import WriteResponse
from synse_server import cache, errors, plugin
from synse_server.i18n import _
from synse_server.log import logger
from synse_server.proto.client import WriteData
from synse_server.scheme.write import WriteResponse


async def write(rack, board, device, data):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import kubernetes.client
import kubernetes.config

from synse import config
from synse.i18n import _
from synse.log import logger
from synse_server import config
from synse_server.i18n import _
from synse_server.log import logger


def discover():
Expand Down
File renamed without changes.
20 changes: 10 additions & 10 deletions synse/factory.py → synse_server/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
from sanic.exceptions import InvalidUsage, NotFound, ServerError
from sanic.response import text

import synse
from synse import config, errors, utils
from synse.cache import clear_all_meta_caches, configure_cache
from synse.log import LOGGING, logger, setup_logger
from synse.response import json
from synse.routes import aliases, base, core
import synse_server
from synse_server import config, errors, utils
from synse_server.cache import clear_all_meta_caches, configure_cache
from synse_server.log import LOGGING, logger, setup_logger
from synse_server.response import json
from synse_server.routes import aliases, base, core


def make_app():
Expand Down Expand Up @@ -68,10 +68,10 @@ def make_app():

# Log out metadata for Synse Server and the application configuration
logger.info('Synse Server:')
logger.info(' version: {}'.format(synse.__version__))
logger.info(' author: {}'.format(synse.__author__))
logger.info(' url: {}'.format(synse.__url__))
logger.info(' license: {}'.format(synse.__license__))
logger.info(' version: {}'.format(synse_server.__version__))
logger.info(' author: {}'.format(synse_server.__author__))
logger.info(' url: {}'.format(synse_server.__url__))
logger.info(' license: {}'.format(synse_server.__license__))
logger.info('Configuration: {}'.format(config.options.config))
return app

Expand Down
2 changes: 1 addition & 1 deletion synse/i18n.py → synse_server/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
# time the locale will change is if it is configured by the user -- if
# the given locale is incorrect or unsupported, we want this to fail so
# they know right away.
t = gettext.translation('synse', os.path.join(_here, 'locale'))
t = gettext.translation('synse_server', os.path.join(_here, 'locale'))
_ = t.gettext
Loading