Skip to content

Commit 802638f

Browse files
authored
Merge branch 'master' into master
2 parents fb502cc + b220fae commit 802638f

File tree

12 files changed

+268
-40
lines changed

12 files changed

+268
-40
lines changed

.github/labels.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
- name: "topic: CI/CD"
2+
color: "54f449"
3+
description: "This issue/PR relates to CI/CD pipeline change"
4+
- name: "topic: code style"
5+
color: "54f449"
6+
description: "This issue/PR relates to code style."
7+
from_name: "code quality"
8+
- name: "topic: tests"
9+
color: "54f449"
10+
description: "This issue/PR relates to tests, QA, CI."
11+
- name: "topic: deprecated"
12+
color: "999999"
13+
description: "Feature or component marked as deprecated and will be removed"
14+
- name: "topic: documentation"
15+
color: "54f449"
16+
description: "This issue/PR relates to or includes documentation."
17+
from_name: "Documentation"
18+
- name: "type: breaking-change"
19+
color: "310372"
20+
description: "Marks an important and likely breaking old interface change."
21+
- name: "type: feature"
22+
color: "310372"
23+
description: "New feature implementation"
24+
- name: "type: enhancement"
25+
color: "310372"
26+
description: "Enhancement update for old feature"
27+
from_name: "enhancement"
28+
- name: "type: good first issue"
29+
color: "310372"
30+
description: "Good for newcomers"
31+
from_name: "Good first contrib"
32+
- name: "type: bug"
33+
color: "b71914"
34+
description: "Something isn't working"
35+
from_name: "bug"
36+
- name: "log:added"
37+
color: "ff935e"
38+
description: "Changelog mark label. Marks new added features."
39+
- name: "log:breaking-change"
40+
color: "ff935e"
41+
description: "Changelog mark label. Marks breaking changes."
42+
- name: "log:changed"
43+
color: "ff935e"
44+
description: "Changelog mark label. Marks old, but changed features."
45+
- name: "log:deprecated"
46+
color: "ff935e"
47+
description: "Changelog mark label. Marks deprecated features, that will be removed in next major release."
48+
- name: "log:fixed"
49+
color: "ff935e"
50+
description: "Changelog mark label. Marks fixed bug issues."
51+
- name: "log:removed"
52+
color: "ff935e"
53+
description: "Changelog mark label. Marks removed features."
54+
- name: "log:skip-changelog"
55+
color: "ff935e"
56+
description: "Should be excluded from the changelog."
57+
- name: "os: linux"
58+
color: "fbca04"
59+
description: "This issue/PR related to linux systems"
60+
- name: "os: mac"
61+
color: "fbca04"
62+
description: "This issue/PR related to mac systems"
63+
- name: "os: windows"
64+
color: "fbca04"
65+
description: "This issue/PR related to windows systems"
66+
- name: "question"
67+
color: "d876e3"
68+
description: "User questions, not related to issues"
69+
from_name: "question"
70+
- name: "decision: duplicate"
71+
color: "eeeeee"
72+
description: "This issue or pull request already exists"
73+
from_name: "duplicate"
74+
- name: "decision: wontfix"
75+
color: "eeeeee"
76+
description: "This will not be worked on"
77+
from_name: "wontfix"
78+
- name: "decision: wontmerge"
79+
color: "eeeeee"
80+
description: "PR Only: This pull request will not be merged (problem described in comments)"
81+
- name: "stage: waiting-for-contributor"
82+
color: "efc1ae"
83+
from_name: "awaiting response"
84+
description: "Waiting for answer from original contributor."
85+
- name: "stage: WIP"
86+
color: "efc1ae"
87+
description: "Work In Progress"
88+
- name: "stage: help wanted"
89+
color: "efc1ae"
90+
description: "Extra attention is needed"
91+
from_name: "Help wanted"

.github/release-drafter.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
categories:
2+
- title: 'Breaking Changes'
3+
labels:
4+
- 'log:breaking-change'
5+
- title: 'Added'
6+
labels:
7+
- 'log:added'
8+
- title: 'Changed'
9+
labels:
10+
- 'log:changed'
11+
- title: 'Fixed'
12+
labels:
13+
- 'log:fixed'
14+
- title: 'Deprecated'
15+
labels:
16+
- 'log:deprecated'
17+
- title: 'Removed'
18+
labels:
19+
- 'log:removed'
20+
exclude-labels:
21+
- 'log:skip-changelog'
22+
sort-by: 'title'
23+
template: |
24+
## Changes
25+
26+
$CHANGES
27+
28+
## This release is made by wonderful contributors:
29+
30+
$CONTRIBUTORS

.github/workflows/labeler-check.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Labels verification
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
labeler:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: Run Labeler
13+
uses: crazy-max/ghaction-github-labeler@v2
14+
with:
15+
yaml_file: .github/labels.yml
16+
dry_run: true
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/labeler.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Labels verification
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
jobs:
8+
labeler:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
- name: Run Labeler
14+
uses: crazy-max/ghaction-github-labeler@v2
15+
with:
16+
yaml_file: .github/labels.yml
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/main.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- "*"
9+
pull_request:
10+
branches:
11+
- "*"
12+
13+
jobs:
14+
build:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
mongodb-version: [3.6, 4.0, 4.2]
20+
21+
include:
22+
- name: "linting"
23+
python: "3.8"
24+
os: ubuntu-latest
25+
tox_env: "lint"
26+
mongodb-version: 4.2
27+
28+
- name: "ubuntu-py36"
29+
python: "3.6"
30+
os: ubuntu-latest
31+
tox_env: "py36"
32+
- name: "ubuntu-py37"
33+
python: "3.7"
34+
os: ubuntu-latest
35+
tox_env: "py37"
36+
- name: "ubuntu-py38"
37+
python: "3.8"
38+
os: ubuntu-latest
39+
tox_env: "py38"
40+
- name: "ubuntu-pypy3"
41+
python: "pypy3"
42+
os: ubuntu-latest
43+
tox_env: "pypy3"
44+
45+
steps:
46+
- uses: actions/checkout@v2
47+
- name: Set up Python ${{ matrix.python }}
48+
uses: actions/setup-python@v1
49+
with:
50+
python-version: ${{ matrix.python }}
51+
- name: Install dependencies
52+
run: |
53+
python -m pip install --upgrade pip
54+
pip install tox virtualenv
55+
- name: Start MongoDB
56+
uses: supercharge/[email protected]
57+
with:
58+
mongodb-version: ${{ matrix.mongodb-version }}
59+
- name: Test build
60+
run: "tox -e ${{ matrix.tox_env }}"

.github/workflows/release-drafter.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
update_release_draft:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: release-drafter/release-drafter@v5
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.travis.yml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1-
# Use a container-based environment
2-
sudo: false
1+
dist: xenial
2+
os: linux
33

44
language: python
55

6-
python:
7-
- '3.6'
8-
- '3.7'
9-
- '3.8'
10-
- pypy3
11-
126
jobs:
137
include:
148
- language: python
159
python: 3.6
1610
name: "linting"
17-
script:
18-
- tox -e lint
19-
20-
env:
21-
- MONGOENGINE=latest_pip
22-
- MONGOENGINE=dev
11+
env: TOXENV=lint
12+
- language: python
13+
python: 3.6
14+
name: "Test on python 3.6"
15+
env: TOXENV=py36
16+
- language: python
17+
python: 3.7
18+
name: "Test on python 3.7"
19+
env: TOXENV=py37
20+
- language: python
21+
python: 3.8
22+
name: "Test on python 3.8"
23+
env: TOXENV=py38
24+
- language: python
25+
python: pypy3
26+
name: "Test on python pypy3"
27+
env: TOXENV=pypy3
2328

2429
services:
2530
- mongodb
@@ -31,11 +36,8 @@ install:
3136
- travis_retry pip install tox>=3.14
3237
- travis_retry pip install virtualenv
3338

34-
# Cache dependencies installed via pip
35-
cache: pip
36-
3739
script:
38-
- tox -e $(echo py$TRAVIS_PYTHON_VERSION-me_$MONGOENGINE | tr -d . | sed -e 's/pypypy/pypy/') -- --with-coverage
40+
- tox
3941

4042
after_success:
4143
- coveralls --verbose
@@ -60,11 +62,8 @@ deploy:
6062
distributions: "sdist bdist_wheel"
6163

6264
# only deploy on tagged commits (aka GitHub releases) and only for the
63-
# parent repo's builds running Python 2.7 along with dev MongoEngine (we run
64-
# Travis against many different Python and MongoEngine versions and we don't
65-
# want the deploy to occur multiple times).
65+
# parent repo's builds running Python 3.6
6666
on:
6767
tags: true
68-
condition: "$MONGOENGINE = dev"
69-
python: 3.5
68+
python: 3.6
7069
repo: MongoEngine/flask-mongoengine

flask_mongoengine/wtf/fields.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import sys
66
from gettext import gettext as _
77

8-
import six
98
from mongoengine.queryset import DoesNotExist
109
from wtforms import widgets
1110
from wtforms.fields import SelectFieldBase, StringField, TextAreaField
@@ -204,7 +203,4 @@ class BinaryField(TextAreaField):
204203

205204
def process_formdata(self, valuelist):
206205
if valuelist:
207-
if six.PY3:
208-
self.data = six.binary_type(valuelist[0], "utf-8")
209-
else:
210-
self.data = six.binary_type(valuelist[0])
206+
self.data = bytes(valuelist[0], "utf-8")

requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Flask>=0.8
2-
Flask-DebugToolbar>=0.8
3-
Flask-WTF>=0.8.3
4-
mongoengine>=0.8.0
5-
pymongo>=3.6.0
1+
Flask>=1.1.2
2+
Flask-DebugToolbar>=0.11.0
3+
WTForms[email]>=2.3.1
4+
Flask-WTF>=0.14.3
5+
mongoengine>=0.20
6+
pymongo>=3.10.1
67
flake8
7-
six

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,15 @@ def get_version(version_tuple):
4545
test_suite="nose.collector",
4646
zip_safe=False,
4747
platforms="any",
48-
install_requires=["Flask>=1.1", "Flask-WTF>=0.14", "mongoengine>=0.19", "six"],
48+
install_requires=[
49+
"Flask>=1.1.2",
50+
"WTForms[email]>=2.3.1",
51+
"Flask-WTF>=0.14.3",
52+
"mongoengine>=0.20",
53+
],
4954
packages=["flask_mongoengine", "flask_mongoengine.wtf"],
5055
include_package_data=True,
5156
tests_require=test_requirements,
52-
setup_requires=test_requirements, # Allow proper nose usage with setuptools and tox
5357
description=description,
5458
long_description=long_description,
5559
classifiers=[

tests/test_forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def test_modelradiofield(self):
371371
with self.app.test_request_context("/"):
372372
db = self.db
373373

374-
choices = (("male", "Male"), ("female", "Female"), ("other", "Other"))
374+
choices = [("male", "Male"), ("female", "Female"), ("other", "Other")]
375375

376376
class Poll(db.Document):
377377
answer = db.StringField(choices=choices)

tox.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
[tox]
2-
envlist = {py36,py37,py38,pypy3}-{me_latest_pip,me_dev},lint
2+
envlist = {py36,py37,py38,pypy3},lint
33

44
[testenv]
55
commands =
66
python -m pytest
77
deps =
8-
me_latest_pip: mongoengine>=0.19.0
9-
me_dev: https://github.com/MongoEngine/mongoengine/tarball/master
108
PyMongo>3.9.0
119
pytest
1210
pytest-cov

0 commit comments

Comments
 (0)