pyBiocFileCache 0.3.1__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/AUTHORS.md +1 -0
- pybiocfilecache-0.4.0/CHANGELOG.md +9 -0
- {pybiocfilecache-0.3.1/src/pyBiocFileCache.egg-info → pybiocfilecache-0.4.0}/PKG-INFO +1 -1
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/docs/authors.md +1 -0
- pybiocfilecache-0.4.0/docs/changelog.md +9 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/docs/conf.py +3 -8
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0/src/pyBiocFileCache.egg-info}/PKG-INFO +1 -1
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/src/pyBiocFileCache.egg-info/SOURCES.txt +2 -2
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/src/pybiocfilecache/BiocFileCache.py +1 -2
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/src/pybiocfilecache/__init__.py +2 -2
- pybiocfilecache-0.4.0/src/pybiocfilecache/const.py +1 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/src/pybiocfilecache/db/__init__.py +1 -1
- pybiocfilecache-0.4.0/src/pybiocfilecache/db/db_config.py +84 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/tests/conftest.py +1 -2
- pybiocfilecache-0.3.1/CHANGELOG.md +0 -5
- pybiocfilecache-0.3.1/docs/changelog.md +0 -5
- pybiocfilecache-0.3.1/src/pybiocfilecache/db/Base.py +0 -36
- pybiocfilecache-0.3.1/src/pybiocfilecache/db/schema.py +0 -35
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/.coveragerc +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/.github/workflows/pypi-publish.yml +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/.github/workflows/pypi-test.yml +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/.gitignore +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/.pre-commit-config.yaml +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/.readthedocs.yml +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/CONTRIBUTING.rst +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/LICENSE.txt +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/README.md +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/docs/Makefile +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/docs/_static/.gitignore +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/docs/contributing.rst +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/docs/index.md +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/docs/license.rst +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/docs/readme.md +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/docs/requirements.txt +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/pyproject.toml +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/setup.cfg +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/setup.py +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/src/pyBiocFileCache.egg-info/dependency_links.txt +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/src/pyBiocFileCache.egg-info/not-zip-safe +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/src/pyBiocFileCache.egg-info/requires.txt +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/src/pyBiocFileCache.egg-info/top_level.txt +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/src/pybiocfilecache/_exceptions.py +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/src/pybiocfilecache/utils.py +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/tests/data/test1.txt +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/tests/data/test2.txt +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/tests/test_cache.py +0 -0
- {pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/tox.ini +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Version 0.4 (development)
|
|
4
|
+
|
|
5
|
+
- Migrate the schema to match R/Bioconductor's BiocFileCache (Check out [this issue](https://github.com/BiocPy/pyBiocFileCache/issues/11)). Thanks to [@khoroshevskyi ](https://github.com/khoroshevskyi) for the PR.
|
|
6
|
+
|
|
7
|
+
## Version 0.1
|
|
8
|
+
|
|
9
|
+
- Initial release of the package, Setting up all the actions.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Version 0.4 (development)
|
|
4
|
+
|
|
5
|
+
- Migrate the schema to match R/Bioconductor's BiocFileCache (Check out [this issue](https://github.com/BiocPy/pyBiocFileCache/issues/11)). Thanks to [@khoroshevskyi ](https://github.com/khoroshevskyi) for the PR.
|
|
6
|
+
|
|
7
|
+
## Version 0.1
|
|
8
|
+
|
|
9
|
+
- Initial release of the package, Setting up all the actions.
|
|
@@ -179,10 +179,7 @@ html_theme = "furo"
|
|
|
179
179
|
# Theme options are theme-specific and customize the look and feel of a theme
|
|
180
180
|
# further. For a list of options available for each theme, see the
|
|
181
181
|
# documentation.
|
|
182
|
-
html_theme_options = {
|
|
183
|
-
"sidebar_width": "300px",
|
|
184
|
-
"page_width": "1200px"
|
|
185
|
-
}
|
|
182
|
+
html_theme_options = {"sidebar_width": "300px", "page_width": "1200px"}
|
|
186
183
|
|
|
187
184
|
# Add any paths that contain custom themes here, relative to this directory.
|
|
188
185
|
# html_theme_path = []
|
|
@@ -266,9 +263,7 @@ latex_elements = {
|
|
|
266
263
|
|
|
267
264
|
# Grouping the document tree into LaTeX files. List of tuples
|
|
268
265
|
# (source start file, target name, title, author, documentclass [howto/manual]).
|
|
269
|
-
latex_documents = [
|
|
270
|
-
("index", "user_guide.tex", "pyBiocFileCache Documentation", "jkanche", "manual")
|
|
271
|
-
]
|
|
266
|
+
latex_documents = [("index", "user_guide.tex", "pyBiocFileCache Documentation", "jkanche", "manual")]
|
|
272
267
|
|
|
273
268
|
# The name of an image file (relative to this directory) to place at the top of
|
|
274
269
|
# the title page.
|
|
@@ -304,4 +299,4 @@ intersphinx_mapping = {
|
|
|
304
299
|
"pyscaffold": ("https://pyscaffold.org/en/stable", None),
|
|
305
300
|
}
|
|
306
301
|
|
|
307
|
-
print(f"loading configurations for {project} {version} ...", file=sys.stderr)
|
|
302
|
+
print(f"loading configurations for {project} {version} ...", file=sys.stderr)
|
|
@@ -32,10 +32,10 @@ src/pyBiocFileCache.egg-info/top_level.txt
|
|
|
32
32
|
src/pybiocfilecache/BiocFileCache.py
|
|
33
33
|
src/pybiocfilecache/__init__.py
|
|
34
34
|
src/pybiocfilecache/_exceptions.py
|
|
35
|
+
src/pybiocfilecache/const.py
|
|
35
36
|
src/pybiocfilecache/utils.py
|
|
36
|
-
src/pybiocfilecache/db/Base.py
|
|
37
37
|
src/pybiocfilecache/db/__init__.py
|
|
38
|
-
src/pybiocfilecache/db/
|
|
38
|
+
src/pybiocfilecache/db/db_config.py
|
|
39
39
|
tests/conftest.py
|
|
40
40
|
tests/test_cache.py
|
|
41
41
|
tests/data/test1.txt
|
|
@@ -9,8 +9,7 @@ from sqlalchemy import func
|
|
|
9
9
|
from sqlalchemy.orm import Session
|
|
10
10
|
|
|
11
11
|
from ._exceptions import NoFpathError, RnameExistsError, RpathTimeoutError
|
|
12
|
-
from .db import create_schema
|
|
13
|
-
from .db.schema import Resource
|
|
12
|
+
from .db.db_config import create_schema, Resource
|
|
14
13
|
from .utils import copy_or_move, create_tmp_dir, generate_id
|
|
15
14
|
|
|
16
15
|
__author__ = "Jayaram Kancherla"
|
|
@@ -17,8 +17,8 @@ finally:
|
|
|
17
17
|
|
|
18
18
|
from .BiocFileCache import BiocFileCache as BiocFileCache
|
|
19
19
|
|
|
20
|
-
from .db.
|
|
21
|
-
from .db.
|
|
20
|
+
from .db.db_config import Metadata as Metadata
|
|
21
|
+
from .db.db_config import Resource as Resource
|
|
22
22
|
|
|
23
23
|
from ._exceptions import NoFpathError as NoFpathError
|
|
24
24
|
from ._exceptions import RnameExistsError as RnameExistsError
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SCHEMA_VERSION = "0.99.4"
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
from typing import Tuple
|
|
2
|
+
|
|
3
|
+
from sqlalchemy import create_engine, select, Column, Integer, Text, DateTime, func
|
|
4
|
+
from sqlalchemy.engine import Engine
|
|
5
|
+
from sqlalchemy.orm.session import Session
|
|
6
|
+
|
|
7
|
+
from sqlalchemy.orm import declarative_base, sessionmaker
|
|
8
|
+
|
|
9
|
+
from ..const import SCHEMA_VERSION
|
|
10
|
+
|
|
11
|
+
__author__ = "jkanche"
|
|
12
|
+
__copyright__ = "jkanche"
|
|
13
|
+
__license__ = "MIT"
|
|
14
|
+
|
|
15
|
+
Base = declarative_base()
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Metadata(Base):
|
|
19
|
+
__tablename__ = "metadata"
|
|
20
|
+
key = Column(Text(), primary_key=True, index=True)
|
|
21
|
+
value = Column(Text())
|
|
22
|
+
|
|
23
|
+
def __repr__(self):
|
|
24
|
+
return "<Metadata(key='%s', valye='%s')>" % (self.key, self.value)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Resource(Base):
|
|
28
|
+
__tablename__ = "resource"
|
|
29
|
+
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
|
|
30
|
+
rid = Column(Text())
|
|
31
|
+
rname = Column(Text())
|
|
32
|
+
create_time = Column(DateTime, server_default=func.now())
|
|
33
|
+
access_time = Column(DateTime, server_default=func.now())
|
|
34
|
+
rpath = Column(Text())
|
|
35
|
+
rtype = Column(Text())
|
|
36
|
+
fpath = Column(Text())
|
|
37
|
+
last_modified_time = Column(DateTime, onupdate=func.now())
|
|
38
|
+
etag = Column(Text())
|
|
39
|
+
expires = Column(DateTime)
|
|
40
|
+
|
|
41
|
+
def __repr__(self):
|
|
42
|
+
return "<Resource(id='%s', rname='%s')>" % (self.id, self.rname)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def add_metadata(key: str, value: str, engine: Engine) -> None:
|
|
46
|
+
"""Add metadata to the database.
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
key:
|
|
50
|
+
Key of the metadata.
|
|
51
|
+
value:
|
|
52
|
+
Value of the metadata.
|
|
53
|
+
engine:
|
|
54
|
+
Engine
|
|
55
|
+
"""
|
|
56
|
+
with Session(engine) as session:
|
|
57
|
+
if session.scalar(select(Metadata).where(Metadata.key == key)):
|
|
58
|
+
pass
|
|
59
|
+
else:
|
|
60
|
+
new_metadata = Metadata(key=key, value=value)
|
|
61
|
+
session.add(new_metadata)
|
|
62
|
+
session.commit()
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def create_schema(cache_dir: str) -> Tuple[Engine, sessionmaker]:
|
|
66
|
+
"""Create the schema in the sqlite database.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
cache_dir:
|
|
70
|
+
Location where the cache directory.
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
A tuple of sqlalchemy engine and session maker.
|
|
74
|
+
"""
|
|
75
|
+
engine = create_engine(
|
|
76
|
+
f"sqlite:///{cache_dir}", connect_args={"check_same_thread": False}
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
Base.metadata.create_all(bind=engine, checkfirst=True)
|
|
80
|
+
sessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
|
81
|
+
|
|
82
|
+
add_metadata("schema_version", SCHEMA_VERSION, engine)
|
|
83
|
+
|
|
84
|
+
return (engine, sessionLocal)
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"""Dummy conftest.py for pybiocfilecache.
|
|
2
|
-
|
|
3
2
|
If you don't know what this is for, just leave it empty.
|
|
4
3
|
Read more about conftest.py under:
|
|
5
4
|
- https://docs.pytest.org/en/stable/fixture.html
|
|
6
5
|
- https://docs.pytest.org/en/stable/writing_plugins.html
|
|
7
6
|
"""
|
|
8
7
|
|
|
9
|
-
# import pytest
|
|
8
|
+
# import pytest
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
from typing import Tuple
|
|
2
|
-
|
|
3
|
-
from sqlalchemy import create_engine
|
|
4
|
-
from sqlalchemy.engine import Engine
|
|
5
|
-
|
|
6
|
-
# from sqlalchemy.ext.declarative import declarative_base
|
|
7
|
-
from sqlalchemy.orm import declarative_base, sessionmaker
|
|
8
|
-
|
|
9
|
-
__author__ = "jkanche"
|
|
10
|
-
__copyright__ = "jkanche"
|
|
11
|
-
__license__ = "MIT"
|
|
12
|
-
|
|
13
|
-
Base = declarative_base()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def create_schema(cache_dir: str) -> Tuple[Engine, sessionmaker]:
|
|
17
|
-
"""Create the schema in the sqlite database.
|
|
18
|
-
|
|
19
|
-
Args:
|
|
20
|
-
cache_dir:
|
|
21
|
-
Location where the cache directory.
|
|
22
|
-
|
|
23
|
-
Returns:
|
|
24
|
-
A tuple of sqlalchemy engine and session maker.
|
|
25
|
-
"""
|
|
26
|
-
try:
|
|
27
|
-
engine = create_engine(
|
|
28
|
-
f"sqlite:///{cache_dir}", connect_args={"check_same_thread": False}
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
Base.metadata.create_all(bind=engine, checkfirst=True)
|
|
32
|
-
sessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
|
33
|
-
|
|
34
|
-
return (engine, sessionLocal)
|
|
35
|
-
except Exception as e:
|
|
36
|
-
raise e
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
from sqlalchemy import Column, DateTime, Integer, String
|
|
2
|
-
from sqlalchemy.sql import func
|
|
3
|
-
|
|
4
|
-
from .Base import Base
|
|
5
|
-
|
|
6
|
-
__author__ = "jkanche"
|
|
7
|
-
__copyright__ = "jkanche"
|
|
8
|
-
__license__ = "MIT"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class Metadata(Base):
|
|
12
|
-
__tablename__ = "metadata"
|
|
13
|
-
key = Column(String(), primary_key=True, index=True)
|
|
14
|
-
value = Column(String())
|
|
15
|
-
|
|
16
|
-
def __repr__(self):
|
|
17
|
-
return "<Metadata(key='%s', valye='%s')>" % (self.key, self.value)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class Resource(Base):
|
|
21
|
-
__tablename__ = "resource"
|
|
22
|
-
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
|
|
23
|
-
rid = Column(String())
|
|
24
|
-
rname = Column(String())
|
|
25
|
-
create_time = Column(DateTime, server_default=func.now())
|
|
26
|
-
access_time = Column(DateTime, server_default=func.now())
|
|
27
|
-
rpath = Column(String())
|
|
28
|
-
rtype = Column(String())
|
|
29
|
-
fpath = Column(String())
|
|
30
|
-
last_modified_time = Column(DateTime, onupdate=func.now())
|
|
31
|
-
etag = Column(String())
|
|
32
|
-
expires = Column(DateTime)
|
|
33
|
-
|
|
34
|
-
def __repr__(self):
|
|
35
|
-
return "<Resource(id='%s', rname='%s')>" % (self.id, self.rname)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pybiocfilecache-0.3.1 → pybiocfilecache-0.4.0}/src/pyBiocFileCache.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|