Skip to content

Commit 0eb002d

Browse files
committed
Merge remote-tracking branch 'origin/master' into exclude-projects
2 parents f6571c9 + 762d342 commit 0eb002d

File tree

150 files changed

+2336
-3171
lines changed

Some content is hidden

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

150 files changed

+2336
-3171
lines changed

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
ignore = E125,D100,D101,D102,D105,D107,D200,D211,P101,FI15,FI16,FI12,FI11,FI17,FI50,FI53,FI54,T000,MQ101
3+
max-line-length = 80

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
.ropeproject/
1616
_build
1717
bower_components/
18+
contrib/supervisord.log
1819
deploy/.vagrant
1920
dist/*
2021
local_settings.py
@@ -42,3 +43,5 @@ private_*
4243
.rope_project/
4344
readthedocs/htmlcov
4445
tags
46+
.python-version
47+
*.pyo

.isort.cfg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[settings]
2+
line_length=80
3+
indent=' '
4+
multi_line_output=4
5+
default_section=THIRDPARTY
6+
known_first_party=readthedocs,readthedocsinc
7+
known_third_party=mock
8+
sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
9+
add_imports=from __future__ import division, from __future__ import print_function, from __future__ import unicode_literals

.pep8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[pep8]
2+
ignore = E701,E70,E702
3+
max-line-length = 80

.pre-commit-config.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
exclude: '^$'
2+
fail_fast: false
3+
repos:
4+
- repo: [email protected]:pre-commit/pre-commit-hooks
5+
sha: v1.1.1
6+
hooks:
7+
- id: autopep8-wrapper
8+
- id: check-added-large-files
9+
- id: debug-statements
10+
- id: double-quote-string-fixer
11+
- id: end-of-file-fixer
12+
- id: fix-encoding-pragma
13+
- id: flake8
14+
additional_dependencies: [
15+
'flake8-blind-except',
16+
'flake8-coding',
17+
'flake8-comprehensions',
18+
'flake8-debugger',
19+
'flake8-deprecated',
20+
'flake8-docstrings',
21+
'flake8-meiqia',
22+
'flake8-mutable',
23+
'flake8-pep3101',
24+
'flake8-print',
25+
'flake8-quotes',
26+
'flake8-string-format',
27+
'flake8-tidy-imports',
28+
'flake8-todo']
29+
- id: trailing-whitespace
30+
31+
- repo: [email protected]:pre-commit/mirrors-yapf.git
32+
sha: v0.20.0
33+
hooks:
34+
- id: yapf
35+
exclude: 'migrations|settings|scripts'
36+
additional_dependencies: ['futures']
37+
38+
- repo: [email protected]:FalconSocial/pre-commit-python-sorter.git
39+
sha: b57843b0b874df1d16eb0bef00b868792cb245c2
40+
hooks:
41+
- id: python-import-sorter
42+
args: ['--silent-overwrite']
43+
44+
- repo: [email protected]:humitos/mirrors-docformatter.git
45+
sha: v0.8
46+
hooks:
47+
- id: docformatter
48+
args: ['--in-place', '--wrap-summaries=80', '--wrap-descriptions=80', '--pre-summary-newline', '--no-blank']
49+
50+
- repo: [email protected]:humitos/mirrors-autoflake.git
51+
sha: v1.0
52+
hooks:
53+
- id: autoflake
54+
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
55+
56+
- repo: git://github.com/guykisel/prospector-mirror
57+
sha: 'b27f281eb9398fc8504415d7fbdabf119ea8c5e1'
58+
hooks:
59+
- id: prospector
60+
# https://github.com/pre-commit/pre-commit/issues/178
61+
language: system
62+
args: ['--profile=prospector']

.style.yapf

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
# https://github.com/google/yapf
2+
# current version used in this repo
3+
# yapf==0.20.0
4+
5+
6+
[style]
7+
# Align closing bracket with visual indentation.
8+
ALIGN_CLOSING_BRACKET_WITH_VISUAL_INDENT=True
9+
10+
# Allow lambdas to be formatted on more than one line.
11+
ALLOW_MULTILINE_LAMBDAS=False
12+
13+
# Allow dictionary keys to exist on multiple lines. For example:
14+
#
15+
# x = {
16+
# ('this is the first element of a tuple',
17+
# 'this is the second element of a tuple'):
18+
# value,
19+
# }
20+
ALLOW_MULTILINE_DICTIONARY_KEYS=False
21+
22+
# Insert a blank line before a 'def' or 'class' immediately nested
23+
# within another 'def' or 'class'. For example:
24+
#
25+
# class Foo:
26+
# # <------ this blank line
27+
# def method():
28+
# ...
29+
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF=True
30+
31+
# Insert a blank line before a class-level docstring.
32+
BLANK_LINE_BEFORE_CLASS_DOCSTRING=True
33+
34+
# Do not split consecutive brackets. Only relevant when
35+
# dedent_closing_brackets is set. For example:
36+
#
37+
# call_func_that_takes_a_dict(
38+
# {
39+
# 'key1': 'value1',
40+
# 'key2': 'value2',
41+
# }
42+
# )
43+
#
44+
# would reformat to:
45+
#
46+
# call_func_that_takes_a_dict({
47+
# 'key1': 'value1',
48+
# 'key2': 'value2',
49+
# })
50+
COALESCE_BRACKETS=True
51+
52+
# The column limit.
53+
COLUMN_LIMIT=80
54+
55+
# Indent width used for line continuations.
56+
CONTINUATION_INDENT_WIDTH=4
57+
58+
# Put closing brackets on a separate line, dedented, if the bracketed
59+
# expression can't fit in a single line. Applies to all kinds of
60+
# brackets, including function definitions and calls. For example:
61+
#
62+
# config = {
63+
# 'key1': 'value1',
64+
# 'key2': 'value2',
65+
# } # <--- this bracket is dedented and on a separate line
66+
#
67+
# time_series = self.remote_client.query_entity_counters(
68+
# entity='dev3246.region1',
69+
# key='dns.query_latency_tcp',
70+
# transform=Transformation.AVERAGE(window=timedelta(seconds=60)),
71+
# start_ts=now()-timedelta(days=3),
72+
# end_ts=now(),
73+
# ) # <--- this bracket is dedented and on a separate line
74+
DEDENT_CLOSING_BRACKETS=False
75+
76+
# Place each dictionary entry onto its own line.
77+
EACH_DICT_ENTRY_ON_SEPARATE_LINE=False
78+
79+
# The regex for an i18n comment. The presence of this comment stops
80+
# reformatting of that line, because the comments are required to be
81+
# next to the string they translate.
82+
I18N_COMMENT=
83+
84+
# The i18n function call names. The presence of this function stops
85+
# reformattting on that line, because the string it has cannot be moved
86+
# away from the i18n comment.
87+
I18N_FUNCTION_CALL=["_", "ugettext", "gettext"]
88+
89+
# Indent the dictionary value if it cannot fit on the same line as the
90+
# dictionary key. For example:
91+
#
92+
# config = {
93+
# 'key1':
94+
# 'value1',
95+
# 'key2': value1 +
96+
# value2,
97+
# }
98+
INDENT_DICTIONARY_VALUE=False
99+
100+
# The number of columns to use for indentation.
101+
INDENT_WIDTH=4
102+
103+
# Join short lines into one line. E.g., single line 'if' statements.
104+
JOIN_MULTIPLE_LINES=True
105+
106+
# Use spaces around the power operator.
107+
SPACES_AROUND_POWER_OPERATOR=True
108+
109+
# Do not include spaces around selected binary operators. For example:
110+
# 1 + 2 * 3 - 4 / 5
111+
# will be formatted as follows when configured with a value "*,/":
112+
# 1 + 2*3 - 4/5
113+
NO_SPACES_AROUND_SELECTED_BINARY_OPERATORS=False
114+
115+
# Set to True to prefer spaces around the assignment operator for
116+
# default or keyword arguments.
117+
SPACES_AROUND_DEFAULT_OR_NAMED_ASSIGN=False
118+
119+
# The number of spaces required before a trailing comment.
120+
SPACES_BEFORE_COMMENT=2
121+
122+
# Insert a space between the ending comma and closing bracket of a list,
123+
# etc.
124+
SPACE_BETWEEN_ENDING_COMMA_AND_CLOSING_BRACKET=False
125+
126+
# Split before arguments if the argument list is terminated by a
127+
# comma.
128+
SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED=True
129+
130+
# Set to True to prefer splitting before '&', '|' or '^' rather than
131+
# after.
132+
SPLIT_BEFORE_BITWISE_OPERATOR=False
133+
134+
# Split before a dictionary or set generator (comp_for). For example,
135+
# note the split before the for:
136+
#
137+
# foo = {
138+
# variable: 'Hello world, have a nice day!'
139+
# for variable in bar if variable != 42
140+
# }
141+
SPLIT_BEFORE_DICT_SET_GENERATOR=True
142+
143+
# Split after the opening paren which surrounds an expression if it doesn't fit on a single line.
144+
SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN=True
145+
146+
# If an argument / parameter list is going to be split, then split
147+
# before the first argument.
148+
SPLIT_BEFORE_FIRST_ARGUMENT=False
149+
150+
# Set to True to prefer splitting before 'and' or 'or' rather than
151+
# after.
152+
SPLIT_BEFORE_LOGICAL_OPERATOR=False
153+
154+
# Split named assignments onto individual lines.
155+
SPLIT_BEFORE_NAMED_ASSIGNS=False
156+
157+
# For list comprehensions and generator expressions with multiple clauses
158+
SPLIT_COMPLEX_COMPREHENSION=False
159+
160+
# The penalty for splitting right after the opening bracket.
161+
SPLIT_PENALTY_AFTER_OPENING_BRACKET=2000
162+
163+
# The penalty for splitting the line after a unary operator.
164+
SPLIT_PENALTY_AFTER_UNARY_OPERATOR=10000
165+
166+
# The penalty for splitting right before an if expression.
167+
SPLIT_PENALTY_BEFORE_IF_EXPR=0
168+
169+
# The penalty of splitting the line around the '&', '|', and '^'
170+
# operators.
171+
SPLIT_PENALTY_BITWISE_OPERATOR=300
172+
173+
# The penalty for splitting a list comprehension or generator expression.
174+
SPLIT_PENALTY_COMPREHENSION=80
175+
176+
# The penalty for characters over the column limit.
177+
SPLIT_PENALTY_EXCESS_CHARACTER=2600
178+
179+
# The penalty incurred by adding a line split to the unwrapped
180+
# line. The more line splits added the higher the penalty.
181+
SPLIT_PENALTY_FOR_ADDED_LINE_SPLIT=30
182+
183+
# The penalty of splitting a list of "import as" names. For example:
184+
#
185+
# from a_very_long_or_indented_module_name_yada_yad import (long_argument_1,
186+
# long_argument_2,
187+
# long_argument_3)
188+
#
189+
# would reformat to something like:
190+
#
191+
# from a_very_long_or_indented_module_name_yada_yad import (
192+
# long_argument_1, long_argument_2, long_argument_3)
193+
SPLIT_PENALTY_IMPORT_NAMES=0
194+
195+
# The penalty of splitting the line around the 'and' and 'or'
196+
# operators.
197+
SPLIT_PENALTY_LOGICAL_OPERATOR=300
198+
199+
# Use the Tab character for indentation.
200+
USE_TABS=False
201+
202+
# Allow splits before the dictionary value.
203+
ALLOW_SPLIT_BEFORE_DICT_VALUE=False

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"jquery": "2.0.3",
1818
"underscore": "~1.7.0",
1919
"readthedocs-client": "https://github.com/agjohnson/readthedocs-client-js.git",
20-
"sphinx-rtd-theme": "https://github.com/snide/sphinx-rtd-theme.git#0.2.4",
20+
"sphinx-rtd-theme": "https://github.com/snide/sphinx-rtd-theme.git#0.2.5b1",
2121
"knockout": "~3.3.0",
2222
"jquery.payment": "~1.3.0",
2323
"jquery-migrate": "~1.2.1",

contrib/readme.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Running Read the Docs via Supervisord
2+
=====================================
3+
4+
This is the easiest way to start all of the commands you'll need for development
5+
in an environment relatively close to the production evironment. All you need is
6+
``supervisord`` and ``redis-server``. Installation of ``redis-server`` is
7+
outside the scope of this documentation, but once installed, all you need to run
8+
from ``supervisord`` is::
9+
10+
pip install supervisor
11+
cd contrib/
12+
supervisord
13+
14+
This will bring up a web instance for the dashboard, a web instance for
15+
documentation serving, two celery instances, and redis-server.
16+
17+
If you already are running redis-server, this will complain about the port
18+
already being in use, but will still load.
19+
20+
Debugging
21+
---------
22+
23+
To debug, set trace points like normal, with ``pdb``/``ipdb``. Then you can
24+
connect to the process by bringing it to the foreground::
25+
26+
supervisorctl fg main
27+
28+
You'll still see logging to STDERR on the main supervisord process page.

contrib/supervisord.conf

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[supervisord]
2+
nodaemon = True
3+
directory = ../
4+
loglevel = error
5+
strip_ansi = False
6+
environment = PYTHONUNBUFFERED=1,READTHEDOCS_INSTANCE=readthedocs.org
7+
8+
[inet_http_server]
9+
port = 127.0.0.1:9001
10+
username = 🍔
11+
password = 🍟
12+
13+
[supervisorctl]
14+
username = 🍔
15+
password = 🍟
16+
17+
[rpcinterface:supervisor]
18+
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
19+
20+
[program:redis]
21+
command = redis-server
22+
directory = ../
23+
priority = 0
24+
startretries = 0
25+
stderr_logfile = /dev/stderr
26+
stderr_logfile_maxbytes = 0
27+
28+
[program:main]
29+
command = python manage.py runserver 8000
30+
directory = ../
31+
priority = 100
32+
stopasgroup = True
33+
stderr_logfile = /dev/stderr
34+
stderr_logfile_maxbytes = 0
35+
36+
[program:celery]
37+
command = celery worker -A readthedocs -Q default,celery,web,builder -l DEBUG -c 2
38+
directory = ../
39+
priority = 100
40+
stopasgroup = True
41+
stderr_logfile = /dev/stderr
42+
stderr_logfile_maxbytes = 0

0 commit comments

Comments
 (0)