Can not install custom python dependency from custom git url
- Lingua principale
- Python
- Stelle
- 380
- Fork
- 161
- Merge medio
- 1g 1h
- PR unite (30g)
- 2
Descrizione
### Description:
I am trying to install a python dependency from a custom git repo, with a specific commit and a subdirectory specified.
### Steps to reproduce:
I have the following line in my requirements.txt:
`langchain @ git+https://github.com/mrtj/langchain.git@7b52eff#subdirectory=libs/langchain`
### Observed result:
`sam build` fails with the error `PythonPipBuilder:ResolveDependencies - Unable to retrieve name/version for package`
### Expected result:
`sam build` works.
Note: `pip install -r requirements.txt` do correctly install the required version of the package.
### Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
```json
{
"version": "1.98.0",
"system": {
"python": "3.8.13",
"os": "macOS-12.5-x86_64-i386-64bit"
},
"additional_dependencies": {
"docker_engine": "20.10.23",
"aws_cdk": "Not available",
"terraform": "1.3.7"
},
"available_beta_feature_env_vars": [
"SAM_CLI_BETA_FEATURES",
"SAM_CLI_BETA_BUILD_PERFORMANCE",
"SAM_CLI_BETA_TERRAFORM_SUPPORT",
"SAM_CLI_BETA_RUST_CARGO_LAMBDA"
]
}
```
`Add --debug flag to command you are running`
Debug output:
```
2023-10-10 18:26:23,075 | Running PythonPipBuilder:ResolveDependencies
2023-10-10 18:26:23,104 | calling pip download -r /Users/janos/Projects/teamsystem_personalizer/personalizer/requirements.txt --dest
/var/folders/6r/wc15p6m13nl_nl_n_xfqpc5c0000gp/T/tmpvma9ri9e --exists-action i
2023-10-10 18:26:39,016 | Non zero rc (2) from the setup.py egg_info command: b"Usage: sam [OPTIONS] COMMAND [ARGS]...\nTry 'sam -h' for
help.\n\nError: No such option: -c\n"
2023-10-10 18:26:39,019 | Using fallback location for PKG-INFO file in package directory:
/var/folders/6r/wc15p6m13nl_nl_n_xfqpc5c0000gp/T/tmpve6hox12/langchain
2023-10-10 18:26:39,146 | PythonPipBuilder:ResolveDependencies raised unhandled exception
Traceback (most recent call last):
File "aws_lambda_builders/workflow.py", line 371, in run
File "aws_lambda_builders/workflows/python_pip/actions.py", line 51, in execute
File "aws_lambda_builders/workflows/python_pip/packager.py", line 158, in build_dependencies
File "aws_lambda_builders/workflows/python_pip/packager.py", line 259, in build_site_packages
File "aws_lambda_builders/workflows/python_pip/packager.py", line 283, in _download_dependencies
File "aws_lambda_builders/workflows/python_pip/packager.py", line 366, in _download_all_dependencies
File "aws_lambda_builders/workflows/python_pip/packager.py", line 366, in
File "aws_lambda_builders/workflows/python_pip/packager.py", line 515, in __init__
File "aws_lambda_builders/workflows/python_pip/packager.py", line 557, in _calculate_name_and_version
File "aws_lambda_builders/workflows/python_pip/packager.py", line 698, in get_package_name_and_version
File "aws_lambda_builders/workflows/python_pip/packager.py", line 610, in _get_pkg_info_filepath
aws_lambda_builders.workflows.python_pip.packager.UnsupportedPackageError: Unable to retrieve name/version for package: langchain
2023-10-10 18:26:39,154 | Exception raised during the execution
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Reproduce the failure with the requirements.txt entry and the reported SAM CLI environment. Start in aws_lambda_builders/workflows/python_pip/packager.py, following _download_all_dependencies, _calculate_name_and_version, and get_package_name_and_version. Done means sam build resolves and packages the dependency from the pinned git commit and subdirectory.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- git, python
- Ambito
- build-system, tooling
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100