Skip to content

Commit 4d04d56

Browse files
authored
Merge c962fb3 into 94e26a3
2 parents 94e26a3 + c962fb3 commit 4d04d56

34 files changed

Lines changed: 1370 additions & 517 deletions

.github/workflows/regenerate_english_userDocs_translation_source.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Rebuild English User Documentation for Translation
1+
name: Rebuild English User Documentation for Translation
22

33
on:
44
push:
@@ -32,7 +32,7 @@ jobs:
3232
run: |
3333
# for any English markdown files changed within the commits of this push,
3434
# update the corresponding xliff file (if one exists) to reflect the current markdown file,
35-
# keeping existing translation IDs in tact.
35+
# keeping existing translation IDs in tact.
3636
$ErrorActionPreference = 'Stop'
3737
$changedFiles = git diff --name-only ${{github.event.before}}.. -- user_docs/en/*.md
3838
foreach ($file in $changedFiles) {
@@ -70,7 +70,7 @@ jobs:
7070
New-Item -ItemType Directory -Force -Path ~/.ssh
7171
# Add github.com to the list of known hosts for ssh
7272
ssh-keyscan github.com >> ~/.ssh/known_hosts
73-
# set the private key of the Github deploy key as the ssh key
73+
# set the private key of the Github deploy key as the ssh key
7474
$privateKey = "${{ secrets.XLIFF_DEPLOY_PRIVATE_KEY }}"
7575
$privateKey | Out-File -FilePath ~/.ssh/id_rsa -Encoding ascii
7676
# Tell git to use ssh for pushing

.github/workflows/testAndPublish.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ jobs:
4545
uses: actions/checkout@v4
4646
with:
4747
submodules: true
48-
- name: Install dependencies
48+
- name: Install Python
4949
uses: actions/setup-python@v5
5050
with:
5151
python-version: '3.11'
5252
architecture: x86
53+
- name: Install the latest version of uv
54+
uses: astral-sh/setup-uv@v5
5355
- name: Set version variables
5456
run: ci/scripts/setBuildVersionVars.ps1
5557
- name: Set scons args
@@ -76,6 +78,8 @@ jobs:
7678
path: ${{ github.workspace }}
7779
key: ${{ github.ref }}-${{ github.run_id }}
7880
fail-on-cache-miss: true
81+
- name: Install the latest version of uv
82+
uses: astral-sh/setup-uv@v5
7983
- name: Check comments for translators
8084
run: ci/scripts/tests/translationCheck.ps1
8185
- name: Upload artifact
@@ -98,6 +102,8 @@ jobs:
98102
path: ${{ github.workspace }}
99103
key: ${{ github.ref }}-${{ github.run_id }}
100104
fail-on-cache-miss: true
105+
- name: Install the latest version of uv
106+
uses: astral-sh/setup-uv@v5
101107
- name: License check
102108
run: ci/scripts/tests/licenseCheck.ps1
103109

@@ -112,6 +118,8 @@ jobs:
112118
path: ${{ github.workspace }}
113119
key: ${{ github.ref }}-${{ github.run_id }}
114120
fail-on-cache-miss: true
121+
- name: Install the latest version of uv
122+
uses: astral-sh/setup-uv@v5
115123
- name: Run unit tests
116124
run: ci/scripts/tests/unitTests.ps1
117125
- name: Replace relative paths in unit test results
@@ -145,16 +153,15 @@ jobs:
145153
path: ${{ github.workspace }}
146154
key: ${{ github.ref }}-${{ github.run_id }}
147155
fail-on-cache-miss: true
156+
- name: Install the latest version of uv
157+
uses: astral-sh/setup-uv@v5
148158
- name: Set version variables
149159
run: ci/scripts/setBuildVersionVars.ps1
150160
- name: Set scons args
151161
run: ci/scripts/setSconsArgs.ps1
152162
- name: Prepare source code for launcher
153163
shell: cmd
154164
run: scons %sconsOutTargets% %sconsArgs% ${{ !runner.debug && '--all-cores' || '-j1'}}
155-
- name: Export package list
156-
shell: cmd
157-
run: .\venvUtils\exportPackageList.bat output\installed_python_packages.txt
158165
- name: Upload launcher
159166
id: uploadLauncher
160167
uses: actions/upload-artifact@v4
@@ -199,6 +206,8 @@ jobs:
199206
path: ${{ github.workspace }}
200207
key: ${{ github.ref }}-${{ github.run_id }}
201208
fail-on-cache-miss: true
209+
- name: Install the latest version of uv
210+
uses: astral-sh/setup-uv@v5
202211
- name: Get NVDA launcher
203212
id: getLauncher
204213
uses: actions/download-artifact@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ source/locale/*/cldr.dic
4949
nvdaHelper/docs/
5050
*.pfx
5151
appveyor-tools/
52+
*.egg-info

.pre-commit-config.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ci:
1313
autoupdate_schedule: monthly
1414
autoupdate_commit_msg: "Pre-commit auto-update"
1515
autofix_commit_msg: "Pre-commit auto-fix"
16+
submodules: true
1617

1718
default_language_version:
1819
python: python3.11
@@ -52,14 +53,14 @@ repos:
5253
- id: debug-statements
5354
# Removes trailing whitespace.
5455
- id: trailing-whitespace
55-
types_or: [python, c, c++, batch, markdown]
56+
types_or: [python, c, c++, batch, markdown, toml, yaml]
5657
# Ensures all files end in 1 (and only 1) newline.
5758
- id: end-of-file-fixer
58-
types_or: [python, c, c++, batch, markdown]
59+
types_or: [python, c, c++, batch, markdown, toml, yaml]
5960
# Removes the UTF-8 BOM from files that have it.
6061
# See https://github.com/nvaccess/nvda/blob/master/projectDocs/dev/codingStandards.md#encoding
6162
- id: fix-byte-order-marker
62-
types_or: [python, c, c++, batch, markdown]
63+
types_or: [python, c, c++, batch, markdown, toml, yaml]
6364
# Validates TOML files.
6465
- id: check-toml
6566
# Validates YAML files.
@@ -98,7 +99,7 @@ repos:
9899
- id: add-trailing-comma
99100

100101
- repo: https://github.com/astral-sh/ruff-pre-commit
101-
# Matches Ruff version in requirements.
102+
# Matches Ruff version in pyproject.
102103
rev: v0.8.1
103104
hooks:
104105
- id: ruff
@@ -120,10 +121,18 @@ repos:
120121
- id: pyright
121122
alias: pyrightCI
122123
name: Check types with pyright
123-
# use nodejs version of pyright and install requirements.txt for CI
124-
additional_dependencies: ["-rrequirements.txt", "pyright[nodejs]"]
124+
# use nodejs version of pyright and install pyproject.toml for CI
125+
additional_dependencies: [".", "pyright[nodejs]"]
125126
stages: [manual] # Only run from CI manually
126127

128+
- repo: https://github.com/astral-sh/uv-pre-commit
129+
rev: 0.6.14
130+
hooks:
131+
- id: uv-lock
132+
name: Verify uv lock file
133+
# Override python interpreter from .python-versions as that is too strict for pre-commit.ci
134+
args: ["-p3.11"]
135+
127136
- repo: local
128137
hooks:
129138
- id: scons-source
@@ -147,7 +156,7 @@ repos:
147156
types_or: [python, c, c++, batch]
148157
- id: licenseCheck
149158
name: Check license compatibility of pip dependencies
150-
files: ^(requirements\.txt|runlicensecheck\.bat|pyproject\.toml)$
159+
files: ^(runlicensecheck\.bat|pyproject\.toml)$
151160
entry: ./runlicensecheck.bat
152161
language: script
153162
pass_filenames: false

.python-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cpython-3.11.9-windows-x86-none

appveyor.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ install:
4747
"INSTALL_START, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append
4848
- ps: appveyor\scripts\setBuildVersionVars.ps1
4949
- ps: appveyor\scripts\decryptFilesForSigning.ps1
50-
- py -m pip install --upgrade --no-warn-script-location pip
50+
- ps: Invoke-RestMethod https://astral.sh/uv/install.ps1 | Invoke-Expression
51+
- set Path=%userprofile%\.local\bin;%Path%
5152
- git submodule update --init
5253
- ps: |
5354
"INSTALL_END, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append

appveyor/scripts/pushPackagingInfo.ps1

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,19 @@ if (!$env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:versionType) {
33
# Not a pr build
44
if ($env:APPVEYOR_REPO_BRANCH -eq "beta" -and $env:feature_crowdinSync) {
55
# Upload files to Crowdin for translation
6-
py -m pip install --no-warn-script-location requests
7-
py appveyor\crowdinSync.py uploadSourceFile 2 output\nvda.pot 2>&1
6+
uv run --with requests --directory appveyor crowdinSync.py uploadSourceFile 2 output\nvda.pot 2>&1
87
}
98
# Upload symbols to Mozilla if feature enabled.
109
if ($env:feature_buildSymbols -and $env:feature_uploadSymbolsToMozilla) {
11-
py -m pip install --upgrade --no-warn-script-location pip
12-
py -m pip install --no-warn-script-location requests
1310
Try {
14-
py appveyor\mozillaSyms.py
11+
uv run --with requests --directory appveyor mozillaSyms.py
1512
}
1613
Catch {
1714
Add-AppveyorMessage "Unable to upload symbols to Mozilla"
1815
}
1916
}
2017
}
2118

22-
# Save an exact list of the actual Python packages and their versions that got installed, to aide in reproducing a build
23-
.\venvUtils\exportPackageList.bat installed_python_packages.txt
24-
Push-AppveyorArtifact installed_python_packages.txt
2519
$appVeyorUrl = "https://ci.appveyor.com"
2620
$exe = Get-ChildItem -Name output\nvda_*.exe
2721
if($?){

constraints.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

ensureuv.bat

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
@echo off
2+
rem Check if 'uv' is available
3+
where uv >nul 2>&1 && goto :runUv
4+
5+
rem Check if WinGet is available
6+
(where winget >nul 2>&1 && set hasWinGet=1) || set hasWinGet=0
7+
8+
:prompt
9+
echo uv is not installed.
10+
echo.
11+
echo Choose how to install uv:
12+
if "%hasWinGet%"=="1" (
13+
echo [1] Install using WinGet, recommended
14+
) else (
15+
echo WinGet is NOT available.
16+
)
17+
echo [2] Install using the official uv install script
18+
echo [0] Exit
19+
20+
set /p "choice=Enter your choice: "
21+
22+
if "%choice%"=="0" (
23+
goto :eof
24+
) else if "%choice%"=="1" (
25+
if "%hasWinGet%"=="1" (
26+
echo Installing uv using WinGet...
27+
(winget install --accept-source-agreements --disable-interactivity -e astral-sh.uv && goto :runUv) || exit /B %ERRORLEVEL%
28+
) else (
29+
echo Invalid option: WinGet is not available.
30+
goto :prompt
31+
)
32+
) else if "%choice%"=="2" (
33+
echo Installing uv using the official script...
34+
powershell -ExecutionPolicy ByPass -c "Invoke-RestMethod https://astral.sh/uv/install.ps1 | Invoke-Expression
35+
goto :runUv
36+
) else (
37+
echo Invalid choice: "%choice%". Exiting.
38+
exit /B 1
39+
)
40+
41+
:runUv
42+
if "%choice%"=="2" (
43+
set "UV_BIN=%UserProfile%\.local\bin"
44+
set "Path=%UV_BIN%;%Path%"
45+
)
46+
uv %*

miscDeps

0 commit comments

Comments
 (0)