This commit is contained in:
Bernhard Posselt 2016-04-03 18:28:23 +02:00
Родитель 44920b4e88
Коммит d20a5ed98d
3 изменённых файлов: 35 добавлений и 3 удалений

16
.travis.yml Normal file
Просмотреть файл

@ -0,0 +1,16 @@
sudo: false
language: python
python:
- "3.2"
- "3.3"
- "3.4"
- "3.5"
before_install:
- pip install pep8
install:
- pip install -r requirements.txt
script:
- make test

Просмотреть файл

@ -1,20 +1,36 @@
# This makefile is only intended for development # This file is licensed under the General Public License version 3 or
# later. See the LICENSE.txt file.
# @author Bernhard Posselt <dev@bernhard-posselt.com>
# @copyright Bernhard Posselt 2016
# This makefile is only intended for development
.PHONY: install
install: install:
sudo python3 setup.py install --install-scripts=/usr/bin sudo python3 setup.py install --install-scripts=/usr/bin
.PHONY: clean
clean: clean:
rm -rf dist rm -rf dist
rm -rf MANIFEST rm -rf MANIFEST
rm -rf build rm -rf build
rm -rf owncloud_news_updater.egg-info rm -rf owncloud_news_updater.egg-info
.PHONY: update
update: clean update: clean
sudo pip3 uninstall owncloud_news_updater sudo pip3 uninstall owncloud_news_updater
sudo python3 setup.py install sudo python3 setup.py install
.PHONY: uninstall
uninstall: clean uninstall: clean
sudo pip3 uninstall owncloud_news_updater sudo pip3 uninstall owncloud_news_updater
.PHONY: clean
pypi: clean pypi: clean
python3 setup.py sdist upload python3 setup.py sdist upload
.PHONY: test
test:
# keep it simple until we've got tests
pep8 owncloud_news_updater
python3 -m owncloud_news_updater --version

Просмотреть файл

@ -1,8 +1,8 @@
from os.path import dirname, realpath, join from os.path import dirname, realpath, join
def get_version(): def get_version():
directory = dirname(realpath(__file__)) directory = dirname(realpath(__file__))
version_file = join(directory, 'version.txt') version_file = join(directory, 'version.txt')
with open(version_file, 'r') as infile: with open(version_file, 'r') as infile:
return ''.join(infile.read().split()) return ''.join(infile.read().split())