Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated README with development instructions #84

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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", "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