Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-commit to the project #612

Merged
merged 2 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[run]
include =
include =
s3fs/*

omit =
Expand All @@ -10,4 +10,3 @@ show_missing = True

[html]
directory = coverage_html_report

7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ jobs:
run: |
flake8 s3fs
black s3fs --check --diff

pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.1.0
hooks:
- id: black
exclude: ^docs/
- repo: https://github.com/pycqa/flake8
rev: '4.0.1'
hooks:
- id: flake8
exclude: tests/|^docs/|__init__.py
2 changes: 1 addition & 1 deletion docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Version 0.4.0
- Always use multipart uploads when not autocommitting (:pr:`243`) by `Marius van Niekerk`_
- Create ``CONTRIBUTING.md`` (:pr:`248`) by `Jacob Tomlinson`_
- Use autofunction for ``S3Map`` sphinx autosummary (:pr:`251`) by `James Bourbeau`_
- Miscellaneous doc updates (:pr:`252`) by `James Bourbeau`_
- Miscellaneous doc updates (:pr:`252`) by `James Bourbeau`_
- Support for Python 3.8 (:pr:`264`) by `Tom Augspurger`_
- Improved performance for ``isdir`` (:pr:`259`) by `Nate Yoder`_
* Increased the minimum required version of fsspec to 0.6.0
Expand Down
2 changes: 1 addition & 1 deletion docs/source/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Create a development environment::

Run tests::

$ pytest
$ pytest
4 changes: 2 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ Multiprocessing

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

.. _multiprocessing: https://docs.python.org/3/library/multiprocessing.html
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ ignore =
E741 # Ambiguous variable names
W504, # line break after binary operator
E501, # line too long (leave it to black!)

60 changes: 31 additions & 29 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,39 @@
from setuptools import setup
import versioneer

with open('requirements.txt') as file:
aiobotocore_version_suffix = ''
with open("requirements.txt") as file:
aiobotocore_version_suffix = ""
for line in file:
parts = line.rstrip().split('aiobotocore')
parts = line.rstrip().split("aiobotocore")
if len(parts) == 2:
aiobotocore_version_suffix = parts[1]
break

setup(name='s3fs',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
description='Convenient Filesystem interface over S3',
url='http://github.com/fsspec/s3fs/',
maintainer='Martin Durant',
maintainer_email='[email protected]',
license='BSD',
keywords='s3, boto',
packages=['s3fs'],
python_requires='>= 3.7',
install_requires=[open('requirements.txt').read().strip().split('\n')],
extras_require={
'awscli': [f"aiobotocore[awscli]{aiobotocore_version_suffix}"],
'boto3': [f"aiobotocore[boto3]{aiobotocore_version_suffix}"],
},
zip_safe=False)
setup(
name="s3fs",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
description="Convenient Filesystem interface over S3",
url="http://github.com/fsspec/s3fs/",
maintainer="Martin Durant",
maintainer_email="[email protected]",
license="BSD",
keywords="s3, boto",
packages=["s3fs"],
python_requires=">= 3.7",
install_requires=[open("requirements.txt").read().strip().split("\n")],
extras_require={
"awscli": [f"aiobotocore[awscli]{aiobotocore_version_suffix}"],
"boto3": [f"aiobotocore[boto3]{aiobotocore_version_suffix}"],
},
zip_safe=False,
)
Loading