diff --git a/pixi.lock b/pixi.lock index 04994b4..5821efb 100644 --- a/pixi.lock +++ b/pixi.lock @@ -399,14 +399,14 @@ packages: requires_python: '>=3.7' - kind: pypi name: gridtk - version: 3.0.1.dev10+gc242a4b.d20240708 + version: 3.0.1.dev12+g8928a47.d20240708 path: . - sha256: 58131c0c43de9e6dc96dd1769664520aa4b76a519375da1e854ae084e634d489 + sha256: 4407a9f85e14b004131599fd51a300faea2681261fdc94edb78ed2bed2d28775 requires_dist: - - clapper - - click - - sqlalchemy>=2 - - tabulate + - clapper~=1.1 + - click~=8.1 + - sqlalchemy~=2.0 + - tabulate~=0.9.0 - furo ; extra == 'doc' - myst-parser ; extra == 'doc' - sphinx ; extra == 'doc' diff --git a/pyproject.toml b/pyproject.toml index 8ed518e..08d8a0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,12 @@ classifiers = [ "Programming Language :: Python :: 3", "Topic :: System :: Distributed Computing", ] -dependencies = ["clapper", "sqlalchemy>=2", "tabulate", "click"] +dependencies = [ + "clapper~=1.1", + "sqlalchemy~=2.0", + "tabulate~=0.9.0", + "click~=8.1", +] [project.urls] documentation = "https://gridtk.readthedocs.io/en/latest/" @@ -159,3 +164,6 @@ convention = "numpy" addopts = ["--cov=gridtk", "--cov-report=term-missing", "--import-mode=append"] junit_logging = "all" junit_log_passing_tests = false + +[tool.mypy] +python_version = "3.12" diff --git a/src/gridtk/cli.py b/src/gridtk/cli.py index ab4f60c..2b7cf1f 100644 --- a/src/gridtk/cli.py +++ b/src/gridtk/cli.py @@ -62,7 +62,7 @@ def cli(ctx, database, logs_dir): @cli.result_callback() def process_result(result, **kwargs): - """Process the result of the command.""" + """Delete the job manager from the context.""" ctx = click.get_current_context() del ctx.meta["job_manager"] diff --git a/tests/test_gridtk.py b/tests/test_gridtk.py index 2b176d3..161c2ab 100644 --- a/tests/test_gridtk.py +++ b/tests/test_gridtk.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-3.0-or-later import json -import subprocess import traceback from unittest.mock import Mock, patch @@ -336,22 +335,6 @@ def test_resubmit_jobs(mock_check_output, runner): ) -def _diagnose_databaselock_error(tmpdir): - # ls -l /path/to/database/file - print(subprocess.run(["ls", "-al", f"{tmpdir}"]).stdout) # noqa: T201 - import sqlite3 - - try: - conn = sqlite3.connect(f"{tmpdir}/jobs.sql3") - cursor = conn.cursor() - cursor.execute("CREATE TABLE IF NOT EXISTS test_write (id INTEGER PRIMARY KEY)") - conn.commit() - conn.close() - print("Write successful") # noqa: T201 - except sqlite3.OperationalError as e: - print(f"Failed to write to the database: {e}") # noqa: T201 - - @patch("subprocess.check_output") def test_submit_with_dependencies(mock_check_output, runner): with runner.isolated_filesystem() as tmpdir: @@ -475,7 +458,6 @@ def test_submit_with_dependencies(mock_check_output, runner): text=True, ) - _diagnose_databaselock_error(tmpdir) # now delete all the jobs mock_check_output.side_effect = [ _failed_job_sacct_json(first_grid_id), # sacct