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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ Instructions: Add a subsection under `[Unreleased]` for additions, fixes, change

## [Unreleased]

### Fixed

- Better error detection and reporting in case `pretext deploy` is unsuccessful.
- Improved image zooming in HTML output
- Footnotes in printouts display correctly in HTML
- Long lists in printouts now break across pages correctly.


## [2.50.0] - 2026-08-24

Includes updates to core through commit: [5db49ad](https://github.com/PreTeXtBook/pretext/commit/5db49adcff964748dba917941936989e6ca9f09f)
Expand Down
2 changes: 1 addition & 1 deletion pretext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

VERSION = get_version("pretext", Path(__file__).parent.parent)

CORE_COMMIT = "5db49adcff964748dba917941936989e6ca9f09f"
CORE_COMMIT = "da96691159216f7aacab5cc88429ee60233b65b0"


def activate() -> None:
Expand Down
32 changes: 27 additions & 5 deletions pretext/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,15 +923,13 @@ def publish_to_ghpages(
log.info("")
log.info("Output committed to the `gh-pages` branch.")
return

# Otherwise we try to push to GitHub.
try:
origin.push(refspec=f"{repo.active_branch.name}:{repo.active_branch.name}")
origin.push(refspec="gh-pages:gh-pages")
except git.exc.GitCommandError as e: # type: ignore
def _report_push_failure(detail: str) -> None:
log.warning(
f"There was an issue connecting to GitHub repository located at {repo_url}\n"
)
log.debug(e, exc_info=True)
log.debug(detail)
log.info(
"Make sure you have set up authentication for GitHub. For more information, visit:"
)
Expand All @@ -949,6 +947,30 @@ def publish_to_ghpages(
)
log.info("")
log.error("Deploy was unsuccessful.")

try:
branch_push_result = origin.push(
refspec=f"{repo.active_branch.name}:{repo.active_branch.name}"
)
gh_push_result = origin.push(refspec="gh-pages:gh-pages", force=True)
except git.exc.GitCommandError as e: # type: ignore
_report_push_failure(str(e))
return
# `push()` does not raise on a rejected/failed push, so each `PushInfo`
# entry's flags must be checked explicitly for errors.
error_flags = (
git.PushInfo.ERROR # type: ignore
| git.PushInfo.REJECTED # type: ignore
| git.PushInfo.REMOTE_REJECTED # type: ignore
| git.PushInfo.REMOTE_FAILURE # type: ignore
)
push_errors = [
info.summary.strip()
for info in list(branch_push_result) + list(gh_push_result)
if info.flags & error_flags
]
if push_errors:
_report_push_failure("\n".join(push_errors))
return
log.info("")
log.info("Latest build successfully pushed to GitHub!\n")
Expand Down