pyconflict 2.0.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.
- pyconflict-2.0.0/LICENSE +21 -0
- pyconflict-2.0.0/PKG-INFO +498 -0
- pyconflict-2.0.0/README.md +455 -0
- pyconflict-2.0.0/pyproject.toml +138 -0
- pyconflict-2.0.0/setup.cfg +4 -0
- pyconflict-2.0.0/src/pyconflict/__init__.py +3 -0
- pyconflict-2.0.0/src/pyconflict/__main__.py +6 -0
- pyconflict-2.0.0/src/pyconflict/application/__init__.py +1 -0
- pyconflict-2.0.0/src/pyconflict/application/exceptions.py +27 -0
- pyconflict-2.0.0/src/pyconflict/application/use_cases/__init__.py +1 -0
- pyconflict-2.0.0/src/pyconflict/application/use_cases/check_add_package.py +113 -0
- pyconflict-2.0.0/src/pyconflict/application/use_cases/check_environment.py +97 -0
- pyconflict-2.0.0/src/pyconflict/application/use_cases/get_latest_stable.py +62 -0
- pyconflict-2.0.0/src/pyconflict/application/use_cases/team_check.py +114 -0
- pyconflict-2.0.0/src/pyconflict/domain/__init__.py +1 -0
- pyconflict-2.0.0/src/pyconflict/domain/entities.py +122 -0
- pyconflict-2.0.0/src/pyconflict/domain/exceptions.py +23 -0
- pyconflict-2.0.0/src/pyconflict/domain/repositories.py +140 -0
- pyconflict-2.0.0/src/pyconflict/domain/services/__init__.py +1 -0
- pyconflict-2.0.0/src/pyconflict/domain/services/conflict_detector.py +124 -0
- pyconflict-2.0.0/src/pyconflict/domain/services/suggestion_generator.py +101 -0
- pyconflict-2.0.0/src/pyconflict/domain/services/version_resolver.py +86 -0
- pyconflict-2.0.0/src/pyconflict/infrastructure/__init__.py +1 -0
- pyconflict-2.0.0/src/pyconflict/infrastructure/exceptions.py +25 -0
- pyconflict-2.0.0/src/pyconflict/infrastructure/repositories/__init__.py +1 -0
- pyconflict-2.0.0/src/pyconflict/infrastructure/repositories/cloud_cache_repository.py +51 -0
- pyconflict-2.0.0/src/pyconflict/infrastructure/repositories/disk_cache_repository.py +154 -0
- pyconflict-2.0.0/src/pyconflict/infrastructure/repositories/pip_environment_repository.py +75 -0
- pyconflict-2.0.0/src/pyconflict/infrastructure/repositories/pypi_repository.py +277 -0
- pyconflict-2.0.0/src/pyconflict/presentation/__init__.py +1 -0
- pyconflict-2.0.0/src/pyconflict/presentation/cli/__init__.py +1 -0
- pyconflict-2.0.0/src/pyconflict/presentation/cli/commands.py +487 -0
- pyconflict-2.0.0/src/pyconflict/presentation/cli/di.py +124 -0
- pyconflict-2.0.0/src/pyconflict/presentation/cli/formatters.py +132 -0
- pyconflict-2.0.0/src/pyconflict.egg-info/PKG-INFO +498 -0
- pyconflict-2.0.0/src/pyconflict.egg-info/SOURCES.txt +38 -0
- pyconflict-2.0.0/src/pyconflict.egg-info/dependency_links.txt +1 -0
- pyconflict-2.0.0/src/pyconflict.egg-info/entry_points.txt +2 -0
- pyconflict-2.0.0/src/pyconflict.egg-info/requires.txt +18 -0
- pyconflict-2.0.0/src/pyconflict.egg-info/top_level.txt +1 -0
pyconflict-2.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ali Moradi
|
|
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,498 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: pyconflict
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Python Dependency Conflict Checker - Check before you install
|
|
5
|
+
Author: PyConflict Team
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/alimoradi296/PyConflict
|
|
8
|
+
Project-URL: Documentation, https://github.com/alimoradi296/PyConflict#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/alimoradi296/PyConflict
|
|
10
|
+
Project-URL: Issues, https://github.com/alimoradi296/PyConflict/issues
|
|
11
|
+
Keywords: dependency,conflict,checker,python,pip,pypi,pep508,dependency-management,cli,ai,mcp,cursor,vscode,claude-code
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
22
|
+
Classifier: Topic :: System :: Installation/Setup
|
|
23
|
+
Classifier: Topic :: Utilities
|
|
24
|
+
Requires-Python: >=3.8
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: typer>=0.9.0
|
|
28
|
+
Requires-Dist: rich>=13.0
|
|
29
|
+
Requires-Dist: requests>=2.28
|
|
30
|
+
Requires-Dist: packaging>=23.0
|
|
31
|
+
Requires-Dist: platformdirs>=3.0
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
36
|
+
Requires-Dist: black>=23.0; extra == "dev"
|
|
37
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
38
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
39
|
+
Requires-Dist: types-requests>=2.28; extra == "dev"
|
|
40
|
+
Requires-Dist: redis>=5.0; extra == "dev"
|
|
41
|
+
Provides-Extra: team
|
|
42
|
+
Requires-Dist: redis>=5.0; extra == "team"
|
|
43
|
+
|
|
44
|
+
# PyConflict
|
|
45
|
+
|
|
46
|
+
[](https://github.com/alimoradi296/PyConflict/actions)
|
|
47
|
+
[](https://codecov.io/gh/alimoradi296/PyConflict)
|
|
48
|
+
[](https://opensource.org/licenses/MIT)
|
|
49
|
+
[](https://github.com/psf/black)
|
|
50
|
+
|
|
51
|
+
**Python Dependency Conflict Checker - Check before you install**
|
|
52
|
+
|
|
53
|
+
PyConflict checks Python package dependency constraints before installation. It supports
|
|
54
|
+
PEP 508 environment markers, installed-environment audits, batch checks, and integrations
|
|
55
|
+
for AI coding tools.
|
|
56
|
+
|
|
57
|
+
It answers one question: **"Will adding this package conflict with versions already installed?"**
|
|
58
|
+
|
|
59
|
+
Unlike existing tools that detect conflicts *after* installation, PyConflict is **proactive** - it checks dependencies before making changes.
|
|
60
|
+
|
|
61
|
+
## Why PyConflict?
|
|
62
|
+
|
|
63
|
+
**The Problem:**
|
|
64
|
+
```bash
|
|
65
|
+
# requirements.txt pins django==3.2 and asgiref==3.2.0
|
|
66
|
+
$ python -m pip install -r requirements.txt
|
|
67
|
+
ERROR: django==3.2 requires asgiref>=3.3.2,<4, but asgiref==3.2.0 is pinned
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**The Solution:**
|
|
71
|
+
```bash
|
|
72
|
+
$ pyconflict check-add django==3.2
|
|
73
|
+
✗ Cannot add django==3.2
|
|
74
|
+
|
|
75
|
+
Conflicts detected:
|
|
76
|
+
• asgiref
|
|
77
|
+
Required: <4,>=3.3.2
|
|
78
|
+
Installed: 3.2.0
|
|
79
|
+
|
|
80
|
+
Suggestions:
|
|
81
|
+
→ Upgrade 'asgiref' from 3.2.0 to satisfy django's requirement (<4,>=3.3.2)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Features
|
|
85
|
+
|
|
86
|
+
- ✅ **Proactive conflict detection** - Check dependency constraints before installing
|
|
87
|
+
- ✅ **AI-assistant friendly** - JSON output for Claude Code, Cursor, Copilot
|
|
88
|
+
- ✅ **Editor integrations** - Cursor instructions, an MCP server, and a VS Code extension
|
|
89
|
+
- ✅ **PEP 508 markers** - Ignore requirements that do not apply to the selected Python and platform
|
|
90
|
+
- ✅ **Cached PyPI metadata** - Reuse package data between checks
|
|
91
|
+
- ✅ **Direct dependencies** - Checks package's immediate dependencies against installed versions
|
|
92
|
+
- ✅ **Latest stable version** - Find the newest non-prerelease version
|
|
93
|
+
- ✅ **Clean Architecture** - Maintainable, testable, extensible codebase
|
|
94
|
+
- ✅ **Tests** - Unit and integration test suites are included
|
|
95
|
+
|
|
96
|
+
### Current limits
|
|
97
|
+
- `check-add` checks direct dependencies. It does not resolve transitive dependencies.
|
|
98
|
+
- Optional extras such as `package[security]` are not included.
|
|
99
|
+
- `batch-check` accepts package names and exact `==` pins only.
|
|
100
|
+
- Private package indexes are not supported.
|
|
101
|
+
|
|
102
|
+
## Installation
|
|
103
|
+
|
|
104
|
+
### From source (current)
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
git clone https://github.com/alimoradi296/PyConflict.git
|
|
108
|
+
cd PyConflict
|
|
109
|
+
python -m pip install .
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
PyConflict does not have a published PyPI release yet. The PyPI install command
|
|
113
|
+
will be added here after a release is published.
|
|
114
|
+
|
|
115
|
+
### Development install
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
python -m pip install -e ".[dev]"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Verify Installation
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
pyconflict --help
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Quick Start
|
|
128
|
+
|
|
129
|
+
### Check if a package is safe to add
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Check latest version
|
|
133
|
+
$ pyconflict check-add tensorflow
|
|
134
|
+
|
|
135
|
+
# Check specific version
|
|
136
|
+
$ pyconflict check-add django==3.2
|
|
137
|
+
|
|
138
|
+
# JSON output (for AI tools)
|
|
139
|
+
$ pyconflict check-add requests --json
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Get latest stable version
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Latest version
|
|
146
|
+
$ pyconflict stable pandas
|
|
147
|
+
|
|
148
|
+
# Filter by Python version
|
|
149
|
+
$ pyconflict stable numpy --python-version 3.8
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Check the installed environment and multiple package candidates
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
pyconflict check-env --json
|
|
156
|
+
pyconflict batch-check -p django -p "requests==2.31.0" --json
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
`batch-check` accepts package names or exact `==` pins. It rejects version ranges,
|
|
160
|
+
extras, and environment markers.
|
|
161
|
+
|
|
162
|
+
### Optional team baseline check
|
|
163
|
+
|
|
164
|
+
From the repository checkout, install Redis support with
|
|
165
|
+
`python -m pip install ".[team]"`, then configure
|
|
166
|
+
`PYCONFLICT_WORKSPACE_ID` and `PYCONFLICT_REDIS_URL`. Compare the current
|
|
167
|
+
environment with a saved baseline by running `pyconflict team-check`. To
|
|
168
|
+
explicitly save the current package names and versions as the shared baseline,
|
|
169
|
+
run `pyconflict team-check --set-standard`. Saving sends those names and
|
|
170
|
+
versions to the configured Redis service; a normal check only reads the
|
|
171
|
+
baseline.
|
|
172
|
+
|
|
173
|
+
## Usage
|
|
174
|
+
|
|
175
|
+
### Command: `check-add`
|
|
176
|
+
|
|
177
|
+
Check if adding a package will cause conflicts with your current environment.
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
pyconflict check-add <package> [OPTIONS]
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Options:**
|
|
184
|
+
- `--version TEXT` - Specific version to check
|
|
185
|
+
- `--json` - Output in JSON format
|
|
186
|
+
|
|
187
|
+
**Exit codes:**
|
|
188
|
+
- `0` - Safe to add, no conflicts
|
|
189
|
+
- `1` - Conflict detected
|
|
190
|
+
- `2` - Package not found
|
|
191
|
+
- `4` - Repository error
|
|
192
|
+
- `5` - Unexpected error
|
|
193
|
+
|
|
194
|
+
**Examples:**
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# Safe to add
|
|
198
|
+
$ pyconflict check-add fastapi
|
|
199
|
+
✓ Safe to add fastapi==0.104.1
|
|
200
|
+
|
|
201
|
+
# Conflict detected
|
|
202
|
+
$ pyconflict check-add django==3.2
|
|
203
|
+
✗ Cannot add django==3.2
|
|
204
|
+
|
|
205
|
+
Conflicts detected:
|
|
206
|
+
• asgiref
|
|
207
|
+
Required: <4,>=3.3.2
|
|
208
|
+
Installed: 3.2.0
|
|
209
|
+
|
|
210
|
+
Suggestions:
|
|
211
|
+
→ Upgrade 'asgiref' from 3.2.0 to satisfy django's requirement (<4,>=3.3.2)
|
|
212
|
+
|
|
213
|
+
# JSON output
|
|
214
|
+
$ pyconflict check-add django==3.2 --json
|
|
215
|
+
{
|
|
216
|
+
"status": "conflict",
|
|
217
|
+
"exit_code": 1,
|
|
218
|
+
"package": {
|
|
219
|
+
"name": "django",
|
|
220
|
+
"version": "3.2.0"
|
|
221
|
+
},
|
|
222
|
+
"conflicts": [
|
|
223
|
+
{
|
|
224
|
+
"dependency": "asgiref",
|
|
225
|
+
"required": "<4,>=3.3.2",
|
|
226
|
+
"installed": "3.2.0",
|
|
227
|
+
"required_by": "django==3.2.0",
|
|
228
|
+
"severity": "error"
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
"suggestions": [
|
|
232
|
+
"Upgrade 'asgiref' from 3.2.0 to satisfy django's requirement (<4,>=3.3.2)"
|
|
233
|
+
],
|
|
234
|
+
"caveats": [
|
|
235
|
+
"Only direct dependencies checked (not transitive)",
|
|
236
|
+
"Optional extras not included"
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Command: `stable`
|
|
242
|
+
|
|
243
|
+
Get the latest stable (non-prerelease) version of a package.
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
pyconflict stable <package> [OPTIONS]
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**Options:**
|
|
250
|
+
- `--python-version TEXT` - Filter by Python version compatibility
|
|
251
|
+
- `--json` - Output in JSON format
|
|
252
|
+
|
|
253
|
+
**Examples:**
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
$ pyconflict stable pandas
|
|
257
|
+
pandas==2.1.4
|
|
258
|
+
|
|
259
|
+
$ pyconflict stable numpy --python-version 3.8
|
|
260
|
+
numpy==1.24.4 (filtered by Python version)
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## AI Assistant Integration
|
|
264
|
+
|
|
265
|
+
### For Claude Code
|
|
266
|
+
|
|
267
|
+
PyConflict is designed to be called by AI coding assistants:
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
# Claude internally runs:
|
|
271
|
+
result=$(pyconflict check-add tensorflow --json)
|
|
272
|
+
exit_code=$?
|
|
273
|
+
|
|
274
|
+
if [ $exit_code -eq 0 ]; then
|
|
275
|
+
echo "tensorflow==2.15.0" >> requirements.txt
|
|
276
|
+
else
|
|
277
|
+
# Show conflict to user
|
|
278
|
+
echo "Cannot add tensorflow: conflicts detected"
|
|
279
|
+
fi
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### For Cursor
|
|
283
|
+
|
|
284
|
+
Add to `.cursor/rules`:
|
|
285
|
+
```
|
|
286
|
+
Before adding Python packages:
|
|
287
|
+
1. Run: pyconflict check-add <package> --json
|
|
288
|
+
2. Only proceed if exit_code == 0
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
## Architecture
|
|
292
|
+
|
|
293
|
+
PyConflict follows **Clean Architecture** principles:
|
|
294
|
+
|
|
295
|
+
```
|
|
296
|
+
┌─────────────────────┐
|
|
297
|
+
│ CLI (Typer) │ ← Presentation Layer
|
|
298
|
+
└──────────┬──────────┘
|
|
299
|
+
│
|
|
300
|
+
┌──────────▼──────────┐
|
|
301
|
+
│ Use Cases │ ← Application Layer
|
|
302
|
+
│ • CheckAddPackage │
|
|
303
|
+
│ • GetLatestStable │
|
|
304
|
+
└──────────┬──────────┘
|
|
305
|
+
│
|
|
306
|
+
┌──────────▼──────────┐
|
|
307
|
+
│ Domain Services │ ← Domain Layer
|
|
308
|
+
│ • ConflictDetector │
|
|
309
|
+
│ • VersionResolver │
|
|
310
|
+
└──────────┬──────────┘
|
|
311
|
+
│
|
|
312
|
+
┌──────────▼──────────┐
|
|
313
|
+
│ Infrastructure │ ← Infrastructure Layer
|
|
314
|
+
│ • PyPI Repository │
|
|
315
|
+
│ • Disk Cache │
|
|
316
|
+
│ • Pip Environment │
|
|
317
|
+
└─────────────────────┘
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
**Key benefits:**
|
|
321
|
+
- **Testable**: Domain logic has zero external dependencies
|
|
322
|
+
- **Swappable**: Can replace PyPI with private registry without touching business logic
|
|
323
|
+
- **Maintainable**: Clear boundaries prevent spaghetti code
|
|
324
|
+
|
|
325
|
+
## Performance
|
|
326
|
+
|
|
327
|
+
PyConflict is designed for speed:
|
|
328
|
+
|
|
329
|
+
- **Cached requests**: < 2 seconds
|
|
330
|
+
- **Uncached requests**: < 10 seconds
|
|
331
|
+
- **Stable version lookup**: < 5 seconds
|
|
332
|
+
- **Parallel requests**: Supports concurrent package checks
|
|
333
|
+
|
|
334
|
+
The timings above are targets and have not been verified for this checkout.
|
|
335
|
+
|
|
336
|
+
## Development
|
|
337
|
+
|
|
338
|
+
### Setup
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
# Clone the repository
|
|
342
|
+
git clone https://github.com/alimoradi296/PyConflict.git
|
|
343
|
+
cd PyConflict
|
|
344
|
+
|
|
345
|
+
# Create virtual environment
|
|
346
|
+
python -m venv venv
|
|
347
|
+
source venv/bin/activate # or venv\Scripts\activate on Windows
|
|
348
|
+
|
|
349
|
+
# Install in development mode
|
|
350
|
+
pip install -e ".[dev]"
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Running Tests
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
# Run all tests
|
|
357
|
+
pytest
|
|
358
|
+
|
|
359
|
+
# Run with coverage
|
|
360
|
+
pytest --cov=pyconflict --cov-report=html
|
|
361
|
+
|
|
362
|
+
# Run only unit tests (fast)
|
|
363
|
+
pytest tests/unit -v
|
|
364
|
+
|
|
365
|
+
# Run integration tests (requires network)
|
|
366
|
+
pytest tests/integration -v -m integration
|
|
367
|
+
|
|
368
|
+
# Run specific test
|
|
369
|
+
pytest tests/unit/domain/test_version_resolver.py
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### Code Quality
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
# Format code
|
|
376
|
+
black src tests
|
|
377
|
+
|
|
378
|
+
# Lint
|
|
379
|
+
ruff check src tests
|
|
380
|
+
|
|
381
|
+
# Type check
|
|
382
|
+
mypy src
|
|
383
|
+
|
|
384
|
+
# Run all checks (CI simulation)
|
|
385
|
+
black --check src tests && ruff check src tests && mypy src && pytest
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
## Limitations
|
|
389
|
+
|
|
390
|
+
PyConflict checks direct dependencies for `check-add` and installed distribution
|
|
391
|
+
requirements for `check-env`:
|
|
392
|
+
|
|
393
|
+
- ⚠️ **Direct dependencies only** - Transitive dependencies are not checked
|
|
394
|
+
- ⚠️ **Extras not checked** - `package[security]` extras are not included
|
|
395
|
+
- ⚠️ **Public PyPI only** - Private registries are not supported
|
|
396
|
+
- ⚠️ **Suggestions only** - No automatic fixes (by design - user decides)
|
|
397
|
+
|
|
398
|
+
**Accuracy is not measured.** The tool checks direct dependency constraints against
|
|
399
|
+
the current environment. It does not resolve the full dependency graph.
|
|
400
|
+
|
|
401
|
+
PyConflict does not report a confidence percentage. Its checks cover documented inputs;
|
|
402
|
+
they are not a guarantee that an installation will succeed.
|
|
403
|
+
|
|
404
|
+
See [Roadmap](ROADMAP.md) for current priorities.
|
|
405
|
+
|
|
406
|
+
## Roadmap
|
|
407
|
+
|
|
408
|
+
### Current implementation
|
|
409
|
+
- ✅ Direct dependency conflict detection
|
|
410
|
+
- ✅ PEP 508 environment marker evaluation
|
|
411
|
+
- ✅ Installed environment check
|
|
412
|
+
- ✅ Batch package checks
|
|
413
|
+
- ✅ Latest stable version lookup
|
|
414
|
+
- ✅ CLI with JSON output
|
|
415
|
+
- ✅ Redis-backed team baseline (explicit opt-in when saving)
|
|
416
|
+
- ✅ MCP server and VS Code extension source package
|
|
417
|
+
- ✅ Cursor setup instructions
|
|
418
|
+
|
|
419
|
+
### Planned
|
|
420
|
+
- Transitive dependency analysis with explicit graph and cycle handling
|
|
421
|
+
- Extras handling (`package[extra]`)
|
|
422
|
+
- Real-service acceptance checks for MCP stdio, Redis, and the VS Code host
|
|
423
|
+
- Private index support after credential and configuration behavior is designed
|
|
424
|
+
|
|
425
|
+
See [ROADMAP.md](ROADMAP.md) for current project priorities.
|
|
426
|
+
|
|
427
|
+
## FAQ
|
|
428
|
+
|
|
429
|
+
**Q: How is this different from `pip check`?**
|
|
430
|
+
A: `pip check` is reactive - it checks for conflicts after installation. PyConflict is proactive - it checks before you install.
|
|
431
|
+
|
|
432
|
+
**Q: Does it work with private PyPI repositories?**
|
|
433
|
+
A: No. PyConflict currently reads package metadata from public PyPI.
|
|
434
|
+
|
|
435
|
+
**Q: Can it automatically fix conflicts?**
|
|
436
|
+
A: No. PyConflict provides suggestions, but you decide what to do. Automatic fixes are too risky.
|
|
437
|
+
|
|
438
|
+
**Q: How accurate is it?**
|
|
439
|
+
A: We have not measured accuracy. `check-add` checks direct dependencies and evaluates their environment markers. It does not check transitive dependencies or optional extras.
|
|
440
|
+
|
|
441
|
+
**Q: Does it replace poetry/pip-tools?**
|
|
442
|
+
A: No. PyConflict is a checker, not a package manager or lock file tool. Use it alongside your existing tools.
|
|
443
|
+
|
|
444
|
+
## Contributing
|
|
445
|
+
|
|
446
|
+
Contributions are welcome! We need help with:
|
|
447
|
+
|
|
448
|
+
- 🐛 Bug reports and fixes
|
|
449
|
+
- ✨ Feature implementations
|
|
450
|
+
- 📝 Documentation improvements
|
|
451
|
+
- 🧪 Test coverage expansion
|
|
452
|
+
- 🌍 Translations (future)
|
|
453
|
+
|
|
454
|
+
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
455
|
+
|
|
456
|
+
### Development Workflow
|
|
457
|
+
|
|
458
|
+
1. Fork and clone the repository
|
|
459
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
460
|
+
3. Make your changes with tests
|
|
461
|
+
4. Ensure all tests pass (`pytest`)
|
|
462
|
+
5. Ensure code quality (`black`, `ruff`, `mypy`)
|
|
463
|
+
6. Commit with conventional commits (`feat:`, `fix:`, etc.)
|
|
464
|
+
7. Push and create a Pull Request
|
|
465
|
+
|
|
466
|
+
## Community
|
|
467
|
+
|
|
468
|
+
- 🐛 **Report bugs or request features**: [GitHub Issues](https://github.com/alimoradi296/PyConflict/issues)
|
|
469
|
+
- 💬 **Ask questions**: Open a GitHub issue and describe what you are trying to do.
|
|
470
|
+
- 🤝 **Contribute**: See [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
471
|
+
|
|
472
|
+
## License
|
|
473
|
+
|
|
474
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
475
|
+
|
|
476
|
+
## Links
|
|
477
|
+
|
|
478
|
+
- **GitHub**: https://github.com/alimoradi296/PyConflict
|
|
479
|
+
- **Documentation**: [README](https://github.com/alimoradi296/PyConflict#readme)
|
|
480
|
+
- **Issues**: https://github.com/alimoradi296/PyConflict/issues
|
|
481
|
+
- **Changelog**: [CHANGELOG.md](CHANGELOG.md)
|
|
482
|
+
|
|
483
|
+
## Star History
|
|
484
|
+
|
|
485
|
+
If PyConflict saves you time, please give it a star on GitHub!
|
|
486
|
+
|
|
487
|
+
[](https://star-history.com/#alimoradi296/PyConflict&Date)
|
|
488
|
+
|
|
489
|
+
## Credits
|
|
490
|
+
|
|
491
|
+
Built with:
|
|
492
|
+
- [Typer](https://typer.tiangolo.com/) - CLI framework
|
|
493
|
+
- [Rich](https://rich.readthedocs.io/) - Terminal formatting
|
|
494
|
+
- [Packaging](https://packaging.pypa.io/) - Version parsing (PEP 440, PEP 508)
|
|
495
|
+
|
|
496
|
+
---
|
|
497
|
+
|
|
498
|
+
**Made with ❤️ for Python developers and AI coding assistants**
|