-
Notifications
You must be signed in to change notification settings - Fork 450
Adds model verification testing #467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
15828fa
fa1ae99
2bfe666
807f1ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
import subprocess | ||
import venv | ||
import os | ||
import shutil | ||
import tempfile | ||
from pathlib import Path | ||
from ...api.connection import PyreConnection | ||
from ...api.query import get_invalid_taint_models | ||
|
||
cur_dir = Path(__file__).parent | ||
envpath = cur_dir / ".env" | ||
requirements_path = cur_dir / "verify_models" / "requirements.txt" | ||
activate = envpath / "bin" / "activate" | ||
command = f"pip install -r {requirements_path}" | ||
|
||
if os.path.exists(envpath): | ||
shutil.rmtree(envpath) | ||
os.mkdir(envpath) | ||
venv.create(envpath, with_pip=True) | ||
|
||
|
||
subprocess.check_call(["bash", "-c", f"source {activate}; {command}"]) | ||
|
||
pyre_connection = PyreConnection(cur_dir / "verify_models") | ||
|
||
temp_file = tempfile.TemporaryFile(prefix=".pyre_configuration", suffix=".local", dir=cur_dir) | ||
temp_file.write(b'{"source_directories": ["verify_models"]}') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Put in taint models path as well pointing to the repositories stubs? This helps us make the action verify newer models as well. |
||
|
||
print(get_invalid_taint_models(pyre_connection)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What output do you get? Can we have a GitHub action that runs this script? We could mimic the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes having a github action is the next step @abishekvashok but first need to find a way to make pyre_configuration.local play well with pyre_configuration at the root folder There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If doesn't play well, feel free to delete the .pyre_configuration file at the root of the dir and create a file at the your folder. For an action it should get you by :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah that's possible and is my last resort. Some clever use of tempfile seems cleaner though There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @PulkitMishra To avoid the issue with the .pyre_configuration located in the root folder the trick is to create a temporary directory in the global temporary folder (with something like
|
||
shutil.rmtree(envpath) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Overview | ||
|
||
This folder helps model_verify.py in model validation. | ||
|
||
# Contents | ||
|
||
1. requirements.txt : File that contain the library dependencies needed for the models defined. | ||
2. main.py : File with an empty main function to help run pyre on the folder. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
def main(): | ||
pass |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Django | ||
mysql-connector-python | ||
lxml | ||
aiohttp | ||
boto3 | ||
s3fs | ||
python-amazon-simple-product-api | ||
dill | ||
falcon | ||
Pillow | ||
Markdown | ||
aiofiles | ||
fabric | ||
fabric2 | ||
furl | ||
mysqlclient | ||
pandas | ||
psycopg2 | ||
PyMySQL | ||
pymssql | ||
asyncssh | ||
jsonpickle | ||
pexpect | ||
paramiko | ||
Mako | ||
Chameleon | ||
Genshi | ||
trender | ||
Cheetah3 | ||
airspeed | ||
chevron | ||
SQLAlchemy | ||
tornado | ||
Jinja2 | ||
MarkupSafe | ||
WTForms | ||
Flask-WTF | ||
djangorestframework | ||
Flask | ||
Werkzeug | ||
PyYAML | ||
requests | ||
pycurl | ||
pyre-check |
Uh oh!
There was an error while loading. Please reload this page.