SyntaxError: invalid decimal literal
- Dominant language
- Python
- Stars
- 7.5k
- Forks
- 424
- PR merge metrics
- No merged PRs in 30d
Description
How to reproduce
```
git clone https://github.com/NVIDIA/cccl.git
cd cccl
pipreqs .
```
error msg
```
ERROR: Failed on file: ./libcudacxx/libcxx/utils/generate_feature_test_macro_components.py
Traceback (most recent call last):
File "/home/xxx/miniforge3/envs/cupy/bin/pipreqs", line 10, in
sys.exit(main())
^^^^^^
File "/home/xxx/miniforge3/envs/cupy/lib/python3.12/site-packages/pipreqs/pipreqs.py", line 528, in main
init(args)
File "/home/xxx/miniforge3/envs/cupy/lib/python3.12/site-packages/pipreqs/pipreqs.py", line 455, in init
candidates = get_all_imports(input_path,
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxx/miniforge3/envs/cupy/lib/python3.12/site-packages/pipreqs/pipreqs.py", line 131, in get_all_imports
raise exc
File "/home/xxx/miniforge3/envs/cupy/lib/python3.12/site-packages/pipreqs/pipreqs.py", line 117, in get_all_imports
tree = ast.parse(contents)
^^^^^^^^^^^^^^^^^^^
File "/home/xxx/miniforge3/envs/cupy/lib/python3.12/ast.py", line 52, in parse
return compile(source, filename, mode, flags,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 36
"c++14": 201304L
^
```
Contributor guide
Research direction
Reproduce the issue with the listed pipreqs command, then inspect pipreqs.py around get_all_imports and the AST parsing call. Use libcudacxx/libcxx/utils/generate_feature_test_macro_components.py, especially line 36, as the failing input. Done means pipreqs handles this file without raising the reported SyntaxError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100