Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
443b665
Use custom multiversion build, since sphinx-multiversion does not wor…
hategan Nov 19, 2026
00bd160
Remove unused import
hategan Nov 19, 2026
920aca5
Updated sphinx version to >8 <9
hategan Nov 19, 2026
a6c7b72
Fix various doc issues
hategan Nov 19, 2026
fd89cd9
Added webrick to jekyll requirements
hategan Nov 19, 2026
5b43b62
Split long line
hategan Nov 19, 2026
7d38f26
Fix @typechecked signatures. Hard to say what's going on there.
hategan Nov 22, 2026
2c21787
Disable typeguard when building docs, except that doesn't quite seem …
hategan Nov 22, 2026
ba64956
Add .bundle and vendor directories to Jekyll ignore list.
hategan Nov 22, 2026
c3ecf1c
Proper levels for api tree, otherwise the toc highlight following cod…
hategan Nov 23, 2026
f327129
Various fixes for tree/index generator.
hategan Nov 23, 2026
8410cea
Update toc maxdepth to 4 so we hit class names in the api tree.
hategan Nov 23, 2026
d7cdfc0
Removed sphinx_multiversion from docs conf.py since we're not using i…
hategan Nov 23, 2026
99dff73
The previous idea of linking to python docs for whatever version we'r…
hategan Nov 23, 2026
2d627bf
Various fixes and updates to web doc builds.
hategan Nov 23, 2026
1191e8e
Patch cloud theme js files to work with newer versions of Sphinx (par…
hategan Nov 23, 2026
d4f74f6
Multiple docstring fixes.
hategan Nov 23, 2026
d79fa64
Spelling fix. While this is more an issue with the cloud theme, we wa…
hategan Dec 2, 2026
41fbf97
Dropped support for Python 3.8 (eol-ed since 2024) and loosened version
hategan Dec 2, 2026
8e4c856
Ensure tests deps are installed.
hategan Dec 2, 2026
739e94e
Use a newer version of the flux image for testing.
hategan Dec 3, 2026
3dba1ea
Adding pip
hategan Dec 3, 2026
3e9d3dd
Use venv to run tests
hategan Dec 3, 2026
60f1089
Ensure venv is installed
hategan Dec 3, 2026
9e574ea
Debugging
hategan Dec 3, 2026
b4d6eb0
Remove bashism
hategan Dec 3, 2026
825e9b9
Ensure that setuptools is installed
hategan Dec 3, 2026
38273cd
Ensure test executors are added when running tests
hategan Dec 3, 2026
3f3dd4d
Remove psij installed by rp
hategan Dec 3, 2026
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
17 changes: 12 additions & 5 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, 3.10, 3.11, 3.12]
python-version: [3.9, 3.10, 3.11, 3.12, 3.13, 3.14, 3.15]
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -47,13 +47,15 @@ jobs:
- name: Test with pytest
uses: addnab/docker-run-action@v3
with:
image: fluxrm/flux-core:focal
image: fluxrm/flux-core:noble
options: -v ${{ github.workspace }}:/workspace -u root
run: |
set -x
set -e
cd /workspace
echo "Running in ${PWD}"
sudo apt update
sudo apt install -y openssh-server openssh-client netcat-traditional
sudo apt install -y openssh-server openssh-client netcat-traditional python3.12-venv
mkdir -p "$HOME/.ssh"
chmod 0755 "$HOME"
chmod 0700 "$HOME/.ssh"
Expand All @@ -62,9 +64,14 @@ jobs:
chmod 600 "$HOME/.ssh/authorized_keys"
ls -la /etc/init.d/
sudo /etc/init.d/ssh start
which python3
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -r requirements-tests.txt
pip install -r requirements-connector-radical.txt
make launcher-scripts
# See above
pip uninstall -y psij-python
make install
PYTHONPATH=$(flux env | grep PYTHONPATH | sed -E 's/.*PYTHONPATH="(.*)"/\1/') OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 make tests
PYTHONPATH=$(flux env | grep PYTHONPATH | sed -E 's/.*PYTHONPATH="(.*)"/\1/'):$PWD/tests/plugins1:$PWD/tests/plugins2 OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 make tests
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ web-docs:
rm -rf docs/.generated
rm -rf docs/.web-build
git fetch --all --tags
PSIJ_WEB_DOCS=1 sphinx-multiversion docs docs/.web-build
PSIJ_WEB_DOCS=1 ${PYTHON} web/build-versions
PSIJ_WEB_DOCS=1 sphinx-build --keep-going -n -W -b html docs docs/.web-build/v/dev

.PHONY: web-docs-dev
Expand Down
13 changes: 13 additions & 0 deletions docs/_static/extras.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ $(document).ready(function() {
$("dl.attribute > dt.sig").each(function() {
$(this).prepend("<em class=\"attribute\"><span class=\"pre\">attribute</span><span class=\"w\"></span></em>");
});
// Parameters seem a bit messed up when using the typechecked decorator from
// typeguard
$("em.sig-param > .n > .pre").each(function() {
let text = $(this).text();
let ix = text.indexOf("=");
if (ix > 0) {
let name = text.substring(0, ix);
let rest = text.substring(ix + 1);
$(this).text(name);
$(this).parent().parent().append($("<span>").addClass("o").append($("<span>").addClass("pre").text("=")));
$(this).parent().parent().append($("<span>").addClass("default_value").append($("<span>").addClass("pre").text(rest)));
}
});
});

function detectAll(selectorType) {
Expand Down
99 changes: 49 additions & 50 deletions docs/api.tree
Original file line number Diff line number Diff line change
@@ -1,51 +1,50 @@
PSI/J Core
psij.Job
psij.JobSpec
psij.JobAttributes
psij.ResourceSpec
psij.ResourceSpecV1
psij.JobStatus
psij.JobState

Serialization
psij.serialize.Export
psij.serialize.Import

Miscellaneous
psij.utils
psij.version
psij.descriptor.Descriptor

Exceptions
psij.exceptions

Executors
"The concrete executor implementations provided by this version of PSI/J Python are:"

.. _available-executors:

+executors

Executor Infrastructure
psij.JobExecutor
psij.JobExecutorConfig
psij.executors.batch.batch_scheduler_executor
psij.executors.batch.batch_scheduler_executor.BatchSchedulerExecutor
psij.executors.batch.batch_scheduler_executor.BatchSchedulerExecutorConfig
~psij.executors.batch.batch_scheduler_executor.check_status_exit_code
psij.executors.batch.script_generator.SubmitScriptGenerator
psij.executors.batch.script_generator.TemplatedScriptGenerator
psij.executors.batch.template_function_library


Launchers

.. _available-launchers:

+launchers


Launcher Infrastructure
psij.Launcher
psij.launchers.script_based_launcher.ScriptBasedLauncher
The PSI/J API

PSI/J Core
psij.Job
psij.JobSpec
psij.JobAttributes
psij.ResourceSpec
psij.ResourceSpecV1
psij.JobStatus
psij.JobState

Serialization
psij.serialize.Export
psij.serialize.Import

Miscellaneous
psij.utils
psij.version
psij.descriptor.Descriptor

Exceptions
psij.exceptions

Executors
"The concrete executor implementations provided by this version of PSI/J Python are:"

.. _available-executors:

+executors

Executor Infrastructure
psij.JobExecutor
psij.JobExecutorConfig
psij.executors.batch.batch_scheduler_executor
psij.executors.batch.script_generator.SubmitScriptGenerator
psij.executors.batch.script_generator.TemplatedScriptGenerator
psij.executors.batch.template_function_library


Launchers

.. _available-launchers:

+launchers


Launcher Infrastructure
psij.Launcher
psij.launchers.script_based_launcher.ScriptBasedLauncher

91 changes: 57 additions & 34 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import os
from typing import List, Tuple

import subprocess

import docutils.nodes
import sphinx.domains.python
import sys

import sphinx_rtd_theme
from sphinx.ext.apidoc import main

web_docs = False
Expand All @@ -19,10 +20,9 @@
project = u'PSI/J'
copyright = u'The ExaWorks Team'
if web_docs:
html_theme = 'cloud'
html_theme = 'cloud'
else:
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_favicon = 'favicon.ico'
autoclass_content = 'both'
add_module_names = False
Expand All @@ -46,11 +46,6 @@
# so we can display that where the broken version would otherwise
# have appeared.
html_title = "PSI/J"
# Multi-version
smv_branch_whitelist = '^matchmeifyoucan$'
smv_remote_whitelist = None
smv_released_pattern = r'^\d+\.\d+\.\d+(\..*)?$'
smv_outputdir_format = 'v/{ref.name}'


html_sidebars = {'**': ['globaltoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html']}
Expand All @@ -62,21 +57,29 @@

# Setup Sphinx extensions (and associated variables)
extensions = [
'sphinx.ext.napoleon',
'sphinx.ext.autodoc',
'sphinx.ext.autodoc.typehints',
'sphinx.ext.napoleon',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.viewcode'
]

if web_docs:
extensions.append('sphinx_multiversion')

autodoc_typehints = "description"
autodoc_typehints_format = "short"
autodoc_default_options = {
'show-inheritance': True
}
autodoc_typehints_description_target = "documented"
autodoc_preserve_defaults = True
typehints_use_signature_return = True

if web_docs:
# properties and attributes before methods
from sphinx.ext import autodoc
autodoc.AttributeDocumenter.member_order = 40
autodoc.PropertyDocumenter.member_order = 40
autodoc.MethodDocumenter.member_order = 50


release = None
version = None
Expand All @@ -97,7 +100,7 @@ def read_version(docs_dir):
read_version(my_dir)

intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'python': (f'https://docs.python.org/3.8', None),
}

# -- Setup for Sphinx API Docs -----------------------------------------------
Expand All @@ -119,25 +122,7 @@ def run_apidoc(sphinx):
main(['-f', '-t', os.path.join(my_dir, '_sphinx'), '-o', output_path, src_dir])


# The following is a hack to allow returns in numpy style doctstrings to
# not duplicate the return type specified by the normal type hints.
# This was taken from https://github.com/svenevs/elba
# It was submitted as a patch to the napoleon extension. Unfortunately,
# it was rejected by the maintainers of napoleon
# (see https://github.com/sphinx-doc/sphinx/issues/7077).
def _consume_returns_section(self) -> List[Tuple[str, str, List[str]]]:
self._consume_empty()
desc_lines = []
while not self._is_section_break():
desc_lines.append(next(self._line_iter))

return [("", "", desc_lines)]

from sphinx.ext.napoleon.docstring import NumpyDocstring
NumpyDocstring._consume_returns_section = _consume_returns_section


# And this is for "More than one target found for cross-reference"
# This is for "More than one target found for cross-reference"
# See https://github.com/sphinx-doc/sphinx/issues/3866
from sphinx.domains.python import PythonDomain

Expand All @@ -157,7 +142,45 @@ def find_obj(self, env, modname, classname, name, type, searchmode=0):
else:
return orig_matches


def _check_children(node, recurse):
replace = {}
found = False
for i in range(len(node)):
item = node[i]
if found and isinstance(item, docutils.nodes.Text) and item.astext() == ')':
replace[i] = ''
if found and isinstance(item, docutils.nodes.Text) and item.astext() == ' -- ':
replace[i] = '\n'
para = docutils.nodes.paragraph()
for j in range(i + 1, len(node)):
para += node[j]
node.remove(node[j])
node += para

if isinstance(item, docutils.nodes.Text) and item.astext() == ' (':
replace[i] = ': '
found = True
if recurse and isinstance(item, docutils.nodes.list_item):
_check_children(item[0], False)

for i, t in replace.items():
node[i] = docutils.nodes.Text(t)


def make_field(self, types, domain, items, env = None, inliner = None, location = None):
field = self.make_field_prev(types, domain, items, env=env, inliner=inliner, location=location)
bodynode = field[1][0]
_check_children(bodynode, True)

return field


# launch setup
def setup(app):
app.add_domain(MyPythonDomain, override=True)
if web_docs:
sphinx.domains.python.PyTypedField.make_field_prev = sphinx.domains.python.PyTypedField.make_field
sphinx.domains.python.PyTypedField.make_field = make_field
app.connect('builder-inited', run_apidoc)

Loading
Loading