Support the HTCondor v2 python bindings#46
Open
ikrommyd wants to merge 1 commit into
Open
Conversation
ikrommyd
force-pushed
the
htcondor2-compat
branch
from
July 25, 2026 00:02
7152df5 to
361139b
Compare
HTCondor 25 removed the version 1 bindings (HTCONDOR-3240), so `import htcondor` now fails on current coffea images. Prefer htcondor2 and fall back to htcondor, alias the removed HTCondorIOError to the surviving HTCondorException, and route spooling through a helper since v2's Schedd.spool() takes the SubmitResult and does not implement Submit.jobs(). Assisted-by: ClaudeCode:claude-opus-5
ikrommyd
force-pushed
the
htcondor2-compat
branch
from
July 25, 2026 00:03
361139b to
36e7605
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
HTCondor 25 removed the v1 python bindings (HTCONDOR-3240), so
import htcondorfails on current coffea images — e.g.coffeateam/coffea-0.7-almalinux9:0.7.31-py3.11, which ships htcondor 25.11.0. The distribution is still namedhtcondor, sopip show htcondorstill finds it; only the module was renamed tohtcondor2.This ports the package rather than pinning, so it works on both. Alternative to #45.
Three v2 differences mattered:
import htcondor→ preferhtcondor2, fall back tohtcondor.HTCondorIOErroris gone, along with every otherHTCondorExceptionsubclass. Aliased to the surviving base class.Submit.jobs()raisesNotImplementedErrorin v2, andSchedd.spool()now takes theSubmitResultinstead of a list of job ads. Both are used together inLPCCondorJob.start, so they are wrapped in aspool()helper inschedd.py.That third one is the reason this is more than an import fix — without it the package imports cleanly and then fails on every job submission.
Everything else works unchanged:
param,Collector,Schedd.query/act,Submit,JobAction, and theAdTypes/DaemonTypesenums, which htcondor2 keeps as explicit back-compat aliases.xquery()isn't used anywhere, so there is no query-loop to rewrite. Nosetup.cfgchange is needed since the distribution name is unchanged.Verified
Against real conda-forge
python-htcondorbuilds on py3.11:htcondoronlyHTCondorIOErrorsubclass preserved;Submit.jobs()works;spool()gets a list — i.e. pre-PR behaviourhtcondor2onlyfrom lpcjobqueue import LPCCondorClusterOK; every touched attribute resolves;Submit.jobs()raisesNotImplementedError;Schedd.spoolis(result: SubmitResult);except HTCondorIOErrorcatchesHTCondorExceptionTwo things worth knowing:
acquire_schedd()against a live collector. Those need an LPC node, so a smoke test before merging would be worthwhile — the spool change above is exactly the path I could not exercise end to end.One note for maintainers
The
HTCondorIOErroralias widens the threeexceptclauses incluster.pyto catch anyHTCondorException. All three are schedd-communication retry paths so this is mostly benign, but non-IO HTCondor errors will now be retried rather than propagating. If you'd prefer it explicit, I can swap the alias for aSCHEDD_RETRY_ERRORStuple inschedd.pyand use that in theexceptclauses instead.