Skip to content

Commit e2676fb

Browse files
committed
Updated files from the latest version of addon template.
1 parent cba51b3 commit e2676fb

File tree

10 files changed

+267
-147
lines changed

10 files changed

+267
-147
lines changed

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
4+
# Maintain dependencies for GitHub Actions
5+
- package-ecosystem: "github-actions"
6+
# Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.)
7+
directory: "/"
8+
schedule:
9+
interval: "weekly"
10+
groups:
11+
actions-minor:
12+
update-types:
13+
- minor
14+
- patch

.github/workflows/build_addon.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ jobs:
1717
runs-on: ubuntu-latest
1818

1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121

2222
- run: echo -e "pre-commit\nscons\nmarkdown">requirements.txt
2323

2424
- name: Set up Python
25-
uses: actions/setup-python@v4
25+
uses: actions/setup-python@v5
2626
with:
27-
python-version: 3.9
27+
python-version: 3.11
2828
cache: 'pip'
2929

3030
- name: Install dependencies
@@ -38,27 +38,38 @@ jobs:
3838
run: export SKIP=no-commit-to-branch; pre-commit run --all
3939

4040
- name: building addon
41-
run: scons
41+
run: scons && scons pot
4242

43-
- uses: actions/upload-artifact@v3
43+
- uses: actions/upload-artifact@v4
4444
with:
4545
name: packaged_addon
46-
path: ./*.nvda-addon
46+
path: |
47+
./*.nvda-addon
48+
./*.pot
4749
4850
upload_release:
4951
runs-on: ubuntu-latest
5052
if: ${{ startsWith(github.ref, 'refs/tags/') }}
5153
needs: ["build"]
54+
permissions:
55+
contents: write
5256
steps:
53-
- uses: actions/checkout@v3
57+
- uses: actions/checkout@v4
5458
- name: download releases files
55-
uses: actions/download-artifact@v3
59+
uses: actions/download-artifact@v4
5660
- name: Display structure of downloaded files
5761
run: ls -R
62+
- name: Calculate sha256
63+
run: |
64+
echo -e "\nSHA256: " >> changelog.md
65+
sha256sum packaged_addon/*.nvda-addon >> changelog.md
5866
5967
- name: Release
60-
uses: softprops/action-gh-release@v1
68+
uses: softprops/action-gh-release@v2
6169
with:
62-
files: packaged_addon/*.nvda-addon
70+
files: |
71+
packaged_addon/*.nvda-addon
72+
packaged_addon/*.pot
73+
body_path: changelog.md
6374
fail_on_unmatched_files: true
6475
prerelease: ${{ contains(github.ref, '-') }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ addon/doc/*.css
22
addon/doc/en/
33
*_docHandler.py
44
*.html
5-
*.ini
5+
manifest.ini
66
*.mo
77
*.pot
88
*.py[co]
99
*.nvda-addon
1010
.sconsign.dblite
11+
/[0-9]*.[0-9]*.[0-9]*.json

.vscode/extensions.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
// List of extensions which should be recommended for users of this workspace.
5+
"recommendations": [
6+
"ms-python.python",
7+
"ms-python.vscode-pylance",
8+
"redhat.vscode-yaml",
9+
"charliermarsh.ruff"
10+
],
11+
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
12+
"unwantedRecommendations": []
13+
}

.vscode/settings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"editor.accessibilitySupport": "on",
3+
"python.autoComplete.extraPaths": [
4+
"../nvda/source",
5+
"../nvda/miscDeps/python"
6+
],
7+
"files.insertFinalNewline": true,
8+
"files.trimFinalNewlines": true,
9+
"editor.insertSpaces": false,
10+
"python.analysis.stubPath": "${workspaceFolder}/.vscode/typings",
11+
"python.analysis.extraPaths": [
12+
"../nvda/source",
13+
"../nvda/miscDeps/python"
14+
],
15+
"python.defaultInterpreterPath": "${workspaceFolder}/../nvda/.venv/scripts/python.exe"
16+
}

.vscode/typings/__builtins__.pyi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def _(msg: str) -> str:
2+
...
3+
4+
5+
def pgettext(context: str, message: str) -> str:
6+
...

flake8.ini

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Custom Flake8 configuration for community add-on template
2+
# Based on NVDA's Flake8 configuration with modifications for the basic add-on template (edited by Joseph Lee)
3+
4+
[flake8]
5+
6+
# Plugins
7+
use-flake8-tabs = True
8+
# Not all checks are replaced by flake8-tabs, however, pycodestyle is still not compatible with tabs.
9+
use-pycodestyle-indent = False
10+
continuation-style = hanging
11+
## The following are replaced by flake8-tabs plugin, reported as ET codes rather than E codes.
12+
# E121, E122, E123, E126, E127, E128,
13+
## The following (all disabled) are not replaced by flake8-tabs,
14+
# E124 - Requires mixing spaces and tabs: Closing bracket does not match visual indentation.
15+
# E125 - Does not take tabs into consideration: Continuation line with same indent as next logical line.
16+
# E129 - Requires mixing spaces and tabs: Visually indented line with same indent as next logical line
17+
# E131 - Requires mixing spaces and tabs: Continuation line unaligned for hanging indent
18+
# E133 - Our preference handled by ET126: Closing bracket is missing indentation
19+
20+
21+
# Reporting
22+
statistics = True
23+
doctests = True
24+
show-source = True
25+
26+
# Options
27+
max-complexity = 15
28+
max-line-length = 110
29+
# Final bracket should match indentation of the start of the line of the opening bracket
30+
hang-closing = False
31+
32+
ignore =
33+
ET113, # use of alignment as indentation, but option continuation-style=hanging does not permit this
34+
W191, # indentation contains tabs
35+
W503, # line break before binary operator. We want W504(line break after binary operator)
36+
37+
builtins = # inform flake8 about functions we consider built-in.
38+
_, # translation lookup
39+
pgettext, # translation lookup
40+
41+
exclude = # don't bother looking in the following subdirectories / files.
42+
.git,
43+
__pycache__,

pyproject.toml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[tool.ruff]
2+
line-length = 110
3+
4+
builtins = [
5+
# translation lookup
6+
"_",
7+
# translation lookup
8+
"ngettext",
9+
# translation lookup
10+
"pgettext",
11+
# translation lookup
12+
"npgettext",
13+
]
14+
15+
include = [
16+
"*.py",
17+
"sconstruct",
18+
]
19+
20+
exclude = [
21+
".git",
22+
"__pycache__",
23+
]
24+
25+
[tool.ruff.format]
26+
indent-style = "tab"
27+
28+
[tool.ruff.lint.mccabe]
29+
max-complexity = 15
30+
31+
[tool.ruff.lint]
32+
ignore = [
33+
# indentation contains tabs
34+
"W191",
35+
]
36+
37+
[tool.ruff.lint.per-file-ignores]
38+
# sconstruct contains many inbuilt functions not recognised by the lint,
39+
# so ignore F821.
40+
"sconstruct" = ["F821"]

0 commit comments

Comments
 (0)