diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..2f0a5f24 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +language: python +python: + - "3.6" # current default Python on Travis CI + - "3.7" + - "3.8" + - "3.8-dev" # 3.8 development branch + - "nightly" # nightly build +# command to install dependencies +install: + - make init +# command to run tests +script: + - make CI diff --git a/Makefile b/Makefile index 3934bf63..c4be40b5 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,26 @@ .PHONY: black build clean publish reinstall +PACKAGE_NAME=solo + # setup development environment init: update-venv # ensure this passes before commiting check: lint - black --check solo/ - isort --check-only --recursive solo/ + venv/bin/black --check $(PACKAGE_NAME)/ + venv/bin/isort --check-only --recursive $(PACKAGE_NAME)/ # automatic code fixes fix: black isort black: - black solo/ + venv/bin/black $(PACKAGE_NAME)/ isort: - isort -y --recursive solo/ + venv/bin/isort -y --recursive $(PACKAGE_NAME)/ lint: - flake8 solo/ + venv/bin/flake8 $(PACKAGE_NAME)/ semi-clean: rm -rf **/__pycache__ @@ -30,7 +32,7 @@ clean: semi-clean # Package management -VERSION_FILE := "solo/VERSION" +VERSION_FILE := "$(PACKAGE_NAME)/VERSION" VERSION := $(shell cat $(VERSION_FILE)) tag: git tag -a $(VERSION) -m"v$(VERSION)" @@ -44,11 +46,16 @@ publish: check venv: python3 -m venv venv - venv/bin/pip install -U pip + venv/bin/python3 -m pip install -U pip # re-run if dev or runtime dependencies change, # or when adding new scripts update-venv: venv - venv/bin/pip install -U pip - venv/bin/pip install -U -r dev-requirements.txt + venv/bin/python3 -m pip install -U pip + venv/bin/python3 -m pip install -U -r dev-requirements.txt venv/bin/flit install --symlink + +.PHONY: CI +CI: + env FLIT_ROOT_INSTALL=1 $(MAKE) init + env FLIT_ROOT_INSTALL=1 $(MAKE) build diff --git a/dev-requirements.txt b/dev-requirements.txt index 874f9ff7..0a33f6c4 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -5,4 +5,4 @@ black flake8 flit ipython - +isort