Skip to content
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
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks.git
sha: v0.9.2
hooks:
- id: check-ast
- id: flake8
- id: check-case-conflict
- id: check-added-large-files
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: docs/generated/
Expand Down Expand Up @@ -46,3 +50,19 @@ repos:
entry: except:$
language: pygrep
files: \.py$
- id: no-dorp
name: Prevent misspelling of drop
entry: dorp
language: pygrep
files: \.(py|pyi|rst|md)$
- id: validatedoc
name: validatedoc
entry: python -m validatedoc.validatedoc
language: system
types: [python]
exclude: (syncr_backend/bin/|syncr_backend/contrib/|docs/|tests/)
- repo: git://github.com/matthewbentley/pre-commit-mirrors-pep257
sha: 'acc6d81940b8d38563929e7fde70696cea42da30'
hooks:
- id: pydocstyle
exclude: (syncr_backend/bin/|syncr_backend/contrib/|docs/|tests/)
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ env:
- TOXENV=itests_simple
- TOXENV=itests_complex
- TOXENV=itests_dht
install: pip install tox
script:
- tox
32 changes: 32 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[requires]
python_version = "3.6"

[packages]
aiofiles = "*"
"bencode.py" = "*"
cachetools = "*"
cryptography = "*"
kademlia = "*"

[dev-packages]
coverage = "*"
docutils = "*"
flake8 = "*"
mypy = "*"
pycodestyle = "*"
pydocstyle = "*"
pytest = "*"
rinohtype = "*"
Sphinx = "*"
sphinxcontrib-autoprogram = "*"
sphinxcontrib-websupport = "*"
tox = "*"
validatedoc = "*"
pre-commit = "*"
sphinx-rtd-theme = "*"
pipenv = "*"
642 changes: 642 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
"""Docs configuration"""
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
Expand Down
55 changes: 55 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
-i https://pypi.python.org/simple
alabaster==0.7.10
aspy.yaml==1.1.1
attrs==18.1.0
babel==2.5.3
cached-property==1.4.2
certifi==2018.4.16
cfgv==1.0.0
chardet==3.0.4
commonmark==0.5.4
coverage==4.5.1
docutils==0.14
flake8==3.5.0
identify==1.0.16
idna==2.6
imagesize==1.0.0
jinja2==2.10
markupsafe==1.0
mccabe==0.6.1
more-itertools==4.1.0
mypy==0.600
nodeenv==1.3.0
packaging==17.1
pipenv==2018.5.18
pluggy==0.6.0
pre-commit==1.8.2
purepng==0.2.0
py==1.5.3
pycodestyle==2.3.1
pydocstyle==2.1.1
pyflakes==1.6.0
pygments==2.2.0
pyparsing==2.2.0
pytest==3.5.1
pytz==2018.4
pyyaml==3.12
recommonmark==0.4.0
requests==2.18.4
rinoh-typeface-dejavuserif==0.1.1
rinoh-typeface-texgyrecursor==0.1.1
rinoh-typeface-texgyreheros==0.1.1
rinoh-typeface-texgyrepagella==0.1.1
rinohtype==0.3.1
six==1.11.0
snowballstemmer==1.2.1
sphinx==1.7.4
sphinx-rtd-theme==0.3.1
sphinxcontrib-autoprogram==0.1.5
sphinxcontrib-websupport==1.0.1
tox==3.0.0
typed-ast==1.1.0
urllib3==1.22
validatedoc==0.0.3
virtualenv==16.0.0
virtualenv-clone==0.3.0
56 changes: 3 additions & 53 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,63 +1,13 @@
## The following requirements were added by pip freeze:
-i https://pypi.python.org/simple
aiofiles==0.3.2
alabaster==0.7.10
asn1crypto==0.24.0
aspy.yaml==1.1.0
attrs==17.4.0
Babel==2.5.3
bencode.py==2.0.0
cached-property==1.4.2
cachetools==2.0.1
certifi==2018.4.16
cffi==1.11.5
cfgv==1.0.0
chardet==3.0.4
CommonMark==0.5.4
coverage==4.5.1
cachetools==2.1.0
cffi==1.11.5; platform_python_implementation != 'pypy'
cryptography==2.2.2
docutils==0.14
flake8==3.5.0
future==0.16.0
identify==1.0.13
idna==2.6
imagesize==1.0.0
Jinja2==2.10
kademlia==1.0
MarkupSafe==1.0
mccabe==0.6.1
more-itertools==4.1.0
mypy==0.590
nodeenv==1.3.0
packaging==17.1
pluggy==0.6.0
pre-commit==1.8.2
psutil==5.4.5
purepng==0.2.0
py==1.5.3
pycodestyle==2.3.1
pycparser==2.18
pyflakes==1.6.0
Pygments==2.2.0
pyparsing==2.2.0
pytest==3.5.1
pytz==2018.4
PyYAML==3.12
recommonmark==0.4.0
requests==2.18.4
rinoh-typeface-dejavuserif==0.1.1
rinoh-typeface-texgyrecursor==0.1.1
rinoh-typeface-texgyreheros==0.1.1
rinoh-typeface-texgyrepagella==0.1.1
rinohtype==0.3.1
rpcudp==3.0.0
six==1.11.0
snowballstemmer==1.2.1
Sphinx==1.7.4
sphinx-rtd-theme==0.2.4
sphinxcontrib-autoprogram==0.1.4
sphinxcontrib-websupport==1.0.1
tox==3.0.0
typed-ast==1.1.0
u-msgpack-python==2.5.0
urllib3==1.22
virtualenv==15.2.0
68 changes: 6 additions & 62 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Setup.py."""
from setuptools import find_packages
from setuptools import setup

Expand Down Expand Up @@ -35,67 +36,10 @@
'syncr_backend/contrib/bq',
],
install_requires=[
"aiofiles==0.3.2",
"alabaster==0.7.10",
"asn1crypto==0.24.0",
"aspy.yaml==1.1.0",
"attrs==17.4.0",
"Babel==2.5.3",
"bencode.py==2.0.0",
"cached-property==1.4.2",
"cachetools==2.0.1",
"certifi==2018.4.16",
"cffi==1.11.5",
"cfgv==1.0.0",
"chardet==3.0.4",
"CommonMark==0.5.4",
"coverage==4.5.1",
"cryptography==2.2.2",
"docutils==0.14",
"flake8==3.5.0",
"future==0.16.0",
"identify==1.0.13",
"idna==2.6",
"imagesize==1.0.0",
"Jinja2==2.10",
"kademlia==1.0",
"MarkupSafe==1.0",
"mccabe==0.6.1",
"more-itertools==4.1.0",
"mypy==0.590",
"nodeenv==1.3.0",
"packaging==17.1",
"pluggy==0.6.0",
"pre-commit==1.8.2",
"psutil==5.4.5",
"purepng==0.2.0",
"py==1.5.3",
"pycodestyle==2.3.1",
"pycparser==2.18",
"pyflakes==1.6.0",
"Pygments==2.2.0",
"pyparsing==2.2.0",
"pytest==3.5.1",
"pytz==2018.4",
"PyYAML==3.12",
"recommonmark==0.4.0",
"requests==2.18.4",
"rinoh-typeface-dejavuserif==0.1.1",
"rinoh-typeface-texgyrecursor==0.1.1",
"rinoh-typeface-texgyreheros==0.1.1",
"rinoh-typeface-texgyrepagella==0.1.1",
"rinohtype==0.3.1",
"rpcudp==3.0.0",
"six==1.11.0",
"snowballstemmer==1.2.1",
"Sphinx==1.7.4",
"sphinx-rtd-theme==0.2.4",
"sphinxcontrib-autoprogram==0.1.4",
"sphinxcontrib-websupport==1.0.1",
"tox==3.0.0",
"typed-ast==1.1.0",
"u-msgpack-python==2.5.0",
"urllib3==1.22",
"virtualenv==15.2.0",
"aiofiles>=0.3.2",
"bencode.py>=2.0.0",
"cachetools>=2.1.0",
"cryptography>=2.2.2",
"kademlia>=1.0",
],
)
2 changes: 1 addition & 1 deletion syncr_backend/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""The backend for 5yncr"""
"""The backend for 5yncr."""
12 changes: 9 additions & 3 deletions syncr_backend/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Constants"""
"""Constants."""
import os
from enum import Enum
from enum import IntEnum
Expand All @@ -9,13 +9,15 @@


class TrackerRequest(IntEnum):
"""Tracker request types"""
"""Tracker request types."""

GET_KEY = 0 #: Get a key
POST_KEY = 1 #: Add a key
GET_PEERS = 2 #: Geet peers
POST_PEER = 3 #: Add a peer

def __str__(self) -> str:
"""Get the string representation of a tracker request."""
return str(self.name)


Expand Down Expand Up @@ -87,13 +89,16 @@ def __str__(self) -> str:


class StrEnum(str, Enum):
"""Enum comparable as strings."""

pass


# Frontend action types
# TODO: make an enum
class FrontendAction(StrEnum):
"""Frontend action strings"""
"""Frontend action strings."""

GET_OWNED_SUBSCRIBED_DROPS = 'get_owned_subscribed_drops'
GET_SELECTED_DROP = 'get_selected_drop'
INITIALIZE_DROP = 'initialize_drop'
Expand All @@ -110,6 +115,7 @@ class FrontendAction(StrEnum):
GET_PUBLIC_KEY = 'get_public_key'

def __str__(self) -> str:
"""Get the string representation of a frontend action."""
return(self.value)


Expand Down
2 changes: 1 addition & 1 deletion syncr_backend/external_interface/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""The interface with the tracker"""
"""The interface with the tracker."""
Loading