In this we'll cover how and what to install in order to correctly open and run the Swiss Pairing tournament_test.py file
- Oracle VM Virtual Box: We use version 4.3.40 and only the hosts are required, not the SDK.
- Vagrant The most recent verion of Vagrant must also be installed.
- Git Bash Will be the command line we will use to navigate to and run the files.
Click here to download the folder containing the needed files, or if you know how to use git you can clone https://github.com/CristianAThompson/SwissPairing.git
- First open your git bash.
- Using command-line navigation
cd
followed by the location from where your prompt starts for instance windows command prompt opens atc/Users/<Your Username>
to navigate to the desktop it would becd Dekstop
Note: the directory is case specific. If you need to see what files are within the current directory you can usels
. - Once you've navigated inside the folder
SwissPairing
inside your command line interface you will runvagrant up
which will start the initial install of all the necessary dependencies to run the tournament files. - After the command finishes you will follow it with
vagrant ssh
which will log you in to the virtual environment where we will run the files. - After it is installed the command line will say
vagrant@vagrant-ubuntu-trusty-32:~$
once this appears we will have to navigate to the tournament folder so we can run the files to do this we will have to runcd ..
two times to move to the parent folders. - After having run
cd ..
two times we should have the linevagrant@vagrant-ubuntu-trusty-32:/$
instead, once here we will type incd vagrant/tournament
to navigate to the folder with the tournament files. - Once we've run that command it should say
vagrant@vagrant-ubuntu-trusty-32:/vagrant/tournament$
once here we need to run the sql file to create the database and tables for the tournament. - To create the database we will type
psql
- You'll know you're inside psql when it says
vagrant=>
we will then type\i tournamentdb.sql
which will create the database after which we will type\c tournament
and run\i tournamenttables.sql
again and it will create all the tables needed. After it runs type\q
to leave psql - Finally to run the tournament_test file we will type
python tournament_test.py
- To exit Vagrant after the test simply type
logout
- To stop Vagrant running in the background when done type
vagrant halt