Comments (9)
Thanks for the info.
The main reason for which this is happening is that stubs for boto3
are not available in typeshed
, hence Pyre cannot resolve that import.
In theory you could make Pyre parse the boto3
sources by providing /Users/jasonkuhrt/.pyenv/versions/3.6.5/lib/python3.6/site-packages/
to the --search-path
option of pyre check
, or equivalently, if that directory is already part of your PYTHONPATH
, by passing --preserve-pythonpath
to the pyre command.
That said, it looks like the sources of boto3
are not annotated either, so Pyre won't be able to do much. The only "real" solution would be for the authors of boto3
to publish stub files to help type checkers.
from pyre-check.
Regarding the original issue, we have added better wording/documentation recently.
As for the last few comments, feel free to open a new issue if the problem presents itself again.
from pyre-check.
Sorry, but it's not clear to me how to use that Pipfile
information. Could you please post a minimal source code that displays the error, along with the output of pyre --debug check
? Thanks.
from pyre-check.
Ok I will post more details as soon as I can.
from pyre-check.
@dark here is a minimal repro:
Do the following:
> mkdir repro && cd repro && pyre init
> echo 'import boto3;import pprint;pprint.pprint(boto3)' > main.py && \
pipenv install boto3 && \
python main.py && \
pyre check
Then you will see various output, but of interest:
<module 'boto3' from '/Users/jasonkuhrt/.pyenv/versions/3.6.5/lib/python3.6/site-packages/boto3/__init__.py'>
ƛ Found 1 type error!
main.py:1:0 Undefined import [21]: Could not find a module corresponding to import `boto3`.
Python ran and found the import just fine. pyre
however did not. False negative. Let me know if you need more information.
from pyre-check.
It sounds like the best thing that can come out of this issue practically then is better user feedback that attempts to automate what you've said in context of different packages?
from pyre-check.
Explicit --search_path
works, but if I place it inside .pyre_configuration
file it doesn't work.
from pyre-check.
@Zebradil The two configuration methods should be equivalent.
Could you please post the full command and configuration that you have tried? Adding --debug
to the commandline would also help. Thanks.
from pyre-check.
Okay, I created a script for reproduce the issue, but now it's working as expected. I'm confused :-) I'll investigate further.
The script, just in case:
#!/bin/bash
rm -rf pyre-test
mkdir pyre-test
cd pyre-test
echo 'import pymysql;import pprint;pprint.pprint(pymysql)' > app.py
pipenv --three
pipenv install pymysql
pipenv run python app.py
pipenv install -d pyre-check
pipenv run pyre --search-path "$(pipenv --venv)/lib/python3.6/site-packages/"
pipenv run pyre init
cat .pyre_configuration \
| jq --arg path "$(pipenv --venv)/lib/python3.6/site-packages/" '. + {search_path: [$path]}' \
> .pyre_configuration
pipenv run pyre
from pyre-check.
Related Issues (20)
- Pyre couldn't find a required site-package HOT 1
- Parsing failure [404]: f-string expression part cannot include a backslash HOT 1
- Pyre infers set-of-literals as set[str] rather than set[MyLiteral] HOT 1
- Null
- Ask for if also import pysa-filter for `sapp` when run `pyre init-pysa`
- Allow use of pyre_extensions in pyre playground, use newer typing_extensions
- Mutable attributes of classes should be invariant in subclasses. HOT 1
- Internal crash: Raised in src/string.ml HOT 11
- Pyre doesn't understand for-else statement HOT 1
- Is it possible to taint specific values of parameters? HOT 2
- Tainting Python Builtin Functions! How do we do this? HOT 1
- Module boto3 - Taint Propagation Issue HOT 3
- Context Manager - Taint Propagation Issue
- PySpark - Incompatible parameter type & Unsupported operand HOT 1
- [Pyre setup.sh] Terminal closes while building from source HOT 2
- Pysa tutorial not working HOT 4
- Find lambdas are not checked correctly
- Errors with recursive type aliases: "JSON is declared to have type `TypeAlias` but is used as type `UnionType`"
- pyre from PyPI can't find its typeshed directory
- Update pyre-check.org/play to use Python 3.11 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyre-check.