APrioriInvestments / typed_python

An llvm-based framework for generating and calling into high-performance native code from Python.
Apache License 2.0
197 stars 8 forks source link

Fixing some bugs/warnings I got when setting up my own environment (Ubuntu 20.04, Python 3.8) #446

Open chrisstanford opened 1 year ago

chrisstanford commented 1 year ago

These are some very minor fixes for some errors/warnings I encountered when setting up my own environment.

Motivation and Context

When attempting to follow the existing installation guide, in which the typed_python root directory is added to PYTHONPATH, I ran into an issue where python was looking at the source files before the the built files, and throwing errors for the missing _types module. If this has been working for other people, maybe it is just my environment. Regardless, calling python setup.py install should put typed_python in the site-packages directory, which python looks at anyway.

I also cleaned up a couple warning messages I was getting with pytest, and it should now run without warnings.

Lastly, I moved all the tests to their own directory, to keep the source directory clean.

Approach

I have updated the installation README to reflect what worked for me in setting up a new development environment, and I have added a section on how to run pytest (the required packages for the tests are not all in requirements.txt)

I also added a pytest.ini file, which I'm using to suppress a spurious SyntaxWarning in operator_is_compilation_test.py. Its scope is limited so that it does not suppress other warnings. In the future, this ini file can be used to handle other similar cases.

How Has This Been Tested?

pytest

Types of changes

Checklist: