This document shows you how to get the project and run various local dev tasks.
To make sure that the following instructions work, please install the following dependencies on your machine:
The below steps should work for any unix-based system (Linux, macOS). For windows, I need a volunteer to come up with those steps.
To get the source, clone the git repository via:
$ git clone http://git.modding-openmw.com/Modding-OpenMW.com/momw.git
This will clone the complete source to your local machine. Navigate to the project folder and install all needed dependencies via pip3:
$ pip3 install --user --upgrade -r requirements.txt
If desired, the
--user flag may be omitted but this is not advised.
Create a psql database, role, and user called
Next, a database user (and related unix account) are created:
$ sudo useradd momwdb $ sudo -u postgres psql -c 'create user momwdb with encrypted password \'postgresqlpassword\';'
Create the required databases:
$ sudo -u postgres createdb momwdb $ sudo -u postgres createdb test_momwdb
Add privileges to the app’s database user:
$ sudo -u postgres psql -c 'alter user momwdb createdb;' $ sudo -u postgres psql -c 'alter user momwdb login;'
And finally, set the owner on the databases that were created:
$ sudo -u postgres psql -c 'alter database momwdb owner to momwdb;' $ sudo -u postgres psql -c 'alter database test_momwdb owner to momwdb;'
If you want to not require a password to do things like
psql as the app’s database user, add the following to your sudoers config:
<your username> ALL=(momwdb) NOPASSWD: /bin/psql,/bin/createdb,/bin/dropdb
Adjust the paths to the binaries as needed.
With that, you should now me able to run the app and related tasks:
make reset make server
If you just want to run a local version of the site, you should now be set.
Tests depend on a working install of both the chrome and gecko webdrivers for selenium.
Their installation and setup is (for now) outside the scope of this document, but all
that’s necessary is to have
geckodriver binaries for your OS in
To run tests:
After a short time, a chrome or chromium instance will pop up with a note about it being controlled by software. After a bit more time it will close and then firefox will open and do the same. This is normal and part of the test suite.
Source is automatically formatted as part of the
make test target, using python black. Please ensure it’s installed for your system.
Linting also happens as part of the test target, be sure the following rules are set at minimum:
[flake8] ignore = E501, E402, W503 max-line-length = 160
Any commit to any branch on the primary
Modding-OpenMW.com/momw repository will kick off
a buildbot build.
Check out a new branch based on
dev and name it to what you intend to do:
$ git checkout -b my-cool-feature origin/dev
Use one branch per fix/feature
Make your changes
Commit your changes
Make a pull request
Tests are expected for any submitted changes. If it’s specific to a particular page, or adds a new page, related selenium tests should be written.