Skip to content

Commit

Permalink
Merge pull request #43 from moshez/debitrot
Browse files Browse the repository at this point in the history
Debitrot
  • Loading branch information
moshez committed Sep 3, 2017
2 parents 8b525b5 + 5ea7ac5 commit f6de57e
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@ dropin.cache
build/
dist/
ncolony.egg-info/
/.eggs
24 changes: 16 additions & 8 deletions .travis.yml
@@ -1,13 +1,21 @@
language: python
python: 2.7
env:
- TOX_ENV=py27-unit
- TOX_ENV=py27-lint
- TOX_ENV=py27-func
- TOX_ENV=pypy-unit
- TOX_ENV=pypy-func
- TOX_ENV=py27-wheel
- TOX_ENV=docs
matrix:
include:
- python: 2.7
env: TOX_ENV=py27-unit
- python: 2.7
env: TOX_ENV=py27-lint
- python: 2.7
env: TOX_ENV=py27-func
- python: pypy2.7-5.8.0
env: TOX_ENV=pypy-unit
- python: pypy2.7-5.8.0
env: TOX_ENV=pypy-func
- python: 2.7
env: TOX_ENV=py27-wheel
- python: 2.7
env: TOX_ENV=docs
install:
- pip install tox
script:
Expand Down
14 changes: 2 additions & 12 deletions admin/pylintrc
@@ -1,18 +1,8 @@
[MESSAGES CONTROL]
disable=E1608,I0012,W1627,E1601,E1603,E1602,E1605,E1604,E1607,E1606,W1621,W1620,W1623,W1622,W1625,W1624,W1609,W1626,W1607,W1606,W1605,W1604,W1603,W1602,W1601,F0401,I0021,W0632,I0020,C0103,W0142,W1618,W1619,W1630,W1631,W1610,W1611,W1612,W1613,W1614,W1615,W1616,W1617,W1632,W1633,W0704,I0011,W1628,W1629,W1608
disable=invalid-name,unbalanced-tuple-unpacking,unused-argument,ungrouped-imports,singleton-comparison,inherit-non-class,relative-import

[REPORTS]
reports=no

[BASIC]
function-rgx=[a-z_][a-z0-9_]{2,30}$
variable-rgx=[a-z_][a-z0-9_]{2,30}$
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
attr-rgx=[a-z_][a-z0-9_]{2,30}$
argument-rgx=[a-z_][a-z0-9_]{2,30}$
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
class-rgx=[A-Z_][a-zA-Z0-9]+$
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
method-rgx=[a-z_][a-z0-9_]{2,30}$
no-docstring-rgx=^_
dummy-arguments-rgx=^dummy
22 changes: 16 additions & 6 deletions ncolony/tests/functional_test.py
Expand Up @@ -3,6 +3,7 @@

"""Functional/integration test for ncolony"""

import errno
import os
import shutil
import subprocess
Expand All @@ -18,6 +19,20 @@ def _getHere():
here = os.path.join(here, 'build')
return here

def _killPatiently(pidFile):
while os.path.exists(pidFile):
print 'Old process remains -- shutting it down'
fp = file(pidFile)
pid = int(fp.read())
try:
os.kill(pid, 15)
except OSError as e:
if e.errno == errno.ESRCH:
break
else:
raise
time.sleep(5)

def main(argv):
"""Run ncolony with a simple process"""
argv = argv
Expand All @@ -32,12 +47,7 @@ def main(argv):
PID_FILE = os.path.join(FUNC_TEMP, 'twistd.pid')
LOG_FILE = os.path.join(FUNC_TEMP, 'twistd.log')
if os.path.exists(FUNC_TEMP):
while os.path.exists(PID_FILE):
print 'Old process remains -- shutting it down'
fp = file(PID_FILE)
pid = int(fp.read())
os.kill(pid, 15)
time.sleep(5)
_killPatiently(PID_FILE)
shutil.rmtree(FUNC_TEMP)
CONFIGS = os.path.join(FUNC_TEMP, 'configs')
MESSAGES = os.path.join(FUNC_TEMP, 'messages')
Expand Down
2 changes: 1 addition & 1 deletion ncolony/tests/nitpicker.py
Expand Up @@ -29,7 +29,7 @@ def main(argv):

## Check .pyc files
for dirpath, dirnames, filenames in os.walk(here, topdown=True):
if 'build' in dirpath or '__pycache__' in dirpath:
if 'build' in dirpath or '__pycache__' in dirpath or '.eggs' in dirpath:
dirnames[:] = []
continue
for filename in filenames:
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Expand Up @@ -11,7 +11,7 @@ deps =
{py27,pypy}-{func,unit}: Twisted
commands =
{py27,pypy}-unit: coverage run {envbindir}/trial --temp-directory build/_trial_temp {posargs:ncolony}
{py27,pypy}-unit: coverage report --include ncolony* --omit ncolony/tests/*,ncolony/interfaces*,ncolony/_version* --show-missing --fail-under=100
{py27,pypy}-unit: coverage report --include */site-packages/ncolony* --omit */tests/*,*/interfaces*,*/_version* --show-missing --fail-under=100
py27-lint: pylint --rcfile admin/pylintrc ncolony
py27-lint: python -m ncolony tests.nitpicker
{py27,pypy}-func: python -m ncolony tests.functional_test
Expand All @@ -28,7 +28,7 @@ commands =
python setup.py bdist_wheel --dist-dir {envtmpdir}/dist
sh -c "pip install --no-index {envtmpdir}/dist/*.whl"
coverage run {envbindir}/trial --temp-directory build/_trial_temp {posargs:ncolony}
coverage report --include ncolony* --omit ncolony/tests/*,ncolony/interfaces*,ncolony/_version* --show-missing --fail-under=100
coverage report --include */site-packages/ncolony* --omit */tests/*,*/interfaces*,*/_version* --show-missing --fail-under=100

[testenv:docs]
changedir = docs
Expand Down

0 comments on commit f6de57e

Please sign in to comment.