Skip to content

Commit 6328b14

Browse files
authored
Merge pull request #179 from cgat-developers/AC-aws
included S3 decorators
2 parents b2d768e + be693f9 commit 6328b14

15 files changed

+544
-480
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,5 @@ _test_commandline.yaml
5959
# sample workflow
6060
means.txt
6161
sample*
62+
63+
.idea

all-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ pytest -v tests/test_pipeline_execution.py
1717
pytest -v tests/test_pipeline_cli.py
1818
pytest -v tests/test_pipeline_actions.py
1919
pytest -v tests/test_execution_cleanup.py
20+
pytest -v tests/test_s3_decorators.py

cgatcore/__init__.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# cgatcore/__init__.py
2+
3+
4+
class CgatCore:
5+
"""Main class to encapsulate CGAT core functionality with lazy loading."""
6+
7+
def __init__(self):
8+
self._pipeline = None
9+
self._remote = None
10+
11+
@property
12+
def pipeline(self):
13+
"""Lazy load the pipeline module."""
14+
if self._pipeline is None:
15+
from cgatcore import pipeline
16+
self._pipeline = pipeline
17+
return self._pipeline
18+
19+
def get_remote(self):
20+
"""Dynamically load and return the remote module when explicitly called."""
21+
if self._remote is None:
22+
from cgatcore import remote
23+
self._remote = remote
24+
return self._remote
25+
26+
27+
# Create a global instance of the CgatCore class
28+
cgatcore = CgatCore()

cgatcore/experiment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,13 @@ class method (:func:`cached_method`) calls.
297297
import functools
298298
import gzip
299299
import warnings
300-
import pipes
301300
import optparse
302301
import argparse
303302
import textwrap
304303
import random
305304
import uuid
306305
import yaml
306+
import shlex as pipes # Use shlex as a replacement for pipes
307307
# import convenience functions from logging
308308
import logging
309309
import logging.config

0 commit comments

Comments
 (0)