Skip to content

Commit a8e298c

Browse files
author
Emmanuel Rondan
committed
adding pre-commit config files
1 parent e00c152 commit a8e298c

File tree

7 files changed

+58
-66
lines changed

7 files changed

+58
-66
lines changed

.bandit.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
skips:
22
- B101 # assert_used, needed for mypy
3-
exclude_dirs: ['tests']
3+
- B311
4+
- B320
5+
- B410
6+
exclude_dirs: ['tests']

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# applying pre-commit hooks to the project
2+
e00df278aa8602b18e7c3525191b843d88334c8f

.github/workflows/main.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,6 @@ jobs:
1717
- python-version: "2.7"
1818
env:
1919
TOXENV: py
20-
- python-version: "3.4"
21-
env:
22-
TOXENV: py34
23-
# 3.5 cannot be tested in CI
24-
# https://github.com/MatteoH2O1999/setup-python/issues/49#issuecomment-2209940822
25-
- python-version: "3.6"
26-
env:
27-
TOXENV: py
28-
- python-version: "3.7"
29-
env:
30-
TOXENV: py
31-
- python-version: "3.8"
32-
env:
33-
TOXENV: py
3420
- python-version: "3.9"
3521
env:
3622
TOXENV: py
@@ -76,3 +62,8 @@ jobs:
7662
run: tox
7763
- name: Upload coverage.xml to codecov
7864
uses: codecov/codecov-action@v1
65+
pre-commit:
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v4
69+
- uses: pre-commit/[email protected]

.isort.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[settings]
2+
profile = black

.pre-commit-config.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
repos:
22
- repo: https://github.com/PyCQA/bandit
3-
rev: 1.7.10
3+
rev: 1.7.9
44
hooks:
55
- id: bandit
66
args: [-r, -c, .bandit.yml]
7+
- repo: https://github.com/psf/black.git
8+
rev: 24.8.0
9+
hooks:
10+
- id: black
11+
- repo: https://github.com/PyCQA/flake8
12+
rev: 7.1.1
13+
hooks:
14+
- id: flake8
15+
- repo: https://github.com/pycqa/isort
16+
rev: 5.13.2
17+
hooks:
18+
- id: isort

setup.py

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,36 @@
55

66

77
setup(
8-
name='scrapy-zyte-smartproxy',
9-
version='2.3.5',
10-
license='BSD',
11-
description='Scrapy middleware for Zyte Smart Proxy Manager',
8+
name="scrapy-zyte-smartproxy",
9+
version="2.3.5",
10+
license="BSD",
11+
description="Scrapy middleware for Zyte Smart Proxy Manager",
1212
long_description=readme,
1313
long_description_content_type="text/x-rst",
14-
maintainer='Raul Gallegos',
15-
maintainer_email='[email protected]',
16-
author='Zyte',
17-
author_email='[email protected]',
18-
url='https://github.com/scrapy-plugins/scrapy-zyte-smartproxy',
19-
packages=['scrapy_zyte_smartproxy'],
20-
platforms=['Any'],
14+
maintainer="Raul Gallegos",
15+
maintainer_email="[email protected]",
16+
author="Zyte",
17+
author_email="[email protected]",
18+
url="https://github.com/scrapy-plugins/scrapy-zyte-smartproxy",
19+
packages=["scrapy_zyte_smartproxy"],
20+
platforms=["Any"],
2121
classifiers=[
22-
'Development Status :: 5 - Production/Stable',
23-
'License :: OSI Approved :: BSD License',
24-
'Operating System :: OS Independent',
25-
'Programming Language :: Python',
26-
'Programming Language :: Python :: 2.7',
27-
'Programming Language :: Python :: 3.4',
28-
'Programming Language :: Python :: 3.5',
29-
'Programming Language :: Python :: 3.6',
30-
'Programming Language :: Python :: 3.7',
31-
'Programming Language :: Python :: 3.8',
32-
'Programming Language :: Python :: 3.9',
33-
'Programming Language :: Python :: 3.10',
34-
'Programming Language :: Python :: 3.11',
35-
'Programming Language :: Python :: 3.12',
36-
'Programming Language :: Python :: 3.13',
37-
'Framework :: Scrapy',
38-
'Intended Audience :: Developers',
39-
'Topic :: Internet :: WWW/HTTP',
40-
'Topic :: Internet :: Proxy Servers',
41-
'Topic :: Software Development :: Libraries :: Application Frameworks',
42-
'Topic :: Software Development :: Libraries :: Python Modules',
22+
"Development Status :: 5 - Production/Stable",
23+
"License :: OSI Approved :: BSD License",
24+
"Operating System :: OS Independent",
25+
"Programming Language :: Python",
26+
"Programming Language :: Python :: 2.7",
27+
"Programming Language :: Python :: 3.9",
28+
"Programming Language :: Python :: 3.10",
29+
"Programming Language :: Python :: 3.11",
30+
"Programming Language :: Python :: 3.12",
31+
"Programming Language :: Python :: 3.13",
32+
"Framework :: Scrapy",
33+
"Intended Audience :: Developers",
34+
"Topic :: Internet :: WWW/HTTP",
35+
"Topic :: Internet :: Proxy Servers",
36+
"Topic :: Software Development :: Libraries :: Application Frameworks",
37+
"Topic :: Software Development :: Libraries :: Python Modules",
4338
],
44-
install_requires=['scrapy>=1.4.0', 'six', 'w3lib'],
39+
install_requires=["scrapy>=1.4.0", "six", "w3lib"],
4540
)

tox.ini

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# tox.ini
22
[tox]
3-
envlist = pre-commit,mypy,min,py27,py34,py35,py36,py37,py38,py39,py310,py311,py312,py313,docs
3+
envlist = pre-commit,mypy,min,py27,py39,py310,py311,py312,py313,docs
44

55
[testenv]
66
deps =
@@ -10,11 +10,9 @@ commands =
1010
py.test --doctest-modules --cov=scrapy_zyte_smartproxy {posargs:scrapy_zyte_smartproxy tests}
1111

1212
[testenv:pre-commit]
13-
basepython = python3
14-
deps =
15-
pre-commit
16-
commands =
17-
pre-commit run {posargs:--all-files}
13+
deps = pre-commit
14+
commands = pre-commit run --all-files --show-diff-on-failure
15+
skip_install = true
1816

1917
[testenv:mypy]
2018
basepython = python3.10
@@ -37,17 +35,6 @@ deps =
3735
w3lib==1.17.0
3836
-rtests/requirements.txt
3937

40-
[testenv:py34]
41-
basepython = python3.4
42-
deps =
43-
Scrapy
44-
six
45-
# Latest Twisted that does not install an embedded version of incremental
46-
# that is incompatible with Python 3.4.
47-
Twisted==16.4.1
48-
w3lib
49-
-rtests/requirements.txt
50-
5138
[testenv:security]
5239
deps =
5340
bandit

0 commit comments

Comments
 (0)