2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 04:25:42 +00:00

Merge branch 'master' of https://github.com/inventree/InvenTree into matmair/issue6281

This commit is contained in:
Matthias Mair
2025-01-19 21:56:54 +01:00
108 changed files with 29896 additions and 29233 deletions

View File

@ -150,7 +150,7 @@ def on_config(config, *args, **kwargs):
We can use these to determine (at run time) where we are hosting
"""
rtd = os.environ.get('READTHEDOCS', False)
rtd = os.environ.get('READTHEDOCS', 'False')
# Note: version selection is handled by RTD internally
# Check for 'versions.json' file

View File

@ -97,6 +97,7 @@ The following debugging / logging options are available:
| INVENTREE_LOG_LEVEL | log_level | Set level of logging to terminal | WARNING |
| INVENTREE_JSON_LOG | json_log | log as json | False |
| INVENTREE_WRITE_LOG | write_log | Enable writing of log messages to file at config base | False |
| INVENTREE_CONSOLE_LOG | console_log | Enable logging to console | True |
### Debug Mode

View File

@ -8,6 +8,26 @@ import textwrap
import requests
import yaml
# Debugging output - useful for diagnosing CI build issues
print('loading ./docs/main.py...')
# Print out some useful debugging information
# Ref: https://docs.readthedocs.io/en/stable/reference/environment-variables.html
for key in [
'GITHUB_ACTIONS',
'GITHUB_REF',
'READTHEDOCS',
'READTHEDOCS_GIT_IDENTIFIER',
'READTHEDOCS_GIT_CLONE_URL',
'READTHEDOCS_GIT_COMMIT_HASH',
'READTHEDOCS_PROJECT',
'READTHEDOCS_VERSION',
'READTHEDOCS_VERSION_NAME',
'READTHEDOCS_VERSION_TYPE',
]:
val = os.environ.get(key) or '-- MISSING --'
print(f' - {key}: {val}')
# Cached settings dict values
global GLOBAL_SETTINGS
global USER_SETTINGS
@ -77,12 +97,15 @@ def get_build_enviroment() -> str:
"""Returns the branch we are currently building on, based on the environment variables of the various CI platforms."""
# Check if we are in ReadTheDocs
if os.environ.get('READTHEDOCS') == 'True':
return os.environ.get('READTHEDOCS_GIT_IDENTIFIER')
for var in ['READTHEDOCS_GIT_COMMIT_HASH', 'READTHEDOCS_GIT_IDENTIFIER']:
if val := os.environ.get(var):
return val
# We are in GitHub Actions
elif os.environ.get('GITHUB_ACTIONS') == 'true':
return os.environ.get('GITHUB_REF')
else:
return 'master'
# Default to 'master' branch
return 'master'
def define_env(env):