Skip to content

Modernize build setup for Julia 1.10 + TeX Live 2025+#37

Open
duncaneddy wants to merge 2 commits intomasterfrom
de/update_setup
Open

Modernize build setup for Julia 1.10 + TeX Live 2025+#37
duncaneddy wants to merge 2 commits intomasterfrom
de/update_setup

Conversation

@duncaneddy
Copy link

@duncaneddy duncaneddy commented Mar 8, 2026

Description

There are a number of issues trying to setup a current version of this repo while it doesn't compile and run from initial checkout currently. Although discussed in #30 the packages and setup used have incompatibilities with current versions of Weave.jl and julia itself. Although this PR does not fully address the issues of modernizing/fixing the required dependencies, it does pin the required packages to ensure that it can be easily, and reproducibly installed.

Additionally, this PR modernizes the build system to use just and creates a one-command setup setup making it even easier to setup this package. Users can now just run just setup && just compile to get started with current package management tooling (juliaup, uv, TeX Live 2025+).

Changelog

Added

  • README.md — prerequisites now list juliaup + Julia 1.10; setup simplified to just setup; removed stale notes about pythontex 0.18 and Pygments 2.6.1

Changed

  • Move from makefile to justfile to avoid using a build-system tool for command execution.
  • Pin Julia 1.10 via juliaup (julia +1.10) — Weave.jl (used by PythonTeX's juliaconsole engine) depends on Highlights.jl, which is incompatible with Julia 1.12+
  • Add [compat] section to Project.toml — pins Julia 1.10 and package version bounds for reproducible installs
  • Regenerate Manifest.toml for Julia 1.10 with modern package versions
  • Bump local pythontex.sty from v0.18 to v0.19 — matches the script version shipped with TeX Live 2025+
  • Use -interaction=nonstopmode for lualatex — tufte-latex v3.5.2 emits non-fatal @iiminipage warnings with modern LaTeX kernels; the PDF is still produced correctly
  • Run pythontex via .venv/bin/python with --interpreter "julia:julia +1.10" — ensures custom Pygments lexer/style are available and Julia 1.10 is used
  • Consolidate submodule initgit submodule update --init replaces separate init + update commands
  • .gitignore — added .venv/

Fixed

  • Custom Julia Pygments lexer — replaced removed pygments.util.unirange import with inlined Unicode range, fixing compatibility with Pygments 2.7+ (in Fix unirange import pygments-julia#11)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the build setup for tufte_algorithms_book, addressing the issue (#30) of broken builds due to incompatibilities between modern Python (Pygments 2.7+) and the custom Julia Pygments lexer, and between modern Julia versions and Weave.jl. The PR pins Julia to 1.10, bumps the vendored pythontex.sty to v0.19, migrates from makefile to a justfile, introduces a uv-managed Python virtual environment, and adds a [compat] section to Project.toml.

Changes:

  • Introduces Justfile with setup, compile, chapter, test, and clean recipes replacing the old makefile
  • Updates Project.toml with a [compat] section and regenerates Manifest.toml for Julia 1.10
  • Bumps pythontex.sty from v0.18 to v0.19 and updates README.md

Reviewed changes

Copilot reviewed 3 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Justfile New just-based command runner replacing makefile, with setup/compile/test/clean targets
README.md Modernized prerequisites (juliaup, uv, just) and updated usage instructions
Project.toml Added [compat] section pinning Julia 1.10 and package version bounds
Manifest.toml Regenerated for Julia 1.10 with updated package versions
pythontex.sty Version bumped from v0.18 to v0.19 to match TeX Live 2025+
.gitignore Added .venv/ to ignored paths

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# the PDF is still produced correctly.
compile: pull-code _ensure-venv
-lualatex -interaction=nonstopmode book
.venv/bin/python "$(which pythontex)" --interpreter "julia:julia +1.10" book
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The $(which pythontex) invocation will silently produce an empty string if pythontex is not found on the system PATH (e.g., under a non-standard TeX Live installation). In that case, the command reduces to .venv/bin/python "", which fails with a confusing error like can't open file ''. Consider using command -v pythontex with an explicit error check, or documenting that pythontex must be accessible via PATH after TeX Live installation. The same issue exists on line 25.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants