Skip to content

Commit 0e74e82

Browse files
feat(nx-python): enable caching in UV and Poetry project generators
1 parent b7ec6c9 commit 0e74e82

File tree

4 files changed

+97
-0
lines changed

4 files changed

+97
-0
lines changed

packages/nx-python/src/generators/poetry-project/__snapshots__/generator.spec.ts.snap

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ exports[`application generator > as-provided > should run successfully minimal c
1919
"options": {},
2020
},
2121
"build": {
22+
"cache": true,
2223
"executor": "@nxlv/python:build",
2324
"options": {
2425
"bundleLocalDependencies": false,
@@ -121,6 +122,7 @@ exports[`application generator > as-provided > should run successfully minimal c
121122
"options": {},
122123
},
123124
"build": {
125+
"cache": true,
124126
"executor": "@nxlv/python:build",
125127
"options": {
126128
"bundleLocalDependencies": false,
@@ -223,6 +225,7 @@ exports[`application generator > custom template dir > should run successfully w
223225
"options": {},
224226
},
225227
"build": {
228+
"cache": true,
226229
"executor": "@nxlv/python:build",
227230
"options": {
228231
"bundleLocalDependencies": false,
@@ -307,6 +310,7 @@ exports[`application generator > individual package > should run successfully mi
307310
"options": {},
308311
},
309312
"build": {
313+
"cache": true,
310314
"executor": "@nxlv/python:build",
311315
"options": {
312316
"bundleLocalDependencies": false,
@@ -409,6 +413,7 @@ exports[`application generator > individual package > should run successfully mi
409413
"options": {},
410414
},
411415
"build": {
416+
"cache": true,
412417
"executor": "@nxlv/python:build",
413418
"options": {
414419
"bundleLocalDependencies": false,
@@ -511,6 +516,7 @@ exports[`application generator > individual package > should run successfully mi
511516
"options": {},
512517
},
513518
"build": {
519+
"cache": true,
514520
"executor": "@nxlv/python:build",
515521
"options": {
516522
"bundleLocalDependencies": false,
@@ -616,6 +622,7 @@ exports[`application generator > individual package > should run successfully mi
616622
"options": {},
617623
},
618624
"build": {
625+
"cache": true,
619626
"executor": "@nxlv/python:build",
620627
"options": {
621628
"bundleLocalDependencies": false,
@@ -718,6 +725,7 @@ exports[`application generator > individual package > should run successfully wi
718725
"options": {},
719726
},
720727
"build": {
728+
"cache": true,
721729
"executor": "@nxlv/python:build",
722730
"options": {
723731
"bundleLocalDependencies": false,
@@ -740,6 +748,7 @@ exports[`application generator > individual package > should run successfully wi
740748
},
741749
},
742750
"lint": {
751+
"cache": true,
743752
"executor": "@nxlv/python:flake8",
744753
"options": {
745754
"outputFile": "reports/apps/test/pylint.txt",
@@ -848,6 +857,7 @@ exports[`application generator > individual package > should run successfully wi
848857
"options": {},
849858
},
850859
"build": {
860+
"cache": true,
851861
"executor": "@nxlv/python:build",
852862
"options": {
853863
"bundleLocalDependencies": false,
@@ -870,6 +880,7 @@ exports[`application generator > individual package > should run successfully wi
870880
},
871881
},
872882
"lint": {
883+
"cache": true,
873884
"executor": "@nxlv/python:flake8",
874885
"options": {
875886
"outputFile": "reports/apps/test/pylint.txt",
@@ -890,6 +901,7 @@ exports[`application generator > individual package > should run successfully wi
890901
"options": {},
891902
},
892903
"test": {
904+
"cache": true,
893905
"executor": "@nxlv/python:run-commands",
894906
"options": {
895907
"command": "poetry run pytest tests/",
@@ -1016,6 +1028,7 @@ exports[`application generator > individual package > should run successfully wi
10161028
"options": {},
10171029
},
10181030
"build": {
1031+
"cache": true,
10191032
"executor": "@nxlv/python:build",
10201033
"options": {
10211034
"bundleLocalDependencies": false,
@@ -1038,6 +1051,7 @@ exports[`application generator > individual package > should run successfully wi
10381051
},
10391052
},
10401053
"lint": {
1054+
"cache": true,
10411055
"executor": "@nxlv/python:flake8",
10421056
"options": {
10431057
"outputFile": "reports/apps/test/pylint.txt",
@@ -1058,6 +1072,7 @@ exports[`application generator > individual package > should run successfully wi
10581072
"options": {},
10591073
},
10601074
"test": {
1075+
"cache": true,
10611076
"executor": "@nxlv/python:run-commands",
10621077
"options": {
10631078
"command": "poetry run pytest tests/",
@@ -1184,6 +1199,7 @@ exports[`application generator > individual package > should run successfully wi
11841199
"options": {},
11851200
},
11861201
"build": {
1202+
"cache": true,
11871203
"executor": "@nxlv/python:build",
11881204
"options": {
11891205
"bundleLocalDependencies": false,
@@ -1206,6 +1222,7 @@ exports[`application generator > individual package > should run successfully wi
12061222
},
12071223
},
12081224
"lint": {
1225+
"cache": true,
12091226
"executor": "@nxlv/python:flake8",
12101227
"options": {
12111228
"outputFile": "reports/apps/test/pylint.txt",
@@ -1226,6 +1243,7 @@ exports[`application generator > individual package > should run successfully wi
12261243
"options": {},
12271244
},
12281245
"test": {
1246+
"cache": true,
12291247
"executor": "@nxlv/python:run-commands",
12301248
"options": {
12311249
"command": "poetry run pytest tests/",
@@ -1352,6 +1370,7 @@ exports[`application generator > individual package > should run successfully wi
13521370
"options": {},
13531371
},
13541372
"build": {
1373+
"cache": true,
13551374
"executor": "@nxlv/python:build",
13561375
"options": {
13571376
"bundleLocalDependencies": false,
@@ -1374,6 +1393,7 @@ exports[`application generator > individual package > should run successfully wi
13741393
},
13751394
},
13761395
"lint": {
1396+
"cache": true,
13771397
"executor": "@nxlv/python:flake8",
13781398
"options": {
13791399
"outputFile": "reports/apps/test/pylint.txt",
@@ -1394,6 +1414,7 @@ exports[`application generator > individual package > should run successfully wi
13941414
"options": {},
13951415
},
13961416
"test": {
1417+
"cache": true,
13971418
"executor": "@nxlv/python:run-commands",
13981419
"options": {
13991420
"command": "poetry run pytest tests/",
@@ -1520,6 +1541,7 @@ exports[`application generator > individual package > should run successfully wi
15201541
"options": {},
15211542
},
15221543
"build": {
1544+
"cache": true,
15231545
"executor": "@nxlv/python:build",
15241546
"options": {
15251547
"bundleLocalDependencies": false,
@@ -1542,6 +1564,7 @@ exports[`application generator > individual package > should run successfully wi
15421564
},
15431565
},
15441566
"lint": {
1567+
"cache": true,
15451568
"executor": "@nxlv/python:flake8",
15461569
"options": {
15471570
"outputFile": "reports/apps/test/pylint.txt",
@@ -1562,6 +1585,7 @@ exports[`application generator > individual package > should run successfully wi
15621585
"options": {},
15631586
},
15641587
"test": {
1588+
"cache": true,
15651589
"executor": "@nxlv/python:run-commands",
15661590
"options": {
15671591
"command": "poetry run pytest tests/",
@@ -1688,6 +1712,7 @@ exports[`application generator > individual package > should run successfully wi
16881712
"options": {},
16891713
},
16901714
"build": {
1715+
"cache": true,
16911716
"executor": "@nxlv/python:build",
16921717
"options": {
16931718
"bundleLocalDependencies": false,
@@ -1710,6 +1735,7 @@ exports[`application generator > individual package > should run successfully wi
17101735
},
17111736
},
17121737
"lint": {
1738+
"cache": true,
17131739
"executor": "@nxlv/python:flake8",
17141740
"options": {
17151741
"outputFile": "reports/apps/test/pylint.txt",
@@ -1730,6 +1756,7 @@ exports[`application generator > individual package > should run successfully wi
17301756
"options": {},
17311757
},
17321758
"test": {
1759+
"cache": true,
17331760
"executor": "@nxlv/python:run-commands",
17341761
"options": {
17351762
"command": "poetry run pytest tests/",
@@ -1843,6 +1870,7 @@ exports[`application generator > individual package > should run successfully wi
18431870
"options": {},
18441871
},
18451872
"build": {
1873+
"cache": true,
18461874
"executor": "@nxlv/python:build",
18471875
"options": {
18481876
"bundleLocalDependencies": false,
@@ -1865,6 +1893,7 @@ exports[`application generator > individual package > should run successfully wi
18651893
},
18661894
},
18671895
"lint": {
1896+
"cache": true,
18681897
"executor": "@nxlv/python:flake8",
18691898
"options": {
18701899
"outputFile": "reports/apps/test/pylint.txt",
@@ -1885,6 +1914,7 @@ exports[`application generator > individual package > should run successfully wi
18851914
"options": {},
18861915
},
18871916
"test": {
1917+
"cache": true,
18881918
"executor": "@nxlv/python:run-commands",
18891919
"options": {
18901920
"command": "poetry run pytest tests/",
@@ -2056,6 +2086,7 @@ exports[`application generator > individual package > should run successfully wi
20562086
"options": {},
20572087
},
20582088
"build": {
2089+
"cache": true,
20592090
"executor": "@nxlv/python:build",
20602091
"options": {
20612092
"bundleLocalDependencies": false,
@@ -2078,6 +2109,7 @@ exports[`application generator > individual package > should run successfully wi
20782109
},
20792110
},
20802111
"lint": {
2112+
"cache": true,
20812113
"executor": "@nxlv/python:ruff-check",
20822114
"options": {
20832115
"lintFilePatterns": [
@@ -2099,6 +2131,7 @@ exports[`application generator > individual package > should run successfully wi
20992131
"options": {},
21002132
},
21012133
"test": {
2134+
"cache": true,
21022135
"executor": "@nxlv/python:run-commands",
21032136
"options": {
21042137
"command": "poetry run pytest tests/",
@@ -2291,6 +2324,7 @@ exports[`application generator > individual package > should run successfully wi
22912324
"options": {},
22922325
},
22932326
"build": {
2327+
"cache": true,
22942328
"executor": "@nxlv/python:build",
22952329
"options": {
22962330
"bundleLocalDependencies": false,
@@ -2313,6 +2347,7 @@ exports[`application generator > individual package > should run successfully wi
23132347
},
23142348
},
23152349
"lint": {
2350+
"cache": true,
23162351
"executor": "@nxlv/python:flake8",
23172352
"options": {
23182353
"outputFile": "reports/apps/test/pylint.txt",
@@ -2333,6 +2368,7 @@ exports[`application generator > individual package > should run successfully wi
23332368
"options": {},
23342369
},
23352370
"test": {
2371+
"cache": true,
23362372
"executor": "@nxlv/python:run-commands",
23372373
"options": {
23382374
"command": "poetry run pytest tests/",
@@ -2505,6 +2541,7 @@ exports[`application generator > individual package > should run successfully wi
25052541
"options": {},
25062542
},
25072543
"build": {
2544+
"cache": true,
25082545
"executor": "@nxlv/python:build",
25092546
"options": {
25102547
"bundleLocalDependencies": false,
@@ -2527,6 +2564,7 @@ exports[`application generator > individual package > should run successfully wi
25272564
},
25282565
},
25292566
"lint": {
2567+
"cache": true,
25302568
"executor": "@nxlv/python:ruff-check",
25312569
"options": {
25322570
"lintFilePatterns": [
@@ -2648,6 +2686,7 @@ exports[`application generator > individual package > should run successfully wi
26482686
"options": {},
26492687
},
26502688
"build": {
2689+
"cache": true,
26512690
"executor": "@nxlv/python:build",
26522691
"options": {
26532692
"bundleLocalDependencies": false,
@@ -2670,6 +2709,7 @@ exports[`application generator > individual package > should run successfully wi
26702709
},
26712710
},
26722711
"lint": {
2712+
"cache": true,
26732713
"executor": "@nxlv/python:ruff-check",
26742714
"options": {
26752715
"lintFilePatterns": [
@@ -2691,6 +2731,7 @@ exports[`application generator > individual package > should run successfully wi
26912731
"options": {},
26922732
},
26932733
"test": {
2734+
"cache": true,
26942735
"executor": "@nxlv/python:run-commands",
26952736
"options": {
26962737
"command": "poetry run pytest tests/",
@@ -2821,6 +2862,7 @@ exports[`application generator > shared virtual environment > should run success
28212862
"options": {},
28222863
},
28232864
"build": {
2865+
"cache": true,
28242866
"executor": "@nxlv/python:build",
28252867
"options": {
28262868
"bundleLocalDependencies": false,
@@ -2943,6 +2985,7 @@ exports[`application generator > shared virtual environment > should run success
29432985
"options": {},
29442986
},
29452987
"build": {
2988+
"cache": true,
29462989
"executor": "@nxlv/python:build",
29472990
"options": {
29482991
"bundleLocalDependencies": false,
@@ -3065,6 +3108,7 @@ exports[`application generator > shared virtual environment > should run success
30653108
"options": {},
30663109
},
30673110
"build": {
3111+
"cache": true,
30683112
"executor": "@nxlv/python:build",
30693113
"options": {
30703114
"bundleLocalDependencies": false,
@@ -3188,6 +3232,7 @@ exports[`application generator > shared virtual environment > should run success
31883232
"options": {},
31893233
},
31903234
"build": {
3235+
"cache": true,
31913236
"executor": "@nxlv/python:build",
31923237
"options": {
31933238
"bundleLocalDependencies": false,

packages/nx-python/src/generators/poetry-project/generator.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ export default async function (
293293
lockedVersions: normalizedOptions.buildLockedVersions,
294294
bundleLocalDependencies: normalizedOptions.buildBundleLocalDependencies,
295295
},
296+
cache: true,
296297
},
297298
install: {
298299
executor: '@nxlv/python:install',
@@ -315,6 +316,7 @@ export default async function (
315316
options: {
316317
outputFile: `reports/${normalizedOptions.projectRoot}/pylint.txt`,
317318
},
319+
cache: true,
318320
};
319321
}
320322

@@ -327,6 +329,7 @@ export default async function (
327329
options.unitTestRunner === 'pytest' ? ['tests'] : [],
328330
),
329331
},
332+
cache: true,
330333
};
331334
}
332335

@@ -341,6 +344,7 @@ export default async function (
341344
command: `poetry run pytest tests/`,
342345
cwd: normalizedOptions.projectRoot,
343346
},
347+
cache: true,
344348
};
345349
}
346350

0 commit comments

Comments
 (0)