Sample Python application that demonstrate the possibility to find and mark text sequence in web page
Before to go you should set up your local environment.
- Fork repository by clicking the Fork button on the upper right-hand side of the repository’s page. See an example here NOTE! All actions described below MUST be applied to the !!!FORKED!!! repository!!!
- Clone forked repository to your local system (hint).
- Go to the project' directory
cd python_highlighter
To install dependencies run:
pip install -r requirements.txt
(Optionally) install highlighter:
pip install -e .
Before to run your app, make sure you are in the project directory, e.g., dir (i.e., ls in Mac OS / Linux) must return highlighter as a subdirectory. To run highlighter app (On Windows use set instead of export):
export FLASK_APP=highlighter
flask run
then go to localhost:5000
The application contains tests. To run tests:
pytest -v
Code must satisfy PEP008 code style requirements
pylint -r y **/*.py
NOTE Before to start your work you must should perform all steps described in Before you go section.
CAUTION All actions described below MUST be applied to the !!!FORKED!!! repository!!! Make sure, your local repository refers to the your remote repo.
git remote show origin
should return an address that differs from parent below
https://github.com/onidzelskyi/python_highlighter.git
Next, perform steps below:
- Create dev branch. You can do it either via Pycharm' menu (see the Pycharm how to for details) or via terminal like this:
git checkout master
git pull
git checkout -b dev
- Add an implementation to methods in the __init__.py module that covers the demands
- markup_text
- highlight_text
- Add tests to the implemented methods in the tests/test_highlighter.py module. You can find examples of tests on Flask testing howto page.
- Run tests
- Run code check
- Commit and push your local changes to the remote git repository. You can do it either via Pycharm view (Ctrl + K) or via terminal
git commit -a -m 'type your commit message here'
git push origin dev
- Create PR (pull request). See how to do it here Note Make sure the target branch is your master, not parent.
- Add two or more peers as a collaborator with write access rights.
- Send the link to the MR to your reviewer