Skip to content

Commit b30b573

Browse files
committed
Merge branch 'two-point-oh'
2 parents e4d9336 + 5235b8c commit b30b573

24 files changed

+725
-960
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ nose*.egg-info
33
nose*.egg
44
_build
55
.coverage
6-
dist
6+
dist/
77
*.pyc
88
.pytest_cache/
9+
_version.py
10+
version.txt
11+
.eggs/
12+
.tox/
13+
build/
914

1015
.idea

.travis.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
language: python
22
python:
3-
- 2.7
4-
- 3.4
5-
- 3.5
6-
- 3.6
3+
- 2.7
4+
- 3.4
5+
- 3.5
6+
- 3.6
77
env:
8+
- STYLE=1
89
# keep this list in sync with what's in tox.ini
910
- PYMONGO=pymongo30
1011
- PYMONGO=pymongo31
@@ -13,6 +14,18 @@ env:
1314
- PYMONGO=pymongo34
1415
- PYMONGO=pymongo35
1516
- PYMONGO=pymongo36
17+
- PYMONGO=pymongo37
18+
matrix:
19+
exclude:
20+
# style runs on 2.7 only so that it runs first
21+
- env: STYLE=1
22+
python: 3.4
23+
- env: STYLE=1
24+
python: 3.5
25+
- env: STYLE=1
26+
python: 3.6
1627
services: docker
1728
install: pip install tox tox-docker
18-
script: tox -e $(tox -l | grep "^$PYMONGO" | tr "\n" ",")
29+
script:
30+
- if test -n "$PYMONGO"; then tox -e $(tox -l | grep "^$PYMONGO" | tr "\n" ","); fi
31+
- if test -n "$STYLE" ; then tox -e style; fi

CONTRIBUTING.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# How to contribute to Flask-PyMongo
2+
3+
Thank you for considering contributing to Flask-PyMongo!
4+
5+
6+
## Support questions
7+
8+
For help and general questions, please consider using the [flask-pymongo
9+
tag](https://stackoverflow.com/questions/tagged/flask-pymongo) on
10+
[StackOverflow](https://stackoverflow.com/) instead of creating issues in
11+
the GitHub project. This will keep the issues in the project focused on
12+
actual bugs and improvement requests.
13+
14+
15+
## Reporting issues
16+
17+
- Describe what you expected to happen.
18+
- If possible, include a [minimal, complete, and verifiable
19+
example](https://stackoverflow.com/help/mcve) to help us identify the issue.
20+
This also helps check that the issue is not with your own code.
21+
- Describe what actually happened. Include the full traceback if there was an
22+
exception.
23+
- List your Flask-PyMongo, PyMongo, and MongoDB versions. If possible, check if
24+
this issue is already fixed in the repository.
25+
26+
27+
## Submitting patches
28+
29+
- All new features must include a test. Flask-PyMongo is tested against a
30+
matrix of all supported versions of Flask, PyMongo, and MongoDB, so tests
31+
ensure that your change works for all users.
32+
- There is also a `style` build. Please ensure your code conforms to
33+
Flask-PyMongo's style rules with `tox -e style`
34+
- Use [Sphinx](http://www.sphinx-doc.org/en/master/)-style docstrings
35+
36+
37+
## Recommended development environment
38+
39+
- MacOS or Linux
40+
- Python 2.7
41+
42+
Using 2.7 ensures that you don't accidentally break Python2.7 support.
43+
Flask-PyMongo will support Python 2.7 for as long as it is an officially
44+
supported version of Python (util some time in 2020).
45+
46+
- Run tests with [tox](https://tox.readthedocs.io/en/latest/), eg `tox -e
47+
pymongo30-mongo32-flask0_11`
48+
49+
Since the build matrix is very big, you may want to select a single
50+
or a few matrix versions to test. Run `tox -l` to see all the builds.
51+
52+
All tests, against all supported versions, are run by
53+
[Travis-CI](https://travis-ci.org/dcrosta/flask-pymongo) for each commit
54+
and pull request.
55+
56+
- Check style compliance with `tox -e style`
57+
58+
59+
## Building the docs
60+
61+
Build the docs in the `docs` directory using Sphinx:
62+
63+
cd docs
64+
make html
65+
66+
Open `_build/html/index.html` in your browser to view the docs.

MANIFEST.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
include *.py *.cfg README.md requirements.txt test-requirements.txt
1+
include *.md version.txt
22
recursive-include examples *.py *.html *.txt
33
recursive-include docs *.py *.rst *.html *.css_t *.conf Makefile LICENSE README
44
prune docs/_build
5+
prune dist
6+
prune build
57
global-exclude *.pyc

README.md

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,3 @@
1-
# Flask-PyMongo 2.0 Coming Soon
2-
3-
Keeping up with PyMongo and MongoDB developments has been a continual
4-
struggle for me as maintainer of Flask-PyMongo, as attested to by the long
5-
list of bugs filed. I have let down those who use this project, and I
6-
apologize for that.
7-
8-
In order to make the maintenance load acceptable, I have decided to release
9-
version 2.0 which will remove all of the "split out" configuration
10-
functionality. In 2.0, Flask-PyMongo will only read a MongoDB connection URI
11-
from Flask config. For cases where some configuration cannot be passed via
12-
URI, it will also accept keyword arguments, which will be passed directly to
13-
PyMongo.
14-
15-
I anticipate that this will require changes from many users of
16-
Flask-PyMongo, and I apologize for the disruption. I believe that this
17-
direction will enable me to keep up with compatibility requests, reduce the
18-
number of custom forked versions, and provide a more compact and stable
19-
platform for future development.
20-
21-
If you have not yet done so, please pin your version of Flask-PyMongo to the
22-
current version (e.g. `flask-pymongo<2.0` in a `requirements.txt` file).
23-
24-
Please use https://github.com/dcrosta/flask-pymongo/issues/110 if you have
25-
any questions or concerns with this decision.
26-
27-
281
# Flask-PyMongo
292

303
PyMongo support for Flask applications
@@ -36,6 +9,7 @@ from flask import Flask
369
from flask_pymongo import PyMongo
3710

3811
app = Flask(__name__)
12+
app.config["MONGO_URI"] = "mongodb://localhost:27017/myDatabase"
3913
mongo = PyMongo(app)
4014

4115
@app.route('/')
@@ -46,6 +20,6 @@ def home_page():
4620

4721
## More Info
4822

49-
* [Flask-PyMongo Documentation](http://flask-pymongo.readthedocs.org/)
50-
* [PyMongo Documentation](http://api.mongodb.org/python/current/)
23+
* [Flask-PyMongo Documentation](https://flask-pymongo.readthedocs.org/)
24+
* [PyMongo Documentation](https://api.mongodb.org/python/current/)
5125
* [Flask Documentation](http://flask.pocoo.org/docs/)

docs/_themes/flask_theme_support.py

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -10,77 +10,77 @@ class FlaskyStyle(Style):
1010

1111
styles = {
1212
# No corresponding class for the following:
13-
#Text: "", # class: ''
14-
Whitespace: "underline #f8f8f8", # class: 'w'
15-
Error: "#a40000 border:#ef2929", # class: 'err'
16-
Other: "#000000", # class 'x'
13+
#Text: "", # class: ""
14+
Whitespace: "underline #f8f8f8", # class: "w"
15+
Error: "#a40000 border:#ef2929", # class: "err"
16+
Other: "#000000", # class "x"
1717

18-
Comment: "italic #8f5902", # class: 'c'
19-
Comment.Preproc: "noitalic", # class: 'cp'
18+
Comment: "italic #8f5902", # class: "c"
19+
Comment.Preproc: "noitalic", # class: "cp"
2020

21-
Keyword: "bold #004461", # class: 'k'
22-
Keyword.Constant: "bold #004461", # class: 'kc'
23-
Keyword.Declaration: "bold #004461", # class: 'kd'
24-
Keyword.Namespace: "bold #004461", # class: 'kn'
25-
Keyword.Pseudo: "bold #004461", # class: 'kp'
26-
Keyword.Reserved: "bold #004461", # class: 'kr'
27-
Keyword.Type: "bold #004461", # class: 'kt'
21+
Keyword: "bold #004461", # class: "k"
22+
Keyword.Constant: "bold #004461", # class: "kc"
23+
Keyword.Declaration: "bold #004461", # class: "kd"
24+
Keyword.Namespace: "bold #004461", # class: "kn"
25+
Keyword.Pseudo: "bold #004461", # class: "kp"
26+
Keyword.Reserved: "bold #004461", # class: "kr"
27+
Keyword.Type: "bold #004461", # class: "kt"
2828

29-
Operator: "#582800", # class: 'o'
30-
Operator.Word: "bold #004461", # class: 'ow' - like keywords
29+
Operator: "#582800", # class: "o"
30+
Operator.Word: "bold #004461", # class: "ow" - like keywords
3131

32-
Punctuation: "bold #000000", # class: 'p'
32+
Punctuation: "bold #000000", # class: "p"
3333

3434
# because special names such as Name.Class, Name.Function, etc.
3535
# are not recognized as such later in the parsing, we choose them
3636
# to look the same as ordinary variables.
37-
Name: "#000000", # class: 'n'
38-
Name.Attribute: "#c4a000", # class: 'na' - to be revised
39-
Name.Builtin: "#004461", # class: 'nb'
40-
Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
41-
Name.Class: "#000000", # class: 'nc' - to be revised
42-
Name.Constant: "#000000", # class: 'no' - to be revised
43-
Name.Decorator: "#888", # class: 'nd' - to be revised
44-
Name.Entity: "#ce5c00", # class: 'ni'
45-
Name.Exception: "bold #cc0000", # class: 'ne'
46-
Name.Function: "#000000", # class: 'nf'
47-
Name.Property: "#000000", # class: 'py'
48-
Name.Label: "#f57900", # class: 'nl'
49-
Name.Namespace: "#000000", # class: 'nn' - to be revised
50-
Name.Other: "#000000", # class: 'nx'
51-
Name.Tag: "bold #004461", # class: 'nt' - like a keyword
52-
Name.Variable: "#000000", # class: 'nv' - to be revised
53-
Name.Variable.Class: "#000000", # class: 'vc' - to be revised
54-
Name.Variable.Global: "#000000", # class: 'vg' - to be revised
55-
Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
37+
Name: "#000000", # class: "n"
38+
Name.Attribute: "#c4a000", # class: "na" - to be revised
39+
Name.Builtin: "#004461", # class: "nb"
40+
Name.Builtin.Pseudo: "#3465a4", # class: "bp"
41+
Name.Class: "#000000", # class: "nc" - to be revised
42+
Name.Constant: "#000000", # class: "no" - to be revised
43+
Name.Decorator: "#888", # class: "nd" - to be revised
44+
Name.Entity: "#ce5c00", # class: "ni"
45+
Name.Exception: "bold #cc0000", # class: "ne"
46+
Name.Function: "#000000", # class: "nf"
47+
Name.Property: "#000000", # class: "py"
48+
Name.Label: "#f57900", # class: "nl"
49+
Name.Namespace: "#000000", # class: "nn" - to be revised
50+
Name.Other: "#000000", # class: "nx"
51+
Name.Tag: "bold #004461", # class: "nt" - like a keyword
52+
Name.Variable: "#000000", # class: "nv" - to be revised
53+
Name.Variable.Class: "#000000", # class: "vc" - to be revised
54+
Name.Variable.Global: "#000000", # class: "vg" - to be revised
55+
Name.Variable.Instance: "#000000", # class: "vi" - to be revised
5656

57-
Number: "#990000", # class: 'm'
57+
Number: "#990000", # class: "m"
5858

59-
Literal: "#000000", # class: 'l'
60-
Literal.Date: "#000000", # class: 'ld'
59+
Literal: "#000000", # class: "l"
60+
Literal.Date: "#000000", # class: "ld"
6161

62-
String: "#4e9a06", # class: 's'
63-
String.Backtick: "#4e9a06", # class: 'sb'
64-
String.Char: "#4e9a06", # class: 'sc'
65-
String.Doc: "italic #8f5902", # class: 'sd' - like a comment
66-
String.Double: "#4e9a06", # class: 's2'
67-
String.Escape: "#4e9a06", # class: 'se'
68-
String.Heredoc: "#4e9a06", # class: 'sh'
69-
String.Interpol: "#4e9a06", # class: 'si'
70-
String.Other: "#4e9a06", # class: 'sx'
71-
String.Regex: "#4e9a06", # class: 'sr'
72-
String.Single: "#4e9a06", # class: 's1'
73-
String.Symbol: "#4e9a06", # class: 'ss'
62+
String: "#4e9a06", # class: "s"
63+
String.Backtick: "#4e9a06", # class: "sb"
64+
String.Char: "#4e9a06", # class: "sc"
65+
String.Doc: "italic #8f5902", # class: "sd" - like a comment
66+
String.Double: "#4e9a06", # class: "s2"
67+
String.Escape: "#4e9a06", # class: "se"
68+
String.Heredoc: "#4e9a06", # class: "sh"
69+
String.Interpol: "#4e9a06", # class: "si"
70+
String.Other: "#4e9a06", # class: "sx"
71+
String.Regex: "#4e9a06", # class: "sr"
72+
String.Single: "#4e9a06", # class: "s1"
73+
String.Symbol: "#4e9a06", # class: "ss"
7474

75-
Generic: "#000000", # class: 'g'
76-
Generic.Deleted: "#a40000", # class: 'gd'
77-
Generic.Emph: "italic #000000", # class: 'ge'
78-
Generic.Error: "#ef2929", # class: 'gr'
79-
Generic.Heading: "bold #000080", # class: 'gh'
80-
Generic.Inserted: "#00A000", # class: 'gi'
81-
Generic.Output: "#888", # class: 'go'
82-
Generic.Prompt: "#745334", # class: 'gp'
83-
Generic.Strong: "bold #000000", # class: 'gs'
84-
Generic.Subheading: "bold #800080", # class: 'gu'
85-
Generic.Traceback: "bold #a40000", # class: 'gt'
75+
Generic: "#000000", # class: "g"
76+
Generic.Deleted: "#a40000", # class: "gd"
77+
Generic.Emph: "italic #000000", # class: "ge"
78+
Generic.Error: "#ef2929", # class: "gr"
79+
Generic.Heading: "bold #000080", # class: "gh"
80+
Generic.Inserted: "#00A000", # class: "gi"
81+
Generic.Output: "#888", # class: "go"
82+
Generic.Prompt: "#745334", # class: "gp"
83+
Generic.Strong: "bold #000000", # class: "gs"
84+
Generic.Subheading: "bold #800080", # class: "gu"
85+
Generic.Traceback: "bold #a40000", # class: "gt"
8686
}

0 commit comments

Comments
 (0)