Skip to content

Reconcile environment for development and docs building #717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Apr 21, 2024
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
18 changes: 6 additions & 12 deletions doc/dev_start_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,9 @@ create a virtual environment in the project directory:

.. code-block:: bash

conda env create -n pytensor-dev -f environment.yml
conda env create -f environment.yml
conda activate pytensor-dev

Afterward, you can install the development dependencies:

.. code-block:: bash

pip install -r requirements.txt

Next, ``pre-commit`` needs to be configured so that the linting and code quality
checks are performed before each commit:

Expand All @@ -202,20 +196,20 @@ see the `NumPy development guide <https://numpy.org/doc/stable/dev/>`_.
Contributing to the documentation
---------------------------------

To contribute to the documentation, first follow the instructions in the previous section. Afterward, you can install the documentation dependencies in the virtual environment you created:

The documentation build dependencies have also been included in the virtual environment you created. You can also create a separate virtual environment just for the documentation using the `environment.yml` file located inside the `doc` folder.

.. code-block:: bash

pip install -r requirements-rtd.txt
conda env create -f doc/environment.yml
conda activate pytensor-docs


You can now build the documentation from the root of the project with:


.. code-block:: bash

python doc/scripts/docgen.py
python -m sphinx -b html ./doc ./html


Afterward, you can go to `html/index.html` and navigate the changes in a browser. One way to do this is to go to the `html` directory and run:
Expand All @@ -226,7 +220,7 @@ Afterward, you can go to `html/index.html` and navigate the changes in a browser
python -m http.server

**Do not commit the `html` directory. The documentation is built automatically.**

For more documentation customizations such as different formats e.g., PDF, refer to the `Sphinx documentation <https://www.sphinx-doc.org/en/master/usage/builders/index.html>`_.

Other tools that might help
===========================
Expand Down
2 changes: 1 addition & 1 deletion doc/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
- sphinx>=5.1.0,<6
- mock
- pillow
- pymc-sphinx-theme
- pip
- pip:
- git+https://github.com/pymc-devs/pymc-sphinx-theme
- -e ..
111 changes: 0 additions & 111 deletions doc/scripts/docgen.py

This file was deleted.

1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies:
- pygments
- pydot
- ipython
- pymc-sphinx-theme
# code style
- ruff
# developer tools
Expand Down
Loading