Switch to django-version-dependant install scheme.

Also update travis to use it.
This commit is contained in:
Raphaël Barrois 2015-07-02 16:20:25 +02:00
parent 2174bdcae6
commit ee65fd925d
10 changed files with 67 additions and 18 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@
# Build-related files
docs/_build/
auto_dev_requirements*.txt
.coverage
*.egg-info
*.egg

View File

@ -1,13 +1,19 @@
language: python
env:
- DJANGO_VERSION=1.4
- DJANGO_VERSION=1.6
- DJANGO_VERSION=1.8
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"
- "3.4"
script: "python setup.py test"
install: "if [[ $TRAVIS_PYTHON_VERSION = 2.6 ]]; then pip install unittest2 --use-mirrors; fi"
script:
- python setup.py test
install:
- make install-deps
notifications:
email: false
irc: "irc.freenode.org#xelnext"

View File

@ -1,28 +1,53 @@
PACKAGE=semantic_version
TESTS_DIR=tests
DOC_DIR=docs
# Use current python binary instead of system default.
COVERAGE = python $(shell which coverage)
# Dependencies
DJANGO_VERSION ?= 1.8
PYTHON_VERSION := $(shell python --version)
NEXT_DJANGO_VERSION=$(shell python -c "v='$(DJANGO_VERSION)'; parts=v.split('.'); parts[-1]=str(int(parts[-1])+1); print('.'.join(parts))")
all: default
PACKAGE_DIR = src/semantic_version
default:
install-deps: auto_dev_requirements_django$(DJANGO_VERSION).txt
pip install --upgrade pip setuptools
pip install --upgrade -r $<
pip freeze
auto_dev_requirements_%.txt: dev_requirements_%.txt dev_requirements.txt requirements.txt
grep --no-filename "^[^-]" $^ | grep -v "^Django" > $@
echo "Django>=$(DJANGO_VERSION),<$(NEXT_DJANGO_VERSION)" >> $@
clean:
find . -type f -name '*.pyc' -delete
find . -type f -path '*/__pycache__/*' -delete
find . -type d -empty -delete
@rm -f auto_dev_requirements_*
@rm -rf tmp_test/
test:
test: install-deps
python -W default setup.py test
coverage:
coverage erase
coverage run "--include=$(PACKAGE_DIR)/*.py,tests/*.py" --branch setup.py test
coverage report "--include=$(PACKAGE_DIR)/*.py,tests/*.py"
coverage html "--include=$(PACKAGE_DIR)/*.py,tests/*.py"
pylint:
pylint --rcfile=.pylintrc --report=no $(PACKAGE)/
coverage: install-deps
$(COVERAGE) erase
$(COVERAGE) run "--include=$(PACKAGE)/*.py,$(TESTS_DIR)/*.py" --branch setup.py test
$(COVERAGE) report "--include=$(PACKAGE)/*.py,$(TESTS_DIR)/*.py"
$(COVERAGE) html "--include=$(PACKAGE)/*.py,$(TESTS_DIR)/*.py"
doc:
$(MAKE) -C docs html
$(MAKE) -C $(DOC_DIR) html
.PHONY: all default clean coverage doc test
.PHONY: all default clean coverage doc install-deps pylint test

1
dev_requirements.txt Normal file
View File

@ -0,0 +1 @@
Django

View File

@ -0,0 +1,3 @@
-r dev_requirements.txt
South

View File

@ -0,0 +1,3 @@
-r dev_requirements.txt
South

View File

@ -0,0 +1,3 @@
-r dev_requirements.txt
South

View File

@ -0,0 +1,3 @@
-r dev_requirements.txt
South>=1.0

View File

@ -0,0 +1,3 @@
-r dev_requirements.txt
# South isn't compatible with django1.8

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
# No hard external requirements.