Skip to content

Commit

Permalink
Improving code style and adding pre-commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfem committed Nov 6, 2020
1 parent d174edf commit 62b4cf4
Show file tree
Hide file tree
Showing 21 changed files with 2,332 additions and 1,371 deletions.
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
# E501: let black handle line length
# W503 is incompatible with PEP 8
# E203 whitespace before ':'
# E231 missing whitespace after ','
ignore = E501,W503,E203,E231
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include:
- remote: 'https://gitlab.esss.lu.se/ics-infrastructure/gitlab-ci-yml/raw/master/PreCommit.gitlab-ci.yml'
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/ambv/black
rev: 20.8b1
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
40 changes: 20 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,33 @@
# Solution comming from:
# https://stackoverflow.com/questions/14399534/reference-requirements-txt-for-the-install-requires-kwarg-in-setuptools-setup-py
# TODO: Find a better way to handle this (can stop working at any moment)
install_reqs = parse_requirements('requirements.txt', session='hack')
install_reqs = parse_requirements("requirements.txt", session="hack")
try: # for pip >= 10
reqs = [str(ir.requirement) for ir in install_reqs]
except AttributeError: # for pip <= 9.0.3
reqs = [str(ir.req) for ir in install_reqs]


def readme():
with open('README.md') as f:
with open("README.md") as f:
return f.read()


setup(name='wetest',
version='2.0.0',
description='WeTest allows you to test EPICS modules',
long_description=readme(),
classifiers=[
'Development Status :: 3 - Alpha',
'Programming Language :: Python :: 2.7',
],
keywords='epics testing',
packages=find_packages(),
package_data={
'wetest': ['resources/*', 'resources/icons/*', 'resources/logo/*']
},
install_requires=reqs,
entry_points={
'console_scripts': ['wetest=wetest.command_line:main'],
},
zip_safe=False)
setup(
name="wetest",
version="2.0.0",
description="WeTest allows you to test EPICS modules",
long_description=readme(),
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 2.7",
],
keywords="epics testing",
packages=find_packages(),
package_data={"wetest": ["resources/*", "resources/icons/*", "resources/logo/*"]},
install_requires=reqs,
entry_points={
"console_scripts": ["wetest=wetest.command_line:main"],
},
zip_safe=False,
)
Loading

0 comments on commit 62b4cf4

Please sign in to comment.