Skip to content

Factory: also parse command-line options#2060

Open
mr-c wants to merge 1 commit intomainfrom
fix_faxtory
Open

Factory: also parse command-line options#2060
mr-c wants to merge 1 commit intomainfrom
fix_faxtory

Conversation

@mr-c
Copy link
Copy Markdown
Member

@mr-c mr-c commented Oct 24, 2024

Re-do of #1099

@mr-c mr-c mentioned this pull request Oct 24, 2024
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 24, 2024

Codecov Report

❌ Patch coverage is 80.95238% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.97%. Comparing base (6cfef62) to head (dd80dea).
⚠️ Report is 164 commits behind head on main.

Files with missing lines Patch % Lines
cwltool/factory.py 80.95% 5 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2060      +/-   ##
==========================================
- Coverage   83.99%   83.97%   -0.02%     
==========================================
  Files          46       46              
  Lines        8302     8332      +30     
  Branches     1957     1964       +7     
==========================================
+ Hits         6973     6997      +24     
- Misses        853      858       +5     
- Partials      476      477       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread cwltool/factory.py
Comment on lines +98 to +127
self.runtime_context.find_default_container = functools.partial(
find_default_container, default_container=None, use_biocontainers=None
)

if sys.platform == "darwin":
default_mac_path = "/private/tmp/docker_tmp"
if self.runtimeContext.tmp_outdir_prefix == DEFAULT_TMP_PREFIX:
self.runtimeContext.tmp_outdir_prefix = default_mac_path

for dirprefix in ("tmpdir_prefix", "tmp_outdir_prefix", "cachedir"):
if (
getattr(self.runtime_context, dirprefix)
and getattr(self.runtime_context, dirprefix) != DEFAULT_TMP_PREFIX
):
sl = (
"/"
if getattr(self.runtime_context, dirprefix).endswith("/")
or dirprefix == "cachedir"
else ""
)
setattr(
self.runtime_context,
dirprefix,
os.path.abspath(getattr(self.runtime_context, dirprefix)) + sl,
)
if not os.path.exists(os.path.dirname(getattr(self.runtime_context, dirprefix))):
try:
os.makedirs(os.path.dirname(getattr(self.runtime_context, dirprefix)))
except Exception as e:
print("Failed to create directory: %s", e)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo, refactor this and the equivalent code from cwltool/main.py to a shared function. May need to look back to

if sys.platform == "darwin":
(when this PR was originally written) for inspiration

Co-authored-by: Michael R. Crusoe <michael.crusoe@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants