Skip to content

Commit 09276ff

Browse files
authored
fix #1 Add initial pipeline (#2)
This adds an example module to be replaced with appropriate jsonpath module code. This also adds all the templates and pipeline configurations required to test things. Signed-off-by: David Brown <dmlb2000@gmail.com>
1 parent ab39943 commit 09276ff

File tree

11 files changed

+188
-2
lines changed

11 files changed

+188
-2
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
### JSONPath2 version
2+
[Version of the JSONPath2 software where you are encountering the issue]
3+
4+
### Platform Details
5+
[Operating system distribution and release version. Cloud provider if running in the cloud]
6+
7+
### Scenario:
8+
[What you are trying to achieve and you can't?]
9+
10+
### Steps to Reproduce:
11+
[If you are filing an issue what are the things we need to do in order to reproduce your problem? How are you using this software or any resources it includes?]
12+
13+
### Expected Result:
14+
[What are you expecting to happen as the consequence of above reproduction steps?]
15+
16+
### Actual Result:
17+
[What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.]

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### Description
2+
3+
[Describe what this change achieves]
4+
5+
### Issues Resolved
6+
7+
[List any existing issues this PR resolves]
8+
9+
### Check List
10+
11+
- [ ] All tests pass.
12+
- [ ] New functionality includes testing.
13+
- [ ] New functionality has been documented in the README if applicable

.pre-commit-config.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
repos:
2+
- repo: git://github.com/pre-commit/pre-commit-hooks
3+
rev: v1.2.3
4+
hooks:
5+
- id: autopep8-wrapper
6+
- id: fix-encoding-pragma
7+
- id: trailing-whitespace
8+
- id: flake8
9+
args: [--max-line-length=120]
10+
- id: check-merge-conflict
11+
- id: double-quote-string-fixer
12+
- id: end-of-file-fixer
13+
- id: name-tests-test
14+
- id: debug-statements
15+
- id: check-added-large-files
16+
- id: check-ast
17+
- id: check-byte-order-marker
18+
- id: check-case-conflict
19+
- id: check-docstring-first
20+
- id: check-executables-have-shebangs
21+
types: [python]
22+
- id: check-json
23+
- id: check-vcs-permalinks
24+
- id: mixed-line-ending
25+
- id: name-tests-test
26+
- id: pretty-format-json
27+
args:
28+
- --autofix
29+
- --top-keys=_id
30+
- id: sort-simple-yaml
31+
files: '.yaml$'
32+
- id: check-symlinks
33+
- id: check-yaml
34+
- id: detect-private-key
35+
- id: requirements-txt-fixer
36+
- id: trailing-whitespace
37+
- repo: local
38+
hooks:
39+
- id: pep257
40+
name: pep257
41+
entry: python -m pep257
42+
language: system
43+
types: [python]
44+
- id: pylint
45+
name: pylint
46+
entry: python -m pylint --rcfile=pylintrc
47+
language: system
48+
types: [python]
49+
- repo: git://github.com/Lucas-C/pre-commit-hooks
50+
rev: v1.1.5
51+
hooks:
52+
- id: remove-tabs
53+
- id: remove-crlf

.travis.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
language: python
2+
python:
3+
- 2.7
4+
- 3.6
5+
stages:
6+
- lint
7+
- test
8+
script:
9+
- coverage run --include='jsonpath2/*' -m pytest -v
10+
- coverage report -m --fail-under 100
11+
- pip install .
12+
- python setup.py bdist_wheel
13+
- python setup.py sdist
14+
jobs:
15+
include:
16+
- stage: lint
17+
python: 3.6
18+
script: pre-commit run -a
19+
- python: 2.7
20+
script: pre-commit run -a
21+
install: pip install -r requirements-dev.txt
22+
deploy:
23+
provider: pypi
24+
user: dmlb2000
25+
password:
26+
secure: MeskzH+TIGe4iboe/VL0+3dSJ5yL/0f8CVH7AcLBmToEArWAOdx5v42fDbOGxSio9ezYdlGyP1fTeBZybIhCvnv44W43iXol2DSkNILdIkfPhsp/RWvZh+qylSldfwiS+gKRtWRCnMpItpmIDMpbBBf/malDLgo41JrhUMeJ2EgvAlRAIDN58VcgZFCyq/cYpo8aRnqvjAmHKwNwEVZP9fFttpys7JXnxxXgP66Yr7WZIVp1v3wv5KwJdqdLlWAL/ZDftTy61ad23sZn0sv3DWYRJ8eJxb2UXQssLyhoZDvAKFoymFhBWoNINpwYDkTZeSQkRPuf1BHgSYRe3nT+71IpXIBF0H7kbmStOttk2Z2kPrlprkZhoZlUwYhRmwgTKWPR2BCyzepDfNKFGoGLz1a98ymb/iqJbBhtuo2ZHH6xsodfKmjVRS8Cx6xCXYyUG5ZW9NK/luMYSNmM78vL6HNcY+yGZ1GS6kXtjUVLPh9CSXld6fuDY/sWWzpXWuhutbfM8+TKNXNF/JOnolJVAgpseDLW3rlNM8jKFLYv1ut/MR/qyoTeMzGe03BgMxX4o5LesVHaWQfvlDubCnXmeRdgYWuxGmFCmRphIu7d3+NwI/ZWWV6dhlqdID1YbdmQJcfz/NPslAn3sXvgLpsmiuSyr2FIuXBbhQozc+xstsQ=
27+
distributions: "sdist bdist_wheel"
28+
on:
29+
tags: true

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# python-jsonpath2
2-
A JSONPath implementation for JSONPath (but better than jsonpath).
1+
# Python JSONPath2
2+
[![Build Status](https://travis-ci.org/pacifica/python-jsonpath2.svg?branch=master)](https://travis-ci.org/pacifica/python-jsonpath2)
3+
A JSONPath implementation for Python (but better than jsonpath).

jsonpath2/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/python
2+
# -*- coding: utf-8 -*-
3+
"""Example Module."""
4+
5+
6+
class Example(object):
7+
"""This is an example class in the example module."""
8+
9+
@staticmethod
10+
def add(thing1, thing2):
11+
"""Add thing one and thing two together."""
12+
return thing1 + thing2
13+
14+
@staticmethod
15+
def mul(thing1, thing2):
16+
"""Multiply thing one and thing two together."""
17+
return thing1 * thing2

jsonpath2/test/example_test.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/python
2+
# -*- coding: utf-8 -*-
3+
"""Test the example module."""
4+
from unittest import TestCase
5+
from jsonpath2 import Example
6+
7+
8+
class TestExample(TestCase):
9+
"""Test the example class."""
10+
11+
def test_add(self):
12+
"""Test the add method in example class."""
13+
self.assertEqual(Example().add('123', 'abc'),
14+
'123abc', 'sum of strings should work')
15+
self.assertEqual(Example().add(123, 456), 579,
16+
'sum of integers should work')
17+
18+
def test_mul(self):
19+
"""Test the mul method in example class."""
20+
self.assertEqual(Example().mul('a', 4), 'aaaa',
21+
'multiply of string and number should work')
22+
self.assertEqual(Example().mul(2, 3), 6,
23+
'multiply of two integers should work')

pylintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[SIMILARITIES]
2+
ignore-imports=yes
3+
max-line-length=120

requirements-dev.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
coverage
2+
pep257
3+
pre-commit
4+
pylint<2.0
5+
pytest
6+
setuptools

requirements.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)