Skip to content

Commit 172a0a3

Browse files
authored
Merge pull request #18 from mekanix/feature/schema-resolver
Build and publish
2 parents 4457d05 + 0ded80a commit 172a0a3

File tree

6 files changed

+40
-4
lines changed

6 files changed

+40
-4
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,9 @@ SERVICE != echo ${app_name}back
44
REGGAE_PATH := /usr/local/share/reggae
55

66
.include <${REGGAE_PATH}/mk/service.mk>
7+
8+
build:
9+
@sudo cbsd jexec jname=${SERVICE} user=devel cmd=/usr/src/bin/build.sh
10+
11+
publish: build
12+
@sudo cbsd jexec jname=${SERVICE} user=devel cmd=/usr/src/bin/publish.sh

bin/build.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
4+
set -e
5+
6+
export BIN_DIR=`dirname $0`
7+
export PROJECT_ROOT="${BIN_DIR}/.."
8+
. ${BIN_DIR}/common.sh
9+
setup
10+
11+
12+
if [ "${OFFLINE}" != "yes" ]; then
13+
pip install -U -r requirements_dev.txt
14+
fi
15+
16+
cd ${PROJECT_ROOT}
17+
rm -rf freenit.egg-info build dist
18+
python setup.py sdist bdist_wheel

bin/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ setup() {
2020
if [ "${update}" != "no" ]; then
2121
pip install -U pip
2222
pip install -U wheel
23-
pip install -e ${PROJECT_ROOT}
23+
pip install -e .
2424
fi
2525
if [ -e "${BIN_DIR}/../migrations/main/001_initial.py" ]; then
2626
flask migration run

bin/publish.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
4+
set -e
5+
6+
export BIN_DIR=`dirname $0`
7+
export PROJECT_ROOT="${BIN_DIR}/.."
8+
. ${BIN_DIR}/common.sh
9+
setup no
10+
11+
12+
twine upload dist/freenit-* --verbose

freenit/api/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ def schema_name_resolver(schema):
3030
for field in schema.partial:
3131
name += field.capitalize()
3232
name += 'Partial'
33-
if schema.only is not None:
33+
if schema.only:
3434
for field in schema.only:
3535
name += field.capitalize()
3636
name += 'Only'
37-
if schema.exclude is not None:
37+
if schema.exclude:
3838
for field in schema.exclude:
3939
name += field.capitalize()
4040
name += 'Exclude'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name='freenit',
12-
version='0.0.12',
12+
version='0.0.14',
1313
description='REST API framework based on Flask-Smorest',
1414
long_description=README,
1515
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)