Skip to content

Commit

Permalink
remove babel dependency from synse package, move it to tox workflow (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
edaniszewski committed Apr 16, 2018
1 parent e73dc60 commit 46a4299
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 43 deletions.
2 changes: 1 addition & 1 deletion dockerfile/release.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN set -e -x \
bash libstdc++ \
&& apk --update --no-cache --virtual .build-dep add \
curl build-base jq \
&& pip install --upgrade pip babel \
&& pip install --upgrade pip \
&& pip install -r requirements.txt \
&& bin_url=$(curl -s https://api.github.com/repos/${EMULATOR_REPO}/releases/latest | jq '.assets[] | select(.name == env.EMULATOR_BIN) | .url' | tr -d '"') \
&& curl -L -H "Accept: application/octet-stream" -o $EMULATOR_BIN $bin_url \
Expand Down
2 changes: 1 addition & 1 deletion dockerfile/slim.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN set -e -x \
bash libstdc++ \
&& apk --update --no-cache --virtual .build-dep add \
build-base \
&& pip install --upgrade pip babel \
&& pip install --upgrade pip \
&& pip install -r requirements.txt \
&& apk del .build-dep

Expand Down
13 changes: 0 additions & 13 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,3 @@ universal = 1
not_skip = __init__.py
default_section = THIRDPARTY
known_first_party = synse,tests

[extract_messages]
keywords = gettext
input_dirs = synse
output_file = synse/i18n/messages.pot

[init_catalog]
input_file = synse/i18n/messages.pot
output_dir = synse/i18n
locale = en_US

[compile_catalog]
directory = synse/i18n
8 changes: 1 addition & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import os

from babel.messages import frontend as babel
from setuptools import find_packages, setup


Expand Down Expand Up @@ -49,10 +48,5 @@
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
cmdclass={
'compile_catalog': babel.compile_catalog,
'extract_messages': babel.extract_messages,
'init_catalog': babel.init_catalog,
}
]
)
24 changes: 14 additions & 10 deletions synse/i18n/en_US/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# English (United States) translations for synse.
# English (United States) translations for PROJECT.
# Copyright (C) 2018 ORGANIZATION
# This file is distributed under the same license as the synse project.
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
#
msgid ""
msgstr ""
"Project-Id-Version: synse 2.0.0\n"
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2018-04-16 09:13-0400\n"
"PO-Revision-Date: 2018-04-16 09:13-0400\n"
"POT-Creation-Date: 2018-04-16 11:31-0400\n"
"PO-Revision-Date: 2018-04-16 11:31-0400\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en_US\n"
"Language-Team: en_US <LL@li.org>\n"
Expand Down Expand Up @@ -126,14 +126,18 @@ msgstr ""
msgid "plugin \"{}\" already exists - will not re-register (tcp)"
msgstr ""

#: synse/validate.py:25
#: synse/validate.py:27
msgid "Device ({}) is not of type {}"
msgstr ""

#: synse/routes/aliases.py:163 synse/routes/aliases.py:169 synse/validate.py:50
#: synse/routes/aliases.py:163 synse/routes/aliases.py:169 synse/validate.py:52
msgid "Invalid query param: {} (valid params: {})"
msgstr ""

#: synse/validate.py:73
msgid "Endpoint does not support query parameters but got: {}"
msgstr ""

#: synse/commands/info.py:23
msgid "No rack specified when issuing info command."
msgstr ""
Expand Down Expand Up @@ -264,15 +268,15 @@ msgstr ""
msgid "forcing re-scan? {}"
msgstr ""

#: synse/routes/core.py:93
#: synse/routes/core.py:95
msgid "Invalid JSON specified: {}"
msgstr ""

#: synse/routes/core.py:96
#: synse/routes/core.py:98
msgid "WRITE -> json: {}"
msgstr ""

#: synse/routes/core.py:100
#: synse/routes/core.py:102
msgid "Invalid data POSTed for write. Must contain \"action\" and/or \"raw\"."
msgstr ""

Expand Down
22 changes: 13 additions & 9 deletions synse/i18n/messages.pot
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Translations template for synse.
# Translations template for PROJECT.
# Copyright (C) 2018 ORGANIZATION
# This file is distributed under the same license as the synse project.
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: synse 2.0.0\n"
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2018-04-16 09:13-0400\n"
"POT-Creation-Date: 2018-04-16 11:31-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -125,14 +125,18 @@ msgstr ""
msgid "plugin \"{}\" already exists - will not re-register (tcp)"
msgstr ""

#: synse/validate.py:25
#: synse/validate.py:27
msgid "Device ({}) is not of type {}"
msgstr ""

#: synse/routes/aliases.py:163 synse/routes/aliases.py:169 synse/validate.py:50
#: synse/routes/aliases.py:163 synse/routes/aliases.py:169 synse/validate.py:52
msgid "Invalid query param: {} (valid params: {})"
msgstr ""

#: synse/validate.py:73
msgid "Endpoint does not support query parameters but got: {}"
msgstr ""

#: synse/commands/info.py:23
msgid "No rack specified when issuing info command."
msgstr ""
Expand Down Expand Up @@ -263,15 +267,15 @@ msgstr ""
msgid "forcing re-scan? {}"
msgstr ""

#: synse/routes/core.py:93
#: synse/routes/core.py:95
msgid "Invalid JSON specified: {}"
msgstr ""

#: synse/routes/core.py:96
#: synse/routes/core.py:98
msgid "WRITE -> json: {}"
msgstr ""

#: synse/routes/core.py:100
#: synse/routes/core.py:102
msgid "Invalid data POSTed for write. Must contain \"action\" and/or \"raw\"."
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ basepython=
deps=
Babel>=2.5.3
commands=
python setup.py extract_messages
python setup.py init_catalog
pybabel extract -k gettext -o synse/i18n/messages.pot synse
pybabel init -i synse/i18n/messages.pot -d synse/i18n -l en_US

0 comments on commit 46a4299

Please sign in to comment.