mirror of
https://github.com/gsi-upm/senpy
synced 2024-11-23 08:32:29 +00:00
Makefile for automated testing (no more drone)
This commit is contained in:
parent
0454fb1afe
commit
5d5de0bc50
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ dist
|
|||||||
build
|
build
|
||||||
README.html
|
README.html
|
||||||
__pycache__
|
__pycache__
|
||||||
|
Dockerfile-*
|
||||||
|
3
Dockerfile.template
Normal file
3
Dockerfile.template
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from python:{{PYVERSION}}-onbuild
|
||||||
|
|
||||||
|
ENTRYPOINT ["python", "-m", "senpy", "-f", ".", "--host", "0.0.0.0"]
|
@ -2,6 +2,7 @@ include requirements.txt
|
|||||||
include test-requirements.txt
|
include test-requirements.txt
|
||||||
include README.md
|
include README.md
|
||||||
include senpy/context.jsonld
|
include senpy/context.jsonld
|
||||||
|
include senpy/VERSION
|
||||||
graft senpy/plugins
|
graft senpy/plugins
|
||||||
graft senpy/schemas
|
graft senpy/schemas
|
||||||
graft senpy/templates
|
graft senpy/templates
|
||||||
|
29
Makefile
Normal file
29
Makefile
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
PYVERSIONS=2.7 3.4
|
||||||
|
NAME=senpy
|
||||||
|
REPO=gsiupm
|
||||||
|
VERSION=$(shell cat $(NAME)/VERSION)
|
||||||
|
|
||||||
|
|
||||||
|
all: build run
|
||||||
|
|
||||||
|
dockerfiles: $(addprefix Dockerfile-,$(PYVERSIONS))
|
||||||
|
|
||||||
|
Dockerfile-%: Dockerfile.template
|
||||||
|
sed "s/{{PYVERSION}}/$*/" Dockerfile.template > Dockerfile-$*
|
||||||
|
|
||||||
|
build: $(addprefix build-, $(PYVERSIONS))
|
||||||
|
|
||||||
|
build-%: Dockerfile-%
|
||||||
|
docker build -t '$(REPO)/$(NAME):$(VERSION)-python$*' -f Dockerfile-$* .;
|
||||||
|
|
||||||
|
test: $(addprefix test-,$(PYVERSIONS))
|
||||||
|
|
||||||
|
test-%: build-%
|
||||||
|
docker run --rm -w /usr/src/app/ --entrypoint=/usr/local/bin/python -ti '$(REPO)/$(NAME):$(VERSION)-python$*' setup.py test ;
|
||||||
|
|
||||||
|
test_pip-%:
|
||||||
|
docker run --rm -ti python:$* pip -q install senpy ;
|
||||||
|
|
||||||
|
test_pip: $(addprefix test_pip-,$(PYVERSIONS))
|
||||||
|
|
||||||
|
.PHONY: test test-% build-% build test test_pip
|
1
senpy/VERSION
Normal file
1
senpy/VERSION
Normal file
@ -0,0 +1 @@
|
|||||||
|
0.5.7
|
@ -18,4 +18,8 @@
|
|||||||
Sentiment analysis server in Python
|
Sentiment analysis server in Python
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = "0.5.6"
|
import os
|
||||||
|
VFILE = os.path.join(os.path.dirname(__file__), "VERSION")
|
||||||
|
|
||||||
|
with open(VFILE, 'r') as f:
|
||||||
|
__version__ = f.read().strip()
|
||||||
|
3
setup.py
3
setup.py
@ -15,7 +15,8 @@ except AttributeError:
|
|||||||
install_reqs = [str(ir.req) for ir in install_reqs]
|
install_reqs = [str(ir.req) for ir in install_reqs]
|
||||||
test_reqs = [str(ir.req) for ir in test_reqs]
|
test_reqs = [str(ir.req) for ir in test_reqs]
|
||||||
|
|
||||||
exec(open('senpy/__init__.py').read())
|
with open('senpy/VERSION') as f:
|
||||||
|
__version__ = f.read().strip()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='senpy',
|
name='senpy',
|
||||||
|
Loading…
Reference in New Issue
Block a user