Skip to content

Commit

Permalink
feat(nx-python): enable caching in UV and Poetry project generators
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasvieirasilva committed Dec 23, 2024
1 parent b7ec6c9 commit 0e74e82
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ exports[`application generator > as-provided > should run successfully minimal c
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand Down Expand Up @@ -121,6 +122,7 @@ exports[`application generator > as-provided > should run successfully minimal c
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand Down Expand Up @@ -223,6 +225,7 @@ exports[`application generator > custom template dir > should run successfully w
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand Down Expand Up @@ -307,6 +310,7 @@ exports[`application generator > individual package > should run successfully mi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand Down Expand Up @@ -409,6 +413,7 @@ exports[`application generator > individual package > should run successfully mi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand Down Expand Up @@ -511,6 +516,7 @@ exports[`application generator > individual package > should run successfully mi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand Down Expand Up @@ -616,6 +622,7 @@ exports[`application generator > individual package > should run successfully mi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand Down Expand Up @@ -718,6 +725,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand All @@ -740,6 +748,7 @@ exports[`application generator > individual package > should run successfully wi
},
},
"lint": {
"cache": true,
"executor": "@nxlv/python:flake8",
"options": {
"outputFile": "reports/apps/test/pylint.txt",
Expand Down Expand Up @@ -848,6 +857,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand All @@ -870,6 +880,7 @@ exports[`application generator > individual package > should run successfully wi
},
},
"lint": {
"cache": true,
"executor": "@nxlv/python:flake8",
"options": {
"outputFile": "reports/apps/test/pylint.txt",
Expand All @@ -890,6 +901,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"test": {
"cache": true,
"executor": "@nxlv/python:run-commands",
"options": {
"command": "poetry run pytest tests/",
Expand Down Expand Up @@ -1016,6 +1028,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand All @@ -1038,6 +1051,7 @@ exports[`application generator > individual package > should run successfully wi
},
},
"lint": {
"cache": true,
"executor": "@nxlv/python:flake8",
"options": {
"outputFile": "reports/apps/test/pylint.txt",
Expand All @@ -1058,6 +1072,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"test": {
"cache": true,
"executor": "@nxlv/python:run-commands",
"options": {
"command": "poetry run pytest tests/",
Expand Down Expand Up @@ -1184,6 +1199,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand All @@ -1206,6 +1222,7 @@ exports[`application generator > individual package > should run successfully wi
},
},
"lint": {
"cache": true,
"executor": "@nxlv/python:flake8",
"options": {
"outputFile": "reports/apps/test/pylint.txt",
Expand All @@ -1226,6 +1243,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"test": {
"cache": true,
"executor": "@nxlv/python:run-commands",
"options": {
"command": "poetry run pytest tests/",
Expand Down Expand Up @@ -1352,6 +1370,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand All @@ -1374,6 +1393,7 @@ exports[`application generator > individual package > should run successfully wi
},
},
"lint": {
"cache": true,
"executor": "@nxlv/python:flake8",
"options": {
"outputFile": "reports/apps/test/pylint.txt",
Expand All @@ -1394,6 +1414,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"test": {
"cache": true,
"executor": "@nxlv/python:run-commands",
"options": {
"command": "poetry run pytest tests/",
Expand Down Expand Up @@ -1520,6 +1541,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand All @@ -1542,6 +1564,7 @@ exports[`application generator > individual package > should run successfully wi
},
},
"lint": {
"cache": true,
"executor": "@nxlv/python:flake8",
"options": {
"outputFile": "reports/apps/test/pylint.txt",
Expand All @@ -1562,6 +1585,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"test": {
"cache": true,
"executor": "@nxlv/python:run-commands",
"options": {
"command": "poetry run pytest tests/",
Expand Down Expand Up @@ -1688,6 +1712,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand All @@ -1710,6 +1735,7 @@ exports[`application generator > individual package > should run successfully wi
},
},
"lint": {
"cache": true,
"executor": "@nxlv/python:flake8",
"options": {
"outputFile": "reports/apps/test/pylint.txt",
Expand All @@ -1730,6 +1756,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"test": {
"cache": true,
"executor": "@nxlv/python:run-commands",
"options": {
"command": "poetry run pytest tests/",
Expand Down Expand Up @@ -1843,6 +1870,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand All @@ -1865,6 +1893,7 @@ exports[`application generator > individual package > should run successfully wi
},
},
"lint": {
"cache": true,
"executor": "@nxlv/python:flake8",
"options": {
"outputFile": "reports/apps/test/pylint.txt",
Expand All @@ -1885,6 +1914,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"test": {
"cache": true,
"executor": "@nxlv/python:run-commands",
"options": {
"command": "poetry run pytest tests/",
Expand Down Expand Up @@ -2056,6 +2086,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand All @@ -2078,6 +2109,7 @@ exports[`application generator > individual package > should run successfully wi
},
},
"lint": {
"cache": true,
"executor": "@nxlv/python:ruff-check",
"options": {
"lintFilePatterns": [
Expand All @@ -2099,6 +2131,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"test": {
"cache": true,
"executor": "@nxlv/python:run-commands",
"options": {
"command": "poetry run pytest tests/",
Expand Down Expand Up @@ -2291,6 +2324,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand All @@ -2313,6 +2347,7 @@ exports[`application generator > individual package > should run successfully wi
},
},
"lint": {
"cache": true,
"executor": "@nxlv/python:flake8",
"options": {
"outputFile": "reports/apps/test/pylint.txt",
Expand All @@ -2333,6 +2368,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"test": {
"cache": true,
"executor": "@nxlv/python:run-commands",
"options": {
"command": "poetry run pytest tests/",
Expand Down Expand Up @@ -2505,6 +2541,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand All @@ -2527,6 +2564,7 @@ exports[`application generator > individual package > should run successfully wi
},
},
"lint": {
"cache": true,
"executor": "@nxlv/python:ruff-check",
"options": {
"lintFilePatterns": [
Expand Down Expand Up @@ -2648,6 +2686,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand All @@ -2670,6 +2709,7 @@ exports[`application generator > individual package > should run successfully wi
},
},
"lint": {
"cache": true,
"executor": "@nxlv/python:ruff-check",
"options": {
"lintFilePatterns": [
Expand All @@ -2691,6 +2731,7 @@ exports[`application generator > individual package > should run successfully wi
"options": {},
},
"test": {
"cache": true,
"executor": "@nxlv/python:run-commands",
"options": {
"command": "poetry run pytest tests/",
Expand Down Expand Up @@ -2821,6 +2862,7 @@ exports[`application generator > shared virtual environment > should run success
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand Down Expand Up @@ -2943,6 +2985,7 @@ exports[`application generator > shared virtual environment > should run success
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand Down Expand Up @@ -3065,6 +3108,7 @@ exports[`application generator > shared virtual environment > should run success
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand Down Expand Up @@ -3188,6 +3232,7 @@ exports[`application generator > shared virtual environment > should run success
"options": {},
},
"build": {
"cache": true,
"executor": "@nxlv/python:build",
"options": {
"bundleLocalDependencies": false,
Expand Down
4 changes: 4 additions & 0 deletions packages/nx-python/src/generators/poetry-project/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ export default async function (
lockedVersions: normalizedOptions.buildLockedVersions,
bundleLocalDependencies: normalizedOptions.buildBundleLocalDependencies,
},
cache: true,
},
install: {
executor: '@nxlv/python:install',
Expand All @@ -315,6 +316,7 @@ export default async function (
options: {
outputFile: `reports/${normalizedOptions.projectRoot}/pylint.txt`,
},
cache: true,
};
}

Expand All @@ -327,6 +329,7 @@ export default async function (
options.unitTestRunner === 'pytest' ? ['tests'] : [],
),
},
cache: true,
};
}

Expand All @@ -341,6 +344,7 @@ export default async function (
command: `poetry run pytest tests/`,
cwd: normalizedOptions.projectRoot,
},
cache: true,
};
}

Expand Down
Loading

0 comments on commit 0e74e82

Please sign in to comment.