Skip to content

Commit 0c53447

Browse files
committed
WIP
1 parent 903a097 commit 0c53447

24 files changed

+443
-506
lines changed

.gitattributes

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,26 @@
11
eol=lf
22
* text=auto
3+
4+
# Source files
5+
# ============
6+
*.pxd text diff=python
7+
*.py text diff=python
8+
*.py3 text diff=python
9+
*.pyw text diff=python
10+
*.pyx text diff=python
11+
*.pyz text diff=python
12+
13+
# Binary files
14+
# ============
15+
*.db binary
16+
*.p binary
17+
*.pkl binary
18+
*.pickle binary
19+
*.pyc binary
20+
*.pyd binary
21+
*.pyo binary
22+
23+
# Note: .db, .p, and .pkl files are associated
24+
# with the python modules ``pickle``, ``dbm.*``,
25+
# ``shelve``, ``marshal``, ``anydbm``, & ``bsddb``
26+
# (among others).
Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test code
1+
name: Test validation code
22

33
on:
44
push:
@@ -7,7 +7,7 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
testCode:
10+
testAllCode:
1111
runs-on: windows-latest
1212
strategy:
1313
matrix:
@@ -22,24 +22,36 @@ jobs:
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424
architecture: x64
25-
- name: Run unit tests
25+
- name: Run unit tests for transform and validation
2626
shell: cmd
27-
# Run automated/unit tests
2827
run: .\rununittests.bat
29-
- name: Lint
30-
shell: cmd
31-
# Check code with the linter
32-
run: .\runlint.bat
28+
- name: Run pyright for validation
29+
run: uv run --group lint --directory validation pyright --threads --level warning
30+
- name: Run pyright for transform
31+
run: uv run --group lint --directory transform pyright --threads --level warning
32+
testValidationCode:
33+
defaults:
34+
run:
35+
shell: cmd
36+
working-directory: validation
37+
runs-on: windows-latest
38+
strategy:
39+
matrix:
40+
python-version: [3.13]
41+
steps:
42+
- name: Install the latest version of uv
43+
uses: astral-sh/setup-uv@v6
44+
- name: Checkout code
45+
uses: actions/checkout@v5
46+
- name: Set up Python ${{ matrix.python-version }}
47+
uses: actions/setup-python@v5
48+
with:
49+
python-version: ${{ matrix.python-version }}
50+
architecture: x64
3351
- name: Validate metadata
34-
shell: cmd
3552
# E2E: test to check the script can be run, no need to actually test the file.
3653
# The internal checks are covered with unit tests.
3754
run: .\runvalidate.bat --dry-run tests/testData/addons/fake/13.0.0.json tests/testData/nvdaAPIVersions.json
38-
- name: Get sha256
39-
shell: cmd
40-
# E2E: test to check the script can be run
41-
run: .\runsha.bat tests/testData/fake.nvda-addon
4255
- name: Generate json file
43-
shell: cmd
4456
# E2E: test to check the script can be run
4557
run: .\runcreatejson.bat -f tests/testData/fake.nvda-addon --dir tests/testOutput/test_runcreatejson --channel=stable --publisher=fakepublisher --sourceUrl=https://github.com/fake/ --url=https://github.com/fake.nvda-addon --licName="GPL v2" --licUrl="https://www.gnu.org/licenses/gpl-2.0.html"

.github/workflows/transformDataToViews.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
run: |
3939
python -m pip install --upgrade pip
4040
cd transform
41-
pip install -r requirements.txt
4241
# empty the views git folder directory
4342
Try { Remove-Item ../views/views/ -Recurse -ErrorAction stop }
4443
Catch [System.Management.Automation.ItemNotFoundException] { $null }

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.venv
2+
venv
3+
__pycache__
4+
*.egg-info
5+
*.pyc
6+
7+
.idea
8+
.vscode
9+
10+
transform/src/tests/test_data
11+
testOutput
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ ci:
99
autofix_commit_msg: "Pre-commit auto-fix"
1010
submodules: true
1111

12+
exclude: addons/.*/.*\.json
13+
1214
default_language_version:
1315
python: python3.13
1416

@@ -73,7 +75,7 @@ repos:
7375

7476
- repo: https://github.com/astral-sh/ruff-pre-commit
7577
# Matches Ruff version in pyproject.
76-
rev: v0.14.10
78+
rev: v0.15.7
7779
hooks:
7880
- id: ruff
7981
name: lint with ruff
@@ -82,13 +84,13 @@ repos:
8284
name: format with ruff
8385

8486
- repo: https://github.com/RobertCraigie/pyright-python
85-
rev: v1.1.407
87+
rev: v1.1.408
8688
hooks:
8789
- id: pyright
8890
name: Check types with pyright
8991

9092
- repo: https://github.com/astral-sh/uv-pre-commit
91-
rev: 0.9.21
93+
rev: v0.11.0
9294
hooks:
9395
- id: uv-lock
9496
name: Verify uv lock file

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Add-on authors who wish to have their add-on distributed through the Add-on Stor
1414

1515
For an overview of the whole Add-on Store, read [the design overview](./docs/design/designOverview.md).
1616

17-
### About security
17+
### About security
1818

1919
Add-ons are run at user's own risk, add-ons in the add-on store do not undergo human security audits.
2020
The add-on store includes the following security measures:
@@ -29,6 +29,7 @@ Please contact the flagged security vendors to get them to review and unflag the
2929
Please email info@nvaccess.org if you need assistance with this process.
3030

3131
## Human review process / code audit
32+
3233
- NV Access doesn't require a manual review of the add-on (code or user experience) itself before the add-on submission.
3334
- NV Access manually maintains a list of approved submitters with permission to submit an add-on to the store.
3435
The process NV Access follows is described [here](./docs/dev/submissionReview.md#approving-an-author-to-submit-to-a-particular-add-on-id-for-the-first-time).
@@ -50,3 +51,8 @@ A plain language summary can be found [here](https://opendatacommons.org/license
5051

5152
- Status for latest submitted add-on: [![view submissions](https://github.com/nvaccess/addon-datastore/actions/workflows/sendJsonFile.yml/badge.svg)](https://github.com/nvaccess/addon-datastore/actions/workflows/sendJsonFile.yml)
5253
- Status for validating all submitted add-ons: [![view validation attempts](https://github.com/nvaccess/addon-datastore/actions/workflows/validateAllAddons.yml/badge.svg)](https://github.com/nvaccess/addon-datastore/actions/workflows/validateAllAddons.yml)
54+
55+
## Dependencies
56+
57+
* [Python](https://www.python.org/) 3.13, 64 bit
58+
* [uv](https://docs.astral.sh/uv/getting-started/installation/)
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[build-system]
2-
requires = ["setuptools~=72.0", "wheel"]
2+
requires = ["setuptools~=82.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "addon-datastore-validation"
6+
name = "addon-datastore"
77
dynamic = ["version"]
8-
description = "Add-on datastore validation"
8+
description = "Add-on datastore"
99
maintainers = [
1010
{name = "NV Access", email = "info@nvaccess.org"},
1111
]
@@ -20,14 +20,15 @@ classifiers = [
2020
readme = "readme.md"
2121
license = {file = "LICENSE"}
2222
dependencies = [
23-
"configobj",
24-
"jsonschema==4.25.1",
23+
"configobj==5.0.6",
24+
"jsonschema==4.26.0",
25+
"requests==2.32.5",
2526
]
2627

2728
[project.urls]
2829
Homepage = "https://www.nvaccess.org/"
29-
Repository = "https://github.com/nvaccess/addon-datastore-validation.git"
30-
Issues = "https://github.com/nvaccess/addon-datastore-validation/issues"
30+
Repository = "https://github.com/nvaccess/addon-datastore.git"
31+
Issues = "https://github.com/nvaccess/addon-datastore/issues"
3132

3233
[tool.pyright]
3334
venvPath = ".venv"
@@ -71,7 +72,10 @@ environments = ["sys_platform == 'win32'"]
7172
required-version = ">=0.8"
7273

7374
[tool.setuptools]
74-
package-dir = {"" = "_validate"}
75+
76+
[tool.setuptools.packages.find]
77+
where = ["validation", "transform"]
78+
include = ["_validate*", "src*"]
7579

7680
[tool.uv.sources]
7781
configobj = { git = "https://github.com/DiffSK/configobj", rev = "8be54629ee7c26acb5c865b74c76284e80f3aa31" }
@@ -85,7 +89,7 @@ lint = [
8589

8690
unit-tests = [
8791
# Creating XML unit test reports
88-
"unittest-xml-reporting==3.2.0",
92+
"unittest-xml-reporting==4.0.0",
8993
]
9094

9195
[tool.ruff]
File renamed without changes.

rununittests.bat

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@echo off
2+
set hereOrig=%~dp0
3+
set here=%hereOrig%
4+
if #%hereOrig:~-1%# == #\# set here=%hereOrig:~0,-1%
5+
set validationUnitTestsPath=%here%\validation\tests
6+
set transformUnitTestsPath=%here%\transform\tests
7+
set testOutput=%here%\testOutput
8+
md %testOutput%
9+
10+
call uv run --group unit-tests --directory "%here%" -m xmlrunner discover -b -s "%validationUnitTestsPath%" -t "%here%" --output-file "%testOutput%\validationUnitTests.xml" %*
11+
call uv run --group unit-tests --directory "%here%" -m xmlrunner discover -b -s "%transformUnitTestsPath%" -t "%here%" --output-file "%testOutput%\transformUnitTests.xml" %*

0 commit comments

Comments
 (0)