Skip to content
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

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

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
There are several methods for building and setting up a development environment.

### Manual Method ###
1. Create a new virtualenv with Python 3.6 (`virtualenv --python=<path-to-py3> venv`) and source it
1. Create a new virtualenv with Python 3.6 (`virtualenv --python=<path-to-py3> venv`) and source it.
2. Install requirements via pip. For the moment there are two options:
* Install with plain pip using the `requirements`
* Install using Pipenv (which reads from the Pipfile)
* Install with plain pip using `pip install -r requirements.txt`
* Install using Pipenv (which reads from the Pipfile).
3. Build nativepython libraries using `python setup.py build`
4. Append the root of this repository to your `PYTHONPATH`
4. Install typed_python in the site-packages directory using `python setup.py install`
5. You might need to move out of the typed_python root directory, as the source files can interfere with the installed package.

### Pipenv Method ###
This method is simple, and can take care of virtual environment creation and installation for you.
Expand All @@ -21,25 +22,20 @@ The included Makefile in this repository contains recipes for building, installi

You can also customize the name and location of any built virtual environments with the `VIRTUAL_ENV` variable.


## Installation ##
## Prerequisites ##

### OSX ###

#### Prerequisites ####
* Python 3.6 (recommended installed with homebrew)
* Currently build is tested against `clang`, not `gcc`. For more information about installing `clang` and configuring your environment see [here](https://embeddedartistry.com/blog/2017/2/20/installing-clangllvm-on-osx)
* It is recommended you use Pipenv ([see this link](https://pipenv.readthedocs.io/en/latest/install/#installing-pipenv)) to manage the application.
* You can also use virtualenv.
* install Redis (`brew install redis`)




### Linux ###
(These instructions are only for Ubuntu for the moment)

#### Prerequisites ####
Before building the modules in this repository, you will need to make sure that you have the following:
* Python 3.6 with header files (`python3.6-dev python3.6-dbg`)
Note that for development you will also install the debug interpreter.
Expand All @@ -53,3 +49,15 @@ Before building the modules in this repository, you will need to make sure that
```
* Pipenv ([see this link](https://pipenv.readthedocs.io/en/latest/install/#installing-pipenv))
* Redis Server (`redis-server`)

## Testing ##

### Manual Method ###

1. Install the following additional packages: `pip install scipy pytest flaky`
2. Navigate to the build directory `cd build`
3. Run `pytest`

### Automatic Method ###

1. Run the included `install_and_test.sh` script, which will create a temporary virtual environment and run the tests within it.
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
filterwarnings =
ignore:.*\"is\" with a literal.*:SyntaxWarning:.*operator_is_compilation_test.*
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ def run(self):
author_email='braxton.mckee@gmail.com',
url='https://github.com/aprioriinvestments/typed_python',
packages=setuptools.find_packages(),
package_data={
'typed_python': ['tests/*']
},
cmdclass={'build_ext': TypedPythonBuildExtension},
ext_modules=ext_modules,
install_requires=INSTALL_REQUIRES,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2021,7 +2021,7 @@ def test_can_convert_numpy_scalars(self):
def test_other_bitness_types(self):
# verify we can cast around non-64-bit values in a way that matches numpy
typeAndNumpyType = [
(bool, numpy.bool),
(bool, numpy.bool_),
(Int8, numpy.int8),
(Int16, numpy.int16),
(Int32, numpy.int32),
Expand Down