python-project-doctor-cli 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 x1958075990h-pixel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,298 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-project-doctor-cli
3
+ Version: 0.1.0
4
+ Summary: A beginner-friendly CLI that checks whether a directory looks like a Python project and suggests what to do next.
5
+ Author: x1958075990h-pixel
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 x1958075990h-pixel
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/x1958075990h-pixel/pyenv-doctor
29
+ Project-URL: Repository, https://github.com/x1958075990h-pixel/pyenv-doctor
30
+ Project-URL: Issues, https://github.com/x1958075990h-pixel/issues
31
+ Classifier: License :: OSI Approved :: MIT License
32
+ Classifier: Operating System :: OS Independent
33
+ Classifier: Programming Language :: Python :: 3
34
+ Classifier: Programming Language :: Python :: 3.11
35
+ Classifier: Programming Language :: Python :: 3.12
36
+ Classifier: Programming Language :: Python :: 3.13
37
+ Requires-Python: >=3.11
38
+ Description-Content-Type: text/markdown
39
+ License-File: LICENSE
40
+ Dynamic: license-file
41
+
42
+ # pyenv-doctor
43
+
44
+ `pyenv-doctor` is a minimal Python command-line tool for beginners.
45
+
46
+ It scans a directory, checks whether it looks like a Python project, and tells you whether the current Python interpreter is running inside a virtual environment.
47
+
48
+ ## What It Checks
49
+
50
+ This MVP checks for these common Python project files:
51
+
52
+ - `requirements.txt`
53
+ - `pyproject.toml`
54
+ - `setup.py`
55
+ - `setup.cfg`
56
+ - `Pipfile`
57
+ - `poetry.lock`
58
+ - `uv.lock`
59
+ - `environment.yml`
60
+ - `.python-version`
61
+
62
+ If at least one of them exists, the tool prints:
63
+
64
+ `Conclusion: this looks like a Python project`
65
+
66
+ It also checks whether the current Python is running in a virtual environment.
67
+ After the scan, it prints a short list of beginner-friendly suggestions based on the result.
68
+
69
+ Supported common cases:
70
+
71
+ - `venv`
72
+ - `virtualenv`
73
+ - `Conda`
74
+
75
+ ## Why Virtual Environments Are Useful
76
+
77
+ Virtual environments help keep project dependencies isolated.
78
+ This makes it easier to avoid version conflicts between different Python projects on the same machine.
79
+
80
+ ## Project Structure
81
+
82
+ ```text
83
+ pyenv-doctor/
84
+ |-- .gitignore
85
+ |-- .github/
86
+ | |-- workflows/
87
+ | | |-- ci.yml
88
+ | | `-- publish.yml
89
+ |-- pyproject.toml
90
+ |-- README.md
91
+ |-- requirements.txt
92
+ |-- LICENSE
93
+ |-- main.py
94
+ `-- tests/
95
+ `-- test_main.py
96
+ ```
97
+
98
+ ## Installation
99
+
100
+ ### 1. Make sure Python 3.11 or newer is available
101
+
102
+ ```powershell
103
+ python --version
104
+ ```
105
+
106
+ ### 2. Install from PyPI
107
+
108
+ The PyPI package name is:
109
+
110
+ ```text
111
+ python-project-doctor-cli
112
+ ```
113
+
114
+ Install it with:
115
+
116
+ ```powershell
117
+ python -m pip install python-project-doctor-cli
118
+ ```
119
+
120
+ The installed command name is still:
121
+
122
+ ```powershell
123
+ pyenv-doctor
124
+ ```
125
+
126
+ ### 3. Install locally from source
127
+
128
+ Clone the repository, enter the project directory, and install it locally:
129
+
130
+ ```powershell
131
+ python -m pip install .
132
+ ```
133
+
134
+ For local development, you can also use editable install:
135
+
136
+ ```powershell
137
+ python -m pip install -e .
138
+ ```
139
+
140
+ ## Run
141
+
142
+ Run the installed CLI command:
143
+
144
+ ```powershell
145
+ pyenv-doctor
146
+ pyenv-doctor .
147
+ pyenv-doctor C:\my-project
148
+ pyenv-doctor . --json
149
+ ```
150
+
151
+ Run the tool from source:
152
+
153
+ ```powershell
154
+ python main.py
155
+ python main.py C:\my-project
156
+ python main.py C:\my-project --json
157
+ ```
158
+
159
+ ### Windows note for virtual environment detection
160
+
161
+ If you want to verify virtual environment detection on Windows, activate the virtual environment first and then run:
162
+
163
+ ```powershell
164
+ python main.py
165
+ ```
166
+
167
+ This is recommended because `py -3.14 main.py` may use the system interpreter instead of the currently activated virtual environment.
168
+
169
+ ## Run Tests
170
+
171
+ Run the test suite with:
172
+
173
+ ```powershell
174
+ python -m unittest discover -s tests -v
175
+ ```
176
+
177
+ ## Exit Codes
178
+
179
+ - `0`: the scan completed successfully
180
+ - non-zero: the scan failed because the path was invalid or the arguments were invalid
181
+
182
+ ## JSON Output
183
+
184
+ Use `--json` to get machine-readable output:
185
+
186
+ ```powershell
187
+ pyenv-doctor . --json
188
+ python main.py . --json
189
+ ```
190
+
191
+ The JSON output includes:
192
+
193
+ - `scanned_directory`
194
+ - `found_files`
195
+ - `looks_like_python_project`
196
+ - `virtual_environment_detected`
197
+ - `error`
198
+ - `suggestions`
199
+
200
+ ## Example Output
201
+
202
+ ### Example 1: Python project detected, virtual environment detected
203
+
204
+ ```text
205
+ Scanned directory: C:\demo\my-project
206
+
207
+ Project file detection:
208
+ - requirements.txt: not found
209
+ - pyproject.toml: found
210
+ - setup.py: not found
211
+ - setup.cfg: not found
212
+ - Pipfile: not found
213
+ - poetry.lock: found
214
+ - uv.lock: not found
215
+ - environment.yml: not found
216
+ - .python-version: not found
217
+
218
+ Conclusion: this looks like a Python project
219
+ Reason: detected pyproject.toml, poetry.lock
220
+
221
+ Virtual environment detection:
222
+ Virtual environment: detected
223
+
224
+ Suggestions:
225
+ - Open pyproject.toml to check how this project should be installed or run.
226
+ - If this project uses Poetry, review pyproject.toml and try poetry install.
227
+ ```
228
+
229
+ ### Example 2: No project markers, no virtual environment
230
+
231
+ ```text
232
+ Scanned directory: C:\demo\empty-folder
233
+
234
+ Project file detection:
235
+ - requirements.txt: not found
236
+ - pyproject.toml: not found
237
+ - setup.py: not found
238
+ - setup.cfg: not found
239
+ - Pipfile: not found
240
+ - poetry.lock: not found
241
+ - uv.lock: not found
242
+ - environment.yml: not found
243
+ - .python-version: not found
244
+
245
+ Conclusion: no clear Python project markers were found
246
+ Details: common Python project files were not found in this directory.
247
+
248
+ Virtual environment detection:
249
+ Virtual environment: not detected
250
+ Recommendation: use venv or Conda for an isolated Python environment
251
+
252
+ Suggestions:
253
+ - Verify that you are scanning the project root directory.
254
+ ```
255
+
256
+ ### Example 3: Invalid path
257
+
258
+ ```text
259
+ Error: path does not exist: C:\does-not-exist
260
+
261
+ Suggestions:
262
+ - Check the path spelling and try again.
263
+ ```
264
+
265
+ ### Example 4: JSON output
266
+
267
+ ```json
268
+ {
269
+ "scanned_directory": "C:\\demo\\my-project",
270
+ "found_files": [
271
+ "Pipfile",
272
+ ".python-version"
273
+ ],
274
+ "looks_like_python_project": true,
275
+ "virtual_environment_detected": false,
276
+ "error": null,
277
+ "suggestions": [
278
+ "Open Pipfile to review the project's dependencies and environment settings.",
279
+ "Check .python-version to see which Python version this project expects."
280
+ ]
281
+ }
282
+ ```
283
+
284
+ ## Publishing
285
+
286
+ This repository includes a GitHub Actions workflow for trusted publishing to PyPI when a GitHub release is published.
287
+
288
+ To use it, first add this repository as a trusted publisher in your PyPI project settings.
289
+ Then create a GitHub release to trigger the publish workflow.
290
+
291
+ ## Roadmap
292
+
293
+ - Improve test coverage
294
+ - Improve detection rules for different Python workflows
295
+
296
+ ## License
297
+
298
+ This project is licensed under the [MIT License](LICENSE).
@@ -0,0 +1,257 @@
1
+ # pyenv-doctor
2
+
3
+ `pyenv-doctor` is a minimal Python command-line tool for beginners.
4
+
5
+ It scans a directory, checks whether it looks like a Python project, and tells you whether the current Python interpreter is running inside a virtual environment.
6
+
7
+ ## What It Checks
8
+
9
+ This MVP checks for these common Python project files:
10
+
11
+ - `requirements.txt`
12
+ - `pyproject.toml`
13
+ - `setup.py`
14
+ - `setup.cfg`
15
+ - `Pipfile`
16
+ - `poetry.lock`
17
+ - `uv.lock`
18
+ - `environment.yml`
19
+ - `.python-version`
20
+
21
+ If at least one of them exists, the tool prints:
22
+
23
+ `Conclusion: this looks like a Python project`
24
+
25
+ It also checks whether the current Python is running in a virtual environment.
26
+ After the scan, it prints a short list of beginner-friendly suggestions based on the result.
27
+
28
+ Supported common cases:
29
+
30
+ - `venv`
31
+ - `virtualenv`
32
+ - `Conda`
33
+
34
+ ## Why Virtual Environments Are Useful
35
+
36
+ Virtual environments help keep project dependencies isolated.
37
+ This makes it easier to avoid version conflicts between different Python projects on the same machine.
38
+
39
+ ## Project Structure
40
+
41
+ ```text
42
+ pyenv-doctor/
43
+ |-- .gitignore
44
+ |-- .github/
45
+ | |-- workflows/
46
+ | | |-- ci.yml
47
+ | | `-- publish.yml
48
+ |-- pyproject.toml
49
+ |-- README.md
50
+ |-- requirements.txt
51
+ |-- LICENSE
52
+ |-- main.py
53
+ `-- tests/
54
+ `-- test_main.py
55
+ ```
56
+
57
+ ## Installation
58
+
59
+ ### 1. Make sure Python 3.11 or newer is available
60
+
61
+ ```powershell
62
+ python --version
63
+ ```
64
+
65
+ ### 2. Install from PyPI
66
+
67
+ The PyPI package name is:
68
+
69
+ ```text
70
+ python-project-doctor-cli
71
+ ```
72
+
73
+ Install it with:
74
+
75
+ ```powershell
76
+ python -m pip install python-project-doctor-cli
77
+ ```
78
+
79
+ The installed command name is still:
80
+
81
+ ```powershell
82
+ pyenv-doctor
83
+ ```
84
+
85
+ ### 3. Install locally from source
86
+
87
+ Clone the repository, enter the project directory, and install it locally:
88
+
89
+ ```powershell
90
+ python -m pip install .
91
+ ```
92
+
93
+ For local development, you can also use editable install:
94
+
95
+ ```powershell
96
+ python -m pip install -e .
97
+ ```
98
+
99
+ ## Run
100
+
101
+ Run the installed CLI command:
102
+
103
+ ```powershell
104
+ pyenv-doctor
105
+ pyenv-doctor .
106
+ pyenv-doctor C:\my-project
107
+ pyenv-doctor . --json
108
+ ```
109
+
110
+ Run the tool from source:
111
+
112
+ ```powershell
113
+ python main.py
114
+ python main.py C:\my-project
115
+ python main.py C:\my-project --json
116
+ ```
117
+
118
+ ### Windows note for virtual environment detection
119
+
120
+ If you want to verify virtual environment detection on Windows, activate the virtual environment first and then run:
121
+
122
+ ```powershell
123
+ python main.py
124
+ ```
125
+
126
+ This is recommended because `py -3.14 main.py` may use the system interpreter instead of the currently activated virtual environment.
127
+
128
+ ## Run Tests
129
+
130
+ Run the test suite with:
131
+
132
+ ```powershell
133
+ python -m unittest discover -s tests -v
134
+ ```
135
+
136
+ ## Exit Codes
137
+
138
+ - `0`: the scan completed successfully
139
+ - non-zero: the scan failed because the path was invalid or the arguments were invalid
140
+
141
+ ## JSON Output
142
+
143
+ Use `--json` to get machine-readable output:
144
+
145
+ ```powershell
146
+ pyenv-doctor . --json
147
+ python main.py . --json
148
+ ```
149
+
150
+ The JSON output includes:
151
+
152
+ - `scanned_directory`
153
+ - `found_files`
154
+ - `looks_like_python_project`
155
+ - `virtual_environment_detected`
156
+ - `error`
157
+ - `suggestions`
158
+
159
+ ## Example Output
160
+
161
+ ### Example 1: Python project detected, virtual environment detected
162
+
163
+ ```text
164
+ Scanned directory: C:\demo\my-project
165
+
166
+ Project file detection:
167
+ - requirements.txt: not found
168
+ - pyproject.toml: found
169
+ - setup.py: not found
170
+ - setup.cfg: not found
171
+ - Pipfile: not found
172
+ - poetry.lock: found
173
+ - uv.lock: not found
174
+ - environment.yml: not found
175
+ - .python-version: not found
176
+
177
+ Conclusion: this looks like a Python project
178
+ Reason: detected pyproject.toml, poetry.lock
179
+
180
+ Virtual environment detection:
181
+ Virtual environment: detected
182
+
183
+ Suggestions:
184
+ - Open pyproject.toml to check how this project should be installed or run.
185
+ - If this project uses Poetry, review pyproject.toml and try poetry install.
186
+ ```
187
+
188
+ ### Example 2: No project markers, no virtual environment
189
+
190
+ ```text
191
+ Scanned directory: C:\demo\empty-folder
192
+
193
+ Project file detection:
194
+ - requirements.txt: not found
195
+ - pyproject.toml: not found
196
+ - setup.py: not found
197
+ - setup.cfg: not found
198
+ - Pipfile: not found
199
+ - poetry.lock: not found
200
+ - uv.lock: not found
201
+ - environment.yml: not found
202
+ - .python-version: not found
203
+
204
+ Conclusion: no clear Python project markers were found
205
+ Details: common Python project files were not found in this directory.
206
+
207
+ Virtual environment detection:
208
+ Virtual environment: not detected
209
+ Recommendation: use venv or Conda for an isolated Python environment
210
+
211
+ Suggestions:
212
+ - Verify that you are scanning the project root directory.
213
+ ```
214
+
215
+ ### Example 3: Invalid path
216
+
217
+ ```text
218
+ Error: path does not exist: C:\does-not-exist
219
+
220
+ Suggestions:
221
+ - Check the path spelling and try again.
222
+ ```
223
+
224
+ ### Example 4: JSON output
225
+
226
+ ```json
227
+ {
228
+ "scanned_directory": "C:\\demo\\my-project",
229
+ "found_files": [
230
+ "Pipfile",
231
+ ".python-version"
232
+ ],
233
+ "looks_like_python_project": true,
234
+ "virtual_environment_detected": false,
235
+ "error": null,
236
+ "suggestions": [
237
+ "Open Pipfile to review the project's dependencies and environment settings.",
238
+ "Check .python-version to see which Python version this project expects."
239
+ ]
240
+ }
241
+ ```
242
+
243
+ ## Publishing
244
+
245
+ This repository includes a GitHub Actions workflow for trusted publishing to PyPI when a GitHub release is published.
246
+
247
+ To use it, first add this repository as a trusted publisher in your PyPI project settings.
248
+ Then create a GitHub release to trigger the publish workflow.
249
+
250
+ ## Roadmap
251
+
252
+ - Improve test coverage
253
+ - Improve detection rules for different Python workflows
254
+
255
+ ## License
256
+
257
+ This project is licensed under the [MIT License](LICENSE).