Code for the web site https://www.unixtimesta.mp/.
First, check out the code:
git clone https://github.com/craiga/unixtimesta.mp.git
cd unixtimesta.mp
Set up the project by creating a virtual environment, activating it, and installing the required packages:
virtualenv --python=python3 venv
. venv/bin/activate
pip install -r requirements.txt
Finally, run the the Flask development server and access the application in a web browser at http://localhost:5000.
export FLASK_APP=unixtimestamp.py
export FLASK_DEBUG=1
flask run
This project uses pip-tools to manage dependencies.
- Add packages to
requirements.in
. - Run
pip-compile
to produce a new version ofrequirements.txt
(usepip-compile --upgrade
to update to the latest versions of packages). - Run
pip-sync
update your environment to the packages inrequirements.txt
.
The most important way to ensure code quality is to run the test suite with nose and behave.
nosetests
behave
Setting up this project will install pycodestyle, pydocstyle, Pylint and piprot. These help test for adherance to PEP 8, PEP 257 and other generally-accepted best Python coding practices, as well as ensuring the latest available versions of all packages are installed.
pycodestyle
pydocstyle
find . -iname "*.py" | xargs pylint
piprot
Note that Travis CI is set up to automatically run these when commits are pushed to GitHub. If any of them fail, you should be notified of it.