Skip to content

Instantly share code, notes, and snippets.

@marble
Created January 28, 2020 14:09
Show Gist options
  • Save marble/287899cf6cacb6bf0ebac520a0432d06 to your computer and use it in GitHub Desktop.
Save marble/287899cf6cacb6bf0ebac520a0432d06 to your computer and use it in GitHub Desktop.
How to build and test the sphinx_typo3_theme locally
# mb, 2020-01-28, 2020-01-28
# MIT license
# go to the sphinx_typo3_theme
# 1. grunt clean
# 2. grunt default
# 3. python3 setup.py sdist bdist_wheel
# Find the final package:
theme_package=/home/user/Repositories/github.com/TYPO3-Documentation/sphinx_typo3_theme/dist/sphinx_typo3_theme-4.0.3.dev12+g903f566.tar.gz
# Fulfill system requirements: python3, pip, pipenv
# For example:
pip install --upgrade --user pip
pip install --upgrade --user pipenv
# 'pipenv' is the new and better 'pip'. It handles lockfiles and virtual environments.
# start with an empty dir
➜ ~ mkdir temp
➜ ~ cd temp
# pipenv will use a '.venv' dir automatically
➜ temp mkdir .venv
# create venv
➜ temp pipenv --three
# launch a subshell with the new environment
➜ temp pipenv shell
# install the theme package
(temp) ➜ temp pipenv install "$theme_package"
# test the import
# THIS is the MAJOR test that should be done
# It should work with Python2 and Python3
(temp) ➜ temp python3 -c "import sphinx_typo3_theme"
# __version__ should be set
(temp) ➜ temp python -c "import sphinx_typo3_theme; print (sphinx_typo3_theme.__version__)"
4.0.3
# theme_info should be set
(temp) ➜ temp python -c "import sphinx_typo3_theme; print (sphinx_typo3_theme.theme_info)"
{'theme_name': 'sphinx_typo3_theme', 'theme_version_build': 'g903f566', 'theme_version_core': '4.0.3', 'theme_version_pre_release': 'dev12', 'theme_version_scm': '4.0.3.dev12+g903f566'}
# ######################################################################################
# showing everything here
# ######################################################################################
➜ ~ mkdir temp
➜ ~ cd temp
➜ temp mkdir .venv
➜ temp pipenv --three
Creating a virtualenv for this project…
Pipfile: /home/marble/temp/Pipfile
Using /usr/bin/python3 (3.6.9) to create virtualenv…
⠴ Creating virtual environment...Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/marble/temp/.venv/bin/python3
Also creating executable in /home/marble/temp/.venv/bin/python
Installing setuptools, pip, wheel...done.
✔ Successfully created virtual environment!
Virtualenv location: /home/marble/temp/.venv
Creating a Pipfile for this project…
➜ temp pipenv shell
Launching subshell in virtual environment…
. /home/marble/temp/.venv/bin/activate
# source /home/marble/.dockrun/dockrun_t3rd/shell-commands.sh
This function is now defined FOR THIS terminal window to run 2.5.0-dev:
dockrun_t3rd
➜ temp . /home/marble/temp/.venv/bin/activate
(temp) ➜ temp theme_package=/home/marble/Repositories/github.com/TYPO3-Documentation/sphinx_typo3_theme/dist/sphinx_typo3_theme-4.0.3.dev12+g903f566.tar.gz
(temp) ➜ temp pipenv install "$theme_package"
Installing /home/marble/Repositories/github.com/TYPO3-Documentation/sphinx_typo3_theme/dist/sphinx_typo3_theme-4.0.3.dev12+g903f566.tar.gz…
Adding sphinx-typo3-theme to Pipfile's [packages]…
✔ Installation Succeeded
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (8351a9)!
Installing dependencies from Pipfile.lock (8351a9)…
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 1/1 — 00:00:01
(temp) ➜ temp python3 -c "import sphinx_typo3_theme"
(temp) ➜ temp python3 -c "import sphinx_typo3_theme; print(sphinx_typo3_theme.__version__)"
4.0.3
(temp) ➜ temp python3 -c "import sphinx_typo3_theme; print(sphinx_typo3_theme.theme_info)"
{'theme_name': 'sphinx_typo3_theme', 'theme_version_build': 'g903f566', 'theme_version_core': '4.0.3', 'theme_version_pre_release': 'dev12', 'theme_version_scm': '4.0.3.dev12+g903f566'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment