Skip to content

Commit 7465dcb

Browse files
authored
Merge pull request #3454 from ferdnyc/sphinx-build-action
Use Github Actions to auto-generate user guide HTML
2 parents e0d3776 + 922f476 commit 7465dcb

File tree

3 files changed

+47
-7
lines changed

3 files changed

+47
-7
lines changed

.github/workflows/sphinx.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Github Actions workflow to generate documentation
2+
# Uses the following shared task definitions:
3+
# - (checkout, upload artifact) from Github
4+
# - sphinx-action maintained by @ammaraskar
5+
name: Sphinx build
6+
7+
# Controls when the action will run.
8+
# Triggers the workflow on push or pull request events.
9+
on:
10+
- push
11+
- pull_request
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
jobs:
15+
# This workflow contains a single job called "build"
16+
build:
17+
# The type of runner that the job will run on
18+
runs-on: ubuntu-latest
19+
20+
# Steps are a sequence of tasks that will be executed as part of the job
21+
steps:
22+
# Check out repository under $GITHUB_WORKSPACE
23+
- uses: actions/checkout@v2
24+
# Builds docs using sphinx
25+
- uses: ammaraskar/sphinx-action@master
26+
with:
27+
docs-folder: "doc/"
28+
# Create an artifact out of the generated HTML
29+
- uses: actions/upload-artifact@v1
30+
with:
31+
name: UserGuideHTML
32+
path: "doc/_build/html/"

doc/requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sphinx_rtd_theme
2+
sphinx_copybutton
3+

src/classes/info.py

+12-7
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
import os
2929
from time import strftime
3030

31-
from PyQt5.QtCore import QDir
32-
3331
VERSION = "2.5.1-dev2"
3432
MINIMUM_LIBOPENSHOT_VERSION = "0.2.5"
3533
DATE = "20200228000000"
@@ -98,11 +96,18 @@
9896
print("Loading translations from: {}".format(language_path))
9997

10098
# Compile language list from :/locale resource
101-
langdir = QDir(language_path)
102-
langs = langdir.entryList(['OpenShot.*.qm'], QDir.NoDotAndDotDot | QDir.Files,
103-
sort=QDir.Name)
104-
for trpath in langs:
105-
SUPPORTED_LANGUAGES.append(trpath.split('.')[1])
99+
try:
100+
from PyQt5.QtCore import QDir
101+
langdir = QDir(language_path)
102+
langs = langdir.entryList(
103+
['OpenShot.*.qm'],
104+
QDir.NoDotAndDotDot | QDir.Files,
105+
sort=QDir.Name)
106+
for trpath in langs:
107+
SUPPORTED_LANGUAGES.append(trpath.split('.')[1])
108+
except ImportError:
109+
# Fail gracefully if we're running without PyQt5 (e.g. CI tasks)
110+
pass
106111

107112
SETUP = {
108113
"name": NAME,

0 commit comments

Comments
 (0)