Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#60)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 24.4.0 → 24.10.0](psf/black@24.4.0...24.10.0)
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](pre-commit/pre-commit-hooks@v4.6.0...v5.0.0)
- [github.com/asottile/blacken-docs: 1.16.0 → 1.19.1](adamchainz/blacken-docs@1.16.0...1.19.1)
- [github.com/asottile/pyupgrade: v3.15.2 → v3.19.0](asottile/pyupgrade@v3.15.2...v3.19.0)
- [github.com/asottile/setup-cfg-fmt: v2.5.0 → v2.7.0](asottile/setup-cfg-fmt@v2.5.0...v2.7.0)
- [github.com/pycqa/flake8: 7.0.0 → 7.1.1](PyCQA/flake8@7.0.0...7.1.1)
- [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.13.0](pre-commit/mirrors-mypy@v1.9.0...v1.13.0)
- [github.com/codespell-project/codespell: v2.2.6 → v2.3.0](codespell-project/codespell@v2.2.6...v2.3.0)
- [github.com/mgedmin/check-manifest: 0.49 → 0.50](mgedmin/check-manifest@0.49...0.50)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove python 3.8 from CI

* Update pyproject.toml

* Don't override AbstractBufferedFile.flush implementation

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Nicholas Smith <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and nsmith- authored Dec 19, 2024
1 parent 1dad761 commit d33c203
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: [ubuntu-latest]
defaults:
run:
Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/psf/black
rev: 24.4.0
rev: 24.10.0
hooks:
- id: black-jupyter

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand Down Expand Up @@ -37,7 +37,7 @@ repos:
args: [--prose-wrap=always]

- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
rev: 1.19.1
hooks:
- id: blacken-docs
additional_dependencies: [black==22.3.0]
Expand All @@ -49,13 +49,13 @@ repos:
args: ["-a", "from __future__ import annotations"] # Python 3.7+

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.19.0
hooks:
- id: pyupgrade
args: ["--py37-plus"]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.5.0
rev: v2.7.0
hooks:
- id: setup-cfg-fmt

Expand All @@ -77,21 +77,21 @@ repos:
- flake8-print

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
exclude: docs/conf.py
additional_dependencies: *flake8_dependencies

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.13.0
hooks:
- id: mypy
files: src
args: []

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell

Expand All @@ -109,7 +109,7 @@ repos:
exclude: .pre-commit-config.yaml

- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
rev: "0.50"
hooks:
- id: check-manifest
stages: [manual]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ testpaths = [

[tool.mypy]
files = "src"
python_version = "3.7"
python_version = "3.9"
warn_unused_configs = true
strict = true
show_error_codes = true
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ project_urls =
packages = find:
install_requires =
fsspec
python_requires = >=3.8
python_requires = >=3.9
include_package_data = True
package_dir =
=src
Expand Down
20 changes: 0 additions & 20 deletions src/fsspec_xrootd/xrootd.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,26 +911,6 @@ def _fetch_range(self, start: int, end: int) -> Any:
raise OSError(f"File did not read properly: {status.message}")
return data

def flush(self, force: bool = False) -> None:
if self.closed:
raise ValueError("Flush on closed file")
if force and self.forced:
raise ValueError("Force flush cannot be called more than once")
if force:
self.forced = True

if self.mode not in {"wb", "ab"}:
# no-op to flush on read-mode
return

if not force and self.buffer.tell() < self.blocksize:
# Defer write on small block
return

if self._upload_chunk(final=force) is not False:
self.offset += self.buffer.seek(0, 2)
self.buffer = io.BytesIO()

def _upload_chunk(self, final: bool = False) -> Any:
status, _n = self._myFile.write(
self.buffer.getvalue(),
Expand Down

0 comments on commit d33c203

Please sign in to comment.