Skip to content

Commit 10e59fb

Browse files
committed
Updated README with development instructions
* Additionally the `setup.py` file is simplified. * Tests automatically enforce `flake8` by using the `pytest-flake8` plugin.
1 parent de5e8bf commit 10e59fb

File tree

6 files changed

+39
-12
lines changed

6 files changed

+39
-12
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*.so
55

66
# Packages
7-
*.egg
7+
*.eggs
88
*.egg-info
99
dist
1010
build
@@ -18,6 +18,12 @@ develop-eggs
1818
lib
1919
lib64
2020

21+
# Virtualenv
22+
env
23+
.env
24+
venv
25+
.venv
26+
2127
# Installer logs
2228
pip-log.txt
2329

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ python:
1111
install: pip install -e .[yaml,toml,tests,xml]
1212

1313
script:
14-
- pytest -v
15-
- flake8 jinja2cli tests
14+
- pytest -vvv

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,26 @@ If `xmltodict` is present, you can use XML as an input data source.
4343

4444
`$ pip install jinja2-cli[xml]`
4545

46+
## Development
47+
For local development install the package in develop mode with `tests` extras
48+
into a virtualenv:
49+
50+
```console
51+
$ python -m venv env
52+
$ env/bin/activate
53+
(env) $ pip install -e ".[tests]"
54+
```
55+
56+
### Code style
57+
The project uses `flake8` to check the code style.
58+
59+
### Tests
60+
To invoke tests (and code style checks) run the `pytest` command:
61+
62+
```console
63+
(env) $ pytest
64+
```
65+
4666
## TODO
4767
* Variable inheritance and overrides
4868
* Tests!

jinja2cli/cli.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
"""
77

88
import warnings
9-
10-
warnings.filterwarnings("ignore")
11-
129
import os
1310
import sys
1411
from optparse import Option, OptionParser
1512

13+
warnings.filterwarnings("ignore")
1614
sys.path.insert(0, os.getcwd())
1715

1816
PY3 = sys.version_info[0] == 3

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ max-line-length = 100
44

55
[bdist_wheel]
66
universal = 1
7+
8+
[tool:pytest]
9+
addopts = --flake8
10+
flake8-max-line-length = 100
11+
flake8-ignore = E402

setup.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from setuptools import find_packages, setup
1515

1616
install_requires = ["jinja2"]
17-
tests_requires = ["pytest", "flake8"]
17+
tests_require = ["pytest", "pytest-flake8"]
1818

1919
setup(
2020
name="jinja2-cli",
@@ -29,12 +29,11 @@
2929
license="BSD",
3030
install_requires=install_requires,
3131
extras_require={
32-
"yaml": install_requires + ["pyyaml"],
33-
"toml": install_requires + ["toml"],
34-
"xml": install_requires + ["xmltodict"],
35-
"tests": install_requires + tests_requires,
32+
"yaml": ["pyyaml"],
33+
"toml": ["toml"],
34+
"xml": ["xmltodict"],
35+
"tests": tests_require,
3636
},
37-
tests_require=tests_requires,
3837
include_package_data=True,
3938
entry_points={"console_scripts": ["jinja2 = jinja2cli:main"]},
4039
classifiers=[

0 commit comments

Comments
 (0)