-
Notifications
You must be signed in to change notification settings - Fork 7
Installation
When running BGPy, we highly recommend using PyPy instead of Python. PyPy is usually 5-10x faster than Python for this repo with no code changes. If you'd rather use Python, that's fine too, simply replace all instances of PyPy with Python3.
We also highly recommend using Python environments. These will not be included in the installation instructions since they are a part of the Python programming language and are also optional. If you don't know what these are, I highly recommend looking them up on Youtube.
This has only been tested on ubuntu, but it's been used on windows, mac, redhat, without issues (although the apt install commands below may need to be modified)
NOTE: while installing with python will enforce that you use python3.10 and up, installing with pypy will not automatically enforce that you use pypy3.10 and up, although it is a requirement that you MUST use pypy3.10 and up (if you plan on using pypy instead of Python) Additionally, you likely must install this directly from the download by using this link https://www.pypy.org/download.html. Also if you have problems with pypy, you can always use Python, although it is considerably slower.
After installing Python, PyPy, and Pip, run:
# Needed for graphviz and Pillow
sudo apt-get install -y graphviz libjpeg-dev zlib1g-dev
pypy3 -m pip install pip --upgrade
pypy3 -m pip install wheel --upgrade
# Numpy for some reason needs a special install due to https://github.com/numpy/numpy/issues/24964
pypy3 -m pip install numpy --config-settings=setup-args="-Dallow-noblas=true"
CIBUILDWHEEL=1 pip install frozendict
Before doing a pypi release we discovered that BGPy was already taken, so you can merely install bgpy_pkg and just import from bgpy.
If you want to install BGPy for production:
pypy3 -m pip install bgpy_pkg
If you want to install BGPy for development:
git clone https://github.com/jfuruness/bgpy_pkg.git
cd bgpy
# Needed for mypy on editable installs
# https://github.com/python/mypy/issues/13392
export SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
pypy3 -m pip install -e .[test]
precommit install
Testing instructions located here