Skip to content

Commit

Permalink
Updated README with development instructions
Browse files Browse the repository at this point in the history
* Additionally the `setup.py` file is simplified.
* Tests automatically enforce `flake8` by using the `pytest-flake8`
plugin.
  • Loading branch information
chaudum committed Mar 14, 2020
1 parent de5e8bf commit 4415e24
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 12 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*.so

# Packages
*.egg
*.eggs
*.egg-info
dist
build
Expand All @@ -18,6 +18,12 @@ develop-eggs
lib
lib64

# Virtualenv
env
.env
venv
.venv

# Installer logs
pip-log.txt

Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ python:
install: pip install -e .[yaml,toml,tests,xml]

script:
- pytest -v
- flake8 jinja2cli tests
- pytest -vvv
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,26 @@ If `xmltodict` is present, you can use XML as an input data source.

`$ pip install jinja2-cli[xml]`

## Development
For local development install the package in develop mode with `tests` extras
into a virtualenv:

```console
$ python -m venv env
$ env/bin/activate
(env) $ pip install -e ".[tests]"
```

### Code style
The project uses `flake8` to check the code style.

### Tests
To invoke tests (and code style checks) run the `pytest` command:

```console
(env) $ pytest
```

## TODO
* Variable inheritance and overrides
* Tests!
4 changes: 1 addition & 3 deletions jinja2cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
"""

import warnings

warnings.filterwarnings("ignore")

import os
import sys
from optparse import Option, OptionParser

warnings.filterwarnings("ignore")
sys.path.insert(0, os.getcwd())

PY3 = sys.version_info[0] == 3
Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ max-line-length = 100

[bdist_wheel]
universal = 1

[tool:pytest]
addopts = --flake8
flake8-max-line-length = 100
flake8-ignore = E402
11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from setuptools import find_packages, setup

install_requires = ["jinja2"]
tests_requires = ["pytest", "flake8"]
tests_require = ["pytest", "flake8"]

setup(
name="jinja2-cli",
Expand All @@ -29,12 +29,11 @@
license="BSD",
install_requires=install_requires,
extras_require={
"yaml": install_requires + ["pyyaml"],
"toml": install_requires + ["toml"],
"xml": install_requires + ["xmltodict"],
"tests": install_requires + tests_requires,
"yaml": ["pyyaml"],
"toml": ["toml"],
"xml": ["xmltodict"],
"tests": tests_require,
},
tests_require=tests_requires,
include_package_data=True,
entry_points={"console_scripts": ["jinja2 = jinja2cli:main"]},
classifiers=[
Expand Down

0 comments on commit 4415e24

Please sign in to comment.