Skip to content

Commit 79714ee

Browse files
committed
py10 min, ruff, commithook
1 parent 09294c6 commit 79714ee

27 files changed

+832
-446
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
- name: "Latest Python 3.x"
1919
os: ubuntu-latest
2020
python-version: 3.x
21-
- name: "OS X Python 3.9"
21+
- name: "OS X Python 3.10"
2222
os: macos-latest
23-
python-version: 3.9
23+
python-version: "3.10"
2424
- name: "Windows Python 3.11"
2525
os: windows-latest
2626
python-version: 3.11
@@ -47,7 +47,7 @@ jobs:
4747
- name: Install dependencies
4848
run: |
4949
python --version
50-
pip install .
50+
pip install .
5151
git clone --depth=1 https://github.com/cmbant/getdist_testchains
5252
5353
- name: Run tests

.vscode/launch.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,65 @@
5656
"console": "integratedTerminal",
5757
"justMyCode": false,
5858
"python": "${command:python.interpreterPath}"
59+
},
60+
{
61+
"name": "Run GetDist Tests",
62+
"type": "debugpy",
63+
"request": "launch",
64+
"module": "unittest",
65+
"args": [
66+
"getdist.tests.getdist_test"
67+
],
68+
"console": "integratedTerminal",
69+
"justMyCode": true,
70+
"python": "${command:python.interpreterPath}",
71+
"cwd": "${workspaceFolder}"
72+
},
73+
{
74+
"name": "Debug GetDist Tests",
75+
"type": "debugpy",
76+
"request": "launch",
77+
"module": "unittest",
78+
"args": [
79+
"getdist.tests.getdist_test"
80+
],
81+
"console": "integratedTerminal",
82+
"justMyCode": false,
83+
"showReturnValue": true,
84+
"redirectOutput": true,
85+
"python": "${command:python.interpreterPath}",
86+
"cwd": "${workspaceFolder}"
87+
},
88+
{
89+
"name": "Run GetDist Tests (pytest)",
90+
"type": "debugpy",
91+
"request": "launch",
92+
"module": "pytest",
93+
"args": [
94+
"getdist/tests/getdist_test.py",
95+
"-v"
96+
],
97+
"console": "integratedTerminal",
98+
"justMyCode": true,
99+
"python": "${command:python.interpreterPath}",
100+
"cwd": "${workspaceFolder}"
101+
},
102+
{
103+
"name": "Debug GetDist Tests (pytest)",
104+
"type": "debugpy",
105+
"request": "launch",
106+
"module": "pytest",
107+
"args": [
108+
"getdist/tests/getdist_test.py",
109+
"-v",
110+
"-s"
111+
],
112+
"console": "integratedTerminal",
113+
"justMyCode": false,
114+
"showReturnValue": true,
115+
"redirectOutput": true,
116+
"python": "${command:python.interpreterPath}",
117+
"cwd": "${workspaceFolder}"
59118
}
60119
]
61120
}

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
"**/__pycache__/": true,
77
"build*/": true,
88
"default_chains": true,
9-
"*.egg*": true
9+
"*.egg*": true,
10+
"**/.ipynb_checkpoints": true,
11+
"**/_summaries*": true,
12+
"dist/": true,
13+
"**/_build": true
1014
},
1115
"python.analysis.extraPaths": [
1216
"${workspaceFolder}"

.vscode/tasks.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,49 @@
1515
},
1616
"problemMatcher": []
1717
},
18+
{
19+
"label": "Run GetDist Tests",
20+
"type": "shell",
21+
"command": "python -m unittest getdist.tests.getdist_test",
22+
"group": "test",
23+
"presentation": {
24+
"reveal": "always",
25+
"panel": "new"
26+
},
27+
"problemMatcher": []
28+
},
29+
{
30+
"label": "Run GetDist Tests (pytest)",
31+
"type": "shell",
32+
"command": "python -m pytest getdist/tests/getdist_test.py -v",
33+
"group": "test",
34+
"presentation": {
35+
"reveal": "always",
36+
"panel": "new"
37+
},
38+
"problemMatcher": []
39+
},
40+
{
41+
"label": "Run All Tests",
42+
"type": "shell",
43+
"command": "python -m pytest",
44+
"group": "test",
45+
"presentation": {
46+
"reveal": "always",
47+
"panel": "new"
48+
},
49+
"problemMatcher": []
50+
},
51+
{
52+
"label": "Run Pre-commit",
53+
"type": "shell",
54+
"command": "pre-commit run --all-files",
55+
"group": "test",
56+
"presentation": {
57+
"reveal": "always",
58+
"panel": "new"
59+
},
60+
"problemMatcher": []
61+
}
1862
]
1963
}

CONTRIBUTING.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Thank you for your interest in contributing to GetDist! This guide will help you
66

77
### Prerequisites
88

9-
- Python 3.9 or higher
9+
- Python 3.10 or higher
1010
- Git
1111
- [uv](https://docs.astral.sh/uv/) (recommended) or pip for package management
1212

@@ -56,7 +56,7 @@ GetDist uses [Ruff](https://docs.astral.sh/ruff/) for code formatting and lintin
5656

5757
- **Line length:** 120 characters
5858
- **Quote style:** Double quotes
59-
- **Target Python version:** 3.9+
59+
- **Target Python version:** 3.10+
6060
- **Import sorting:** Enabled (isort-compatible)
6161

6262
### Pre-commit Hooks
@@ -104,6 +104,28 @@ python -m pytest getdist/tests/getdist_test.py
104104
python -m unittest getdist.tests.getdist_test
105105
```
106106

107+
### VS Code Integration
108+
109+
If you're using VS Code, the repository includes pre-configured launch configurations and tasks:
110+
111+
**Launch Configurations (F5 menu):**
112+
- `Run GetDist Tests` - Run tests using unittest
113+
- `Debug GetDist Tests` - Debug tests with breakpoints
114+
- `Run GetDist Tests (pytest)` - Run tests using pytest
115+
- `Debug GetDist Tests (pytest)` - Debug tests with pytest
116+
117+
**Tasks (Ctrl+Shift+P → "Tasks: Run Task"):**
118+
- `Run GetDist Tests` - Quick test execution
119+
- `Run GetDist Tests (pytest)` - Run with pytest
120+
- `Run All Tests` - Run all tests in the project
121+
- `Run Pre-commit` - Run code quality checks
122+
123+
**Keyboard Shortcuts:**
124+
- `Ctrl+Shift+T` - Run GetDist Tests
125+
- `Ctrl+Shift+F5` - Launch GetDist Tests
126+
- `Ctrl+Shift+F6` - Debug GetDist Tests
127+
- `Ctrl+Shift+P` - Run Pre-commit checks
128+
107129
### Writing Tests
108130

109131
When adding new features or fixing bugs:

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ the `Plot Gallery and tutorial <https://getdist.readthedocs.io/en/latest/plot_ga
5959

6060
Dependencies
6161
=============
62-
* Python 3.9+
62+
* Python 3.10+
6363
* matplotlib
6464
* scipy
6565
* PySide6 - optional, only needed for Qt-based GUI

0 commit comments

Comments
 (0)