-
Notifications
You must be signed in to change notification settings - Fork 957
Set up local environment
-
Ensure you are using Python Python 3.8 (We recommend using pyenv to handle different Python versions.)
-
Ensure you have the dependency management tool Poetry installed by this guide. The easiest is to do
pip install poetry
-
Ensure you have the dependency tool tesseract installed, following the instructions in this guide.
-
From the root folder, install the dependencies in a virtual environment:
poetry install -E parsers
You can now run a few different commands:
poetry run lint # linting
poetry run test # run unit tests
You might need to have zlib
and libjpeg
installed on your machine.
First up, make sure you're using Python 3.8
(or 3.7
). Also, see Troubleshooting for fixes to common issues.
If it's still not working, please create an issue where you include the output from poetry debug
so that we can help debug it.
-
Install docker
-
First, you need to compile the frontend. Open a terminal in the root directory and run:
docker-compose build
-
Start the application by running:
docker-compose up
This will watch over source file changes, run nonstop and watch changes you make in the code to recompile the frontend if needed.
-
Go to http://localhost:8000/ and you should now see the map!
-
You can run the mockserver to color the map by running:
yarn run mockserver
Notes:
- These steps only build with the English language (which will be faster as not all languages need to be built). To build all languages, change the
command
of theweb-watch-en
section of docker-compose.yml fromcommand: npm run watch-en
tocommand: npm run watch
. - The backend handles the calculation of carbon emissions. The map data from the mock server provides dummy data from the state file.
See Troubleshooting for common issues and fixes when building the map locally.
Do you have a question or an idea for improvements? Open a new discussion here