Skip to content

Commit 1c53522

Browse files
Merge branch 'master' into async-github-repo-syncing
2 parents 867b173 + 68e5890 commit 1c53522

File tree

164 files changed

+1271
-42735
lines changed

Some content is hidden

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

164 files changed

+1271
-42735
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
.coverage
77
.idea
88
.vagrant
9+
.tox
910
_build
1011
cnames
1112
bower_components/

.travis.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
language: python
22
python:
3-
- "2.7"
3+
- 2.7
4+
sudo: false
5+
env:
6+
- TOX_ENV=py27
7+
- TOX_ENV=docs
8+
#- TOX_ENV=lint
49
install:
5-
- pip install flake8 stripe
6-
- pip install -r requirements.txt
10+
- pip install tox
711
- pip install coveralls
812
script:
9-
#- flake8 `find . -iname "*.py" -not -ipath "*migration*"`
10-
- ./runtests.sh
13+
- tox -e $TOX_ENV
1114
after_success:
1215
- coveralls
1316
notifications:

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"tests"
1515
],
1616
"dependencies": {
17-
"jquery": "*",
17+
"jquery": "~2.0.3",
1818
"underscore": "~1.7.0",
1919
"readthedocs-client": "https://github.com/agjohnson/readthedocs-client-js.git",
2020
"knockout": "~3.3.0",

docs/changelog.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Changelog
2+
3+
This document will track major changes in the project.
4+
5+
Also note, this document is a Markdown file. This is mainly to keep parity with GitHub, and also because we can.
6+
7+
## July 23, 2015
8+
9+
10+
* Django 1.8 Support Merged
11+
12+
### Code Notes
13+
14+
15+
- Updated Django from `1.6.11` to `1.8.3`.
16+
- Removed South and ported the South migrations to Django's migration framework.
17+
- Updated django-celery from `3.0.23` to `3.1.26` as django-celery 3.0.x does not support Django 1.8.
18+
- Updated Celery from `3.0.24` to `3.1.18` because we had to update django-celery. We need to test this extensively and might need to think about using the new Celery API directly and dropping django-celery. See release notes: http://docs.celeryproject.org/en/latest/whatsnew-3.1.html
19+
- Updated tastypie from `0.11.1` to current master (commit `1e1aff3dd4dcd21669e9c68bd7681253b286b856`) as 0.11.x is not compatible with Django 1.8. No suprises expected but we should ask for a proper release, see release notes: https://github.com/django-tastypie/django-tastypie/blob/master/docs/release_notes/v0.12.0.rst
20+
- Updated django-oauth from `0.16.1` to `0.21.0`. No suprises expected, see release notes [in the docs](https://django-allauth.readthedocs.org/en/latest/changelog.html) and [finer grained in the repo](https://github.com/pennersr/django-allauth/blob/9123223f167959e4e5c4074408db068f725559d1/ChangeLog#L1-169)
21+
- Updated django-guardian from `1.2.0` to `1.3.0` to gain Django 1.8 support. No suprises expected, see release notes: https://github.com/lukaszb/django-guardian/blob/devel/CHANGES
22+
- Using `django-formtools` instead of removed `django.contrib.formtools` now. Based on the Django release notes, these modules are the same except of the package name.
23+
- Updated pytest-django from `2.6.2` to `2.8.0`. No tests required, but running the testsuite :smile:
24+
- Updated psycopg2 from 2.4 to 2.4.6 as 2.4.5 is required by Django 1.8. No trouble expected as Django is the layer between us and psycopg2. Also it's only a minor version upgrade. Release notes: http://initd.org/psycopg/docs/news.html#what-s-new-in-psycopg-2-4-6
25+
- Added `django.setup()` to `conf.py` to load django properly for doc builds.
26+
- Added migrations for all apps with models in the `readthedocs/` directory
27+
28+
### Deployment Notes
29+
30+
After you have updated the code and installed the new dependencies, you need to run these commands on the server:
31+
32+
```bash
33+
python manage.py migrate contenttypes
34+
python manage.py migrate projects 0002 --fake
35+
python manage.py migrate --fake-initial
36+
```
37+
38+
Locally I had trouble in a test environment that pip did not update to the specified commit of tastypie. It might be required to use `pip install -U -r requirements/deploy.txt` during deployment.
39+
40+
41+
### Development Update Notes
42+
43+
The readthedocs developers need to execute these commands when switching to this branch (or when this got merged into master):
44+
45+
- **Before updating** please make sure that all migrations are applied:
46+
47+
```bash
48+
python manage.py syncdb
49+
python manage.py migrate
50+
```
51+
52+
- Update the codebase: `git pull`
53+
- You need to update the requirements with `pip install -r requirements.txt`
54+
- Now you need to fake the initial migrations:
55+
56+
```bash
57+
python manage.py migrate contenttypes
58+
python manage.py migrate projects 0002 --fake
59+
python manage.py migrate --fake-initial
60+
```

docs/conf.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
import os
44
import sys
55

6+
from recommonmark.parser import CommonMarkParser
7+
68
sys.path.insert(0, os.path.abspath('../readthedocs'))
79
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.sqlite")
810
from django.conf import settings
911

12+
import django
13+
django.setup()
14+
1015

1116
sys.path.append(os.path.abspath('_ext'))
1217
extensions = [
@@ -16,7 +21,12 @@
1621
'djangodocs',
1722
]
1823
templates_path = ['_templates']
19-
source_suffix = '.rst'
24+
25+
source_suffix = ['.rst', '.md']
26+
source_parsers = {
27+
'.md': CommonMarkParser,
28+
}
29+
2030
master_doc = 'index'
2131
project = u'Read The Docs'
2232
copyright = u'2010, Eric Holscher, Charlie Leifer, Bobby Grace'

docs/custom_installs/local_rtd_vm.rst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Assumptions and Prerequisites
88
* All python dependencies and setup tools are installed ::
99

1010
$ sudo apt-get install python-setuptools
11-
$ sudo apt-get install built-essential
11+
$ sudo apt-get install build-essential
1212
$ sudo apt-get install python-dev
1313
$ sudo apt-get install libevent-dev
1414
$ sudo easy_install pip
@@ -37,7 +37,7 @@ To host your documentation on a local RTD installation, set it up in your VM. ::
3737
$ cd checkouts
3838
$ git clone https://github.com/rtfd/readthedocs.org.git
3939
$ cd readthedocs.org
40-
$ sudo pip install -r pip_requirements.txt
40+
$ sudo pip install -r requirements.txt
4141
4242
Possible Error and Resolution
4343
`````````````````````````````
@@ -56,18 +56,14 @@ Possible Error and Resolution
5656
1. Run the following commands. ::
5757

5858
$ cd readthedocs
59-
$ ./manage.py syncdb
59+
$ ./manage.py migrate
6060

6161
2. This will prompt you to create a superuser account for Django. Enter appropriate details. For example: ::
6262

6363
Username: monami.b
6464
Email address: [email protected]
6565
Password: pa$$word
6666

67-
3. Run the migrate command. ::
68-
69-
$ ./manage.py migrate
70-
7167
3. RTD Server Administration.
7268
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7369

@@ -76,9 +72,9 @@ Navigate to the ``../checkouts/readthedocs.org/readthedocs`` folder in your VM a
7672
$ ./manage.py runserver [VM IP ADDRESS]:8000
7773
$ curl -i http://[VM IP ADDRESS]:8000
7874

79-
You should now be able to log into the admin interface from any PC in your LAN at http://[VM IP ADDRESS]:8000/admin using the superuser account created in django.
75+
You should now be able to log into the admin interface from any PC in your LAN at ``http://[VM IP ADDRESS]:8000/admin`` using the superuser account created in django.
8076

81-
Go to the dashboard at http://[VM IP ADDRESS]:8000/dashboard and follow these steps:
77+
Go to the dashboard at ``http://[VM IP ADDRESS]:8000/dashboard`` and follow these steps:
8278

8379
1. Point the repository to your corporate Git project where the documentation source is checked in. Example:
8480
git.corp.company.com:/git/docs/documentation.git
@@ -124,7 +120,7 @@ This provides all permissions for that particular remote session, which are revo
124120
4. Build Documentation on Local RTD Instance.
125121
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
126122

127-
Log into http://[VM IP ADDRESS]:[PORT] using the django superuser creds and follow these steps.
123+
Log into ``http://[VM IP ADDRESS]:[PORT]`` using the django superuser creds and follow these steps.
128124

129125
For a new project
130126
`````````````````

docs/development.rst

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
=====================
2+
Development Standards
3+
=====================
4+
5+
Front End Development
6+
=====================
7+
8+
Background
9+
----------
10+
11+
.. info::
12+
13+
Consider this the canonical resource for contributing Javascript and CSS. We
14+
are currently in the process of modernizing our front end development
15+
procedures. You will see a lot of different styles around the code base for
16+
front end JavaScript and CSS.
17+
18+
Our modern front end development stack includes the following tools:
19+
20+
* `Gulp`_
21+
* `Bower`_
22+
* `Browserify`_
23+
* `Debowerify`_
24+
* And soon, `LESS`_
25+
26+
We use the following libraries:
27+
28+
* `Knockout`_
29+
* `jQuery`_
30+
* Several jQuery plugins
31+
32+
Previously, JavaScript development has been done in monolithic files or inside
33+
templates. jQuery was added as a global object via an include in the base
34+
template to an external source. There are no standards currently to JavaScript
35+
libraries, this aims to solve that.
36+
37+
The requirements for modernizing our front end code are:
38+
39+
* Code should be modular and testable. One-off chunks of JavaScript in templates
40+
or in large monolithic files are not easily testable. We currently have no
41+
JavaScript tests.
42+
* Reduce code duplication.
43+
* Easy JavaScript dependency management.
44+
45+
Modularizing code with `Browserify`_ is a good first step. In this development
46+
workflow, major dependencies commonly used across JavaScript includes are
47+
installed with `Bower`_ for testing, and vendorized as standalone libraries via
48+
`Gulp`_ and `Browserify`_. This way, we can easily test our JavaScript libraries
49+
against jQuery/etc, and have the flexibility of modularizing our code. See
50+
`JavaScript Bundles`_ for more information on what and how we are bundling.
51+
52+
To ease deployment and contributions, bundled JavaScript is checked into the
53+
repository for now. This ensures new contributors don't need an additional front
54+
end stack just for making changes to our Python code base. In the future, this
55+
may change, so that assets are compiled before deployment, however as our front
56+
end assets are in a state of flux, it's easier to keep absolute sources checked
57+
in.
58+
59+
Getting Started
60+
---------------
61+
62+
You will need a working version of Node and NPM to get started. We won't cover
63+
that here, as it varies from platform to platform.
64+
65+
To install these tools and dependencies::
66+
67+
npm install
68+
69+
This will install locally to the project, not globally. You can install globally
70+
if you wish, otherwise make sure ``node_modules/.bin`` is in your PATH.
71+
72+
Next, install front end dependencies::
73+
74+
bower install
75+
76+
The sources for our bundles are found in the per-application path
77+
``static-src``, which has the same directory structure as ``static``. Files in
78+
``static-src`` are compiled to ``static`` for static file collection in Django.
79+
Don't edit files in ``static`` directly, unless you are sure there isn't a
80+
source file that will compile over your changes.
81+
82+
To test changes while developing, which will watch source files for changes and
83+
compile as necessary, you can run `Gulp`_ with our development target::
84+
85+
gulp dev
86+
87+
Once you are satisfied with your changes, finalize the bundles (this will
88+
minify library sources)::
89+
90+
gulp build
91+
92+
If you updated any of our vendor libraries, compile those::
93+
94+
gulp vendor
95+
96+
Make sure to check in both files under ``static`` and ``static-src``.
97+
98+
Making Changes
99+
--------------
100+
101+
If you are creating a new library, or a new library entry point, make sure to
102+
define the application source file in ``gulpfile.js``, this is not handled
103+
automatically right now.
104+
105+
If you are bringing in a new vendor library, make sure to define the bundles you
106+
are going to create in ``gulpfile.js`` as well.
107+
108+
Tests should be included per-application, in a path called ``tests``, under the
109+
``static-src/js`` path you are working in. Currently, we still need a test
110+
runner that accumulates these files.
111+
112+
Deployment
113+
----------
114+
115+
If merging several branches with JavaScript changes, it's important to do a
116+
final post-merge bundle. Follow the steps above to rebundle the libraries, and
117+
check in any changed libraries.
118+
119+
JavaScript Bundles
120+
------------------
121+
122+
There are several components to our bundling scheme:
123+
124+
Vendor library
125+
We repackage these using `Browserify`_, `Bower`_, and `Debowerify`_ to
126+
make these libraries available by a ``require`` statement. Vendor
127+
libraries are packaged separately from our JavaScript libraries, because
128+
we use the vendor libraries in multiple locations. Libraries bundled
129+
this way with `Browserify`_ are available to our libraries via
130+
``require`` and will back down to finding the object on the global
131+
``window`` scope.
132+
133+
Vendor libraries should only include libraries we are commonly reusing.
134+
This currently includes `jQuery` and `Knockout`. These modules will be
135+
excluded from libraries by special includes in our ``gulpfile.js``.
136+
137+
Minor third party libraries
138+
These libraries are maybe used in one or two locations. They are
139+
installed via `Bower`_ and included in the output library file. Because
140+
we aren't reusing them commonly, they don't require a separate bundle or
141+
separate include. Examples here would include jQuery plugins used on one
142+
off forms, such as jQuery Payments.
143+
144+
Our libraries
145+
These libraries are bundled up excluding vendor libraries ignored by
146+
rules in our ``gulpfile.js``. These files should be organized by
147+
function and can be split up into multiple files per application.
148+
149+
Entry points to libraries must be defined in ``gulpfile.js`` for now. We
150+
don't have a defined directory structure that would make it easy to
151+
imply the entry point to an application library.
152+
153+
.. _`Bower`: http://bower.io
154+
.. _`Gulp`: http://gulpjs.com
155+
.. _`Browserify`: http://browserify.org
156+
.. _`Debowerify`: https://github.com/eugeneware/debowerify
157+
.. _`LESS`: http://lesscss.org
158+
159+
.. _`jQuery`: http://jquery.com
160+
.. _`Knockout`: http://knockoutjs.com

docs/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ Information about development is also available:
7373
:caption: Developer Documentation
7474

7575
install
76+
changelog
7677
contribute
7778
tests
7879
architecture
80+
development
7981
symlinks
8082
settings
8183
i18n

docs/install.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,11 @@ This may take a while, so go grab a beverage. When it's done, build your
7373
database::
7474

7575
cd readthedocs
76-
./manage.py syncdb
77-
78-
This will prompt you to create a superuser account for Django. Do that. Then::
79-
8076
./manage.py migrate
8177

82-
Go ahead and load in a couple users and a test projects::
78+
This will prompt you to create a superuser account for Django. Do that.
79+
80+
Then go ahead and load in a couple users and a test projects::
8381

8482
./manage.py loaddata test_data
8583

0 commit comments

Comments
 (0)