pyproject
dev_tool.config.pyproject
log = logging.getLogger(__name__)
module-attribute
PyprojectConfig
A class for managing pyproject.toml configuration.
This class provides methods for loading, parsing, and retrieving settings from the pyproject.toml file.
The constructor for the PyprojectConfig class.
This method initializes an empty configuration dictionary.
Source code in dev_tool/config/pyproject.py
create_default
A method that creates a default pyproject.toml file.
This method copies the content from a template file to create a new pyproject.toml file if it doesn't already exist.
Parameters:
-
path(Path) –The path where the new file should be created.
-
template(Path) –The path to the template file.
Source code in dev_tool/config/pyproject.py
get_value
A method that retrieves a value from the pyproject.toml configuration.
This method traverses the configuration using the provided keys and returns the default value if the path doesn't exist.
Parameters:
-
keys(str, default:()) –The sequence of keys to navigate through.
-
default(Any, default:None) –The default value to return if the path doesn't exist.
Returns:
-
Any–The value at the specified path, or the default.
Source code in dev_tool/config/pyproject.py
get_project_name
A method that retrieves the project name.
This method gets the project name from the configuration.
Returns:
-
str–The project name, or 'project' if not specified.
Source code in dev_tool/config/pyproject.py
get_project_config
A method that retrieves a project configuration section.
This method gets a specific section from the project configuration.
Parameters:
-
key(str) –The section key to retrieve.
Returns:
Source code in dev_tool/config/pyproject.py
get_tool_config
A method that retrieves a tool configuration section.
This method gets a specific section from the tool configuration.
Parameters:
-
key(str) –The section key to retrieve.
Returns:
Source code in dev_tool/config/pyproject.py
get_dev_tool_config
A method that retrieves the dev_tool configuration.
This method gets the entire dev_tool configuration section.
Returns:
Source code in dev_tool/config/pyproject.py
get_docker_config
A method that retrieves the Docker configuration.
This method gets the Docker configuration section from dev_tool config.
Returns:
Source code in dev_tool/config/pyproject.py
get_coverage_config
A method that retrieves the coverage configuration.
This method gets the coverage configuration section from dev_tool config.
Returns:
Source code in dev_tool/config/pyproject.py
get_django_coverage_config
A method that retrieves the Django coverage configuration.
This method gets the Django-specific coverage configuration and merges it with the base.
Returns:
Source code in dev_tool/config/pyproject.py
get_python_coverage_config
A method that retrieves the Python coverage configuration.
This method gets the Python-specific coverage configuration and merges it with the base.
Returns:
Source code in dev_tool/config/pyproject.py
get_dev_tool_port
A method that retrieves the dev_tool port setting.
This method gets the port number configured for the dev_tool.
Returns:
-
str | None–The port string, or None if not configured.
Source code in dev_tool/config/pyproject.py
get_scripting_config
A method that retrieves the scripting configuration.
This method gets the scripting configuration section from dev_tool config.
Returns:
Source code in dev_tool/config/pyproject.py
get_unittest_config
A method that retrieves the unittest configuration.
This method gets the unittest configuration section from dev_tool config.
Returns:
Source code in dev_tool/config/pyproject.py
get_django_unittest_config
A method that retrieves the Django unittest configuration.
This method gets the Django-specific unittest configuration and merges it with the base.
Returns:
Source code in dev_tool/config/pyproject.py
get_python_unittest_config
A method that retrieves the Python unittest configuration.
This method gets the Python-specific unittest configuration and merges it with the base.
Returns:
Source code in dev_tool/config/pyproject.py
reload
A method that reloads the pyproject.toml configuration.
This method reads the configuration from the specified file path and updates the internal configuration dictionary.
Parameters:
-
path(Path) –The path to the pyproject.toml file.