Skip to content

Commit

Permalink
Merge pull request #18 from mekanix/feature/schema-resolver
Browse files Browse the repository at this point in the history
Build and publish
  • Loading branch information
mekanix authored Jan 9, 2020
2 parents 4457d05 + 0ded80a commit 172a0a3
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ SERVICE != echo ${app_name}back
REGGAE_PATH := /usr/local/share/reggae

.include <${REGGAE_PATH}/mk/service.mk>

build:
@sudo cbsd jexec jname=${SERVICE} user=devel cmd=/usr/src/bin/build.sh

publish: build
@sudo cbsd jexec jname=${SERVICE} user=devel cmd=/usr/src/bin/publish.sh
18 changes: 18 additions & 0 deletions bin/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh


set -e

export BIN_DIR=`dirname $0`
export PROJECT_ROOT="${BIN_DIR}/.."
. ${BIN_DIR}/common.sh
setup


if [ "${OFFLINE}" != "yes" ]; then
pip install -U -r requirements_dev.txt
fi

cd ${PROJECT_ROOT}
rm -rf freenit.egg-info build dist
python setup.py sdist bdist_wheel
2 changes: 1 addition & 1 deletion bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ setup() {
if [ "${update}" != "no" ]; then
pip install -U pip
pip install -U wheel
pip install -e ${PROJECT_ROOT}
pip install -e .
fi
if [ -e "${BIN_DIR}/../migrations/main/001_initial.py" ]; then
flask migration run
Expand Down
12 changes: 12 additions & 0 deletions bin/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh


set -e

export BIN_DIR=`dirname $0`
export PROJECT_ROOT="${BIN_DIR}/.."
. ${BIN_DIR}/common.sh
setup no


twine upload dist/freenit-* --verbose
4 changes: 2 additions & 2 deletions freenit/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def schema_name_resolver(schema):
for field in schema.partial:
name += field.capitalize()
name += 'Partial'
if schema.only is not None:
if schema.only:
for field in schema.only:
name += field.capitalize()
name += 'Only'
if schema.exclude is not None:
if schema.exclude:
for field in schema.exclude:
name += field.capitalize()
name += 'Exclude'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='freenit',
version='0.0.12',
version='0.0.14',
description='REST API framework based on Flask-Smorest',
long_description=README,
long_description_content_type='text/markdown',
Expand Down

0 comments on commit 172a0a3

Please sign in to comment.