Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added batchtools/__init__.py
Empty file.
File renamed without changes.
20 changes: 10 additions & 10 deletions batchtools.py → batchtools/batchtools.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import argparse
import sys

from basecommand import Command
from basecommand import SubParserFactory
from bj import ListJobsCommand
from bd import DeleteJobsCommand
from bl import LogsCommand
from bp import PrintJobsCommand
from bq import GpuQueuesCommand
from br import CreateJobCommand
from bps import ListPodsCommand
from helpers import is_logged_in
from .basecommand import Command
from .basecommand import SubParserFactory
from .bj import ListJobsCommand
from .bd import DeleteJobsCommand
from .bl import LogsCommand
from .bp import PrintJobsCommand
from .bq import GpuQueuesCommand
from .br import CreateJobCommand
from .bps import ListPodsCommand
from .helpers import is_logged_in


class BatchTools:
Expand Down
6 changes: 3 additions & 3 deletions bd.py → batchtools/bd.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import openshift_client as oc

from basecommand import Command
from basecommand import SubParserFactory
from helpers import oc_delete
from .basecommand import Command
from .basecommand import SubParserFactory
from .helpers import oc_delete


class DeleteJobsCommandArgs(argparse.Namespace):
Expand Down
2 changes: 1 addition & 1 deletion bj.py → batchtools/bj.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys
import openshift_client as oc

from basecommand import Command
from .basecommand import Command


class ListJobsCommand(Command):
Expand Down
6 changes: 3 additions & 3 deletions bl.py → batchtools/bl.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import argparse
import openshift_client as oc

from basecommand import Command
from basecommand import SubParserFactory
from helpers import pretty_print
from .basecommand import Command
from .basecommand import SubParserFactory
from .helpers import pretty_print


class LogsCommandArgs(argparse.Namespace):
Expand Down
4 changes: 2 additions & 2 deletions bp.py → batchtools/bp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import openshift_client as oc

from basecommand import Command
from basecommand import SubParserFactory
from .basecommand import Command
from .basecommand import SubParserFactory


class PrintJobsCommandArgs(argparse.Namespace):
Expand Down
4 changes: 2 additions & 2 deletions bps.py → batchtools/bps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import argparse
import openshift_client as oc

from basecommand import Command
from basecommand import SubParserFactory
from .basecommand import Command
from .basecommand import SubParserFactory


class ListPodsCommandArgs(argparse.Namespace):
Expand Down
2 changes: 1 addition & 1 deletion bq.py → batchtools/bq.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import openshift_client as oc

from basecommand import Command
from .basecommand import Command


class GpuQueuesCommand(Command):
Expand Down
12 changes: 6 additions & 6 deletions br.py → batchtools/br.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

import openshift_client as oc

from basecommand import Command
from basecommand import SubParserFactory
from build_yaml import build_job_body
from helpers import pretty_print
from helpers import oc_delete
from file_setup import prepare_context
from .basecommand import Command
from .basecommand import SubParserFactory
from .build_yaml import build_job_body
from .helpers import pretty_print
from .helpers import oc_delete
from .file_setup import prepare_context


class CreateJobCommandArgs(argparse.Namespace):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 21 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
[build-system]
requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta"

[project]
name = "python-batchtools"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"kubernetes-typed>=18.20.2",
"openshift-client>=2.0.5",
"typing-extensions>=4.15.0",
]
requires-python = ">=3.11"
dependencies = ["openshift-client>=2.0.5", "typing-extensions>=4.15.0"]

[project.scripts]
# When we install the project, this causes the installer to create a
# "batchtools" script that will run our main function.
batchtools = "batchtools.batchtools:main"

[dependency-groups]
dev = ["pytest>=8.4.2", "pytest-cov>=7.0.0", "ty>=0.0.1a24"]

[tool.basedpyright]

# This configures the "basedpyright" type checker to ignore a variety of
# issues that crop up when working with non-type-aware Python code.
ignore = ["**/tests"]
reportUnusedCallResult = false
reportUnknownMemberType = false
Expand All @@ -28,7 +34,15 @@ analyzeUnannotatedFunctions = false


[tool.pytest.ini_options]
# These options will be added to the pytest command line automatically.
addopts = "--cov=. --cov-report=html"

[tool.coverage.report]
omit = ["tests/*"]

[tool.setuptools]
# This tells packaging tools which top-level directories correspond to
# Python packages. Without this, package builds will fail if there are
# multiple top-level directories ("error: Multiple top-level packages
# discovered in a flat-layout")
packages = ["batchtools"]
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_batchtools.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from batchtools import BatchTools
from batchtools.batchtools import BatchTools


def test_no_command():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_bd.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import argparse

from bd import DeleteJobsCommand
from batchtools.bd import DeleteJobsCommand
from tests.helpers import DictToObject


Expand Down
2 changes: 1 addition & 1 deletion tests/test_bj.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import argparse

from bj import ListJobsCommand
from batchtools.bj import ListJobsCommand
from tests.helpers import DictToObject


Expand Down
2 changes: 1 addition & 1 deletion tests/test_bl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Any
from typing import Callable

from bl import LogsCommand
from batchtools.bl import LogsCommand
from tests.helpers import DictToObject


Expand Down
2 changes: 1 addition & 1 deletion tests/test_bp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Any
import argparse

from bp import PrintJobsCommand
from batchtools.bp import PrintJobsCommand
from tests.helpers import DictToObject


Expand Down
2 changes: 1 addition & 1 deletion tests/test_bps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from contextlib import contextmanager
from typing import Any

from bps import ListPodsCommand, summarize_gpu_pods
from batchtools.bps import ListPodsCommand, summarize_gpu_pods


def create_pod(
Expand Down
6 changes: 3 additions & 3 deletions tests/test_br.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import tempfile
import argparse

import build_yaml
from br import CreateJobCommand
import batchtools.build_yaml
from batchtools.br import CreateJobCommand
from tests.helpers import DictToObject


Expand Down Expand Up @@ -98,7 +98,7 @@ def test_create_job_nowait(
},
}

build_yaml.rsync_script = "testcommand {cmdline}"
batchtools.build_yaml.rsync_script = "testcommand {cmdline}"
CreateJobCommand.run(args)

assert mock_create.call_args.args[0] == expected
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.