Skip to content

Commit

Permalink
Revert temporary changes
Browse files Browse the repository at this point in the history
Pin deps
  • Loading branch information
183amir committed Jul 8, 2024
1 parent 8928a47 commit 86e2a45
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 26 deletions.
12 changes: 6 additions & 6 deletions pixi.lock

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

10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down Expand Up @@ -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"
2 changes: 1 addition & 1 deletion src/gridtk/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
18 changes: 0 additions & 18 deletions tests/test_gridtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later

import json
import subprocess
import traceback

from unittest.mock import Mock, patch
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 86e2a45

Please sign in to comment.