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
2 changes: 1 addition & 1 deletion pretext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
VERSION = get_version("pretext", Path(__file__).parent.parent)


CORE_COMMIT = "c750a05a2c35cad67dd269682e1618e3c1eb63dc"
CORE_COMMIT = "acd359af3ce3476249f3a81d14dc93f5dd7ae61e"


def activate() -> None:
Expand Down
21 changes: 13 additions & 8 deletions scripts/bundle_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@
import shutil
import re
import json
import urllib.request
from pathlib import Path
from pretext import VERSION
from pretext.constants import PROJECT_RESOURCES


def resource_hashes() -> None:
# Get version of the pretext-docker image:
docker_version_url = "https://raw.githubusercontent.com/PreTeXtBook/pretext-docker/refs/heads/main/version.txt"
with urllib.request.urlopen(docker_version_url) as response:
docker_version = response.read().decode().strip()
print(f"pretext-docker version: {docker_version}")

# Load current hash table
if (Path("pretext") / "resources" / "resource_hash_table.json").exists():
with open(Path("pretext") / "resources" / "resource_hash_table.json", "r") as f:
Expand All @@ -30,17 +37,15 @@ def resource_hashes() -> None:
for line in lines:
if "This file was automatically generated" in line:
# replace the version number with {VERSION}:
new_line = re.sub(r"PreTeXt {VERSION}", f"PreTeXt {VERSION}", line)
f.write(new_line)
elif '"image": "pretextbook/pretext' in line:
new_line = re.sub(
r"PreTeXt \d+\.\d+\.\d+", f"PreTeXt {VERSION}", line
r'("image": "pretextbook/pretext(-full)?):latest"',
rf'\1:{docker_version}"',
line,
)
f.write(new_line)
# elif '"image": "oscarlevin/pretext' in line:
# new_line = re.sub(
# r'("image": "oscarlevin/pretext(-full)?):latest"',
# rf'\1:{VERSION}"',
# line,
# )
# f.write(new_line)
else:
f.write(line)
# Now hash the updated file to add to a hash-table for this version
Expand Down
2 changes: 1 addition & 1 deletion templates/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was automatically generated with PreTeXt 2.19.4.
# This file was automatically generated with PreTeXt {VERSION}.
# If you modify this file, PreTeXt will no longer automatically update it.
#
# Boilerplate list of files in a PreTeXt project for git to ignore
Expand Down
2 changes: 1 addition & 1 deletion templates/codechat_config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was automatically generated with PreTeXt 2.19.4.
# This file was automatically generated with PreTeXt {VERSION}.
# If you modify this file, PreTeXt will no longer automatically update it.
#
#############################################################
Expand Down
6 changes: 3 additions & 3 deletions templates/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was automatically generated with PreTeXt 2.19.3.
// This file was automatically generated with PreTeXt {VERSION}.
// If you modify this file, PreTeXt will no longer automatically update it.
//
//////////////////////////////////////////////////////////////
Expand All @@ -13,9 +13,9 @@
//
///////////////////////////////////////////////////////////////
{
"image": "oscarlevin/pretext-full", // uses latest image from https://hub.docker.com/r/oscarlevin/pretext-full/tags
"image": "pretextbook/pretext-full:latest", // uses latest image from https://hub.docker.com/r/PreTeXtBook/pretext-full/tags
// If you don't need sagemath, you can use a smaller base image. Comment out the line above and uncomment the line below to use a smaller image.
// "image": "oscarlevin/pretext",
// "image": "pretextbook/pretext:latest",
"features": {"ghcr.io/devcontainers/features/github-cli": {}},

// The pretext-full image above includes pretext, prefigure, and enough parts of latex and sagemath for most cases. If there are errors with sage, you can install the full sagemath package through Conda by running ./.devcontainer/installSage.sh, or uncommenting that line and rebuilding the container.
Expand Down
2 changes: 1 addition & 1 deletion templates/installPandoc.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# This file was automatically generated with PreTeXt 2.19.4.
# This file was automatically generated with PreTeXt {VERSION}.
# If you modify this file, PreTeXt will no longer automatically update it.

wget https://github.com/jgm/pandoc/releases/download/3.6.4/pandoc-3.6.4-1-amd64.deb -O pandoc.deb
Expand Down
2 changes: 1 addition & 1 deletion templates/installSage.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# This file was automatically generated with PreTeXt 2.19.4.
# This file was automatically generated with PreTeXt {VERSION}.
# If you modify this file, PreTeXt will no longer automatically update it.

# Conda should already be installed in the codespace. We need to add the conda-forge channel
Expand Down
2 changes: 1 addition & 1 deletion templates/pretext-cli.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was automatically generated with PreTeXt 2.23.1.
# This file was automatically generated with PreTeXt {VERSION}.
# If you modify this file, PreTeXt will no longer automatically update it.
#
# This workflow file can be used to automatically build a project and create
Expand Down
2 changes: 1 addition & 1 deletion templates/pretext-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was automatically generated with PreTeXt 2.19.4.
# This file was automatically generated with PreTeXt {VERSION}.
# If you modify this file, PreTeXt will no longer automatically update it.
#

Expand Down
2 changes: 1 addition & 1 deletion templates/project.ptx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This file was automatically generated by PreTeXt 2.19.4. -->
<!-- This file was automatically generated by PreTeXt {VERSION}. -->
<!-- If you modify this file, PreTeXt will no longer automatically update it.-->

<!-- This file, the project manifest, provides the overall configuration for your PreTeXt project. To edit the content of your document, open `source/main.ptx`. See https://pretextbook.org/doc/guide/html/processing-CLI.html#cli-project-manifest. -->
Expand Down