The Collaborative OPen Omics (COPO) documentation is created using the Sphinx reStructuredText (reST) markup language and is hosted on ReadThedocs.io. It provides a comprehensive overview of the platform, including visual guides, usage instructions, answers to frequently asked questions, and guidance on how to make necessary metadata submissions.
The documentation is available at http://copo-docs.rtfd.io or http://copo-docs.readthedocs.io.
You can access the COPO website at https://copo-project.org and its GitHub repository at https://github.com/TGAC/COPO-production.
For more information about Sphinx, see the Don’t Be Afraid to Commit guide.
- Getting Started 🚀
- PyCharm Configuration (Optional) ⚙️
- Updating Packages 🔄
- Building the Documentation Locally 🧪
- Common Issues and Fixes 🐞
- Publishing to ReadTheDocs 📦
git clone https://github.com/TGAC/COPO-documentation.git
cd COPO-documentation
sudo apt install python3.10-venv
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
To learn more, see: Creating a virtual environment (PyCharm)
pip3 check
Note: This command checks for broken dependencies in the installed packages. If there are any issues, you may need to resolve them before proceeding.
To use PyCharm’s Sphinx task runner:
- Go to Add New Configuration > Python docs
- Select Sphinx task
- Fill in the configuration:
- Command:
html
- Input:
<path to the documentation root directory>
- Output:
<path to _build/html>
- Python interpreter:
<path to the Python virtual environment>
- Working directory:
<path to the documentation root>
- Command:
More information: Run/debug configurations in PyCharm
To update the packages in the requirements.txt
file, use pip-upgrader
which allows packages to be updated interactively.
pip3 install pip-upgrader
cd COPO-documentation
pip-upgrade
Build the documentation
make html
# or
sphinx-build -b html . _build/
Clean build
make clean html
View the docs locally by opening _build/html/index.html
in a browser, or use the following commands
sphinx-autobuild --open-browser ./ _build/html
# or
make htmllive
# or with a port
sphinx-autobuild --port=8002 --open-browser ./ _build/html
Note:
- If the
index.html
is launched then the web browser (local) full path will behttp:// localhost:63342/documentation/_build/html/index.html
where63342
is the port number.- Server will start at http://127.0.0.1:8000 with port
8000
by default unless specified otherwise.
Enable spell checking
sphinx-build -b spelling html/_source _build
Note: This renders the project locally with spell checker enabled
To build internal docs
make htmlinternal
# or
sphinx-build -b html . _buildinternal/
Clean and build
make clean htmlinternal
Auto-build and serve
sphinx-autobuild --port=8002 --open-browser ./ _buildinternal/html
View browser
-
To view the web browser, locate and manually open the
index.html
file located at_buildinternal/html/index.html
-
To view the web browser (local) full path will be:
http://localhost:63342/documentation/_buildinternal/html/index.html
WARNING: html_static_path entry '_static' does not exist
Fix:
mkdir _static
Note: This creates the _static
folder in the documentation root directory, which is required for static files used by Sphinx.
bash: make: command not found
Fix:
sudo apt install make
Note: This installs the
make
utility, which is required to build the documentation.
OSError: [Errno 98] Address already in use
Fix:
sudo lsof -i TCP:8002 | grep LISTEN | awk '{print $2}' | xargs kill -9
Note:
8002
is the port number. The solution above will kill the process running on that port.
NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'
Fix:
sudo apt-get install enchant-2
brew update
brew install enchant
Note: Install Homebrew before running the Mac commands. The fixes describe how to install Enchant C library
Extension error: Could not import extension sphinxcontrib.email (exception: dlopen(~/site-packages/lxml/etree.cpython-39-darwin.so, 0x0002): (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')))
Fix:
pip3 install lxml==5.2.2 --compile --force-reinstall
brew update
brew install enchant
Note: Force reinstall lxml package so that it is assigned to the correct OS architecture. To find the version of the currently installed lxml package, run
pip3 show lxml
in the terminal. The version is displayed by the Version.
Could not import extension sphinxcontrib.spelling (exception: The 'enchant' C library was not found and maybe needs to be installed)
Fix:
pip3 install sphinxcontrib.spelling==7.7.0 --compile --force-reinstall
Note:
- This fix downgrades the
sphinxcontrib.spelling
package by forcing reinstall ofsphinxcontrib.spelling
package so that it is assigned to the correct OS architecture.- To find the version of the currently installed
sphinxcontrib.spelling
package, run -pip3 show sphinxcontrib.spelling
. The version is displayed by the Version.
Requirements are not installing or old package versions are still being recognised despite being upgraded
Fix:
rm -rf venv
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
Note: This deletes the
venv
directory file (if it exists) from the project directory then, recreates thevenv
virtual environment and install the requirements.