Vlad-Shcherbina / icfpc2018-tbd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setup

CPython 3.7.0 (the latest stable release).

Virtualenv is optional.

pip3 install -r requirements.txt

Copy git_hooks/pre-push to .git/hooks/. Edit it as neccessary to match how you invoke Python in your environment.

Running stuff

Root of this repository should be in PYTHONPATH, because we use absolute imports (from production import utils). There are several ways to achieve that:

  • add project path to the environment variable PYTHONPATH
  • create the file <python installation or venv>/lib/python3.7/site-packages/tbd.pth whose content is a single line /path/to/icfpc2018-tbd
  • configure your favorite IDE appropriately
  • use python3 -m production.some_script instead of python3 production/some_script.py

Testing stuff

cd icfpc2018-tbd/
python3 -m production.test_all

# or simply
cd icfpc2018-tbd/
pytest

Random notes

Windows

You'll need C++ compiler to build C++ extensions. Most likely Visual Studio 2017 would work.

Most Python packages could be installed simply with pip3 install whatever_package nowadays, but sometimes it does not work (e.g. for psycopg2). In such cases, download the package from https://www.lfd.uci.edu/~gohlke/pythonlibs/ and install it manually (pip install whatever_package.wheel).

WSL or Ubuntu 16.04 (Xenial)

Python:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.7

Then use python3.7 to invoke Python, python3.7 -m pip to invoke pip, python3.7 -m pytest to invoke pytest, you get the idea.

GCC:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-8

Then set environment variable CC to g++-8.

About


Languages

Language:JavaScript 88.1%Language:Python 9.3%Language:C++ 2.2%Language:HTML 0.4%Language:TypeScript 0.1%Language:Nix 0.0%Language:Shell 0.0%Language:C 0.0%Language:CSS 0.0%