@@ -129,49 +129,49 @@ dependencies = ["test-rust", "doctest"]
129129
130130[tasks .test-python ]
131131description = " Build and test Python bindings"
132- dependencies = [" build-python" , " test-python-run" ]
132+ condition = { files_exist = [" ${CARGO_MAKE_WORKING_DIRECTORY}/crates/feedparser-rs-py/Cargo.toml" ] }
133+ dependencies = [" test-python-deps" , " test-python-build" , " test-python-install" , " test-python-run" , " test-python-import" ]
134+
135+ [tasks .test-python-deps ]
136+ description = " Install Python dependencies"
137+ command = " uv"
138+ args = [" pip" , " install" , " --system" , " maturin" , " pytest" ]
133139
134- [tasks .build -python ]
140+ [tasks .test -python-build ]
135141description = " Build Python wheel with maturin"
136- condition = { files_exist = [" ${CARGO_MAKE_WORKING_DIRECTORY}/crates/feedparser-rs-py/Cargo.toml" ] }
137- script = '''
138- #!/bin/bash
139- set -e
140- cd crates/feedparser-rs-py
142+ cwd = " ./crates/feedparser-rs-py"
143+ command = " maturin"
144+ args = [" build" , " --release" , " --out" , " dist" ]
141145
142- # Check if uv is available, fallback to pip
143- if command -v uv &> /dev/null; then
144- uv pip install --system maturin pytest
145- else
146- pip install maturin pytest
147- fi
146+ [ tasks . test-python-install ]
147+ description = " Install built wheel "
148+ cwd = " ./crates/feedparser-rs-py "
149+ command = " uv "
150+ args = [ " pip" , " install" , " --system " , " --reinstall " , " --no-deps " , " dist/feedparser_rs-0.1.0-cp39-abi3-${CARGO_MAKE_RUST_TARGET_TRIPLE}.whl " ]
151+ # Note: wheel name pattern may need adjustment per platform
148152
149- maturin build --release --out dist
150- '''
153+ [tasks .test-python-install .linux ]
154+ command = " uv"
155+ args = [" pip" , " install" , " --system" , " --reinstall" , " --no-deps" , " --find-links" , " dist" , " feedparser-rs" ]
151156
152- [tasks .test-python-run ]
153- description = " Run pytest on Python bindings"
154- condition = { files_exist = [" ${CARGO_MAKE_WORKING_DIRECTORY}/crates/feedparser-rs-py/tests" ] }
155- script = '''
156- #!/bin/bash
157- set -e
158- cd crates/feedparser-rs-py
157+ [tasks .test-python-install .mac ]
158+ command = " uv"
159+ args = [" pip" , " install" , " --system" , " --reinstall" , " --no-deps" , " --find-links" , " dist" , " feedparser-rs" ]
159160
160- # Install the built wheel
161- if command -v uv &> /dev/null; then
162- uv pip install --system dist/*.whl
163- else
164- pip install dist/*.whl
165- fi
161+ [tasks .test-python-install .windows ]
162+ command = " uv"
163+ args = [" pip" , " install" , " --system" , " --reinstall" , " --no-deps" , " --find-links" , " dist" , " feedparser-rs" ]
166164
167- # Run tests if they exist
168- if [ -d "tests" ] && [ "$(ls -A tests/*.py 2>/dev/null)" ]; then
169- pytest tests/ -v
170- fi
165+ [tasks .test-python-run ]
166+ description = " Run pytest"
167+ cwd = " ./crates/feedparser-rs-py"
168+ command = " pytest"
169+ args = [" tests/" , " -v" ]
171170
172- # Test import
173- python -c "import feedparser_rs; print('feedparser-rs loaded successfully')"
174- '''
171+ [tasks .test-python-import ]
172+ description = " Test Python import"
173+ command = " python"
174+ args = [" -c" , " import feedparser_rs; print('feedparser-rs loaded successfully')" ]
175175
176176# ============================================================================
177177# Testing Tasks - Node.js
@@ -180,15 +180,25 @@ python -c "import feedparser_rs; print('feedparser-rs loaded successfully')"
180180[tasks .test-node ]
181181description = " Build and test Node.js bindings"
182182condition = { files_exist = [" ${CARGO_MAKE_WORKING_DIRECTORY}/crates/feedparser-rs-node/package.json" ] }
183- script = '''
184- #!/bin/bash
185- set -e
186- cd crates/feedparser-rs-node
187-
188- npm ci
189- npm run build
190- npm test
191- '''
183+ dependencies = [" test-node-install" , " test-node-build" , " test-node-run" ]
184+
185+ [tasks .test-node-install ]
186+ description = " Install Node.js dependencies"
187+ cwd = " ./crates/feedparser-rs-node"
188+ command = " npm"
189+ args = [" ci" ]
190+
191+ [tasks .test-node-build ]
192+ description = " Build Node.js bindings"
193+ cwd = " ./crates/feedparser-rs-node"
194+ command = " npm"
195+ args = [" run" , " build" ]
196+
197+ [tasks .test-node-run ]
198+ description = " Run Node.js tests"
199+ cwd = " ./crates/feedparser-rs-node"
200+ command = " npm"
201+ args = [" test" ]
192202
193203# ============================================================================
194204# Coverage Tasks
@@ -219,47 +229,53 @@ echo "Coverage report generated: lcov.info"
219229[tasks .coverage-python ]
220230description = " Generate Python code coverage"
221231condition = { files_exist = [" ${CARGO_MAKE_WORKING_DIRECTORY}/crates/feedparser-rs-py/tests" ] }
222- script = '''
223- #!/bin/bash
224- set -e
225- cd crates/feedparser-rs-py
226-
227- # Install dependencies
228- if command -v uv &> /dev/null; then
229- uv pip install --system maturin pytest pytest-cov
230- else
231- pip install maturin pytest pytest-cov
232- fi
233-
234- # Build and install wheel
235- maturin build --release --out dist
236- if command -v uv &> /dev/null; then
237- uv pip install --system --force-reinstall dist/*.whl
238- else
239- pip install --force-reinstall dist/*.whl
240- fi
241-
242- # Run tests with coverage if tests exist
243- if [ -d "tests" ] && [ "$(ls -A tests/*.py 2>/dev/null)" ]; then
244- pytest tests/ --cov=feedparser_rs --cov-report=xml --cov-report=term
245- echo "Python coverage report generated: coverage.xml"
246- fi
247- '''
232+ dependencies = [" coverage-python-deps" , " coverage-python-build" , " coverage-python-install" , " coverage-python-run" ]
233+
234+ [tasks .coverage-python-deps ]
235+ description = " Install Python coverage dependencies"
236+ command = " uv"
237+ args = [" pip" , " install" , " --system" , " maturin" , " pytest" , " pytest-cov" ]
238+
239+ [tasks .coverage-python-build ]
240+ description = " Build Python wheel for coverage"
241+ cwd = " ./crates/feedparser-rs-py"
242+ command = " maturin"
243+ args = [" build" , " --release" , " --out" , " dist" ]
244+
245+ [tasks .coverage-python-install ]
246+ description = " Install built wheel for coverage"
247+ cwd = " ./crates/feedparser-rs-py"
248+ command = " uv"
249+ args = [" pip" , " install" , " --system" , " --reinstall" , " --no-deps" , " --find-links" , " dist" , " feedparser-rs" ]
250+
251+ [tasks .coverage-python-run ]
252+ description = " Run pytest with coverage"
253+ cwd = " ./crates/feedparser-rs-py"
254+ command = " pytest"
255+ args = [" tests/" , " --cov=feedparser_rs" , " --cov-report=xml" , " --cov-report=term" ]
248256
249257[tasks .coverage-node ]
250258description = " Generate Node.js code coverage with c8"
251259condition = { files_exist = [" ${CARGO_MAKE_WORKING_DIRECTORY}/crates/feedparser-rs-node/package.json" ] }
252- script = '''
253- #!/bin/bash
254- set -e
255- cd crates/feedparser-rs-node
256-
257- npm ci
258- npm run build
259- npm run test:coverage
260-
261- echo "Node.js coverage report generated in coverage/"
262- '''
260+ dependencies = [" coverage-node-install" , " coverage-node-build" , " coverage-node-run" ]
261+
262+ [tasks .coverage-node-install ]
263+ description = " Install Node.js dependencies for coverage"
264+ cwd = " ./crates/feedparser-rs-node"
265+ command = " npm"
266+ args = [" ci" ]
267+
268+ [tasks .coverage-node-build ]
269+ description = " Build Node.js bindings for coverage"
270+ cwd = " ./crates/feedparser-rs-node"
271+ command = " npm"
272+ args = [" run" , " build" ]
273+
274+ [tasks .coverage-node-run ]
275+ description = " Run Node.js tests with coverage"
276+ cwd = " ./crates/feedparser-rs-node"
277+ command = " npm"
278+ args = [" run" , " test:coverage" ]
263279
264280# ============================================================================
265281# MSRV Check
0 commit comments