define_01_paths¶
Enumeration of important paths on local file system.
- class pywf_internal_proprietary.define_01_paths.PyWfPaths[source]¶
Namespace class for accessing important paths.
- get_path_venv_bin_cli(cmd: str) Path[source]¶
Get the path of a command in virtualenv bin folder.
Example:
${dir_project_root}/.venv/bin/${cmd}
- property path_venv_bin_python: Path¶
The python executable in virtualenv.
Example:
${dir_project_root}/.venv/bin/python
- property path_venv_bin_pip: Path¶
The pip command in virtualenv.
Example:
${dir_project_root}/.venv/bin/pip
- property path_venv_bin_pytest: Path¶
The pytest command in virtualenv.
Example:
${dir_project_root}/.venv/bin/pytest
- property path_venv_bin_sphinx_build: Path¶
The sphinx-build executable in virtualenv.
Example:
${dir_project_root}/.venv/bin/sphinx-build
- property path_venv_bin_bin_jupyter: Path¶
The jupyter executable in virtualenv.
Example:
${dir_project_root}/.venv/bin/jupyter
- get_path_dynamic_bin_cli(cmd: str) Path[source]¶
Search multiple locations to get the absolute path of the CLI command. It searches the following locations in order:
the bin folder in virtualenv.
the global Python’s bin folder.
Then use the raw command name (string) as the path.
Example:
${dir_project_root}/.venv/bin/${cmd}or${global_python_bin}/${cmd}
- property path_bin_virtualenv: Path¶
The virtualenv CLI command path.
Example:
${dir_project_root}/.venv/bin/virtualenv
- property path_bin_poetry: Path¶
The poetry CLI command path.
Example:
${dir_project_root}/.venv/bin/poetry
- property path_bin_twine: Path¶
The twine CLI command path.
Example:
${dir_project_root}/.venv/bin/twine
- property dir_python_lib: Path¶
The current Python library directory.
Example:
${dir_project_root}/${package_name}
- property path_version_py: Path¶
Path to the
_version.pyfile where the package version is defined.Example:
${dir_project_root}/${package_name}/_version.py
- property dir_htmlcov: Path¶
The code coverage test results HTML output folder.
Example:
${dir_project_root}/htmlcov
- property path_htmlcov_index_html: Path¶
The code coverage test results HTML file.
Example:
${dir_project_root}/htmlcov/index.html
- property dir_sphinx_doc_source: Path¶
Sphinx docs source code folder.
Example:
${dir_project_root}/docs/source
- property dir_sphinx_doc_source_conf_py: Path¶
Sphinx docs
conf.pyfile path.Example:
${dir_project_root}/docs/source/conf.py
- property dir_sphinx_doc_source_python_lib: Path¶
The generated Python library API reference Sphinx docs folder.
Example:
${dir_project_root}/docs/source/${package_name}
- property dir_sphinx_doc_build: Path¶
The temp Sphinx doc build folder.
Example: ``${dir_project_root}/docs/build
- property dir_sphinx_doc_build_html: Path¶
The built Sphinx doc build HTML folder.
Example: ``${dir_project_root}/docs/build/html
- property path_sphinx_doc_build_index_html: Path¶
The built Sphinx doc site entry HTML file path.
Example: ``${dir_project_root}/docs/build/html/index.html or README.html
- property path_requirements: Path¶
The requirements.txt file path.
Example:
${dir_project_root}/requirements.txt
- property path_requirements_dev: Path¶
The requirements-dev.txt file path.
Example:
${dir_project_root}/requirements-dev.txt
- property path_requirements_test: Path¶
The requirements-test.txt file path.
Example:
${dir_project_root}/requirements-test.txt
- property path_requirements_doc: Path¶
The requirements-doc.txt file path.
Example:
${dir_project_root}/requirements-doc.txt
- property path_requirements_automation: Path¶
The requirements-automation.txt file path.
Example:
${dir_project_root}/requirements-automation.txt
- property path_poetry_lock: Path¶
The poetry.lock file path.
Example:
${dir_project_root}/poetry.lock
- property path_poetry_lock_hash_json: Path¶
The poetry-lock-hash.json file path. It is the cache of the poetry.lock file hash.
Example:
${dir_project_root}/poetry-lock-hash.json
- property path_pyproject_toml: Path¶
The pyproject.toml file path.
Example:
${dir_project_root}/pyproject.toml
- property dir_build: Path¶
The build folder for Python or artifacts build.
Example:
${dir_project_root}/build
- property dir_dist: Path¶
The dist folder for Python package distribution (.whl file).
Example:
${dir_project_root}/dist
- property path_github_token_file: Path¶
Create GitHub token in https://github.com/settings/tokens and put the token at
${HOME}/.github/${github_account}/pac/${github_token_name}.txt
- property path_codecov_token_file: Path¶
Create Codecov token in https://app.codecov.io/account/gh/${codecov_account}/access and put the token at
${HOME}/.codecov/github/${codecov_account}/${codecov_token_name}.txtNote
If you use Github to login, then codecov_account is your github_account.
- property path_cloudflare_token_file: Path¶
Create CloudFlare User API token in https://dash.cloudflare.com/profile/api-tokens Give it the following permission:
All accounts - Cloudflare Pages:Read, Cloudflare Pages:Edit
All users - Memberships:Read, User Details:Read
And put the token at
${HOME}/.cloudflare/${cloudflare_account_alias}/{cloudflare_pages_token_name}.txt
- property path_bin_aws: Path¶
The AWS CLI executable path.
Example:
${dir_project_root}/.venv/bin/aws
- property path_bin_wrangler: Path¶
The Cloudflare wrangler CLI command path.
Suggestion:
mkdir ${HOME}/.npm-tools cd ${HOME}/.npm-tools npm install wrangler --save-dev