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-documentationsudo apt install python3.10-venv
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txtTo learn more, see: Creating a virtual environment (PyCharm)
pip3 checkNote: 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-upgradeBuild the documentation
make html
# or
sphinx-build -b html . _build/Clean build
make clean htmlView 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/htmlNote:
- If the
index.htmlis launched then the web browser (local) full path will behttp:// localhost:63342/documentation/_build/html/index.htmlwhere63342is the port number.- Server will start at http://127.0.0.1:8000 with port
8000by default unless specified otherwise.
Enable spell checking
sphinx-build -b spelling html/_source _buildNote: 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 htmlinternalAuto-build and serve
sphinx-autobuild --port=8002 --open-browser ./ _buildinternal/htmlView browser
-
To view the web browser, locate and manually open the
index.htmlfile 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 _staticNote: 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 makeNote: This installs the
makeutility, 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 -9Note:
8002is 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-2brew update
brew install enchantNote: 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-reinstallbrew update
brew install enchantNote: 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 lxmlin 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-reinstallNote:
- This fix downgrades the
sphinxcontrib.spellingpackage by forcing reinstall ofsphinxcontrib.spellingpackage so that it is assigned to the correct OS architecture.- To find the version of the currently installed
sphinxcontrib.spellingpackage, 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.txtNote: This deletes the
venvdirectory file (if it exists) from the project directory then, recreates thevenvvirtual environment and install the requirements.