Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
env:
SQLALCHEMY_DATABASE_URI:
postgresql+psycopg2://pguser:[email protected]:15432/app
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
pip install -r requirements-extra.txt
- name: Run tests
run: |
nosetests --stop -v --with-coverage --cover-package=flask_appbuilder tests --ignore-files="test_mongoengine\.py"
nose2 -c setup.cfg -F -v --with-coverage --coverage flask_appbuilder -A '!mongo' tests
- name: Upload code coverage
run: |
bash <(curl -s https://codecov.io/bash) -cF python
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
pip install -r requirements-extra.txt
- name: Run tests
run: |
nosetests --stop -v --with-coverage --cover-package=flask_appbuilder tests --ignore-files="test_mongoengine\.py"
nose2 -c setup.cfg -F -v --with-coverage --coverage flask_appbuilder -A '!mongo' tests
- name: Upload code coverage
run: |
bash <(curl -s https://codecov.io/bash) -cF python
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
sudo cp .github/workflows/odbcinst.ini /etc/odbcinst.ini
- name: Run tests
run: |
nosetests --stop -v --with-coverage --cover-package=flask_appbuilder tests --ignore-files="test_mongoengine\.py"
nose2 -c setup.cfg -F -v --with-coverage --coverage flask_appbuilder -A '!mongo' tests
- name: Upload code coverage
run: |
bash <(curl -s https://codecov.io/bash) -cF python
Expand All @@ -193,7 +193,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.7]
python-version: [3.8]
services:
mongo:
image: mongo:4.4.1-bionic
Expand Down Expand Up @@ -228,7 +228,7 @@ jobs:
pip install -r requirements-mongodb.txt
- name: Run tests
run: |
nosetests --stop -v --with-coverage --cover-package=flask_appbuilder tests/test_mongoengine.py
nose2 -c setup.cfg -F -v --with-coverage --coverage flask_appbuilder -A 'mongo' tests
- name: Upload code coverage
run: |
bash <(curl -s https://codecov.io/bash) -cF python
8 changes: 4 additions & 4 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ can run a subset of tests targeting only Postgres.

.. code-block:: bash

$ nosetests -v
$ nose2 -c setup.cfg -A '!mongo' tests

You can also use tox

Expand All @@ -44,8 +44,8 @@ You can also use tox

.. code-block:: bash

$ black flask_appbuilder
$ flake8 flask_appbuilder
$ black flask_appbuilder tests
$ flake8 flask_appbuilder tests

Run a single test
-----------------
Expand All @@ -69,7 +69,7 @@ Using Postgres

.. code-block:: bash

$ nosetests -v tests.test_api:APITestCase.test_get_item_dotted_mo_notation
$ nose2 -v tests.test_api.APITestCase.test_get_item_dotted_mo_notation

.. note::

Expand Down
1 change: 0 additions & 1 deletion flask_appbuilder/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def as_unicode(s):
return s.decode("utf-8")
return str(s)


else:
text_type = unicode # noqa
string_types = (str, unicode) # noqa
Expand Down
28 changes: 14 additions & 14 deletions flask_appbuilder/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ def __repr__(self):

def action(name, text, confirmation=None, icon=None, multiple=True, single=True):
"""
Use this decorator to expose actions
Use this decorator to expose actions

:param name:
Action name
:param text:
Action text.
:param confirmation:
Confirmation text. If not provided, action will be executed
unconditionally.
:param icon:
Font Awesome icon name
:param multiple:
If true will display action on list view
:param single:
If true will display action on show view
:param name:
Action name
:param text:
Action text.
:param confirmation:
Confirmation text. If not provided, action will be executed
unconditionally.
:param icon:
Font Awesome icon name
:param multiple:
If true will display action on list view
:param single:
If true will display action on show view
"""

def wrap(f):
Expand Down
3 changes: 1 addition & 2 deletions flask_appbuilder/api/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class OpenApi(BaseApi):
@protect()
@safe
def get(self, version):
""" Endpoint that renders an OpenApi spec for all views that belong
"""Endpoint that renders an OpenApi spec for all views that belong
to a certain version
---
get:
Expand Down Expand Up @@ -80,7 +80,6 @@ def _create_api_spec(version):


class SwaggerView(BaseView):

route_base = "/swagger"
default_view = "ui"
openapi_uri = "/api/{}/_openapi"
Expand Down
1 change: 0 additions & 1 deletion flask_appbuilder/babel/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class BabelManager(BaseManager):

babel = None
locale_view = None

Expand Down
2 changes: 1 addition & 1 deletion flask_appbuilder/basemanager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class BaseManager(object):
"""
The parent class for all Managers
The parent class for all Managers
"""

def __init__(self, appbuilder):
Expand Down
2 changes: 0 additions & 2 deletions flask_appbuilder/baseviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def wrap(f):


class AbstractViewApi:

appbuilder: "AppBuilder"
base_permissions: Optional[List[str]]
class_permission_name: str
Expand Down Expand Up @@ -1069,7 +1068,6 @@ def _get_list_widget(
widgets=None,
**args,
):

"""get joined base filter and current active filter for query"""
widgets = widgets or {}
actions = actions or self.actions
Expand Down
20 changes: 10 additions & 10 deletions flask_appbuilder/charts/jsontools.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@

def dict_to_json(xcol, ycols, labels, value_columns): # pragma: no cover
"""
Converts a list of dicts from datamodel query results
to google chart json data.
Converts a list of dicts from datamodel query results
to google chart json data.

:param xcol:
The name of a string column to be used has X axis on chart
:param ycols:
A list with the names of series cols, that can be used as numeric
:param labels:
A dict with the columns labels.
:param value_columns:
A list of dicts with the values to convert
:param xcol:
The name of a string column to be used has X axis on chart
:param ycols:
A list with the names of series cols, that can be used as numeric
:param labels:
A dict with the columns labels.
:param value_columns:
A list of dicts with the values to convert
"""
json_data = dict()

Expand Down
Loading