course-index 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. course_index-0.1.0/.github/dependabot.yml +15 -0
  2. course_index-0.1.0/.github/workflows/python-package.yml +144 -0
  3. course_index-0.1.0/.github/workflows/security.yml +31 -0
  4. course_index-0.1.0/.gitignore +31 -0
  5. course_index-0.1.0/.readthedocs.yaml +13 -0
  6. course_index-0.1.0/LICENSE +674 -0
  7. course_index-0.1.0/PKG-INFO +775 -0
  8. course_index-0.1.0/README.md +73 -0
  9. course_index-0.1.0/SECURITY.md +17 -0
  10. course_index-0.1.0/docs/mkdocs.yml +61 -0
  11. course_index-0.1.0/docs/pages/api.md +91 -0
  12. course_index-0.1.0/docs/pages/cli/course-index.md +69 -0
  13. course_index-0.1.0/docs/pages/contributing.md +53 -0
  14. course_index-0.1.0/docs/pages/format.md +87 -0
  15. course_index-0.1.0/docs/pages/img/banner.png +0 -0
  16. course_index-0.1.0/docs/pages/img/icon.png +0 -0
  17. course_index-0.1.0/docs/pages/img/logo.png +0 -0
  18. course_index-0.1.0/docs/pages/img/screenshot-editor.png +0 -0
  19. course_index-0.1.0/docs/pages/img/screenshot-gui-editor.png +0 -0
  20. course_index-0.1.0/docs/pages/img/screenshot-gui-preview.png +0 -0
  21. course_index-0.1.0/docs/pages/img/screenshot-gui-problems.png +0 -0
  22. course_index-0.1.0/docs/pages/img/screenshot-gui-section-edit.png +0 -0
  23. course_index-0.1.0/docs/pages/img/screenshot-gui-sections.png +0 -0
  24. course_index-0.1.0/docs/pages/img/screenshot-gui.png +0 -0
  25. course_index-0.1.0/docs/pages/img/screenshot-main.png +0 -0
  26. course_index-0.1.0/docs/pages/img/screenshot-preview.png +0 -0
  27. course_index-0.1.0/docs/pages/img/screenshot-problems.png +0 -0
  28. course_index-0.1.0/docs/pages/img/screenshot-section-edit.png +0 -0
  29. course_index-0.1.0/docs/pages/img/screenshot-sections.png +0 -0
  30. course_index-0.1.0/docs/pages/index.md +50 -0
  31. course_index-0.1.0/docs/pages/installation.md +32 -0
  32. course_index-0.1.0/docs/pages/internals.md +70 -0
  33. course_index-0.1.0/docs/pages/usage.md +277 -0
  34. course_index-0.1.0/docs/requirements.txt +6 -0
  35. course_index-0.1.0/pyproject.toml +65 -0
  36. course_index-0.1.0/requirements.txt +3 -0
  37. course_index-0.1.0/setup.cfg +4 -0
  38. course_index-0.1.0/src/course_index/VERSION.txt +1 -0
  39. course_index-0.1.0/src/course_index/__info__.py +18 -0
  40. course_index-0.1.0/src/course_index/__init__.py +6 -0
  41. course_index-0.1.0/src/course_index/__main__.py +104 -0
  42. course_index-0.1.0/src/course_index/common.py +106 -0
  43. course_index-0.1.0/src/course_index/compiler.py +178 -0
  44. course_index-0.1.0/src/course_index/course.py +93 -0
  45. course_index-0.1.0/src/course_index/gui/__init__.py +3 -0
  46. course_index-0.1.0/src/course_index/gui/app.py +1183 -0
  47. course_index-0.1.0/src/course_index/gui/dialogs.py +773 -0
  48. course_index-0.1.0/src/course_index/gui/widgets.py +383 -0
  49. course_index-0.1.0/src/course_index/idx.py +865 -0
  50. course_index-0.1.0/src/course_index/latex.py +216 -0
  51. course_index-0.1.0/src/course_index/preview.py +56 -0
  52. course_index-0.1.0/src/course_index/skeleton.idx +46 -0
  53. course_index-0.1.0/src/course_index/template/data.tex +4 -0
  54. course_index-0.1.0/src/course_index/template/lib/android.png +0 -0
  55. course_index-0.1.0/src/course_index/template/lib/app.png +0 -0
  56. course_index-0.1.0/src/course_index/template/lib/aws.png +0 -0
  57. course_index-0.1.0/src/course_index/template/lib/azure.png +0 -0
  58. course_index-0.1.0/src/course_index/template/lib/book.png +0 -0
  59. course_index-0.1.0/src/course_index/template/lib/cc-by-sa.png +0 -0
  60. course_index-0.1.0/src/course_index/template/lib/cc-by.png +0 -0
  61. course_index-0.1.0/src/course_index/template/lib/cc.png +0 -0
  62. course_index-0.1.0/src/course_index/template/lib/cloud.png +0 -0
  63. course_index-0.1.0/src/course_index/template/lib/cross-platform.png +0 -0
  64. course_index-0.1.0/src/course_index/template/lib/dollar.png +0 -0
  65. course_index-0.1.0/src/course_index/template/lib/dotnet.png +0 -0
  66. course_index-0.1.0/src/course_index/template/lib/executive.png +0 -0
  67. course_index-0.1.0/src/course_index/template/lib/file.png +0 -0
  68. course_index-0.1.0/src/course_index/template/lib/go.png +0 -0
  69. course_index-0.1.0/src/course_index/template/lib/group.png +0 -0
  70. course_index-0.1.0/src/course_index/template/lib/individual.png +0 -0
  71. course_index-0.1.0/src/course_index/template/lib/k8s.png +0 -0
  72. course_index-0.1.0/src/course_index/template/lib/linux.png +0 -0
  73. course_index-0.1.0/src/course_index/template/lib/mac.png +0 -0
  74. course_index-0.1.0/src/course_index/template/lib/malware.png +0 -0
  75. course_index-0.1.0/src/course_index/template/lib/note.png +0 -0
  76. course_index-0.1.0/src/course_index/template/lib/option.png +0 -0
  77. course_index-0.1.0/src/course_index/template/lib/perl.png +0 -0
  78. course_index-0.1.0/src/course_index/template/lib/portable.png +0 -0
  79. course_index-0.1.0/src/course_index/template/lib/powershell.png +0 -0
  80. course_index-0.1.0/src/course_index/template/lib/python.png +0 -0
  81. course_index-0.1.0/src/course_index/template/lib/question.png +0 -0
  82. course_index-0.1.0/src/course_index/template/lib/ruby.png +0 -0
  83. course_index-0.1.0/src/course_index/template/lib/script.png +0 -0
  84. course_index-0.1.0/src/course_index/template/lib/solaris.png +0 -0
  85. course_index-0.1.0/src/course_index/template/lib/std.ist +11 -0
  86. course_index-0.1.0/src/course_index/template/lib/tool.png +0 -0
  87. course_index-0.1.0/src/course_index/template/lib/tool_blue.png +0 -0
  88. course_index-0.1.0/src/course_index/template/lib/tool_red.png +0 -0
  89. course_index-0.1.0/src/course_index/template/lib/tuto.png +0 -0
  90. course_index-0.1.0/src/course_index/template/lib/warning.png +0 -0
  91. course_index-0.1.0/src/course_index/template/lib/web.png +0 -0
  92. course_index-0.1.0/src/course_index/template/lib/windows.png +0 -0
  93. course_index-0.1.0/src/course_index/template/main.tex +110 -0
  94. course_index-0.1.0/src/course_index/tui/__init__.py +3 -0
  95. course_index-0.1.0/src/course_index/tui/app.py +1022 -0
  96. course_index-0.1.0/src/course_index/tui/app.tcss +221 -0
  97. course_index-0.1.0/src/course_index/tui/screens.py +727 -0
  98. course_index-0.1.0/src/course_index/tui/widgets.py +160 -0
  99. course_index-0.1.0/src/course_index.egg-info/PKG-INFO +775 -0
  100. course_index-0.1.0/src/course_index.egg-info/SOURCES.txt +109 -0
  101. course_index-0.1.0/src/course_index.egg-info/dependency_links.txt +1 -0
  102. course_index-0.1.0/src/course_index.egg-info/entry_points.txt +2 -0
  103. course_index-0.1.0/src/course_index.egg-info/requires.txt +3 -0
  104. course_index-0.1.0/src/course_index.egg-info/top_level.txt +1 -0
  105. course_index-0.1.0/tests/data/main.idx +107 -0
  106. course_index-0.1.0/tests/data/sec504.idx +2040 -0
  107. course_index-0.1.0/tests/data/sec588.idx +1854 -0
  108. course_index-0.1.0/tests/test_gui.py +445 -0
  109. course_index-0.1.0/tests/test_idx.py +328 -0
  110. course_index-0.1.0/tests/test_others.py +135 -0
  111. course_index-0.1.0/tests/test_tui.py +756 -0
@@ -0,0 +1,15 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: /
5
+ schedule:
6
+ interval: monthly
7
+ groups:
8
+ actions:
9
+ patterns: ["*"]
10
+ - package-ecosystem: pip
11
+ directory: /
12
+ schedule:
13
+ interval: monthly
14
+ # dependencies are minimum versions (>=) ; only open security updates, not routine upgrades
15
+ open-pull-requests-limit: 0
@@ -0,0 +1,144 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: build
5
+
6
+ on:
7
+ push:
8
+ branches: [ "main" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ env:
16
+ package: course_index
17
+ distribution: course-index
18
+
19
+ jobs:
20
+ build:
21
+ runs-on: ${{ matrix.os }}
22
+ strategy:
23
+ fail-fast: false
24
+ matrix:
25
+ os: [ubuntu-latest]
26
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
27
+ env:
28
+ cov_python_version: "3.13"
29
+ steps:
30
+ - uses: actions/checkout@v7
31
+ - name: Set up Python ${{ matrix.python-version }}
32
+ uses: actions/setup-python@v7
33
+ with:
34
+ python-version: ${{ matrix.python-version }}
35
+ - name: Install the libraries of Qt (for the GUI tests, run with the offscreen platform)
36
+ run: |
37
+ sudo apt-get update
38
+ sudo apt-get install -y --no-install-recommends libegl1 libgl1 libxkbcommon0 libfontconfig1 libdbus-1-3
39
+ - name: Install TeX Live (for the compilation tests)
40
+ # only on the coverage run, the other runs skip the compilation tests
41
+ if: matrix.python-version == env.cov_python_version
42
+ run: |
43
+ sudo apt-get update
44
+ sudo apt-get install -y --no-install-recommends texlive-latex-base texlive-latex-recommended texlive-latex-extra
45
+ - name: Install ${{ env.distribution }}
46
+ run: |
47
+ python -m pip install --upgrade pip
48
+ python -m pip install flake8 pytest pytest-cov
49
+ pip install -r requirements.txt
50
+ pip install .
51
+ - name: Lint with flake8
52
+ run: |
53
+ # stop the build if there are Python syntax errors or undefined names
54
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
55
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
56
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
57
+ - name: Test ${{ env.distribution }} with pytest
58
+ run: |
59
+ QT_QPA_PLATFORM=offscreen pytest --cov=$package --cov-report=xml
60
+ - name: Upload coverage report
61
+ if: matrix.python-version == env.cov_python_version
62
+ uses: actions/upload-artifact@v7
63
+ with:
64
+ name: coverage-report
65
+ path: coverage.xml
66
+ coverage:
67
+ # only publish the badge for commits on main (not for pull requests)
68
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
69
+ needs: build
70
+ permissions:
71
+ contents: write
72
+ runs-on: ubuntu-latest
73
+ env:
74
+ cov_badge_path: docs/coverage.svg
75
+ steps:
76
+ - uses: actions/checkout@v7
77
+ - name: Set up Python
78
+ uses: actions/setup-python@v7
79
+ with:
80
+ python-version: "3.13"
81
+ - name: Download coverage report
82
+ uses: actions/download-artifact@v8
83
+ with:
84
+ name: coverage-report
85
+ - name: Make coverage badge
86
+ run: |
87
+ pip install genbadge[coverage]
88
+ genbadge coverage -i coverage.xml -o $cov_badge_path
89
+ - name: Push coverage badge
90
+ run: |
91
+ # keep the badge alone on an orphan branch so that main is never modified by the workflow
92
+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
93
+ git config --local user.name "github-actions[bot]"
94
+ if git fetch --depth=1 origin coverage-badge 2>/dev/null && \
95
+ git show FETCH_HEAD:$cov_badge_path | cmp -s - $cov_badge_path; then
96
+ echo "Coverage badge unchanged"
97
+ exit 0
98
+ fi
99
+ git checkout --orphan coverage-badge
100
+ git rm -rqf --cached .
101
+ git add $cov_badge_path
102
+ git commit -m "Update coverage badge"
103
+ git push origin coverage-badge --force
104
+ deploy:
105
+ # only release from main, never from pull requests
106
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
107
+ environment:
108
+ name: pypi
109
+ url: https://pypi.org/p/course-index
110
+ permissions:
111
+ contents: read
112
+ id-token: write # for PyPI trusted publishing (OIDC)
113
+ runs-on: ubuntu-latest
114
+ needs: build
115
+ steps:
116
+ - uses: actions/checkout@v7
117
+ - name: Check whether the version is already on PyPI
118
+ # comparing with PyPI (not with the previous commit) also releases a version whose push did not trigger a deploy
119
+ id: version
120
+ run: |
121
+ version=$(tr -d '[:space:]' < src/$package/VERSION.txt)
122
+ status=$(curl -s -o /dev/null -w '%{http_code}' --retry 3 "https://pypi.org/pypi/$distribution/$version/json")
123
+ case "$status" in
124
+ 200) echo "Version $version is already on PyPI" ; echo "new=false" >> "$GITHUB_OUTPUT" ;;
125
+ 404) echo "Version $version is not on PyPI yet" ; echo "new=true" >> "$GITHUB_OUTPUT" ;;
126
+ *) echo "::error::Unexpected HTTP status $status from PyPI" ; exit 1 ;;
127
+ esac
128
+ - if: steps.version.outputs.new == 'true'
129
+ name: Cleanup README
130
+ run: |
131
+ sed -ri 's/^(##*)\s*:.*:\s*/\1 /g' README.md
132
+ awk '{if (match($0,"## Supporters")) exit; print}' README.md > README
133
+ mv -f README README.md
134
+ - if: steps.version.outputs.new == 'true'
135
+ name: Set up Python
136
+ uses: actions/setup-python@v7
137
+ with:
138
+ python-version: "3.13"
139
+ - if: steps.version.outputs.new == 'true'
140
+ name: Build ${{ env.distribution }} package
141
+ run: python -m pip install --upgrade build && python -m build
142
+ - if: steps.version.outputs.new == 'true'
143
+ name: Publish to PyPI
144
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,31 @@
1
+ # This workflow audits the package dependencies for known vulnerabilities
2
+ # It is separate from python-package.yml so that a new advisory never blocks a release
3
+
4
+ name: security
5
+
6
+ on:
7
+ push:
8
+ branches: [ "main" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+ schedule:
12
+ - cron: "0 6 * * 1" # weekly, catches new advisories between pushes
13
+ workflow_dispatch:
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ pip-audit:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v7
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v7
25
+ with:
26
+ python-version: "3.13"
27
+ - name: Install pip-audit
28
+ run: python -m pip install --upgrade pip pip-audit
29
+ - name: Audit dependencies
30
+ # resolves the dependencies of pyproject.toml in an isolated environment, so only these are audited
31
+ run: pip-audit .
@@ -0,0 +1,31 @@
1
+ # Temp files
2
+ *~
3
+ *.backup
4
+ *.bak
5
+ .DS_Store
6
+
7
+ # Byte-compiled / optimized / DLL files
8
+ __pycache__/
9
+ *.py[cod]
10
+
11
+ # Distribution / packaging
12
+ build/
13
+ dist/
14
+ *.egg-info/
15
+ .eggs/
16
+
17
+ # Tests and coverage
18
+ .pytest_cache/
19
+ .coverage
20
+ coverage.xml
21
+ htmlcov/
22
+
23
+ # Documentation
24
+ site/
25
+
26
+ # LaTeX by-products
27
+ *.aux
28
+ *.ilg
29
+ *.ind
30
+ *.log
31
+ *.synctex.gz
@@ -0,0 +1,13 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: ubuntu-24.04
5
+ tools:
6
+ python: "3.13"
7
+
8
+ mkdocs:
9
+ configuration: docs/mkdocs.yml
10
+
11
+ python:
12
+ install:
13
+ - requirements: docs/requirements.txt