Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scikit-build-cpp-python
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Neutrino Physics tutorial
scikit-build-cpp-python
Commits
c21182ec
Commit
c21182ec
authored
3 months ago
by
Xuefeng Ding
Browse files
Options
Downloads
Patches
Plain Diff
python typing
parent
d4da3c04
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.pre-commit-config.yaml
+0
-1
0 additions, 1 deletion
.pre-commit-config.yaml
README.md
+27
-19
27 additions, 19 deletions
README.md
python/myproj/simulation/core.py
+2
-5
2 additions, 5 deletions
python/myproj/simulation/core.py
with
29 additions
and
25 deletions
.pre-commit-config.yaml
+
0
−
1
View file @
c21182ec
...
...
@@ -34,7 +34,6 @@ repos:
rev
:
v0.7.4
# Use the latest version
hooks
:
-
id
:
ruff
# args: ["--fix", "--exit-non-zero-on-fix", "--show-fixes"]
args
:
[
"
--fix"
,
"
--show-fixes"
]
-
id
:
ruff-format
...
...
This diff is collapsed.
Click to expand it.
README.md
+
27
−
19
View file @
c21182ec
...
...
@@ -267,28 +267,36 @@ Publisher: Astral Software
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff
```
#### py
lint: nox + vscode extensions
#### py
right: pre-commit + vscode
## vscode extensions to install
-
"isort", which sort python import
-
install pre-commit
```
Name: isort
Id: ms-python.isort
Description: Import organization support for Python files using isort.
Version: 2023.10.1
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.isort
```
yaml
repos
:
-
repo
:
https://github.com/RobertCraigie/pyright-python
rev
:
v1.1.389
hooks
:
-
id
:
pyright
```
-
"pylint", for complrehensive code analysis
-
vscode: included in pylance automatically
```
json
{
"python.defaultInterpreterPath"
:
".venv/bin/python"
,
"python.analysis.autoFormatStrings"
:
true
,
"python.analysis.autoImportCompletions"
:
true
,
"python.analysis.completeFunctionParens"
:
true
,
"python.analysis.inlayHints.functionReturnTypes"
:
true
,
"python.analysis.inlayHints.pytestParameters"
:
true
,
"python.analysis.inlayHints.variableTypes"
:
true
,
"python.analysis.typeCheckingMode"
:
"strict"
,
"python.analysis.extraPaths"
:
[
"${workspaceFolder}/python"
]
}
```
Name: Pylint
Id: ms-python.pylint
Description: Linting support for Python files using Pylint.
Version: 2024.0.0
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.pylint
```
#### not used
-
pylint, replaced by ruff-lint
-
black, replaced by ruff-format
-
mypy, replaced by pyright
This diff is collapsed.
Click to expand it.
python/myproj/simulation/core.py
+
2
−
5
View file @
c21182ec
import
os
from
._csrc._hello
import
add
,
complexf
def
div
(
a
:
float
,
b
:
float
)
->
float
:
print
(
os
.
path
)
return
a
/
b
+
1
return
a
/
b
def
complex2
(
a
:
float
,
b
:
float
)
->
float
:
def
complex2
(
a
,
b
:
float
)
->
float
:
return
complexf
(
a
,
b
)
+
add
(
a
,
b
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment