bumpy-noon-80834
10/09/2022, 9:56 PMbumpy-noon-80834
10/09/2022, 9:57 PMwide-midnight-78598
10/09/2022, 10:50 PMwide-midnight-78598
10/09/2022, 10:50 PMbumpy-noon-80834
10/10/2022, 7:50 AMbusy-vase-39202
10/10/2022, 5:39 PMwide-midnight-78598
10/10/2022, 6:16 PMbumpy-noon-80834
10/10/2022, 6:19 PMbumpy-noon-80834
10/10/2022, 6:30 PMyarn build && pulumi up
⦠I'll try to find a way to achieve the same with a Python lambda this time
⦠The easy and hackish way to to it IMO is to add a package.json
file in the Lambda directory, which includes a build
script who will basically run ./pants package projectName::
⢠Then, I'm thinking about another use case: having a Python project depend on a TypeScript project
⦠For this, I expect I could add a BUILD
file in a yarn-managed workspace and use `experimental_shell_command`to run yarn build
⢠In summary:
⦠Delegate all TypeScript builds to yarn/yarn.build
⦠Delegate all Python builds to Pants
⦠Integrate the 2 by adding package.json and BUILD files which simply run commands to invoke the other side build systembumpy-noon-80834
10/10/2022, 6:34 PMbusy-vase-39202
10/10/2022, 7:32 PMbusy-vase-39202
10/10/2022, 7:35 PMbumpy-noon-80834
10/10/2022, 7:37 PMbusy-vase-39202
10/10/2022, 7:40 PMbumpy-noon-80834
10/10/2022, 7:42 PMbumpy-noon-80834
10/10/2022, 7:45 PMbusy-vase-39202
10/10/2022, 7:52 PMbumpy-noon-80834
10/10/2022, 7:55 PMwide-midnight-78598
10/10/2022, 11:53 PMbumpy-noon-80834
10/12/2022, 10:10 PM$ cat package.json
{
"name": "seneca-monorepo",
"version": "0.0.0",
"author": "Philippe Muller",
"license": "UNLICENSED",
"packageManager": "yarn@3.2.4",
"workspaces": [
"python/*",
"typescript/*"
]
}
$ cat python/data-fred/package.json
{
"name": "@senecafinance/python-data-fred",
"scripts": {
"build": "../../pants package .::",
"clean": "rm -f ../../dist/data-fred-downloader-lambda.zip"
}
}
$ cd typescript/infra-data
$ cat package.json
{
"name": "@senecafinance/infra-data",
[..]
"dependencies": {
[..]
"@senecafinance/python-data-fred": "workspace:^"
},
[..]
}
$ CI=true yarn build -vr
[ Run Order ]-------------------------------------------------------------------
āā[0] typescript/eslint-config
āā[0] python/data-fred
āā[1] typescript/prettier-config
āā[2] typescript/infra-lib
āā[3] typescript/infra-data
[ Run / Command: build / Concurrency: 12 ]--------------------------------------
ā
typescript/eslint-config 0.27s
ā
typescript/prettier-config 0.22s
ā
typescript/infra-lib 0.21s
ā
python/data-fred 11.62s
ā
typescript/infra-data 8.01s
[ build for All ]---------------------------------------------------------------
[ Summary ]---------------------------------------------------------------------
Success: 5
[..]
It's a bit hackish, but it works well, and it's definitely maintainable.