Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Warsame committed Sep 27, 2025
1 parent 35d9ebf commit 922fbc1
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 9 deletions.
4 changes: 3 additions & 1 deletion requirments.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
requests
pytest
pytest-cov
flake8
mypy
pytest
coverage
13 changes: 5 additions & 8 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,25 @@ def do_install():

def do_test():
import re, subprocess, sys, os, pathlib

# Always run from repo root
os.chdir(pathlib.Path(__file__).parent.resolve())

cmd = [sys.executable, "-m", "pytest", "tests",
"--maxfail=1", "--disable-warnings",
"--cov=acmecli", "--cov-report=term-missing"]
r = subprocess.run(cmd, text=True, capture_output=True)
out = (r.stdout or "") + (r.stderr or "")

# Extract counts
collected = re.search(r"collected\s+(\d+)", out)
passed = re.search(r"(\d+)\s+passed", out)
cov = re.search(r"TOTAL\s+.*?(\d+)%", out)

x = int(passed.group(1)) if passed else 0
y = int(collected.group(1)) if collected else 0
z = int(cov.group(1)) if cov else 0

print(f"{x}/{y} test cases passed. {z}% line coverage achieved.")
return 0 if r.returncode == 0 else 1

def do_score(url_file):
sys.path.insert(0, "src") # make sure acmecli is importable
from acmecli.cli import main as cli_main
return cli_main(['run', url_file])

def main():
if len(sys.argv) < 2:
Expand All @@ -46,4 +43,4 @@ def main():
sys.exit(1)

if __name__ == "__main__":
main()
main()
Binary file added src/acmecli/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file added src/acmecli/__pycache__/cli.cpython-312.pyc
Binary file not shown.
Binary file added src/acmecli/__pycache__/reporter.cpython-312.pyc
Binary file not shown.
Binary file added src/acmecli/__pycache__/types.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file added src/acmecli/metrics/__pycache__/base.cpython-312.pyc
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions urls.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/octocat/Hello-World
https://huggingface.co/google/gemma-3-270m

0 comments on commit 922fbc1

Please sign in to comment.