-
Notifications
You must be signed in to change notification settings - Fork 814
[checks] Implement Python checks #9146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
9dcbe96
6d4a54c
9f2e23e
017ddec
fe02c01
c0c5e23
1e73cea
270d416
8daba1d
1a5fc29
35ed7e7
e20070e
4513a75
5111413
665dbe0
7cbded1
c48c2dd
388e42c
7af3d56
33b9379
147575e
0cebc60
7a03870
9460b52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: check-python | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "tools/**.py" | ||
| - "pyrightconfig.json" | ||
| - ".github/workflows/check-python.yml" | ||
| push: | ||
| paths: | ||
| - "tools/**.py" | ||
| - "pyrightconfig.json" | ||
| - ".github/workflows/check-python.yml" | ||
|
|
||
| jobs: | ||
| pyright: | ||
| name: Pyright type check | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: setup Node | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: "20" | ||
|
|
||
| - name: install pyright | ||
| run: npm install -g pyright | ||
|
|
||
| - name: run pyright | ||
| run: pyright |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,3 +22,8 @@ tools/sections | |
| *.synctex.gz | ||
| *.synctex* | ||
| .check.stamp | ||
|
|
||
| __pycache__ | ||
| *.pyc | ||
| *.egg | ||
| *.egg-info | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "include": [ | ||
| "tools/*.py" | ||
| ], | ||
| "typeCheckingMode": "strict", | ||
| "reportMissingTypeStubs": false, | ||
| "reportUnknownMemberType": false, | ||
| "reportUnknownArgumentType": false, | ||
| "reportUnknownVariableType": false, | ||
| "reportUnknownParameterType": false, | ||
| "reportUnusedImport": true, | ||
| "reportUnusedVariable": true, | ||
| "pythonVersion": "3.12" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| %NOCHECKBEGIN | ||
| \documentclass[9pt]{standalone} | ||
|
|
||
| \usepackage{fontspec} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| %NOCHECKBEGIN | ||
| \documentclass[9pt]{standalone} | ||
|
|
||
| \usepackage{fontspec} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| %NOCHECKBEGIN | ||
| \documentclass[9pt]{standalone} | ||
|
|
||
| \usepackage{fontspec} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| %NOCHECKBEGIN | ||
| \documentclass[9pt]{standalone} | ||
|
|
||
| \usepackage{fontspec} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| %NOCHECKBEGIN | ||
| \documentclass[9pt]{standalone} | ||
|
|
||
| \usepackage{fontspec} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| %NOCHECKBEGIN | ||
| \documentclass[9pt]{standalone} | ||
|
|
||
| \usepackage{fontspec} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN(lib-*) | ||
| \rSec0[basic]{Basics} | ||
|
|
||
| \gramSec[gram.basic]{Basics} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN(lib-*) | ||
| \rSec0[class]{Classes}% | ||
| \indextext{class|(} | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN(lib-*) | ||
| \rSec0[dcl]{Declarations}% | ||
| \indextext{declaration|(} | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN(lib-*) | ||
| \rSec0[except]{Exception handling}% | ||
| \indextext{exception handling|(} | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN(lib-*) | ||
| \rSec0[expr]{Expressions} | ||
|
|
||
| \gramSec[gram.expr]{Expressions} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| %NOCHECKBEGIN(lib-*) | ||
| \infannex{gram}{Grammar summary} | ||
|
|
||
| \rSec1[gram.general]{General} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN(lib-*) | ||
|
|
||
| \clearpage | ||
| \bigskip\noindent\textlarger{\textbf{Programming languages --- \Cpp{}}} | ||
|
|
@@ -325,8 +326,7 @@ | |
| behavior, for a \termref{defns.well.formed}{well-formed program}{} construct and correct data, that | ||
| depends on the implementation and that each implementation documents | ||
|
|
||
| \definition{implementation-defined strict total order over pointers} | ||
| {defns.order.ptr} | ||
| \definition{implementation-defined strict total order over pointers}{defns.order.ptr} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this looks like an unrelated change, does it have to be in this patch?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I recall correctly, it's like this because the definition-checking check uses capture groups to yoink the It's easier to change just this one place in the standard markup than to redesign the checks and make them cross-line.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, but why in this patch? This seems like an okay change to do separately. I'd prefer if this patch doesn't touch anything that isn't directly related to the new script.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because the Python checks also come with CI checks in this PR that actually run them, and you don't get a green build if you don't change this line of markup.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That I understand, but why does this need to be in this patch? Why can't that be done separately? |
||
| \indexdefn{pointer!strict total order}% | ||
| \defncontext{library} | ||
| \impldef{strict total order over pointer values} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN(lib-*) | ||
| \infannex{implimits}{Implementation quantities} | ||
|
|
||
| \pnum | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN | ||
| %NOCHECKEND(text-*) | ||
|
|
||
| % Definitions and redefinitions of special commands | ||
| % | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN(lib-*) | ||
| \rSec0[module]{Modules}% | ||
|
|
||
| \gramSec[gram.module]{Modules} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN(lib-*) | ||
| \rSec0[over]{Overloading}% | ||
| \indextext{overloading|(} | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN(lib-*) | ||
| \rSec0[stmt]{Statements}% | ||
| \indextext{statement|(} | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN(lib-*) | ||
| \rSec0[temp]{Templates}% | ||
| \indextext{template|(} | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN(lib-ranges-*) | ||
|
|
||
| \rSec0[text]{Text processing library} | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN(lib-ranges-*) | ||
| \rSec0[time]{Time library} | ||
|
|
||
| \rSec1[time.general]{General} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN(lib-*) | ||
| \infannex{ub}{Core undefined behavior} | ||
|
|
||
| \rSec1[ub.general]{General} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| %!TEX root = std.tex | ||
| %NOCHECKBEGIN(lib-ranges-*) | ||
|
|
||
| \rSec0[utilities]{General utilities library} | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any particular reason why this requires Python 3.12 rather than the current version (3.14)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current GitHub actions
ubuntu-latestrunner is on Ubuntu 24.04 according to GitHub's documentation, whose Python3 package is3.12.3.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is not a limitation. You might as well pull a newer Python version in through
uvor something like micromamba. Also there's an official Python docker container.3.12 is probably okay for now, but let's please switch to something newer the second we want to use a Python 3.13 or later feature.