Skip to content

Commit

Permalink
Merge pull request #191 from asmacdo/single-file
Browse files Browse the repository at this point in the history
Move all logic into single file
  • Loading branch information
yarikoptic authored Oct 1, 2024
2 parents 5163a42 + bfaf37b commit 6b73360
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ commit = True
message = [skip ci] Bump version: {current_version} → {new_version}
tag = False

[bumpversion:file:src/con_duct/__init__.py]
[bumpversion:file:src/con_duct/__main__.py]
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = con-duct
version = attr:con_duct.__version__
version = attr:con_duct.__main__.__version__
description = Runs a not-so-simple command and collects resource usage metrics
long_description = file:README.md
long_description_content_type = text/markdown
Expand Down
2 changes: 0 additions & 2 deletions src/con_duct/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
__version__ = "0.4.0"
__schema_version__ = "0.1.0"
6 changes: 5 additions & 1 deletion src/con_duct/__main__.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
from __future__ import annotations
import argparse
from collections.abc import Iterable, Iterator
Expand All @@ -18,7 +19,10 @@
import threading
import time
from typing import IO, Any, Optional, TextIO
from . import __schema_version__, __version__

__version__ = "0.4.0"
__schema_version__ = "0.1.0"


lgr = logging.getLogger("con-duct")
DEFAULT_LOG_LEVEL = os.environ.get("DUCT_LOG_LEVEL", "INFO").upper()
Expand Down
6 changes: 6 additions & 0 deletions test/test_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,9 @@ def runner() -> int:

exit_code = info_data["execution_summary"]["exit_code"]
assert exit_code == 128 + 15


def test_duct_as_executable(temp_output_dir: str) -> None:
ps_command = f"./src/con_duct/__main__.py -p {temp_output_dir} sleep 0.01"
# Assert does not raise
subprocess.check_output(ps_command, shell=True).decode()

0 comments on commit 6b73360

Please sign in to comment.