Skip to content

Commit

Permalink
gh-35460: Update developer guide for workflows on github
Browse files Browse the repository at this point in the history
<!-- Please provide a concise, informative and self-explanatory title.
-->
<!-- Don't put issue numbers in the title. Put it in the Description
below. -->
<!-- For example, instead of "Fixes #12345", use "Add a new method to
multiply two integers" -->

### 📚 Description

Our developer guide needs to be updated incorporating the new workflows
on GitHub. Here is the updated developer guide.

I know this needs more editing, but at least it reached the point where
other eyes would catch more errors, typos, and defects than mine alone.

So please examine the built documentation and report errors, typos, and
defects. If you think a major addition such as a new section is needed,
then please open a new PR that builds on this PR and provide your own
writing.

<!-- Describe your changes here in detail. -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes #12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x
]`. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- #12345: short description why this is a dependency
- #34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

URL: #35460
Reported by: Kwankyu Lee
Reviewer(s): Kwankyu Lee, Matthias Köppe, Sebastian Oehms, Tobias Diez
  • Loading branch information
Release Manager committed May 18, 2023
2 parents 4ed2157 + 4719a3f commit 8476c46
Show file tree
Hide file tree
Showing 43 changed files with 2,017 additions and 2,727 deletions.
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=fa8e9c79b0857a18d0a7e6cb12e191d465e21e39
md5=6b50e8ca9245b3b41d72335666036ce2
cksum=2566457121
sha1=896e4d369868e9f80990c64eb132b518cfba6688
md5=03ea0f45da8434f4a46fe4499af53b64
cksum=1394688091
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2d8444ddbd3ba506c88343ab73aa135f9ce2bf07
31658166a79ad3024f5f122fe5faf8fb33122ed6
6 changes: 3 additions & 3 deletions src/doc/en/a_tour_of_sage/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. _a-tour-of-sage:

==========================
Welcome to a Tour of Sage!
==========================
=========================
Welcome to a Tour of Sage
=========================

This is a tour of Sage that closely follows the tour of Mathematica
that is at the beginning of the Mathematica Book.
Expand Down
5 changes: 3 additions & 2 deletions src/doc/en/constructions/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
.. _constructions:

Welcome to the Sage Constructions!
==================================
=============================
Welcome to Sage Constructions
=============================

This document collects the answers to some questions along the line
"How do I construct ... in Sage?" Though much of this material can
Expand Down
28 changes: 14 additions & 14 deletions src/doc/en/developer/coding_basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ style conventions discussed in this chapter.

.. _section-coding-python:

Python Code Style
Python code style
=================

Follow the standard Python formatting rules when writing code for
Expand Down Expand Up @@ -90,7 +90,7 @@ In particular,

.. _chapter-directory-structure:

Files and Directory Structure
Files and directory structure
=============================

Roughly, the Sage directory tree is layout like this. Note that we use
Expand Down Expand Up @@ -193,7 +193,7 @@ search, but restricted to function definitions, while
docstrings for more information and more options.


Headings of Sage Library Code Files
Headings of Sage library code files
===================================

The top of each Sage code file should follow this format::
Expand Down Expand Up @@ -240,7 +240,7 @@ compatible, that is, less restrictive license (e.g. the BSD license).

.. _section-docstrings:

Documentation Strings
Documentation strings
=====================

.. _section-docstring-function:
Expand Down Expand Up @@ -473,7 +473,7 @@ information. You can use the existing functions of Sage as templates.
Note the trailing underscores which makes the citations into hyperlinks. See
below for more about the master bibliography file. For more about citations,
see the `Sphinx/reST markup for citations
<https://www.sphinx-doc.org/rest.html#citations>`_. For links to trac tickets
<https://www.sphinx-doc.org/rest.html#citations>`_. For links to GitHub issues and PRs
or wikipedia, see :ref:`chapter-sage_manuals_links`.

- A **TESTS** block (highly recommended).
Expand Down Expand Up @@ -771,7 +771,7 @@ there is not one already. That is, you can do the following:
.. _section-latex-typeset:

LaTeX Typesetting
LaTeX typesetting
-----------------

In Sage's documentation LaTeX code is allowed and is marked with **backticks**:
Expand Down Expand Up @@ -875,7 +875,7 @@ for details about how to add more macros.

.. _section-doctest-writing:

Writing Testable Examples
Writing testable examples
-------------------------

The examples from Sage's documentation have a double purpose:
Expand Down Expand Up @@ -983,7 +983,7 @@ written.

.. _section-further_conventions:

Special Markup to Influence Doctests
Special markup to influence doctests
------------------------------------

Overly complicated output in the example code can be shortened
Expand Down Expand Up @@ -1172,7 +1172,7 @@ framework. Here is a comprehensive list:

.. CODE-BLOCK:: rest
The following should yield 4. See :trac:`2`. ::
The following should yield 4. See :issue:`2`. ::
sage: 2+2 # optional - bug
5
Expand Down Expand Up @@ -1242,7 +1242,7 @@ further development on Sage.

.. _chapter-testing:

Running Automated Doctests
Running automated doctests
==========================

This section describes Sage's automated testing of test files of the
Expand All @@ -1257,7 +1257,7 @@ doctesting modules in the Sage library.

.. _section-testpython:

Testing .py, .pyx and .sage Files
Testing .py, .pyx and .sage files
---------------------------------

Run ``sage -t <filename.py>`` to test all code examples in
Expand All @@ -1282,7 +1282,7 @@ write for the documentation and have them work.
For more information, see :ref:`chapter-doctesting`.


Testing reST Documentation
Testing reST documentation
--------------------------

Run ``sage -t <filename.rst>`` to test the examples in verbatim
Expand Down Expand Up @@ -1325,7 +1325,7 @@ Sage.

.. _section-coding-general-whitespace:

General Coding Style Regarding Whitespace
General coding style regarding whitespace
=========================================

Use spaces instead of tabs for indentation. The only exception is for
Expand All @@ -1343,7 +1343,7 @@ If you use another editor, we recommend to configure it so you do not
add tabs to files. See :ref:`section-ide`.


Global Options
Global options
==============

Global options for classes can be defined in Sage using
Expand Down
8 changes: 4 additions & 4 deletions src/doc/en/developer/coding_in_cython.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ up-to-date information or check out the
to get started immediately.


Writing Cython Code in Sage
Writing cython code in Sage
===========================

There are several ways to create and build Cython code in Sage.
Expand Down Expand Up @@ -69,7 +69,7 @@ There are several ways to create and build Cython code in Sage.
Then run ``sage -b`` to rebuild Sage.


Attaching or Loading .spyx Files
Attaching or loading .spyx files
================================

The easiest way to try out Cython without having to learn anything
Expand Down Expand Up @@ -142,7 +142,7 @@ version with a type declaration, by changing ``def is2pow(n):`` to

.. _section-interrupt:

Interrupt and Signal Handling
Interrupt and signal handling
=============================

When writing Cython code for Sage, special care must be taken to ensure
Expand All @@ -152,7 +152,7 @@ Sage uses the `cysignals package </~https://github.com/sagemath/cysignals>`_
for this, see the `cysignals documentation <http://cysignals.readthedocs.org/>`_
for more information.

Unpickling Cython Code
Unpickling Cython code
======================

Pickling for Python classes and extension classes, such as Cython, is different.
Expand Down
8 changes: 4 additions & 4 deletions src/doc/en/developer/coding_in_other.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ In this chapter, we discuss interfaces between Sage and :ref:`PARI

.. _section-pari-library:

The PARI C Library Interface
The PARI C library interface
============================

Here is a step-by-step guide to adding new PARI functions to Sage. We
Expand Down Expand Up @@ -570,7 +570,7 @@ One more example (in addition to the one in the docstring):
((0, 1, 0), (1, 0, 0), (0, 0, 1))


Singular: Another Approach
Singular: another approach
==========================

There is also a more Python-like interface to Singular. Using this,
Expand Down Expand Up @@ -626,7 +626,7 @@ implemented in the Sage/Singular interface, whereas the code in the
previous section used only the barest minimum of that interface.


Creating a New Pseudo-TTY Interface
Creating a new pseudo-TTY interface
===================================

You can create Sage pseudo-tty interfaces that allow Sage to work with
Expand Down Expand Up @@ -708,7 +708,7 @@ dumps the user into an Octave interactive shell:
Use octave to compute a solution x to A*x = b, as a list.
INPUT:
- A -- mxn matrix A with entries in QQ or RR
- b -- m-vector b entries in QQ or RR (resp)
Expand Down
26 changes: 12 additions & 14 deletions src/doc/en/developer/coding_in_python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This chapter discusses some issues with, and advice for, coding in
Sage.


Python Language Standard
Python language standard
========================

Sage library code needs to be compatible with all versions of Python
Expand Down Expand Up @@ -45,7 +45,7 @@ using one of two mechanisms:
The Sage library declares these packages as dependencies and ensures that
versions that provide features of Python 3.11 are available.

Meta-ticket :trac:`29756` keeps track of newer Python features and serves
Meta :issue:`29756` keeps track of newer Python features and serves
as a starting point for discussions on how to make use of them in the
Sage library.

Expand All @@ -64,7 +64,7 @@ scratch. Try to figure out how your code should fit in with other Sage
code, and design it accordingly.


Special Sage Functions
Special sage functions
======================

Functions with leading and trailing double underscores ``__XXX__`` are
Expand Down Expand Up @@ -157,7 +157,7 @@ representing the object ``a``. Calling ``view(a)`` will display the
typeset version of this.


Print Representation
Print representation
--------------------

The standard Python printing method is ``__repr__(self)``. In Sage,
Expand Down Expand Up @@ -193,7 +193,7 @@ Here is an example of the ``_latex_`` and ``_repr_`` functions for the
return "\\pi"
Matrix or Vector from Object
Matrix or vector from object
----------------------------

Provide a ``_matrix_`` method for an object that can be coerced to a
Expand Down Expand Up @@ -232,7 +232,7 @@ will work for this object. The following is from the file
.. _section-preparsing:

Sage Preparsing
Sage preparsing
===============

To make Python even more usable interactively, there are a number of
Expand Down Expand Up @@ -307,7 +307,7 @@ In particular, the file ``preparse.py`` contains the Sage preparser
code.


The Sage Coercion Model
The Sage coercion model
=======================

The primary goal of coercion is to be able to transparently do
Expand Down Expand Up @@ -346,7 +346,7 @@ immutable later. See the file
``SAGE_ROOT/src/sage/structure/mutability.py``.


The __hash__ Special Method
The __hash__ special method
============================

Here is the definition of ``__hash__`` from the Python reference
Expand Down Expand Up @@ -474,7 +474,7 @@ Note that the syntax in ``except`` is to list all the exceptions that
are caught as a tuple, followed by an error message.


Integer Return Values
Integer return values
=====================

Many functions and methods in Sage return integer values.
Expand Down Expand Up @@ -585,8 +585,6 @@ by
return initialize_big_data()
Deprecation
===========

Expand All @@ -599,7 +597,7 @@ in the future. We call this a *deprecation*.
Deprecated code can only be removed one year after the first
stable release in which it appeared.

Each deprecation warning contains the number of the trac ticket that defines
Each deprecation warning contains the number of the GitHub PR that defines
it. We use 666 in the examples below. For each entry, consult the function's
documentation for more information on its behaviour and optional arguments.

Expand Down Expand Up @@ -672,7 +670,7 @@ documentation for more information on its behaviour and optional arguments.
deprecation(666, "Do not use your computer to compute 1+1. Use your brain.")
Experimental/Unstable Code
Experimental/unstable code
--------------------------

You can mark your newly created code (classes/functions/methods) as
Expand Down Expand Up @@ -720,7 +718,7 @@ reviewing process.
experimental_warning(66666, 'This code is not foolproof.')
Using Optional Packages
Using optional packages
=======================

If a function requires an optional package, that function should fail
Expand Down
4 changes: 2 additions & 2 deletions src/doc/en/developer/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
html_static_path = [] + html_common_static_path

# General information about the project.
project = "Developer's Guide"
project = "Developer Guide"

# The name for this set of Sphinx documents.
html_title = project
Expand All @@ -33,6 +33,6 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
latex_documents = [
('index', 'developer.tex', 'Developer\'s Guide',
('index', 'developer.tex', 'Developer Guide',
'The Sage Development Team', 'manual'),
]
Loading

0 comments on commit 8476c46

Please sign in to comment.