Skip to content

Commit 7639e84

Browse files
committed
docs/contrib: begin writing a contribution guide.
1 parent 1826fa8 commit 7639e84

File tree

2 files changed

+89
-0
lines changed

2 files changed

+89
-0
lines changed

docs/contrib.rst

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
Contributing
2+
############
3+
4+
The Amaranth project is a collective work of many people collaborating over the years, and it would not be the same without everyone's unique perspectives and contributions. We're glad that you are considering joining us! This page will guide you through some of the ways to contribute.
5+
6+
.. warning::
7+
8+
This page is a work in progress!
9+
10+
11+
Working with the codebase
12+
=========================
13+
14+
15+
Preparing the environment
16+
-------------------------
17+
18+
The Amaranth codebase uses PDM_ to structure the development workflow. Please `install PDM`_ first. Once you have done so, run:
19+
20+
.. _PDM: https://pdm.fming.dev/
21+
.. _install PDM: https://pdm.fming.dev/latest/#recommended-installation-method
22+
23+
.. code-block:: console
24+
25+
$ pdm install --dev
26+
27+
This command creates a :ref:`virtual environment <python:tut-venv>` located at ``./.venv/`` and installs the runtime dependencies of Amaranth as well as the necessary development tools in it.
28+
29+
Amaranth itself is installed in the *editable mode*, meaning that the changes to its source files are immediately reflected in running the tests and documentation. However, other changes (addition or removal of source files, or changes to dependencies) will not be picked up, and it is a good habit to run ``pdm install`` each time after updating the source tree.
30+
31+
32+
Running the testsuite
33+
---------------------
34+
35+
Some of the tests make use of `formal methods`_, and to run the complete testsuite, it is necessary to install the Yosys_ frontend and the yices2_ SMT solver. These are distributed as a part of the `OSS CAD Suite`_. Without the tools being installed, the tests that rely on formal verification will be skipped.
36+
37+
.. _formal methods: https://symbiyosys.readthedocs.io/en/latest/
38+
.. _Yosys: https://github.com/YosysHQ/yosys
39+
.. _yices2: https://github.com/SRI-CSL/yices2
40+
.. _OSS CAD Suite: https://github.com/YosysHQ/oss-cad-suite-build
41+
42+
To run the testsuite, use:
43+
44+
.. code-block:: console
45+
46+
$ pdm run test
47+
48+
49+
Building the documentation
50+
--------------------------
51+
52+
To build the documentation once, use:
53+
54+
.. code-block:: console
55+
56+
$ pdm run document
57+
58+
The documentation index is located at ``./docs/_build/index.html``.
59+
60+
Working on documentation usually involves making many small, iterative changes, and it is laborous to rebuild it manually each time. To start a process that rebuilds documentation automatically on change, use:
61+
62+
.. code-block:: console
63+
64+
$ pdm run document-live
65+
66+
While it is running you can browse the documentation at `https://127.0.0.1:8000 <https://127.0.0.1:8000>`_. The edits you make are reflected on the document open in the browser after a short delay. It is useful to keep an eye on the terminal where this process is running, as the information about syntactic errors, missing references, and other issues will be printed there.
67+
68+
Occasionally, the documentation builder will persist in rendering an incorrect or outdated version of the contents of a Python source file. To fix this, run:
69+
70+
.. code-block:: console
71+
72+
$ pdm run document-live -a
73+
74+
75+
Contributing your changes
76+
=========================
77+
78+
.. todo::
79+
80+
Write this section
81+
82+
83+
Proposing new features
84+
======================
85+
86+
.. todo::
87+
88+
Write this section

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ Language & toolchain
1616
stdlib
1717
platform
1818
changes
19+
contrib

0 commit comments

Comments
 (0)