Skip to content

Commit 49443fc

Browse files
authored
Add pre-commit to the project (#612)
* Add pre-commit to the project * Run pre-commit run --all-files
1 parent 05983ed commit 49443fc

File tree

9 files changed

+230
-147
lines changed

9 files changed

+230
-147
lines changed

.coveragerc

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[run]
2-
include =
2+
include =
33
s3fs/*
44

55
omit =
@@ -10,4 +10,3 @@ show_missing = True
1010

1111
[html]
1212
directory = coverage_html_report
13-

.github/workflows/ci.yml

+7
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,10 @@ jobs:
5151
run: |
5252
flake8 s3fs
5353
black s3fs --check --diff
54+
55+
pre-commit:
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v2
59+
- uses: actions/setup-python@v2
60+
- uses: pre-commit/[email protected]

.pre-commit-config.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v2.3.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- repo: https://github.com/psf/black
9+
rev: 22.1.0
10+
hooks:
11+
- id: black
12+
exclude: ^docs/
13+
- repo: https://github.com/pycqa/flake8
14+
rev: '4.0.1'
15+
hooks:
16+
- id: flake8
17+
exclude: tests/|^docs/|__init__.py

docs/source/changelog.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Version 0.4.0
119119
- Always use multipart uploads when not autocommitting (:pr:`243`) by `Marius van Niekerk`_
120120
- Create ``CONTRIBUTING.md`` (:pr:`248`) by `Jacob Tomlinson`_
121121
- Use autofunction for ``S3Map`` sphinx autosummary (:pr:`251`) by `James Bourbeau`_
122-
- Miscellaneous doc updates (:pr:`252`) by `James Bourbeau`_
122+
- Miscellaneous doc updates (:pr:`252`) by `James Bourbeau`_
123123
- Support for Python 3.8 (:pr:`264`) by `Tom Augspurger`_
124124
- Improved performance for ``isdir`` (:pr:`259`) by `Nate Yoder`_
125125
* Increased the minimum required version of fsspec to 0.6.0

docs/source/development.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ Create a development environment::
77

88
Run tests::
99

10-
$ pytest
10+
$ pytest

docs/source/index.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ Multiprocessing
119119

120120
When using Python's `multiprocessing`, the start method must be set to either
121121
``spawn`` or ``forkserver``. ``fork`` is not safe to use because of the open sockets
122-
and async thread used by s3fs, and may lead to
123-
hard-to-find bugs and occasional deadlocks. Read more about the available
122+
and async thread used by s3fs, and may lead to
123+
hard-to-find bugs and occasional deadlocks. Read more about the available
124124
`start methods`.
125125

126126
.. _multiprocessing: https://docs.python.org/3/library/multiprocessing.html

setup.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,3 @@ ignore =
3131
E741 # Ambiguous variable names
3232
W504, # line break after binary operator
3333
E501, # line too long (leave it to black!)
34-

setup.py

+31-29
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,39 @@
33
from setuptools import setup
44
import versioneer
55

6-
with open('requirements.txt') as file:
7-
aiobotocore_version_suffix = ''
6+
with open("requirements.txt") as file:
7+
aiobotocore_version_suffix = ""
88
for line in file:
9-
parts = line.rstrip().split('aiobotocore')
9+
parts = line.rstrip().split("aiobotocore")
1010
if len(parts) == 2:
1111
aiobotocore_version_suffix = parts[1]
1212
break
1313

14-
setup(name='s3fs',
15-
version=versioneer.get_version(),
16-
cmdclass=versioneer.get_cmdclass(),
17-
classifiers=[
18-
'Development Status :: 4 - Beta',
19-
'Intended Audience :: Developers',
20-
'License :: OSI Approved :: BSD License',
21-
'Operating System :: OS Independent',
22-
'Programming Language :: Python :: 3.7',
23-
'Programming Language :: Python :: 3.8',
24-
'Programming Language :: Python :: 3.9',
25-
],
26-
description='Convenient Filesystem interface over S3',
27-
url='http://github.com/fsspec/s3fs/',
28-
maintainer='Martin Durant',
29-
maintainer_email='[email protected]',
30-
license='BSD',
31-
keywords='s3, boto',
32-
packages=['s3fs'],
33-
python_requires='>= 3.7',
34-
install_requires=[open('requirements.txt').read().strip().split('\n')],
35-
extras_require={
36-
'awscli': [f"aiobotocore[awscli]{aiobotocore_version_suffix}"],
37-
'boto3': [f"aiobotocore[boto3]{aiobotocore_version_suffix}"],
38-
},
39-
zip_safe=False)
14+
setup(
15+
name="s3fs",
16+
version=versioneer.get_version(),
17+
cmdclass=versioneer.get_cmdclass(),
18+
classifiers=[
19+
"Development Status :: 4 - Beta",
20+
"Intended Audience :: Developers",
21+
"License :: OSI Approved :: BSD License",
22+
"Operating System :: OS Independent",
23+
"Programming Language :: Python :: 3.7",
24+
"Programming Language :: Python :: 3.8",
25+
"Programming Language :: Python :: 3.9",
26+
],
27+
description="Convenient Filesystem interface over S3",
28+
url="http://github.com/fsspec/s3fs/",
29+
maintainer="Martin Durant",
30+
maintainer_email="[email protected]",
31+
license="BSD",
32+
keywords="s3, boto",
33+
packages=["s3fs"],
34+
python_requires=">= 3.7",
35+
install_requires=[open("requirements.txt").read().strip().split("\n")],
36+
extras_require={
37+
"awscli": [f"aiobotocore[awscli]{aiobotocore_version_suffix}"],
38+
"boto3": [f"aiobotocore[boto3]{aiobotocore_version_suffix}"],
39+
},
40+
zip_safe=False,
41+
)

0 commit comments

Comments
 (0)