Skip to content

Commit

Permalink
Merge 8796073 into cc8669a
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Oct 23, 2017
2 parents cc8669a + 8796073 commit ad62d21
Show file tree
Hide file tree
Showing 16 changed files with 745 additions and 432 deletions.
3 changes: 2 additions & 1 deletion .pydocstyle → .pydocstyle.ini
Expand Up @@ -9,5 +9,6 @@ add_select = D211
# D103: Missing docstring in public function
# D104: Missing docstring in public package
# D105: Missing docstring in magic method
# D107: Missing docstring in __init__
# D202: No blank lines allowed after function docstring
add_ignore = D100,D101,D102,D103,D104,D105,D202
add_ignore = D100,D101,D102,D103,D104,D105,D107,D202
369 changes: 192 additions & 177 deletions .pylint.ini

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions .travis.yml
Expand Up @@ -10,10 +10,9 @@ cache:
env:
global:
- RANDOM_SEED=0
- PIPENV_NOSPIN=true

before_install:
- make setup
- pip install pipenv==8.2.7
- make doctor

install:
Expand Down
15 changes: 5 additions & 10 deletions .verchew.ini
@@ -1,34 +1,29 @@
[Make]

cli = make

version = GNU Make


[Python]

cli = python

version = Python 3.6.


[pipenv]

cli = pipenv

version = 3.

version = 8.2.7

[pandoc]

cli = pandoc

version = 1.

option = true
message = This is only needed to generate the README for PyPI

[Graphviz]

cli = dot
cli_version_arg = -V

version = 2.
optional = true
message = This is only needed to generate UML diagrams for documentation
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Revision History

## 1.5 (2017/10/22)

- Ignored conflicting program name ("slack helper.app").

## 1.4 (2017/04/18)

- Added color to display the state of running applications.
Expand Down
84 changes: 14 additions & 70 deletions Makefile
Expand Up @@ -8,49 +8,11 @@ PACKAGES := $(PACKAGE) tests
CONFIG := $(wildcard *.py)
MODULES := $(wildcard $(PACKAGE)/*.py)

# Python settings
ifndef TRAVIS
PYTHON_MAJOR ?= 3
PYTHON_MINOR ?= 6
endif

# System paths
PLATFORM := $(shell python -c 'import sys; print(sys.platform)')
ifneq ($(findstring win32, $(PLATFORM)), )
WINDOWS := true
SYS_PYTHON_DIR := C:\\Python$(PYTHON_MAJOR)$(PYTHON_MINOR)
SYS_PYTHON := $(SYS_PYTHON_DIR)\\python.exe
# https://bugs.launchpad.net/virtualenv/+bug/449537
export TCL_LIBRARY=$(SYS_PYTHON_DIR)\\tcl\\tcl8.5
else
ifneq ($(findstring darwin, $(PLATFORM)), )
MAC := true
else
LINUX := true
endif
SYS_PYTHON := python$(PYTHON_MAJOR)
ifdef PYTHON_MINOR
SYS_PYTHON := $(SYS_PYTHON).$(PYTHON_MINOR)
endif
endif

# Virtual environment paths
export PIPENV_SHELL_COMPAT=true
export PIPENV_VENV_IN_PROJECT=true
export PIPENV_IGNORE_VIRTUALENVS=true
ENV := .venv
ifneq ($(findstring win32, $(PLATFORM)), )
BIN := $(ENV)/Scripts
ACTIVATE := $(BIN)/activate.bat
OPEN := cmd /c start
else
BIN := $(ENV)/bin
ACTIVATE := . $(BIN)/activate
ifneq ($(findstring cygwin, $(PLATFORM)), )
OPEN := cygstart
else
OPEN := open
endif
endif
PYTHON := $(BIN)/python
PIP := $(BIN)/pip

# MAIN TASKS ###################################################################

Expand All @@ -68,48 +30,30 @@ watch: install .clean-test ## Continuously run all CI tasks when files chanage

.PHONY: run ## Start the program
run: install
$(PYTHON) $(PACKAGE)/__main__.py
pipenv run python $(PACKAGE)/__main__.py

# SYSTEM DEPENDENCIES ##########################################################

.PHONY: setup
setup:
pip install pipenv==3.5.6
touch Pipfile

.PHONY: doctor
doctor: ## Confirm system dependencies are available
bin/verchew

# PROJECT DEPENDENCIES #########################################################

export PIPENV_SHELL_COMPAT=true
export PIPENV_VENV_IN_PROJECT=true

DEPENDENCIES := $(ENV)/.installed
METADATA := *.egg-info

.PHONY: install
install: $(DEPENDENCIES) $(METADATA)

$(DEPENDENCIES): $(PIP) Pipfile*
pipenv install --dev --ignore-hashes
ifdef WINDOWS
@ echo "Manually install pywin32: https://sourceforge.net/projects/pywin32/files/pywin32"
else ifdef MAC
$(PIP) install pync MacFSEvents
else ifdef LINUX
$(PIP) install pyinotify
endif
$(DEPENDENCIES): Pipfile*
pipenv install --dev
@ touch $@

$(METADATA): $(PIP) setup.py
$(PYTHON) setup.py develop
$(METADATA): setup.py
pipenv run python setup.py develop
@ touch $@

$(PIP):
pipenv --python=$(SYS_PYTHON)

# CHECKS #######################################################################

PYLINT := pipenv run pylint
Expand Down Expand Up @@ -177,7 +121,7 @@ test-all: install

.PHONY: read-coverage
read-coverage:
$(OPEN) htmlcov/index.html
bin/open htmlcov/index.html

# DOCUMENTATION ################################################################

Expand Down Expand Up @@ -207,7 +151,7 @@ $(MKDOCS_INDEX): mkdocs.yml docs/*.md

.PHONY: mkdocs-live
mkdocs-live: mkdocs
eval "sleep 3; open http://127.0.0.1:8000" &
eval "sleep 3; bin/open http://127.0.0.1:8000" &
$(MKDOCS) serve

# BUILD ########################################################################
Expand All @@ -222,9 +166,9 @@ EXE_FILES := dist/$(PROJECT).*
dist: install $(DIST_FILES)
$(DIST_FILES): $(MODULES) README.rst CHANGELOG.rst
rm -f $(DIST_FILES)
$(PYTHON) setup.py check --restructuredtext --strict --metadata
$(PYTHON) setup.py sdist
$(PYTHON) setup.py bdist_wheel
pipenv run python setup.py check --restructuredtext --strict --metadata
pipenv run python setup.py sdist
pipenv run python setup.py bdist_wheel

%.rst: %.md
pandoc -f markdown_github -t rst -o $@ $<
Expand Down Expand Up @@ -252,7 +196,7 @@ register: dist ## Register the project on PyPI
.PHONY: upload
upload: .git-no-changes register ## Upload the current version to PyPI
$(TWINE) upload dist/*.*
$(OPEN) https://pypi.python.org/pypi/$(PROJECT)
bin/open https://pypi.python.org/pypi/$(PROJECT)

.PHONY: .git-no-changes
.git-no-changes:
Expand Down
31 changes: 24 additions & 7 deletions Pipfile
@@ -1,25 +1,42 @@
[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true

[packages]
testpackage = "*"
[requires]

python_version = "3.6"

[dev-packages]
pylint = "~=1.7.0"
pycodestyle = "*"
pydocstyle = "*"

# Linters
pylint = "~=1.7"
pycodestyle = "~=2.3"
pydocstyle = "~=2.0"

# Testing
pytest = "~=3.0.7"
pytest-describe = "==0.11.0"
pytest-expecter = "==0.2.2.post6"
pytest-cov = "*"
pytest-random = "*"
pytest-catchlog = "*"

# Coverage
coverage = "~=4.0"
"coverage.space" = "~=0.8"

# Documentation
mkdocs = "*"
docutils = "*"
pygments = "*"

# Build
wheel = "*"
pyinstaller = "*"

# Release
twine = "*"

# Tooling
sniffer = "*"
Pygments = "*"
PyInstaller = "*"

0 comments on commit ad62d21

Please sign in to comment.