Closed mostafa-abdullah closed 6 years ago
Installation goes fine but something is wrong when I try to run the inference. I get this stack trace (I installed everything in a virtualenv called qwerty
):
Traceback (most recent call last):
File "./qwerty/bin/typpete", line 11, in <module>
load_entry_point('Typpete==0.1', 'console_scripts', 'typpete')()
File "./qwerty/lib/python3.6/site-packages/pkg_resources/__init__.py", line 572, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "./qwerty/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2755, in load_entry_point
return ep.load()
File "./qwerty/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2408, in load
return self.resolve()
File "./qwerty/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2414, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'typpete'
Any idea of why this happens?
@caterinaurban Fixed now
I ran out of ideas :(
Traceback (most recent call last):
File "./qwerty/bin/typpete", line 11, in <module>
load_entry_point('Typpete==0.1', 'console_scripts', 'typpete')()
File "./qwerty/lib/python3.6/site-packages/typpete/tests/inference_runner.py", line 38, in run_inference
solver = z3_types.TypesSolver(t, root_folder)
File "./qwerty/lib/python3.6/site-packages/typpete/frontend/z3_types.py", line 47, in __init__
self.z3_types = Z3Types(self.config)
File "./qwerty/lib/python3.6/site-packages/typpete/frontend/z3_types.py", line 94, in __init__
type_sort = declare_type_sort(max_tuple_length, max_function_args, classes_to_instance_attrs)
File "./qwerty/lib/python3.6/site-packages/typpete/frontend/z3_types.py", line 294, in declare_type_sort
return type_sort.create()
File "./qwerty/lib/python3.6/site-packages/typpete/z3/z3.py", line 4365, in create
return CreateDatatypes([self])[0]
File "./qwerty/lib/python3.6/site-packages/typpete/z3/z3.py", line 4467, in CreateDatatypes
cref = cref()
File "./qwerty/lib/python3.6/site-packages/typpete/z3/z3.py", line 715, in __call__
_z3_assert(num == self.arity(), "Incorrect number of arguments to %s" % self)
File "./qwerty/lib/python3.6/site-packages/typpete/z3/z3.py", line 292, in __str__
return obj_to_string(self)
File "./qwerty/lib/python3.6/site-packages/typpete/z3/z3printer.py", line 1183, in obj_to_string
_PP(out, _Formatter(a))
File "./qwerty/lib/python3.6/site-packages/typpete/z3/z3printer.py", line 1079, in __call__
return self.main(a)
File "./qwerty/lib/python3.6/site-packages/typpete/z3/z3printer.py", line 1052, in main
if z3.is_expr(a):
AttributeError: module 'z3' has no attribute 'is_expr'
Packaging Typpete. Now we can run the type inference directly from the command line.
Changes include the following:
Note that you see a lot of rename changes (111 files :D ) because I had to move all the project files into a
typpete
folder to have successful packaging.Typpete Installation
In the root folder (the one which contains the package and
setup.py
), runpip install .
orpython3 setup.py install
. Note that installation viapip
is recommended since packages installed withsetup.py
are not uninstallable (They can only be uninstalled by manually deleting their files)Running the inference
You can run the inference with the following command
Where flags is a space separated list of options for configuring the type inference. Each flag must have the following syntax:
--flag_name=flag_value
. For example, the following is a valid configuration flag:--allow_attributes_outside_init=True
The currently supported flags are the following:
__init__
Example: