Skip to content

Commit

Permalink
Merge branch 'CI-init'
Browse files Browse the repository at this point in the history
Add Travis CI configuration for Python 3.6+

Fixes #7
  • Loading branch information
szszszsz committed Jun 15, 2020
2 parents 1c2748a + 1fa4e79 commit d3d4a77
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
25 changes: 16 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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__
Expand All @@ -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)"
Expand All @@ -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
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ black
flake8
flit
ipython

isort

0 comments on commit d3d4a77

Please sign in to comment.