Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Commit 718732c

Browse files
committed
add black style checks
1 parent 3300895 commit 718732c

File tree

3 files changed

+47
-30
lines changed

3 files changed

+47
-30
lines changed

.github/workflows/style.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ jobs:
2727
- name: Test mypy typing with tox
2828
run: tox -e mypy
2929
- name: bandit static check
30-
run: tox -e bandit
30+
run: tox -e bandit
31+
- name: black style check
32+
run : tox -e black

setup.py

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,53 @@
55
setuptools.setup(
66
name=__name__,
77
version=__version__,
8-
description='Swift upload / download runner for swift-browser-ui',
8+
description="Swift upload / download runner for swift-browser-ui",
99
author=__author__,
1010
author_email="[email protected]",
1111
project_urls={
12-
'Source': 'https://github.com/CSCfi/swift-upload-runner',
12+
"Source": "https://github.com/CSCfi/swift-upload-runner",
1313
},
14-
license='MIT',
14+
license="MIT",
1515
install_requires=[
16-
'aiohttp',
17-
'python-swiftclient',
18-
'keystoneauth1',
19-
'gunicorn',
20-
'certifi',
21-
'uvloop',
22-
"swift-browser-ui"
23-
"@ git+https://github.com/cscfi/swift-browser-ui.git"
16+
"aiohttp",
17+
"python-swiftclient",
18+
"keystoneauth1",
19+
"gunicorn",
20+
"certifi",
21+
"uvloop",
22+
"swift-browser-ui" "@ git+https://github.com/cscfi/swift-browser-ui.git",
2423
],
2524
extras_require={
26-
'test': ['tox', 'pytest', 'pytest-cov', 'coverage',
27-
'tox', 'flake8', 'flake8-docstrings', 'pytest-aiohttp',
28-
'asynctest'],
25+
"test": [
26+
"tox",
27+
"pytest",
28+
"pytest-cov",
29+
"coverage",
30+
"tox",
31+
"flake8",
32+
"flake8-docstrings",
33+
"pytest-aiohttp",
34+
"asynctest",
35+
"black",
36+
],
2937
},
3038
packages=[__name__],
3139
include_package_data=True,
32-
platforms='any',
40+
platforms="any",
3341
entry_points={
34-
'console_scripts': [
35-
'swift-upload-runner=swift_upload_runner.server:main',
42+
"console_scripts": [
43+
"swift-upload-runner=swift_upload_runner.server:main",
3644
]
3745
},
3846
classifiers=[
39-
'Development Status :: 4 - Beta',
40-
47+
"Development Status :: 4 - Beta",
4148
# Indicate who your project is intended for
42-
'Intended Audience :: Developers',
43-
'Intended Audience :: Information Technology',
44-
'Topic :: Internet :: WWW/HTTP :: HTTP Servers',
45-
49+
"Intended Audience :: Developers",
50+
"Intended Audience :: Information Technology",
51+
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
4652
# Pick your license as you wish
47-
'License :: OSI Approved :: MIT License',
48-
49-
'Programming Language :: Python :: 3.7',
50-
'Programming Language :: Python :: 3.8',
53+
"License :: OSI Approved :: MIT License",
54+
"Programming Language :: Python :: 3.7",
55+
"Programming Language :: Python :: 3.8",
5156
],
5257
)

tox.ini

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ deps = bandit
88
commands = bandit -r ./swift_upload_runner
99

1010
[flake8]
11-
ignore = W503,D203,D212,D100,D104,ANN101
11+
max-line-length = 80
12+
select = C,E,F,W,B,B950
13+
ignore = E203,E501,W503,ANN101
1214
exclude = .git/, ./venv/, ./.tox/, build/, swift_upload_runner.egg-info/
1315
# Not using type hints in tests, ignore all errors
1416
per-file-ignores =
@@ -27,6 +29,8 @@ skip_install = true
2729
deps =
2830
-rrequirements.txt
2931
mypy
32+
types-requests
33+
types-certifi
3034
# Mypy fails if 3rd party library doesn't have type hints configured.
3135
# Alternative to ignoring imports would be to write custom stub files, which
3236
# could be done at some point.
@@ -40,11 +44,17 @@ commands = py.test -x --cov=swift_upload_runner tests
4044
; add later
4145
; --cov-fail-under=75
4246

47+
[testenv:black]
48+
skip_install = true
49+
deps =
50+
black
51+
commands = black swift_upload_runner setup.py -l 90 --check
52+
4353
[testenv]
4454
deps =
4555
-rrequirements.txt
4656

4757
[gh-actions]
4858
python =
4959
3.8: pytest, mypy
50-
3.7: flake8, pytest, bandit, mypy
60+
3.7: flake8, pytest, bandit, mypy, black

0 commit comments

Comments
 (0)