Skip to content

Commit cd04648

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent ef1a564 commit cd04648

15 files changed

+32
-33
lines changed

.github/workflows/pypi-publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ jobs:
4848
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
4949
with:
5050
user: __token__
51-
password: ${{ secrets.PYPI_PASSWORD }}
51+
password: ${{ secrets.PYPI_PASSWORD }}

.github/workflows/pypi-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
# # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3333
- name: Test with tox
3434
run: |
35-
tox
35+
tox

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ repos:
4949
# - repo: https://github.com/codespell-project/codespell
5050
# rev: v2.2.5
5151
# hooks:
52-
# - id: codespell
52+
# - id: codespell

AUTHORS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Contributors
22

33
* Jayaram Kancherla <[email protected]>
4-
* Max Hargreaves <[email protected]>
4+
* Max Hargreaves <[email protected]>

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
## Version 0.1 (development)
44

5-
- Initial release
5+
- Initial release

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Package is published to [PyPI](https://pypi.org/project/pyBiocFileCache/)
1616
pip install pybiocfilecache
1717
```
1818

19-
#### Initialize a cache directory
19+
#### Initialize a cache directory
2020

2121
```
2222
from pybiocfilecache import BiocFileCache

docs/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
furo
12
# Requirements file for ReadTheDocs, check .readthedocs.yml.
23
# To build the module reference correctly, make sure every external package
34
# under `install_requires` in `setup.cfg` is also listed here!
45
# sphinx_rtd_theme
56
recommonmark
67
sphinx>=3.2.1
7-
furo

setup.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
"""
2-
Setup file for pyBiocFileCache.
3-
Use setup.cfg to configure your project.
1+
"""Setup file for pyBiocFileCache. Use setup.cfg to configure your project.
42
5-
This file was generated with PyScaffold 4.1.
6-
PyScaffold helps you to put up the scaffold of your new Python project.
7-
Learn more under: https://pyscaffold.org/
3+
This file was generated with PyScaffold 4.1.
4+
PyScaffold helps you to put up the scaffold of your new Python project.
5+
Learn more under: https://pyscaffold.org/
86
"""
7+
98
from setuptools import setup
109

1110
if __name__ == "__main__":

src/pybiocfilecache/BiocFileCache.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
Python Implementation of BiocFileCache
3-
"""
1+
"""Python Implementation of BiocFileCache."""
42

53
import os
64
from pathlib import Path
@@ -21,9 +19,7 @@
2119

2220

2321
class BiocFileCache:
24-
"""
25-
Class to manage and cache files.
26-
"""
22+
"""Class to manage and cache files."""
2723

2824
def __init__(self, cacheDirOrPath: Union[str, Path] = create_tmp_dir()):
2925
"""Initialize BiocFileCache.
@@ -90,7 +86,13 @@ def add(
9086

9187
# create new record in the database
9288
res = Resource(
93-
**dict(rid=rid, rname=rname, rpath=rpath, rtype=rtype, fpath=str(fpath),)
89+
**dict(
90+
rid=rid,
91+
rname=rname,
92+
rpath=rpath,
93+
rtype=rtype,
94+
fpath=str(fpath),
95+
)
9496
)
9597

9698
# If this was higher up a parallel process could have added the key to
@@ -164,7 +166,7 @@ def _get(self, session: Session, rname: str) -> Optional[Resource]:
164166
return resource
165167

166168
def get(self, rname: str) -> Optional[Resource]:
167-
"""get resource by name from cache.
169+
"""Get resource by name from cache.
168170
169171
Args:
170172
rname (str): Name of the file to search.

src/pybiocfilecache/db/Base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
def create_schema(cache_dir: str) -> Tuple[Engine, sessionmaker]:
16-
"""Create the schema in the sqlite database
16+
"""Create the schema in the sqlite database.
1717
1818
Args:
1919
cache_dir (str): Location where the cache directory

src/pybiocfilecache/db/schema.py

-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,3 @@ class Resource(Base):
3333

3434
def __repr__(self):
3535
return "<Resource(id='%s', rname='%s')>" % (self.id, self.rname)
36-

src/pybiocfilecache/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
def create_tmp_dir() -> str:
12-
"""create a temporary directory.
12+
"""Create a temporary directory.
1313
1414
Returns:
1515
str: path to the directory
@@ -57,7 +57,7 @@ def copy_or_move(
5757

5858

5959
def setup_logging(loglevel):
60-
"""Setup basic logging
60+
"""Setup basic logging.
6161
6262
Args:
6363
loglevel (int): minimum loglevel for emitting messages

tests/conftest.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
"""
2-
Dummy conftest.py for pybiocfilecache.
1+
"""Dummy conftest.py for pybiocfilecache.
32
4-
If you don't know what this is for, just leave it empty.
5-
Read more about conftest.py under:
6-
- https://docs.pytest.org/en/stable/fixture.html
7-
- https://docs.pytest.org/en/stable/writing_plugins.html
3+
If you don't know what this is for, just leave it empty.
4+
Read more about conftest.py under:
5+
- https://docs.pytest.org/en/stable/fixture.html
6+
- https://docs.pytest.org/en/stable/writing_plugins.html
87
"""
98

109
# import pytest

tests/data/test1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
test1
1+
test1

tests/data/test2.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
test2
1+
test2

0 commit comments

Comments
 (0)