Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
... and make some adjustments, as this repo has no `src` top level
directory.

modified:   MANIFEST.in
modified:   setup.py
modified:   tox.ini
modified:   zc/zdaemonrecipe/__init__.py
modified:   zc/zdaemonrecipe/tests.py
  • Loading branch information
jugmac00 committed May 15, 2020
1 parent 3c53307 commit 4fd65ab
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 41 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ exclude MANIFEST.in
recursive-include docs *.bat
recursive-include docs *.py
recursive-include docs *.rst
recursive-include zc *.txt
recursive-include docs Makefile

recursive-include src *.pt
Expand Down
31 changes: 16 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,22 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
name = 'zc.zdaemonrecipe'

import os
from setuptools import setup, find_packages

name = 'zc.zdaemonrecipe'

entry_points = '''
[zc.buildout]
default=zc.zdaemonrecipe:Recipe
'''


def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()

long_description=(

long_description = (
read('README.rst')
+ '\n' +
'Detailed Documentation\n'
Expand All @@ -44,22 +46,21 @@ def read(*rnames):
]

setup(
name = name,
name=name,
version='0.3.2.dev0',
author = 'Jim Fulton',
author_email = 'jim@zope.com',
description = 'ZC Buildout recipe for zdaemon scripts',
author='Jim Fulton',
author_email='jim@zope.com',
description='ZC Buildout recipe for zdaemon scripts',
long_description=long_description,
license = 'ZPL 2.1',
license='ZPL 2.1',

entry_points=entry_points,
packages = find_packages('.'),
namespace_packages = ['zc'],
extras_require = dict(test=tests_require),
install_requires = ['setuptools',
'zc.buildout', 'zc.recipe.egg',
'ZConfig'],
test_suite='zc.zdaemonrecipe.tests.test_suite',
packages=find_packages('.'),
namespace_packages=['zc'],
extras_require=dict(test=tests_require),
install_requires=['setuptools',
'zc.buildout', 'zc.recipe.egg',
'ZConfig'],
tests_require=tests_require,
zip_safe=False,
classifiers=[
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ deps =
check-manifest
check-python-versions
commands =
flake8 src setup.py
flake8 zc setup.py
check-manifest
check-python-versions .

Expand All @@ -39,14 +39,14 @@ deps =
coverage-python-version
zope.testrunner
commands =
coverage run -m zope.testrunner --test-path=src []
coverage run -m zope.testrunner
coverage html
coverage report -m --fail-under=0

[coverage:run]
branch = True
plugins = coverage_python_version
source = src
source = zc

[coverage:report]
precision = 2
Expand Down
23 changes: 12 additions & 11 deletions zc/zdaemonrecipe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def install(self):
self.name+'-zdaemon.sock')

rc = deployment + '-' + self.name
rc=os.path.join(options['rc-directory'], rc)
rc = os.path.join(options['rc-directory'], rc)

logrotate = options['logrotate']
options.created(logrotate)
Expand Down Expand Up @@ -117,7 +117,7 @@ def install(self):
'daemon': 'on',
'transcript': event_log_path,
'socket-name': socket_path,
'directory' : run_directory,
'directory': run_directory,
}
if deployment:
defaults['user'] = options['user']
Expand Down Expand Up @@ -146,7 +146,7 @@ def install(self):
options.created(rc)
if self.shell_script:
if not os.path.exists(options['zdaemon']):
logger.warn(no_zdaemon % options['zdaemon'])
logger.warn("Path does not exist: %s" % options['zdaemon'])

contents = "%(zdaemon)s -C '%(conf)s' $*" % dict(
zdaemon=options['zdaemon'],
Expand All @@ -169,25 +169,26 @@ def install(self):
zc.buildout.easy_install.scripts(
[(rc, 'zdaemon.zdctl', 'main')],
ws, options['executable'], options['rc-directory'],
arguments = ('['
'\n %r, %r,'
'\n ]+sys.argv[1:]'
'\n '
% ('-C', zdaemon_conf_path,
)
),
arguments=('['
'\n %r, %r,'
'\n ]+sys.argv[1:]'
'\n '
% ('-C', zdaemon_conf_path,
)
),
)

return options.created()


update = install


def event_log(path, *data):
return ZConfig.schemaless.Section(
'eventlog', '', None,
[ZConfig.schemaless.Section('logfile', '', dict(path=[path]))])


event_log_template = """
<eventlog>
<logfile>
Expand Down
24 changes: 12 additions & 12 deletions zc/zdaemonrecipe/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
##############################################################################
from six import print_

import os, re, shutil, sys, tempfile
import pkg_resources
import re

import zc.buildout.testing

import doctest
import unittest
import zope.testing
from zope.testing import renormalizing

try:
Expand All @@ -29,7 +27,9 @@
not_found = (re.compile(r'Not found: [^\n]+/(\w|\.)+/\r?\n'), '')

setuptools_or_distribute = (
re.compile(r"[d-] (setuptools|distribute)([.]egg-link|-pyN.N.egg)"), "setuptools-pyN.N.egg")
re.compile(
r"[d-] (setuptools|distribute)([.]egg-link|-pyN.N.egg)"
), "setuptools-pyN.N.egg")


def newlines_in_program():
Expand Down Expand Up @@ -66,7 +66,7 @@ def newlines_in_program():
path /sample-buildout/parts/run/transcript.log
</logfile>
</eventlog>
"""
""" # noqa: F821


def setUp(test):
Expand All @@ -81,18 +81,18 @@ def setUp(test):
checker = renormalizing.RENormalizing([
zc.buildout.testing.normalize_path,
(re.compile(
"Couldn't find index page for '[a-zA-Z0-9.]+' "
"\(maybe misspelled\?\)"
"\n"
r"Couldn't find index page for '[a-zA-Z0-9.]+' "
r"\(maybe misspelled\?\)"
r"\n"
), ''),
(re.compile('#![^\n]+\n'), ''),
(re.compile('-\S+-py\d[.]\d(-\S+)?.egg'),
'-pyN.N.egg',
),
(re.compile(r'#![^\n]+\n'), ''),
(re.compile(r'-\S+-py\d[.]\d(-\S+)?.egg'),
'-pyN.N.egg',),
not_found,
setuptools_or_distribute,
])


def test_suite():
return unittest.TestSuite((
doctest.DocFileSuite(
Expand Down

0 comments on commit 4fd65ab

Please sign in to comment.