Eloi Torrents 4d7c1a1d12 init
2025-09-21 14:46:51 +02:00

990 B
Raw Blame History

SageMath Package Template

A lightweight template that shows how to structure a SageMath package and ship a couple of runnable demos.

Quick start

  • Install the package in editable mode with sage -pip install -e .
  • Run the elliptic curve demo: sage -python elliptic_curve_demo.py

Just shortcuts

  • just prepare create the Sage-aware virtualenv and install the package editable
  • just run execute the elliptic curve demo inside that virtualenv
  • just test run the unit tests with Sage's Python

Running tests

Use Sage's Python so Sage-specific imports resolve correctly when you run the bundled unittest suite:

sage -python -m unittest discover -s tests -t .

Project layout

  • demo_package/ minimal package source code
  • elliptic_curve_demo.py Python entry point using SageMath
  • tests/ example unittest-based tests

Feel free to copy this template, rename the package, and extend the demos for your own SageMath projects.