Skip to content

Commit 7ef72dc

Browse files
committed
Update add-on template.
1 parent 4932026 commit 7ef72dc

File tree

9 files changed

+211
-159
lines changed

9 files changed

+211
-159
lines changed

.github/dependabot.yml

+14
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

+22-11
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
tags: ["*"]
66
# To build on main/master branch, uncomment the following line:
7-
branches: [ main , master ]
7+
# branches: [ main , master ]
88

99
pull_request:
1010
branches: [ main, master ]
@@ -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, '-') }}

.vscode/extensions.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"ms-python.python",
77
"ms-python.vscode-pylance",
88
"redhat.vscode-yaml",
9-
"ms-python.flake8"
9+
"charliermarsh.ruff"
1010
],
1111
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
1212
"unwantedRecommendations": []

.vscode/settings.json

-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{
22
"editor.accessibilitySupport": "on",
3-
"flake8.args": [
4-
"--config=flake8.ini"
5-
],
6-
"flake8.importStrategy": "fromEnvironment",
73
"python.autoComplete.extraPaths": [
84
"../nvda/source",
95
"../nvda/miscDeps/python"

buildVars.py

+21-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
def _(arg):
1313
return arg
1414

15-
1615
# Add-on information variables
1716
addon_info = {
1817
# add-on Name/identifier, internal for NVDA
@@ -57,7 +56,7 @@ def _(arg):
5756
# pythonSources = ["addon/globalPlugins/*.py"]
5857
# For more information on SCons Glob expressions please take a look at:
5958
# https://scons.org/doc/production/HTML/scons-user/apd.html
60-
pythonSources = ["addon/globalPlugins/*.py"]
59+
pythonSources = []
6160

6261
# Files that contain strings for translation. Usually your python sources
6362
i18nSources = pythonSources + ["buildVars.py"]
@@ -69,6 +68,7 @@ def _(arg):
6968
# Base language for the NVDA add-on
7069
# If your add-on is written in a language other than english, modify this variable.
7170
# For example, set baseLanguage to "es" if your add-on is primarily written in spanish.
71+
# You must also edit .gitignore file to specify base language files to be ignored.
7272
baseLanguage = "en"
7373

7474
# Markdown extensions for add-on documentation
@@ -77,3 +77,22 @@ def _(arg):
7777
# Extensions string must be of the form "markdown.extensions.extensionName"
7878
# e.g. "markdown.extensions.tables" to add tables.
7979
markdownExtensions = []
80+
81+
# Custom braille translation tables
82+
# If your add-on includes custom braille tables (most will not), fill out this dictionary.
83+
# Each key is a dictionary named according to braille table file name,
84+
# with keys inside recording the following attributes:
85+
# displayName (name of the table shown to users and translatable),
86+
# contracted (contracted (True) or uncontracted (False) braille code),
87+
# output (shown in output table list),
88+
# input (shown in input table list).
89+
brailleTables = {}
90+
91+
# Custom speech symbol dictionaries
92+
# Symbol dictionary files reside in the locale folder, e.g. `locale\en`, and are named `symbols-<name>.dic`.
93+
# If your add-on includes custom speech symbol dictionaries (most will not), fill out this dictionary.
94+
# Each key is the name of the dictionary,
95+
# with keys inside recording the following attributes:
96+
# displayName (name of the speech dictionary shown to users and translatable),
97+
# mandatory (True when always enabled, False when not.
98+
symbolDictionaries = {}

changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* Update updateCheck and addonStore URLs to use new NV Access mirror endpoints, See nvaccess/nvda#17680
2+
* Update add-on template

pyproject.toml

+40
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)