Debian Codegraph @

docs/community/topics/manual-dev.md

raw
1 (manual-environment)=
2
3 # Set up a manual development environment
4
5 If you prefer not to use automation tools like `tox`, or want to have more control over the specific version of packages that you'd like installed,
6 you may set your local development environment manually.
7
8 To do so, follow the instructions on this page.
9
10 ## Create a new development environment
11
12 This is optional, but it's best to start with a fresh development environment so that you've isolated the packages that you're using for this repository.
13
14 To do so, use a tool like [conda](https://docs.conda.io/en/latest/), [mamba](https://github.com/mamba-org/mamba), or [virtualenv](https://virtualenv.pypa.io/).
15
16 ## Pre-requisites
17
18 Before you start, ensure that you have the following installed:
19
20 - Python >= 3.10
21 - [Pandoc](https://pandoc.org/): we use `nbsphinx` to support notebook (`.ipynb`) files in the documentation, which requires [installing Pandoc](https://pandoc.org/installing.html) at a system level (or within a Conda environment).
22
23 ## Clone the repository locally
24
25 First clone this repository from the `pydata` organization, or from a fork that you have created:
26
27 ```console
28 $ git clone https://github.com/pydata/pydata-sphinx-theme
29 $ cd pydata-sphinx-theme
30 ```
31
32 ## Install this theme locally
33
34 Next, install this theme locally so that we have the necessary dependencies to build the documentation and testing suite:
35
36 ```console
37 $ pip install -e ".[dev]"
38 ```
39
40 Note that the `sphinx-theme-builder` will automatically install a local copy of `nodejs` for building the theme's assets.
41 This will be placed in a `.nodeenv` folder.
42
43 ## Build the documentation
44
45 To manually build the documentation, run the following command:
46
47 ```console
48 $ sphinx-build docs docs/_build/html
49 ```
50
51 ## Compile web assets (JS/CSS)
52
53 To compile the JavaScript and CSS assets for the theme, run the following command:
54
55 ```console
56 $ stb compile
57 ```
58
59 This will compile everything in the `src/pydata_sphinx_theme/assets` folder and place them in the appropriate places in our theme's folder structure.
60
61 ## Start a live server to build and serve your documentation
62
63 To manually open a server to watch your documentation for changes, build them, and display them locally in a browser, run this command:
64
65 ```console
66 $ stb serve docs --open-browser
67 ```
68
69 ## Manually run the tests
70
71 To manually run the tests for this theme, first set up your environment locally, and then run:
72
73 ```console
74 $ pytest
75 ```