Skip to content

Commit c7b12f0

Browse files
committed
Initial commit
0 parents  commit c7b12f0

15 files changed

+2163
-0
lines changed

.coveragerc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[run]
2+
omit = jsonrpc/_version.py

.gitignore

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# IntelliJ
7+
*.iml
8+
*.ipr
9+
*.iws
10+
.idea/
11+
out/
12+
13+
# C extensions
14+
*.so
15+
16+
# Distribution / packaging
17+
.Python
18+
env/
19+
env3/
20+
build/
21+
develop-eggs/
22+
dist/
23+
downloads/
24+
eggs/
25+
.eggs/
26+
lib/
27+
lib64/
28+
parts/
29+
sdist/
30+
var/
31+
*.egg-info/
32+
.installed.cfg
33+
*.egg
34+
35+
# PyInstaller
36+
# Usually these files are written by a python script from a template
37+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
38+
*.manifest
39+
*.spec
40+
41+
# Installer logs
42+
pip-log.txt
43+
pip-delete-this-directory.txt
44+
45+
# Unit test / coverage reports
46+
htmlcov/
47+
.tox/
48+
.coverage
49+
.coverage.*
50+
.cache
51+
nosetests.xml
52+
coverage.xml
53+
*,cover
54+
.hypothesis/
55+
pytest.xml
56+
.pytest_cache/
57+
58+
# Translations
59+
*.mo
60+
*.pot
61+
62+
# Django stuff:
63+
*.log
64+
local_settings.py
65+
66+
# Flask stuff:
67+
instance/
68+
.webassets-cache
69+
70+
# Scrapy stuff:
71+
.scrapy
72+
73+
# Sphinx documentation
74+
docs/_build/
75+
76+
# PyBuilder
77+
target/
78+
79+
# IPython Notebook
80+
.ipynb_checkpoints
81+
82+
# pyenv
83+
.python-version
84+
85+
# celery beat schedule file
86+
celerybeat-schedule
87+
88+
# dotenv
89+
.env
90+
91+
# virtualenv
92+
venv/
93+
ENV/
94+
95+
# Spyder project settings
96+
.spyderproject
97+
98+
# Rope project settings
99+
.ropeproject
100+
101+
# JavaScript
102+
**/*.vscode/
103+
104+
# vim
105+
*.sw[mnopqrs]
106+
107+
# Idea
108+
.idea/
109+
110+
# Merge orig files
111+
*.orig

.pylintrc

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[FORMAT]
2+
3+
max-line-length = 120
4+
5+
[MESSAGES CONTROL]
6+
7+
enable =
8+
useless-suppression
9+
10+
disable =
11+
duplicate-code,
12+
invalid-name,
13+
fixme,
14+
missing-docstring,
15+
protected-access,
16+
too-few-public-methods,
17+
too-many-arguments,
18+
too-many-instance-attributes
19+
20+
[REPORTS]
21+
22+
reports = no
23+
24+
[TYPECHECK]
25+
26+
generated-members = pyls_*

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright 2017 Palantir Technologies, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

MANIFEST.in

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include README.rst
2+
include versioneer.py
3+
include jsonrpc/_version.py

README.rst

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Python JSON RPC Server
2+
======================
3+
4+
.. image:: https://circleci.com/gh/palantir/python-jsonrpc-server.svg?style=shield
5+
:target: https://circleci.com/gh/palantir/python-jsonrpc-server
6+
7+
.. image:: https://ci.appveyor.com/api/projects/status/mdacv6fnif7wonl0?svg=true
8+
:target: https://ci.appveyor.com/project/gatesn/python-jsonrpc-server
9+
10+
.. image:: https://img.shields.io/github/license/palantir/python-jsonrpc-server.svg
11+
:target: https://github.com/palantir/python-jsonrpc-server/blob/master/LICENSE
12+
13+
A Python 2.7 and 3.4+ server implementation of the `JSON RPC 2.0`_ protocol. This library has been pulled
14+
out of the `Python Language Server`_ project.
15+
16+
Asynchronous request handling is supported using Python 3's ``concurrent.futures`` module and the Python 2 `concurrent.futures backport`_.
17+
18+
Installation
19+
------------
20+
21+
``pip install -U python-jsonrpc-server``
22+
23+
Usage
24+
-----
25+
26+
27+
Development
28+
-----------
29+
30+
To run the test suite:
31+
32+
``pip install .[test] && tox``
33+
34+
License
35+
-------
36+
37+
This project is made available under the MIT License.
38+
39+
.. _JSON RPC 2.0: http://www.jsonrpc.org/specification
40+
.. _concurrent.futures backport: https://github.com/agronholm/pythonfutures

appveyor.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
environment:
2+
matrix:
3+
- TOXENV: py27
4+
- TOXENV: py34
5+
- TOXENV: lint
6+
7+
matrix:
8+
fast_finish: true
9+
10+
install:
11+
- C:\Python27\python -m pip install --pre -U tox
12+
13+
build: false # Not a C# project
14+
15+
test_script:
16+
- C:\Python27\scripts\tox
17+
18+
cache:
19+
- '%APPDATA%\pip\Cache'

circle.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
machine:
2+
post:
3+
- pyenv global 2.7.11 3.4.3
4+
5+
test:
6+
post:
7+
- ./setup.py -V | grep dirty -vq
8+
9+
deployment:
10+
releases:
11+
tag: /[0-9]+(\.[0-9]+)+((-(beta|rc)[0-9]{1,2})(\.[0-9])?)?/
12+
owner: palantir
13+
commands:
14+
- ./scripts/circle/pypi.sh

jsonrpc/__init__.py

Whitespace-only changes.

scripts/circle/pypi.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash -e
2+
3+
if [ -z "$CI" ]; then
4+
echo "Will only continue on CI"
5+
exit
6+
fi
7+
8+
# build package and upload to private pypi index
9+
rm -f ~/.pypirc
10+
echo "[distutils]" >> ~/.pypirc
11+
echo "index-servers = pypi-private" >> ~/.pypirc
12+
echo "[pypi-private]" >> ~/.pypirc
13+
echo "repository=https://$PYPI_HOST" >> ~/.pypirc
14+
echo "username=$PYPI_USERNAME" >> ~/.pypirc
15+
echo "password=$PYPI_PASSWORD" >> ~/.pypirc
16+
17+
python setup.py sdist upload -r pypi-private

setup.cfg

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[versioneer]
2+
VCS = git
3+
style = pep440
4+
versionfile_source = jsonrpc/_version.py
5+
versionfile_build = jsonrpc/_version.py
6+
tag_prefix =
7+
parentdir_prefix =

setup.py

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env python
2+
from setuptools import find_packages, setup
3+
import versioneer
4+
5+
README = open('README.rst', 'r').read()
6+
7+
8+
setup(
9+
name='python-jsonrpc-server',
10+
11+
# Versions should comply with PEP440. For a discussion on single-sourcing
12+
# the version across setup.py and the project code, see
13+
# https://packaging.python.org/en/latest/single_source_version.html
14+
version=versioneer.get_version(),
15+
cmdclass=versioneer.get_cmdclass(),
16+
17+
description='JSON RPC 2.0 server library',
18+
19+
long_description=README,
20+
21+
# The project's main homepage.
22+
url='https://github.com/palantir/python-jsonrpc-server',
23+
24+
author='Palantir Technologies, Inc.',
25+
26+
# You can just specify the packages manually here if your project is
27+
# simple. Or you can use find_packages().
28+
packages=find_packages(exclude=['contrib', 'docs', 'test']),
29+
30+
# List run-time dependencies here. These will be installed by pip when
31+
# your project is installed. For an analysis of "install_requires" vs pip's
32+
# requirements files see:
33+
# https://packaging.python.org/en/latest/requirements.html
34+
install_requires=[
35+
'future>=0.14.0',
36+
'futures; python_version<"3.2"',
37+
],
38+
39+
# List additional groups of dependencies here (e.g. development
40+
# dependencies). You can install these using the following syntax,
41+
# for example:
42+
# $ pip install -e .[test]
43+
extras_require={
44+
'test': ['tox', 'versioneer', 'pytest', 'mock', 'pytest-cov', 'coverage'],
45+
},
46+
)

test/__init__.py

Whitespace-only changes.

tox.ini

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Tox (http://tox.testrun.org/) is a tool for running tests
2+
# in multiple virtualenvs. This configuration file will run the
3+
# test suite on all supported python versions. To use it, "pip install tox"
4+
# and then run "tox" from this directory.
5+
6+
[tox]
7+
envlist = py27,py34,lint
8+
9+
[pycodestyle]
10+
ignore = E226, E722, W504
11+
max-line-length = 120
12+
exclude = test/plugins/.ropeproject,test/.ropeproject
13+
14+
[pytest]
15+
testpaths = test
16+
addopts =
17+
--cov-report html --cov-report term --junitxml=pytest.xml
18+
--cov jsonrpc --cov test
19+
20+
[testenv]
21+
commands =
22+
py.test {posargs:test/}
23+
deps =
24+
pytest
25+
coverage
26+
mock
27+
pytest-cov
28+
pylint
29+
extras = all
30+
31+
[testenv:lint]
32+
commands =
33+
pylint jsonrpc test
34+
pycodestyle jsonrpc test
35+
pyflakes jsonrpc test

0 commit comments

Comments
 (0)