Skip to content

Commit

Permalink
Fixes #61
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneBachmann committed Dec 21, 2017
1 parent 203144b commit b0b136a
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 112 deletions.
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ matrix:
# python: pypy3 (only P3.3 available)

# We don't use mypy here, and cPyparsing fails e.g. in pypy
install: "pip install appdirs chardet configr coconut coverage python-coveralls"
# we could test using coconut-run instead, but this approach seems cleaner
script: python setup.py clean build test && coverage run --branch --debug=sys --source=sos sos/tests.py && coverage html && coverage annotate sos/tests.py
install: "pip install appdirs chardet configr coconut coverage python-coveralls collective.checkdocs"
script: python setup.py clean build checkdocs test && coverage run --branch --debug=sys --source=sos sos/tests.py && coverage html && coverage annotate sos/tests.py
after_success:
- coveralls
# TODO add mypy step for better checks?
# TODO add mypy step for better checks
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
[![Travis badge](https://travis-ci.org/ArneBachmann/sos.svg?branch=master)](https://travis-ci.org/ArneBachmann/sos)
[![Build status](https://ci.appveyor.com/api/projects/status/fe915rtx02buqe4r?svg=true)](https://ci.appveyor.com/project/ArneBachmann/sos)
[![PyPI badge](https://img.shields.io/pypi/v/sos-vcs.svg)](https://badge.fury.io/py/sos-vcs)
[![Conda badge](https://img.shields.io/conda/pn/conda-forge/python.svg)]()
[![Code coverage badge](https://coveralls.io/repos/github/ArneBachmann/sos/badge.svg?branch=master)](https://coveralls.io/github/ArneBachmann/sos?branch=master)

License: [MPL-2.0](https://www.mozilla.org/en-US/MPL/2.0/)
- License: [MPL-2.0](https://www.mozilla.org/en-US/MPL/2.0/)
- If you enjoy using SOS, [buy the developer a coffee](http://PayPal.Me/ArneBachmann/) for motivation!

### List of Abbreviations ###
- **MPL**: *Mozilla Public License*
Expand Down
14 changes: 7 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# https://ci.appveyor.com/tools/validate-yaml
# http://www.yamllint.com/
build_script:
- cmd: "python setup.py clean build test && coverage run --branch --debug=sys --source=sos sos/tests.py && coverage html && coverage annotate sos/tests.py"
clone_script:
build_script:
- cmd: "python setup.py clean build checkdocs test && coverage run --branch --debug=sys --source=sos sos/tests.py && coverage html && coverage annotate sos/tests.py"
clone_script:
- cmd: "git clone https://github.com/ArneBachmann/sos .\\"
deploy: false
environment:
environment:
PYTHONDONTWRITEBYTECODE: true
matrix:
# - PYTHON_VERSION: 2.7
Expand All @@ -23,13 +23,13 @@ environment:
platform: x86
- PYTHON_VERSION: 3.6
platform: x64
init:
init:
- "set PY_VER=%PYTHON_VERSION:.=%"
- "set PYTHON=C:\\PYTHON%PY_VER%"
- "if %PLATFORM%==x64 (set PYTHON=%PYTHON%-x64)"
- "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
install:
install:
- cmd: "python --version"
- cmd: "pip install --upgrade appdirs chardet configr coconut coverage python-coveralls"
- cmd: "pip install --upgrade appdirs chardet configr coconut coverage python-coveralls collective.checkdocs"
skip_branch_with_pr: true
version: "{build}.{branch}"
19 changes: 8 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
readmeFile = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'README.md')
if 'build' in sys.argv:
print("Transpiling Coconut for packaging...")
if not os.path.exists("build"):
try: os.mkdir("build")
except: print("Cannot create build folder")
cmd = "-develop" if 0 == subprocess.Popen("coconut-develop --help", shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE, bufsize = 10000000).wait() and os.getenv("NODEV", "false").strip().lower() != "true" else ""

assert 0 == os.system("coconut%s -p -l -t 3 sos%sutility.coco" % (cmd, os.sep))
Expand Down Expand Up @@ -40,11 +37,10 @@

import sos.sos as sos

if 'test' in sys.argv : print("Warning: Won't build distribution after running unit tests")

if 'sdist' in sys.argv:
print("Cleaning up old archives for twine upload")
if not os.path.exists("dist"):
try: os.mkdir("dist")
except: print("Cannot create dist folder")
if os.path.exists("dist"):
rmFiles = list(sorted(os.listdir("dist")))
try:
Expand All @@ -54,18 +50,19 @@
except: print("Cannot remove old distribution file " + file)
except: pass

if 'build' not in sys.argv:
import sos.version # was already generated during build phase
with open(readmeFile, "r") as fd: README = fd.read()

#if 'test' in sys.argv and '-v' in sys.argv: os.environ["DEBUG"] = "true"
if 'cover' in sys.argv:
sys.argv.remove('cover')
if 'test' in sys.argv: sys.argv.remove('test')
if 0 != os.system("coverage run --branch --debug=sys --source=sos sos/tests.py && coverage html && coverage annotate sos/tests.py"):
print("Cannot create coverage report when tests fail")

if 'checkdocs' in sys.argv:
try: import collective.checkdocs
except: raise Exception("Setup requires the pip package 'collective.checkdocs'")

import sos.version

with open(readmeFile.split(".")[0] + ".rst", "r") as fd: README = fd.read()
print("\nRunning setup() for SOS version " + sos.version.__version__)
setup(
name = 'sos-vcs',
Expand Down
Loading

0 comments on commit b0b136a

Please sign in to comment.