Skip to content

Commit 961cb1a

Browse files
committed
Merge branch 'refs/heads/master' into sqlalchemy
2 parents 9a0b33c + a0ac884 commit 961cb1a

File tree

181 files changed

+10776
-871
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+10776
-871
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{py,rst,ini}]
12+
indent_style = space
13+
indent_size = 4
14+

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,20 @@ target/
6161

6262

6363
/tests/django.sqlite
64+
65+
/graphene/index.json
66+
/graphene/meta.json
67+
68+
/meta.json
69+
/index.json
70+
71+
/docs/playground/graphene-js/pypyjs-release-nojit/
72+
/docs/static/playground/lib
73+
74+
/docs/static/playground
75+
76+
# PyCharm
77+
.idea
78+
79+
# Databases
80+
*.sqlite3

.travis.yml

Lines changed: 83 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,92 @@ language: python
22
sudo: false
33
python:
44
- 2.7
5-
- 3.3
65
- 3.4
76
- 3.5
87
- pypy
9-
cache: pip
8+
cache:
9+
directories:
10+
- .cache/pip/
11+
- $HOME/.cache/pip
12+
- docs/node_modules/
13+
- $HOME/docs/node_modules
14+
before_install:
15+
- |
16+
git_diff=$(git diff --name-only $TRAVIS_COMMIT_RANGE)
17+
if [ "$?" == 0 ] && [ "$TEST_TYPE" != build_website ] && \
18+
! echo "$git_diff" | grep -qvE '(\.md$)|(^(docs))/'
19+
then
20+
echo "Only docs were updated, stopping build process."
21+
exit
22+
fi
1023
install:
11-
- pip install --cache-dir $HOME/.cache/pip pytest pytest-cov coveralls flake8 six blinker pytest-django
12-
- pip install --cache-dir $HOME/.cache/pip -e .[django]
13-
- python setup.py develop
24+
- |
25+
if [ "$TEST_TYPE" = build ]; then
26+
pip install --download-cache $HOME/.cache/pip/ pytest pytest-cov coveralls six pytest-django django-filter
27+
pip install --download-cache $HOME/.cache/pip/ -e .[django]
28+
pip install django==$DJANGO_VERSION
29+
python setup.py develop
30+
elif [ "$TEST_TYPE" = build_website ]; then
31+
pip install --download-cache $HOME/.cache/pip/ -e .
32+
python setup.py develop
33+
elif [ "$TEST_TYPE" = lint ]; then
34+
pip install --download-cache $HOME/.cache/pip/ flake8
35+
fi
1436
script:
15-
- py.test --cov=graphene
16-
- flake8
37+
- |
38+
if [ "$TEST_TYPE" = build_website ]; then
39+
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
40+
echo "Building the web."
41+
nvm install 4.0
42+
43+
GH_PAGES_DIR="$TRAVIS_BUILD_DIR"/docs/public
44+
git config --global user.name "Travis CI"
45+
git config --global user.email "[email protected]"
46+
git clone --branch gh-pages --depth=50 \
47+
https://[email protected]/graphql-python/graphene.git \
48+
$GH_PAGES_DIR
49+
cd docs
50+
./playground/graphene-js/build.sh
51+
npm run deploy
52+
cd $GH_PAGES_DIR
53+
git status
54+
git add --intent-to-add .
55+
if ! git diff-index --quiet HEAD --; then
56+
git add -A .
57+
git commit -m "Rebuild website"
58+
git push "https://${GITHUB_TOKEN}@github.com/graphql-python/graphene.git" gh-pages
59+
fi
60+
exit
61+
fi
62+
elif [ "$TEST_TYPE" = lint ]; then
63+
echo "Checking Python code lint."
64+
flake8
65+
exit
66+
elif [ "$TEST_TYPE" = build ]; then
67+
py.test --cov=graphene
68+
fi
1769
after_success:
18-
- coveralls
70+
- |
71+
if [ "$TEST_TYPE" = build ]; then
72+
coveralls
73+
fi
74+
env:
75+
matrix:
76+
- TEST_TYPE=build
77+
global:
78+
secure: SQC0eCWCWw8bZxbLE8vQn+UjJOp3Z1m779s9SMK3lCLwJxro/VCLBZ7hj4xsrq1MtcFO2U2Kqf068symw4Hr/0amYI3HFTCFiwXAC3PAKXeURca03eNO2heku+FtnQcOjBanExTsIBQRLDXMOaUkf3MIztpLJ4LHqMfUupKmw9YSB0v40jDbSN8khBnndFykmOnVVHznFp8USoN5F0CiPpnfEvHnJkaX76lNf7Kc9XNShBTTtJsnsHMhuYQeInt0vg9HSjoIYC38Tv2hmMj1myNdzyrHF+LgRjI6ceGi50ApAnGepXC/DNRhXROfECKez+LON/ZSqBGdJhUILqC8A4WmWmIjNcwitVFp3JGBqO7LULS0BI96EtSLe8rD1rkkdTbjivajkbykM1Q0Tnmg1adzGwLxRUbTq9tJQlTTkHBCuXIkpKb1mAtb/TY7A6BqfnPi2xTc/++qEawUG7ePhscdTj0IBrUfZsUNUYZqD8E8XbSWKIuS3SHE+cZ+s/kdAsm4q+FFAlpZKOYGxIkwvgyfu4/Plfol4b7X6iAP9J3r1Kv0DgBVFst5CXEwzZs19/g0CgokQbCXf1N+xeNnUELl6/fImaR3RKP22EaABoil4z8vzl4EqxqVoH1nfhE+WlpryXsuSaF/1R+WklR7aQ1FwoCk8V8HxM2zrj4tI8k=
79+
matrix:
80+
fast_finish: true
81+
include:
82+
- python: '2.7'
83+
env: TEST_TYPE=build DJANGO_VERSION=1.6
84+
- python: '2.7'
85+
env: TEST_TYPE=build DJANGO_VERSION=1.7
86+
- python: '2.7'
87+
env: TEST_TYPE=build DJANGO_VERSION=1.8
88+
- python: '2.7'
89+
env: TEST_TYPE=build DJANGO_VERSION=1.9
90+
- python: '2.7'
91+
env: TEST_TYPE=build_website
92+
- python: '2.7'
93+
env: TEST_TYPE=lint

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ![Graphene Logo](http://graphene-python.org/favicon.png) [Graphene](http://graphene-python.org) [![Build Status](https://travis-ci.org/graphql-python/graphene.svg?branch=master)](https://travis-ci.org/graphql-python/graphene) [![PyPI version](https://badge.fury.io/py/graphene.svg)](https://badge.fury.io/py/graphene) [![Coverage Status](https://coveralls.io/repos/graphql-python/graphene/badge.svg?branch=master&service=github)](https://coveralls.io/github/graphql-python/graphene?branch=master)
22

33

4-
Graphene is a Python library for building GraphQL schemas/types fast and easily.
4+
[Graphene](http://graphene-python.org) is a Python library for building GraphQL schemas/types fast and easily.
55

66
- **Easy to use:** Graphene helps you use GraphQL in Python without effort.
77
- **Relay:** Graphene has builtin support for Relay
@@ -10,6 +10,7 @@ Graphene is a Python library for building GraphQL schemas/types fast and easily.
1010

1111
*What is supported in this Python version?* **Everything**: Interfaces, ObjectTypes, Scalars, Unions and Relay (Nodes, Connections), in addition to queries, mutations and subscriptions.
1212

13+
**NEW**!: [Try graphene online](http://graphene-python.org/playground/)
1314

1415
## Installation
1516

README.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
|Graphene Logo| `Graphene <http://graphene-python.org>`__ |Build Status| |PyPI version| |Coverage Status|
22
=========================================================================================================
33

4-
Graphene is a Python library for building GraphQL schemas/types fast and
5-
easily.
4+
`Graphene <http://graphene-python.org>`__ is a Python library for
5+
building GraphQL schemas/types fast and easily.
66

77
- **Easy to use:** Graphene helps you use GraphQL in Python without
88
effort.
@@ -16,6 +16,9 @@ easily.
1616
ObjectTypes, Scalars, Unions and Relay (Nodes, Connections), in addition
1717
to queries, mutations and subscriptions.
1818

19+
**NEW**!: `Try graphene
20+
online <http://graphene-python.org/playground/>`__
21+
1922
Installation
2023
------------
2124

bin/autolinter

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3-
autoflake ./ -r --remove-unused-variables --remove-all-unused-imports --in-place
4-
autopep8 ./ -r --in-place --experimental --aggressive --max-line-length 120
5-
isort -rc .
3+
# Install the required scripts with
4+
# pip install autoflake autopep8 isort
5+
autoflake ./examples/ ./graphene/ -r --remove-unused-variables --remove-all-unused-imports --in-place
6+
autopep8 ./examples/ ./graphene/ -r --in-place --experimental --aggressive --max-line-length 120
7+
isort -rc ./examples/ ./graphene/

docs/.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"stage": 0
3+
}

docs/.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Directory for instrumented libs generated by jscoverage/JSCover
11+
lib-cov
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
16+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17+
.grunt
18+
19+
# node-waf configuration
20+
.lock-wscript
21+
22+
# Compiled binary addons (http://nodejs.org/api/addons.html)
23+
build/Release
24+
25+
# Dependency directory
26+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
27+
node_modules
28+
29+
public/

docs/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Graphene Docs
2+
3+
Graphene docs are powered by [gatsby](https://github.com/gatsbyjs/gatsby).
4+
5+
6+
## Installation
7+
8+
For running locally this docs. You have to execute
9+
```bash
10+
npm install -g gatsby && npm install
11+
```
12+
13+
And then
14+
15+
```bash
16+
gatsby develop
17+
```
18+
19+
## Playground
20+
21+
If you want to have the playground running too, just execute
22+
23+
```
24+
./playground/graphene-js/build.sh
25+
```
26+
27+
This command will clone the [pypyjs-release-nojit](https://github.com/pypyjs/pypyjs-release-nojit) repo, update it with the latest graphene, graphql-core and graphql-relay code, and make it available for the `/playground` view in the docs.
28+
29+
30+
## Build
31+
32+
For building the docs into the `public` dir, just run:
33+
34+
```bash
35+
npm run build
36+
```
37+
38+
39+
## Automation
40+
41+
Thanks to [Travis](https://github.com/graphql-python/graphene/blob/master/.travis.yml#L39-L58), we automated the way documentation is updated in the `gh-pages` branch.
42+
43+
Each time we modify the docs in the `master` branch the travis job runs and updates the `gh-pages` branch with the latest code, so [Graphene's website](http://graphene-python.org) have always the latest docs.

docs/app.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
exports.loadContext = function(callback) {
2+
var context;
3+
context = require.context('./pages', true);
4+
if (module.hot) {
5+
module.hot.accept(context.id, function() {
6+
context = require.context('./pages', true);
7+
return callback(context);
8+
});
9+
}
10+
return callback(context);
11+
};
12+
13+
exports.onRouteChange = function(state) {
14+
if (typeof window !== "undefined" && window.ga) {
15+
window.ga('send', 'pageview', {
16+
page: state.pathname
17+
});
18+
}
19+
}

0 commit comments

Comments
 (0)