mirror of
https://github.com/enzet/map-machine.git
synced 2025-08-04 00:59:54 +02:00
Update contributing instructions.
Add virtual environment settings, add Mypy.
This commit is contained in:
parent
3c0104e86f
commit
33854f9d75
4 changed files with 42 additions and 16 deletions
26
.github/CONTRIBUTING.md
vendored
26
.github/CONTRIBUTING.md
vendored
|
@ -21,22 +21,36 @@ This action is not that easy as it supposed to be. We use [Moire](http://github.
|
|||
Modify the code
|
||||
---------------
|
||||
|
||||
First configure your workspace.
|
||||
### First configure your workspace ###
|
||||
|
||||
Make sure you have Python 3.9 development tools. E.g., for Ubuntu, run `apt install python3.9-dev python3.9-venv`.
|
||||
|
||||
* Install formatter, linter and test system: `pip install black flake8 pytest`.
|
||||
* Be sure to run `git config --local core.hooksPath data/githooks` to enable Git hooks.
|
||||
Activate virtual environment. E.g. for fish shell, run `source venv/bin/activate.fish`.
|
||||
|
||||
If you are using Pycharm, you may want to set up user dictionary as well:
|
||||
Install the project in editable mode:
|
||||
|
||||
```shell
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
Install formatter, linter and test system: `pip install black flake8 mypy pytest pytest-cov`.
|
||||
|
||||
Be sure to enable Git hooks:
|
||||
|
||||
```shell
|
||||
git config --local core.hooksPath data/githooks
|
||||
```
|
||||
|
||||
If you are using PyCharm, you may want to set up user dictionary as well:
|
||||
|
||||
|
||||
* `cp data/dictionary.xml .idea/dictionaries/<user name>.xml`
|
||||
* in `.idea/dictionaries/<user name>.xml` change `%USERNAME%` to your username,
|
||||
* restart Pycharm.
|
||||
* restart PyCharm if it is launched.
|
||||
|
||||
### Code style ###
|
||||
|
||||
We use [Black](http://github.com/psf/black) code formatter with maximum 80 characters line length for all Python files within the project. Reformat a file is as simple as `black -l 80 <file name>`.
|
||||
We use [Black](http://github.com/psf/black) code formatter with maximum 80 characters line length for all Python files within the project. Reformat a file is as simple as `black -l 80 <file name>`. Reformat everything with `black -l 80 map_machine tests`.
|
||||
|
||||
If you create new Python file, make sure you add `__author__ = "<first name> <second name>"` and `__email__ = "<author e-mail>"` string variables.
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ Japanese maps usually use [special symbols](https://en.wikipedia.org/wiki/List_o
|
|||
|
||||
### Shape combination ###
|
||||
|
||||
Map Machine constructs icons from the shapes extracted from the sketch SVG file. Some icons consist of just one shape, to construct others it may be necessary to combine two or more shapes.
|
||||
One of the key features of Map Machine is constructing icons from the several shapes.
|
||||
|
||||
#### Masts ####
|
||||
|
||||
|
|
|
@ -20,21 +20,31 @@ This action is not that easy as it supposed to be. We use \ref {http://github.c
|
|||
|
||||
\2 {Modify the code} {}
|
||||
|
||||
First configure your workspace.
|
||||
\3 {First configure your workspace}
|
||||
|
||||
\list
|
||||
{Install formatter, linter and test system\: \m {pip install black flake8 pytest}.}
|
||||
{Be sure to run \m {git config --local core.hooksPath data/githooks} to enable Git hooks.}
|
||||
Make sure you have Python 3.9 development tools. E.g., for Ubuntu, run \m {apt install python3.9-dev python3.9-venv}.
|
||||
|
||||
If you are using Pycharm, you may want to set up user dictionary as well:
|
||||
Activate virtual environment. E.g. for fish shell, run \m {source venv/bin/activate.fish}.
|
||||
|
||||
Install the project in editable mode:
|
||||
|
||||
\code {pip install -e .} {shell}
|
||||
|
||||
Install formatter, linter and test system\: \m {pip install black flake8 mypy pytest pytest-cov}.
|
||||
|
||||
Be sure to enable Git hooks:
|
||||
|
||||
\code {git config --local core.hooksPath data/githooks} {shell}
|
||||
|
||||
If you are using PyCharm, you may want to set up user dictionary as well:
|
||||
|
||||
\list
|
||||
{\m {cp data/dictionary.xml .idea/dictionaries/<user name>.xml}}
|
||||
{in \m {.idea/dictionaries/<user name>.xml} change \m {%USERNAME%} to your username,}
|
||||
{restart Pycharm.}
|
||||
{restart PyCharm if it is launched.}
|
||||
|
||||
\3 {Code style} {code-style}
|
||||
|
||||
We use \ref {http://github.com/psf/black} {Black} code formatter with maximum 80 characters line length for all Python files within the project. Reformat a file is as simple as \m {black -l 80 \formal {file name}}.
|
||||
We use \ref {http://github.com/psf/black} {Black} code formatter with maximum 80 characters line length for all Python files within the project. Reformat a file is as simple as \m {black -l 80 \formal {file name}}. Reformat everything with \m {black -l 80 map_machine tests}.
|
||||
|
||||
If you create new Python file, make sure you add \m {__author__ = "\formal {first name} \formal {second name}"} and \m {__email__ = "\formal {author e-mail}"} string variables.
|
||||
|
|
|
@ -114,7 +114,9 @@ Japanese maps usually use \ref {https://en.wikipedia.org/wiki/List_of_Japanese_m
|
|||
|
||||
\3 {Shape combination} {shape-combination}
|
||||
|
||||
Map Machine constructs icons from the shapes extracted from the sketch SVG file. Some icons consist of just one shape, to construct others it may be necessary to combine two or more shapes.
|
||||
One of the key features of Map Machine is constructing icons from the several shapes.
|
||||
|
||||
/* Some icons consist of just one shape, to construct others it may be necessary to combine two or more shapes. */
|
||||
|
||||
\4 {Masts} {masts}
|
||||
|
||||
|
@ -302,7 +304,7 @@ HTML code\:
|
|||
|
||||
\2 {Map options} {map-options}
|
||||
|
||||
Map configuration options used by \m {render} and \m {tile} commands:
|
||||
Map configuration options used by \m {render} and \m {tile} commands\:
|
||||
|
||||
\options {map}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue