Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug information to hopefully fix future problems #1458

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install .[lint]
python -c "import shutil;shutil.rmtree('build')"
- name: Print debug information
run: python ./.github/workflows/debug.py lint
- name: Run black
run: black --check --verbose .
- name: Run flake8
Expand Down Expand Up @@ -62,6 +65,9 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install .[lint]
python -c "import shutil;shutil.rmtree('build')"
- name: Print debug information
run: python ./.github/workflows/debug.py lint
- name: Check other phrase usages
run: python ./tools/static_word_checks.py
- name: Run black
Expand Down Expand Up @@ -97,6 +103,9 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install .[test]
python -c "import shutil;shutil.rmtree('build')"
- name: Print debug information
run: python ./.github/workflows/debug.py test
- name: Test with pytest
run: pytest
strategy:
Expand All @@ -123,6 +132,9 @@ jobs:
python -m pip install --upgrade pip
pip install .[test]
pip install https://github.com/bboe/coveralls-python/archive/github_actions.zip
python -c "import shutil;shutil.rmtree('build')"
- name: Print debug information
run: python ./.github/workflows/debug.py test-coverage
- name: Test with pytest
run: coverage run --source praw --module pytest
- env:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/debug.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""Obtains debug information on the running system."""

import os
import sys

from pip._internal.cli.main import main as pip_invoker

program_list = {
"lint": ("black", "flake8", "pydocstyle", "sphinx"),
"test": ("pytest",),
"test-coverage": ("pytest", "coverage"),
}

debug_mode = sys.argv[1]


def print_group(*print_args, **print_kwargs):
print(*print_args, **print_kwargs)
print("-" * 25)


print_group("Running debug script in {} mode".format(debug_mode))

print_group("Printing python version", sys.version, sep="\n")
for program in program_list[debug_mode]:
print("Printing information on program {}".format(program))
pip_invoker(["show", program])
print("*" * 25)

print("List of python files in directory:")
for directory, folders, files in os.walk("."):
for file in files:
if file.endswith(".py"):
print("{}/{}".format(directory.rstrip("/"), file))