1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-11-22 08:12:27 +00:00

Added fallback version '0.0'

Installing depends on the VERSION file, so it raies an error if it is
installed in some other way.

ReadTheDocs installs the package so it can generate code docs.
This commit adds a default version 0.0
This commit is contained in:
J. Fernando Sánchez 2017-03-01 18:49:52 +01:00
parent efb305173e
commit cbeb3adbdb
2 changed files with 10 additions and 4 deletions

View File

@ -85,8 +85,6 @@ git_push:
pip_upload: pip_upload:
python setup.py sdist upload ; python setup.py sdist upload ;
pip_test: $(addprefix pip_test-,$(PYVERSIONS))
run-%: build-% run-%: build-%
docker run --rm -p 5000:5000 -ti '$(IMAGEWTAG)-python$(PYMAIN)' --default-plugins docker run --rm -p 5000:5000 -ti '$(IMAGEWTAG)-python$(PYMAIN)' --default-plugins
@ -101,6 +99,10 @@ push-latest: build-$(PYMAIN)
push-%: build-% push-%: build-%
docker push $(IMAGENAME):$(VERSION)-python$* docker push $(IMAGENAME):$(VERSION)-python$*
push: $(addprefix push-,$(PYVERSIONS))
docker tag '$(IMAGEWTAG)-python$(PYMAIN)' '$(IMAGEWTAG)'
docker push $(IMAGENAME):$(VERSION)
ci: ci:
gitlab-runner exec docker --docker-volumes /var/run/docker.sock:/var/run/docker.sock --env CI_PROJECT_NAME=$(NAME) ${action} gitlab-runner exec docker --docker-volumes /var/run/docker.sock:/var/run/docker.sock --env CI_PROJECT_NAME=$(NAME) ${action}

View File

@ -8,8 +8,12 @@ DEFAULT_FILE = os.path.join(ROOT, 'VERSION')
def read_version(versionfile=DEFAULT_FILE): def read_version(versionfile=DEFAULT_FILE):
with open(versionfile) as f: try:
return f.read().strip() with open(versionfile) as f:
return f.read().strip()
except IOError:
logger.error('Running an unknown version of senpy. Be careful!.')
return '0.0'
__version__ = read_version() __version__ = read_version()