conf Module#

conf.add_all_subdirectories_to_path(root_dir: str | None = '/home/runner/work/python-programming/python-programming', excluded_dirs: list[str] = ['.git', '.github', '.idea', '.ipynb_checkpoints', '.pytest_cache', '.venv', '.virtual_documents', '.vscode', 'python-programming.egg-info', '__pycache__', 'build', 'docs', 'environments', 'examples', 'input', 'img', 'js', 'output', 'tests', 'third', 'source/_static', 'source/_templates', 'source/reports']) None[source]#

Recursively adds all subdirectories within the root directory to sys.path.

This is so that the .rst files and Sphinx can see modules in other directories.

Parameters:
  • root_dir (str) – The root directory to start searching from. Defaults to PROJECT_ROOT.

  • excluded_dirs (list, optional) – A list of directory names to exclude. Defaults to EXCLUDED_DIRS.

conf.clear_destination() None[source]#

Removes old copies from the destination folder.

Raises:

Exception – If the destination folder cannot be cleared.

conf.copy_notebooks() None[source]#

Walks through project directories and copies specified .ipynb files.

Raises:

Exception – If a file copy operation fails.

conf.import_notebooks() None[source]#

Executes the clear and copy process for Jupyter Notebooks to be included.

Clears the destination directory and then copies the specified notebooks.

conf.is_included_notebook(filename: str) bool[source]#

Checks if a file is a specified Jupyter Notebook.

Parameters:

filename (str) – The name of the file to check.

Returns:

True if the file is in INCLUDED_NOTEBOOKS, False otherwise.

Return type:

bool

conf.main() None[source]#

Sets up working directories and imports notebooks.

This is the main entry point for the custom configuration logic in conf.py.

conf.should_skip_directory(directory: str) bool[source]#

Checks if a directory should be skipped based on EXCLUDED_DIRS.

Parameters:

directory (str) – The directory name to check.

Returns:

True if the directory should be skipped, False otherwise.

Return type:

bool