Skip to content

Commit

Permalink
Merge 4221bd0 into 64a5740
Browse files Browse the repository at this point in the history
  • Loading branch information
karol-gruszczyk committed Oct 27, 2018
2 parents 64a5740 + 4221bd0 commit 23c8588
Show file tree
Hide file tree
Showing 114 changed files with 3,481 additions and 1,725 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,5 +4,6 @@ venv
.cache
.idea
.pytest_cache/
.mypy_cache/

docs/_build
5 changes: 4 additions & 1 deletion .travis.yml
@@ -1,11 +1,14 @@
language: python
sudo: required
dist: xenial
python:
- 3.6
- 3.7
install:
- pip install -r requirements.txt
script:
- pytest --cov
- flake8 slothql
# - mypy .
after_success:
- pip install coveralls
- coveralls
61 changes: 29 additions & 32 deletions docs/conf.py
Expand Up @@ -2,14 +2,14 @@

# -- Project information -----------------------------------------------------

project = 'SlothQL'
copyright = '2018, Karol Gruszczyk'
author = 'Karol Gruszczyk'
project = "SlothQL"
copyright = "2018, Karol Gruszczyk"
author = "Karol Gruszczyk"

# The short X.Y version
version = '0.1'
version = "0.1"
# The full version, including alpha/beta/rc tags
release = '0.1a'
release = "0.1a"

# -- General configuration ---------------------------------------------------

Expand All @@ -21,22 +21,20 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
"sphinx.ext.doctest",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

source_parsers = {
'.md': CommonMarkParser,
}
source_parsers = {".md": CommonMarkParser}

source_suffix = ['.rst', '.md']
source_suffix = [".rst", ".md"]

master_doc = 'index'
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -48,17 +46,17 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -69,7 +67,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -85,23 +83,20 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'SlothQLdoc'
htmlhelp_basename = "SlothQLdoc"

# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -111,28 +106,30 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'SlothQL.tex', 'SlothQL Documentation',
'Karol Gruszczyk', 'manual'),
(master_doc, "SlothQL.tex", "SlothQL Documentation", "Karol Gruszczyk", "manual")
]

# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'slothql', 'SlothQL Documentation',
[author], 1)
]
man_pages = [(master_doc, "slothql", "SlothQL Documentation", [author], 1)]

# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'SlothQL', 'SlothQL Documentation',
author, 'SlothQL', 'GraphQL framework for lazy people.',
'Miscellaneous'),
(
master_doc,
"SlothQL",
"SlothQL Documentation",
author,
"SlothQL",
"GraphQL framework for lazy people.",
"Miscellaneous",
)
]

# -- Extension configuration -------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions mypy.ini
@@ -0,0 +1,5 @@
[mypy]
python_version = 3.7
warn_return_any = True
warn_unused_configs = True
ignore_missing_imports = True
27 changes: 14 additions & 13 deletions requirements.txt
@@ -1,21 +1,22 @@
graphql-core>=2<3
cached-property==1.4
cached-property==1.5.1

# optional
django>=2.0<3
django>=2.0
psycopg2-binary>=2.7<3

# development
pytest
pytest-cov
pytest-django
# testing
pytest==3.8.2
pytest-cov==2.6.0
pytest-django==3.4.3

flake8
flake8-comprehensions
flake8-commas
flake8-quotes
# QA
mypy==0.630
flake8==3.5.0
flake8-comprehensions==1.4.1
black==18.9b0

# documentation
sphinx
recommonmark # markdown support
sphinx-rtd-theme
sphinx==1.8.1
recommonmark==0.4.0 # markdown support
sphinx-rtd-theme==0.4.2
47 changes: 20 additions & 27 deletions setup.py
@@ -1,37 +1,30 @@
from distutils.core import setup
from setuptools import find_packages

VERSION = '0.1.0a0'
VERSION = "0.1.0a0"

setup(
name='slothql',
name="slothql",
version=VERSION,
description='The async GraphQL framework.',
long_description=open('README.rst').read(),

author='Karol Gruszczyk',
author_email='karol.gruszczyk@gmail.com',

packages=find_packages(exclude=['*.tests*']),

url='https://github.com/IndioInc/slothql/',
keywords='graphql framework django async aiohttp relay graphene',

license='MIT',
description="The async GraphQL framework.",
long_description=open("README.rst").read(),
author="Karol Gruszczyk",
author_email="karol.gruszczyk@gmail.com",
packages=find_packages(exclude=["*.tests*"]),
url="https://github.com/IndioInc/slothql/",
keywords="graphql framework django async aiohttp relay graphene",
license="MIT",
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
],
python_requires='~=3.6',

install_requires=[
'graphql-core>=2.0,<3',
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
platforms='any',
python_requires="~=3.6",
install_requires=["graphql-core>=2.0,<3"],
platforms="any",
include_package_data=True,
)
84 changes: 49 additions & 35 deletions slothql/__init__.py
@@ -1,44 +1,58 @@
from graphql import ResolveInfo

from .types.fields import Field, Integer, Float, String, Boolean, ID, JsonString, DateTime, Date, Time
from .resolution import (
Resolver,
ResolveArgs,
PartialResolver,
Selection,
ResolveInfo,
FilterExpression,
FilterOperator,
)
from .types.fields import (
Field,
Integer,
Float,
String,
Boolean,
ID,
JsonString,
DateTime,
Date,
Time,
)
from .types import BaseType, Object, Enum, EnumValue, Union
from .schema import Schema
from .operation import Operation, InvalidOperation
from .query import gql, ExecutionResult

__all__ = (
# graphql
'ResolveInfo',

# resolution
"Resolver",
"PartialResolver",
"ResolveArgs",
"Selection",
"ResolveInfo",
"FilterExpression",
"FilterOperator",
# fields
'Field',
'Integer',
'Float',
'String',
'Boolean',
'ID',
'JsonString',
'DateTime',
'Date',
'Time',

"Field",
"Integer",
"Float",
"String",
"Boolean",
"ID",
"JsonString",
"DateTime",
"Date",
"Time",
# types
'BaseType',
'Object',
'Enum',
'EnumValue',
'Union',

'Operation',
'InvalidOperation',
'Schema',
'gql',
'ExecutionResult',
"BaseType",
"Object",
"Enum",
"EnumValue",
"Union",
"Operation",
"InvalidOperation",
"Schema",
"gql",
"ExecutionResult",
)

try:
from slothql import django
__all__ += ('django',)
except ImportError as e:
if str(e) != "No module named 'django'":
raise

0 comments on commit 23c8588

Please sign in to comment.