abundant-analyst-12845
11/24/2022, 7:12 AM├── ROOT Repo
├── .gitignore
├── README.md
├── lambda-one
│ └── lambda_one
| ├── config -> directory containing other python files
| └── lambda.py -> has import statement pointing to shared-code from shared_code.module_b.file_name import hello_world
│ ├── tests -> contains test for this
│ ├── poetry.lock
│ └── pyproject.toml
├── lambda-two
│ └── lambda_two
| ├── config -> directory containing other python files
| └── lambda.py -> has import statement pointing to shared-code -> from shared_code.module_b.file_name import sum
│ ├── tests -> contains test for this
│ ├── poetry.lock
│ └── pyproject.toml
├── shared-one
│ └── shared_code
| ├── module_a -> directory containing python files
| └── module_b -> directory containing python files
│ ├── tests -> contains test for this
│ ├── poetry.lock
│ └── pyproject.toml
├── pants
└── pants.toml
I understand that pants supports creating of lock files. is it possible for pants to resolve the lock files for each module
• I know I can define multiple resolve names and point to something but the problem is those lock files contain the same list of dependencies
• what am wondering is if i can resolve the poetry.lock file in the pants.toml from each package and then within my BUILD
do something like this
# for lambda-one/BUILD
__defaults__(all=dict(resolve="lambda-one"))
poetry_requirements(
name="poetry",
)
# for lambda-two/BUILD
__defaults__(all=dict(resolve="lambda-two"))
poetry_requirements(
name="poetry",
)
# for shared-code/BUILD
__defaults__(all=dict(resolve="shared-code"))
poetry_requirements(
name="poetry",
)
My thinking here is to have pants sort of "lock" each modules dependencies separately. wonder if that makes sense or something worth doingabundant-analyst-12845
11/24/2022, 7:34 AMshared-code
), but they were present in other resolves:
* lambda_one.logging.logging.get_cloudlogbase_config: 'lambda-one' from lambda-one/lambda_one/logging/logging.py
If you do not expect an import to be inferrable, add # pants: no-infer-dep
to the import line. Otherwise, see https://www.pantsbuild.org/v2.14/docs/troubleshooting#import-errors-and-missing-dependencies for common problems.
073309.45 [WARN] Pants cannot infer owners for the following imports in the target lambda-one/lambda_one/lambda_function.py:lib@resolve=lambda-one:
* shared_code.string_utils.string_utils.string_concat (line: 9)
These imports are not in the resolve used by the target (lambda-one
), but they were present in other resolves:
* shared_code.string_utils.string_utils.string_concat: 'shared-code' from shared-code/shared_code/string_utils/string_utils.py:libabundant-analyst-12845
11/24/2022, 7:40 AMlambda-one
), but they were present in other resolves:
* shared_code.string_utils.string_utils.string_concat: 'shared-code' from shared-code/shared_code/string_utils/string_utils.py:lib
If you do not expect an import to be inferrable, add # pants: no-infer-dep
to the import line. Otherwise,refined-addition-53644
11/24/2022, 12:50 PMabundant-analyst-12845
11/24/2022, 1:13 PMabundant-analyst-12845
11/24/2022, 1:13 PMabundant-analyst-12845
11/24/2022, 1:21 PM