Automatically generate a RESTful API service for your legacy database. No code required!

Overview

sandman2

Build Status Documentation Status Coverage Status

sandman2 documentation

[ ~ Dependencies scanned by PyUp.io ~ ]

sandman2 automagically generates a RESTful API service from your existing database, without requiring you to write a line of code. Simply point sandman2 to your database, add salt for seasoning, and voila!, a fully RESTful API service with hypermedia support starts running, ready to accept HTTP requests.

This is a big deal. It means every single database you interact with, from the SQLite database that houses your web browser's data up to your production PostgreSQL server can be endowed with a REST API and accessed programmatically, using any number of HTTP client libraries available in every language. sandman2 frees your data.

For developers:

Imagine you're working for AnonymousCorp and need to access Group Y's data, which is presented to you through some horrible API or GUI. Wouldn't it be nice if you could just interact with that database through a REST API?

More than that, imagine if you could interact with the database through a REST API and no one had to write any code. Not you. Not Group Y. No one. That means no boilerplate ORM code, no database connection logic. Nothing. sandman2 can be run as a command-line tool (sandman2ctl) that just takes your database information as parameters and connects to it, introspects the schema, generates a RESTful API, and starts the server.

What Happened to Sandman (1)?

sandman, the precursor to sandman2, is no longer being maintained. sandman had almost identical functionality but had an architecture that reflected the capabilities of the underlying ORM, SQLAlchemy. As of the 0.9 release, SQLAlchemy introduced the automap construct. This fundamentally changed the way that sandman could interact with the underlying database in a way that greatly simplified things. All that was needed was the actual effort to rewrite sandman from scratch...

sandman2 has since surpassed the functionality of the original sandman and the latter should be considered deprecated/obsolete.

Quickstart

Install sandman2 using pip: $ pip install sandman2. This provides the script sandman2ctl, which just takes the database URI string, described here. For example, to connect to a SQLite database in the same directory you're running the script, you would run:

$ sandman2ctl sqlite+pysqlite:///database_file_name

To connect to a PostgreSQL database, make sure you install a driver like psycopg2 using pip, then use the following connection string:

$ sandman2ctl postgresql+psycopg2://scott:tiger@localhost/mydatabase

Again, see the SQLAlchemy documentation for a more comprehensive discussion of connection strings.

Supported Databases

sandman2 supports all databases that the underlying ORM, SQLAlchemy, supports. Presently, that includes:

  • MySQL
  • PostgreSQL
  • Oracle
  • Microsoft SQL Server
  • SQLite
  • Sybase
  • Drizzle
  • Firebird

Third-party packages extend support to:

  • IBM DB2
  • Amazon Redshift
  • SQL Anywhere
  • MonetDB

Admin Interface

One of the best things about the original sandman was the Admin Interface. Not only does sandman2 include the Admin Interface, but it modernizes it as well. The layout has been greatly improved, especially when dealing with larger numbers of tables. All of the original functionality of the Admin Interface remains unchanged.

Here's a shot of the new look:

admin interface awesomesauce screenshot

Customizing

If sandman2ctl doesn't give you fine-grained enough control over your REST endpoints, or you'd like to restrict the set of tables made available via sandman2ctl, you can easily integrate sandman2 into your application. See the documentation for more info.

Running sandman2 under Docker

sandman2 has an official docker image at Docker Hub. Simply docker pull jeffknupp/sandman2 to get the latest version. It supports the most popular database engines, but not all that sandman2 currently natively supports. If you'd like to see support for your RDBMS, either add a pull request on this repo (if possible) or create a new issue with the details of your database's Python driver.

Example

Here's how one would run sandman2 to connect to a PostgreSQL database running on one's host machine (i.e. not a remote database, which is far simpler) under Docker (on a Mac, explained below):

  1. $ docker pull jeffknupp/sandman2
  2. $ docker run -d -e DB_TYPE=postgres -e DB_DRIVER=psycopg2 -e USERNAME=jknupp -e DB_HOST=host.docker.internal -e DATABASE=jknupp -e DB_PORT=5432 -p 9000:5000 sandman2
  3. $ curl localhost:9000/meta or open a browser to http://localhost:9000/admin/

Note, DB_HOST=host.docker.internal is only necessary for databases that reside on the host system (and the value only works on macOS). To connect to a database on a remote machine, simply replace that value with the machine's IP or hostname.

Parameters

Here are the parameters available to specify your connection information and their meaning:

  • $DB_TYPE - The type of RDBMS to connect to (e.g. postgres or mysql)
  • $DB_DRIVER - The name of the Python library to use as a driver (e.g. psycopg2 or pymysql)
  • $USERNAME - Database username
  • $PASSWORD - Database password
  • $DB_HOST - Database IP or hostname
  • $DB_PORT - Database port
  • $DATABASE - Name of database to connect to

Pass each value separately to the docker run command with -e <VARIABLE>=<VALUE>. Not all are required, but which ones are required differs based on your target RDBMS.

Comments
  • General Refactoring

    General Refactoring

    Dear Mr. Knupp,

    I was hoping to make this PR against a development branch in your repository but it seems that Github does not allow for this and forces one to push to an existing branch, so I went with the master branch again, I trust this is fine with you.

    I have tried to follow the Flask Extension/Pallets Project guidelines with this PR. The major changes are as follows :

    • Major refactorings are as follows :
      • Moving the functions within app.py into their "parent" modules e.g. register_service is now the register function in service.py, similarly there are register functions in model.py, views.py, exception.py and admin.py.
      • Splitting of the logic in flask_sandman.app:application into flask_sandman.api:sandman so that there is a central function any user of the library can invoke within their own create_app methods. I have also refactored this into a Sandman class akin to SQLAlchemy or Api from flask restful but it's rough and omitted from this PR.
      • Combining _register_user_models and _reflect_all into flask_sandman.api:sandman removing the need for the reflect_all flag. This was a touch more intricate then I initially realized.
      • Within flask_sandman.app:application there is a "router" variable this is assigned either the application or, if one is provided, a blueprint. I am developing an application against this feature and haven't had any trouble when using a blueprint so far. I haven't had the chance to port my experiences to uni test in Sandman just yet though.
    • Renaming of the package components to conform to the "standard" structure it seems Palette encourages :
      • Renaming the base package from Sandman2 to flask_sandman.
      • Renaming get_app to create_app; internally this is called application but it is exposed to the user as create_app e.g. from flask_sandman import create_app.

    I have also done some work on the documentation. This is still a bit rough though and I thought it best to make another PR's if this one is accepted.

    opened by Carelvd 7
  • 500 Inernal Server Error while inserting into a table via admin interface

    500 Inernal Server Error while inserting into a table via admin interface

    Hi,

    I'm using sandman2 with PostgreSQL. Every time inserting data into a table using admin interface I'm receiving this page:

    Internal Server Error
    
    The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
    

    However, table becomes updated and selects in psql shows new inserted data.

    invalid 
    opened by pavdmyt 6
  • [WIP] Swagger

    [WIP] Swagger

    Auto-document API using Swagger.

    Todo:

    • [ ] Serialize responses using Marshmallow
    • [ ] Add Swagger markup for query parameters
    • [ ] Add Swagger markup for pagination
    • [ ] Write unit tests
    opened by jmcarp 6
  • Not able to insert DateTime into sqlite

    Not able to insert DateTime into sqlite

    I run sandman2ctl sqlite+pysqlite:///storage.db with an sqlite database.

    The following error occurs if I try to insert '2019-02-17T21:48:07.539Z' into a column with the type datetime:

    [2019-02-17 22:48:27,888] ERROR in app: Exception on /t_purchase/ [POST]
    Traceback (most recent call last):
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\engine\base.py", line 1127, in _execute_context
        context = constructor(dialect, self, conn, *args)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\engine\default.py", line 669, in _init_compiled
        param.append(processors[key](compiled_params[key]))
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\dialects\sqlite\base.py", line 610, in process
        raise TypeError("SQLite DateTime type only accepts Python "
    TypeError: SQLite DateTime type only accepts Python datetime and date objects as input.
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\flask\app.py", line 2292, in wsgi_app
        response = self.full_dispatch_request()
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request
        rv = self.handle_user_exception(e)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\flask\app.py", line 1718, in handle_user_exception
        reraise(exc_type, exc_value, tb)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\flask\_compat.py", line 35, in reraise
        raise value
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request
        rv = self.dispatch_request()
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\flask\app.py", line 1799, in dispatch_request
        return self.view_functions[rule.endpoint](**req.view_args)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\flask\views.py", line 88, in view
        return self.dispatch_request(*args, **kwargs)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\flask\views.py", line 158, in dispatch_request
        return meth(*args, **kwargs)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sandman2\decorators.py", line 72, in decorated
        return func(instance, *args, **kwargs)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sandman2\service.py", line 152, in post
        db.session().commit()
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\orm\session.py", line 954, in commit
        self.transaction.commit()
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\orm\session.py", line 467, in commit
        self._prepare_impl()
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\orm\session.py", line 447, in _prepare_impl
        self.session.flush()
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\orm\session.py", line 2313, in flush
        self._flush(objects)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\orm\session.py", line 2440, in _flush
        transaction.rollback(_capture_exception=True)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\util\langhelpers.py", line 66, in __exit__
        compat.reraise(exc_type, exc_value, exc_tb)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\util\compat.py", line 249, in reraise
        raise value
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\orm\session.py", line 2404, in _flush
        flush_context.execute()
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\orm\unitofwork.py", line 395, in execute
        rec.execute(self)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\orm\unitofwork.py", line 560, in execute
        uow
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\orm\persistence.py", line 181, in save_obj
        mapper, table, insert)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\orm\persistence.py", line 872, in _emit_insert_statements
        execute(statement, params)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\engine\base.py", line 948, in execute
        return meth(self, multiparams, params)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\sql\elements.py", line 269, in _execute_on_connection
        return connection._execute_clauseelement(self, multiparams, params)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\engine\base.py", line 1060, in _execute_clauseelement
        compiled_sql, distilled_params
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\engine\base.py", line 1132, in _execute_context
        None, None)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\engine\base.py", line 1413, in _handle_dbapi_exception
        exc_info
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\util\compat.py", line 265, in raise_from_cause
        reraise(type(exception), exception, tb=exc_tb, cause=cause)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\util\compat.py", line 248, in reraise
        raise value.with_traceback(tb)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\engine\base.py", line 1127, in _execute_context
        context = constructor(dialect, self, conn, *args)
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\engine\default.py", line 669, in _init_compiled
        param.append(processors[key](compiled_params[key]))
      File "c:\users\lorenz\appdata\local\programs\python\python36\lib\site-packages\sqlalchemy\dialects\sqlite\base.py", line 610, in process
        raise TypeError("SQLite DateTime type only accepts Python "
    sqlalchemy.exc.StatementError: (builtins.TypeError) SQLite DateTime type only accepts Python datetime and date objects as input. [SQL: 'INSERT INTO t_purchase (date) VALUES (?)'] [parameters: [{'date': '2019-02-17T21:48:07.539Z'}]]
    127.0.0.1 - - [17/Feb/2019 22:48:27] "POST /t_purchase/ HTTP/1.1" 500 -
    
    opened by LorenzHenk 5
  • Including relational data?

    Including relational data?

    I was messing around with PostgREST before this and they have the concept of resource embedding to pull in related data. Is there anything similar here? It also seems like https://github.com/pyeve/eve-sqlalchemy supports this.

    With sandman(1), it seems like the docs suggest that there should be links - altho there is a field named links, it's not clear how that relates to items: image

    With sandman2, I don't even see a link: image

    Schema constructed with a simple many-to-many relationship:

    users_items_assoc = Table('users_items_assoc', Base.metadata,
                              Column('users_items_assoc_id', Integer, primary_key=True),
                              Column('user_id', Integer, ForeignKey('users.id')),
                              Column('item_id', Integer, ForeignKey('items.id'))
                              )
    
    class User(Base):
        __tablename__ = 'users'
        id = Column(Integer, primary_key=True)
        name = Column(String)
        nickname = Column(String)
    
        items = relationship('Item', back_populates='users', secondary=users_items_assoc)
    
        def __repr__(self):
            return f'{self.name}'
    
    
    class Item(Base):
        __tablename__ = 'items'
        id = Column(Integer, primary_key=True)
        name = Column(String)
        description = Column(String)
    
        users = relationship('User', back_populates='items', secondary=users_items_assoc)
        # TODO: add image, upc, and so on
    
        def __repr__(self):
            return f'{self.name}'
    
    opened by jcrben 5
  • Switched to a __main__.py file

    Switched to a __main__.py file

    Moved the script under sandman2.script.sandmanctl to a __main__.py file in the package root making the package directly executable via Python while maintaining the entry point. One may then invoke sandman2 through two means :

    sandman2ctl ...
    

    or :

    python -m sandman2 ...
    
    opened by Carelvd 4
  • Enable encoding for the read function.

    Enable encoding for the read function.

    The encoding is needed or installation will fail for Python3. I tested this change locally and it works with the encoding.

    Traceback (most recent call last): File "setup.py", line 19, in LONG_DESCRIPTION = read('README.rst') File "setup.py", line 17, in read return codecs.open(os.path.join(HERE, *parts), 'r').read() File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 563: ordinal not in range(128)

    opened by Expire0 4
  • Scheduled weekly dependency update for week 17

    Scheduled weekly dependency update for week 17

    Update Flask-SQLAlchemy from 2.3.2 to 2.4.0.

    Changelog

    2.3.3

    -------------
    
    Fix &quot;AttributeError: &#39;NoneType&#39; object has no attribute &#39;info&#39;&quot;, when using polymorphic models. (`651`_)
    
    .. _651: https://github.com/mitsuhiko/flask-sqlalchemy/pull/651
    
    Links
    • PyPI: https://pypi.org/project/flask-sqlalchemy
    • Changelog: https://pyup.io/changelogs/flask-sqlalchemy/
    • Repo: https://github.com/pallets/flask-sqlalchemy
    • Docs: https://pythonhosted.org/Flask-SQLAlchemy/

    Update SQLAlchemy from 1.3.1 to 1.3.3.

    Changelog

    1.3.3

    :released: April 15, 2019
    
     .. change::
         :tags: bug, postgresql
         :tickets: 4601
    
         Fixed regression from release 1.3.2 caused by :ticket:`4562` where a URL
         that contained only a query string and no hostname, such as for the
         purposes of specifying a service file with connection information, would no
         longer be propagated to psycopg2 properly.   The change in :ticket:`4562`
         has been adjusted to further suit psycopg2&#39;s exact requirements, which is
         that if there are any connection parameters whatsoever, the &quot;dsn&quot; parameter
         is no longer required, so in this case the query string parameters are
         passed alone.
    
     .. change::
        :tags: bug, pool
        :tickets: 4585
    
        Fixed behavioral regression as a result of deprecating the &quot;use_threadlocal&quot;
        flag for :class:`.Pool`, where the :class:`.SingletonThreadPool` no longer
        makes use of this option which causes the &quot;rollback on return&quot; logic to take
        place when the same :class:`.Engine` is used multiple times in the context
        of a transaction to connect or implicitly execute, thereby cancelling the
        transaction.   While this is not the recommended way to work with engines
        and connections, it is nonetheless a confusing behavioral change as when
        using :class:`.SingletonThreadPool`, the transaction should stay open
        regardless of what else is done with the same engine in the same thread.
        The ``use_threadlocal`` flag remains deprecated however the
        :class:`.SingletonThreadPool` now implements its own version of the same
        logic.
    
    
     .. change::
        :tags: bug, orm
        :tickets: 4584
    
        Fixed 1.3 regression in new &quot;ambiguous FROMs&quot; query logic introduced in
        :ref:`change_4365` where a :class:`.Query` that explicitly places an entity
        in the FROM clause with :meth:`.Query.select_from` and also joins to it
        using :meth:`.Query.join` would later cause an &quot;ambiguous FROM&quot; error if
        that entity were used in additional joins, as the entity appears twice in
        the &quot;from&quot; list of the :class:`.Query`.  The fix resolves this ambiguity by
        folding the standalone entity into the join that it&#39;s already a part of in
        the same way that ultimately happens when the SELECT statement is rendered.
    
     .. change::
         :tags: bug, ext
         :tickets: 4603
    
         Fixed bug where using ``copy.copy()`` or ``copy.deepcopy()`` on
         :class:`.MutableList` would cause the items within the list to be
         duplicated, due to an inconsistency in how Python pickle and copy both make
         use of ``__getstate__()`` and ``__setstate__()`` regarding lists.  In order
         to resolve, a ``__reduce_ex__`` method had to be added to
         :class:`.MutableList`.  In order to maintain backwards compatibility with
         existing pickles based on ``__getstate__()``, the ``__setstate__()`` method
         remains as well; the test suite asserts that pickles made against the old
         version of the class can still be deserialized by the pickle module.
    
     .. change::
        :tags: bug, orm
        :tickets: 4606
    
        Adjusted the :meth:`.Query.filter_by` method to not call :func:`.and()`
        internally against multiple criteria, instead passing it off to
        :meth:`.Query.filter` as a series of criteria, instead of a single criteria.
        This allows :meth:`.Query.filter_by` to defer to :meth:`.Query.filter`&#39;s
        treatment of variable numbers of clauses, including the case where the list
        is empty.  In this case, the :class:`.Query` object will not have a
        ``.whereclause``, which allows subsequent &quot;no whereclause&quot; methods like
        :meth:`.Query.select_from` to behave consistently.
    
     .. change::
        :tags: bug, mssql
        :tickets: 4587
    
        Fixed issue in SQL Server dialect where if a bound parameter were present in
        an ORDER BY expression that would ultimately not be rendered in the SQL
        Server version of the statement, the parameters would still be part of the
        execution parameters, leading to DBAPI-level errors.  Pull request courtesy
        Matt Lewellyn.
    
    .. changelog::
    

    1.3.2

    :released: April 2, 2019
    
     .. change::
        :tags: bug, documentation, sql
        :tickets: 4580
    
        Thanks to :ref:`change_3981`, we no longer need to rely on recipes that
        subclass dialect-specific types directly, :class:`.TypeDecorator` can now
        handle all cases.   Additionally, the above change made it slightly less
        likely that a direct subclass of a base SQLAlchemy type would work as
        expected, which could be misleading.  Documentation has been updated to use
        :class:`.TypeDecorator` for these examples including the PostgreSQL
        &quot;ArrayOfEnum&quot; example datatype and direct support for the &quot;subclass a type
        directly&quot; has been removed.
    
     .. change::
        :tags: bug, postgresql
        :tickets: 4550
    
        Modified the :paramref:`.Select.with_for_update.of` parameter so that if a
        join or other composed selectable is passed, the individual :class:`.Table`
        objects will be filtered from it, allowing one to pass a join() object to
        the parameter, as occurs normally when using joined table inheritance with
        the ORM.  Pull request courtesy Raymond Lu.
    
    
     .. change::
         :tags: feature, postgresql
         :tickets: 4562
    
         Added support for parameter-less connection URLs for the psycopg2 dialect,
         meaning, the URL can be passed to :func:`.create_engine` as
         ``&quot;postgresql+psycopg2://&quot;`` with no additional arguments to indicate an
         empty DSN passed to libpq, which indicates to connect to &quot;localhost&quot; with
         no username, password, or database given. Pull request courtesy Julian
         Mehnle.
    
     .. change::
        :tags: bug, orm, ext
        :tickets: 4574, 4573
    
        Restored instance-level support for plain Python descriptors, e.g.
        ``property`` objects, in conjunction with association proxies, in that if
        the proxied object is not within ORM scope at all, it gets classified as
        &quot;ambiguous&quot; but is proxed directly.  For class level access, a basic class
        level``__get__()`` now returns the
        :class:`.AmbiguousAssociationProxyInstance` directly, rather than raising
        its exception, which is the closest approximation to the previous behavior
        that returned the :class:`.AssociationProxy` itself that&#39;s possible.  Also
        improved the stringification of these objects to be more descriptive of
        current state.
    
     .. change::
        :tags: bug, orm
        :tickets: 4537
    
        Fixed bug where use of :func:`.with_polymorphic` or other aliased construct
        would not properly adapt when the aliased target were used as the
        :meth:`.Select.correlate_except` target of a subquery used inside of a
        :func:`.column_property`. This required a fix to the clause adaption
        mechanics to properly handle a selectable that shows up in the &quot;correlate
        except&quot; list, in a similar manner as which occurs for selectables that show
        up in the &quot;correlate&quot; list.  This is ultimately a fairly fundamental bug
        that has lasted for a long time but it is hard to come across it.
    
    
     .. change::
        :tags: bug, orm
        :tickets: 4566
    
        Fixed regression where a new error message that was supposed to raise when
        attempting to link a relationship option to an AliasedClass without using
        :meth:`.PropComparator.of_type` would instead raise an ``AttributeError``.
        Note that in 1.3, it is no longer valid to create an option path from a
        plain mapper relationship to an :class:`.AliasedClass` without using
        :meth:`.PropComparator.of_type`.
    
    .. changelog::
    
    Links
    • PyPI: https://pypi.org/project/sqlalchemy
    • Changelog: https://pyup.io/changelogs/sqlalchemy/
    • Homepage: http://www.sqlalchemy.org

    Update pytest from 4.3.0 to 4.4.1.

    Changelog

    4.4.1

    =========================
    
    Bug Fixes
    ---------
    
    - `5031 &lt;https://github.com/pytest-dev/pytest/issues/5031&gt;`_: Environment variables are properly restored when using pytester&#39;s ``testdir`` fixture.
    
    
    - `5039 &lt;https://github.com/pytest-dev/pytest/issues/5039&gt;`_: Fix regression with ``--pdbcls``, which stopped working with local modules in 4.0.0.
    
    
    - `5092 &lt;https://github.com/pytest-dev/pytest/issues/5092&gt;`_: Produce a warning when unknown keywords are passed to ``pytest.param(...)``.
    
    
    - `5098 &lt;https://github.com/pytest-dev/pytest/issues/5098&gt;`_: Invalidate import caches with ``monkeypatch.syspath_prepend``, which is required with namespace packages being used.
    

    4.4.0

    =========================
    
    Features
    --------
    
    - `2224 &lt;https://github.com/pytest-dev/pytest/issues/2224&gt;`_: ``async`` test functions are skipped and a warning is emitted when a suitable
    async plugin is not installed (such as ``pytest-asyncio`` or ``pytest-trio``).
    
    Previously ``async`` functions would not execute at all but still be marked as &quot;passed&quot;.
    
    
    - `2482 &lt;https://github.com/pytest-dev/pytest/issues/2482&gt;`_: Include new ``disable_test_id_escaping_and_forfeit_all_rights_to_community_support`` option to disable ascii-escaping in parametrized values. This may cause a series of problems and as the name makes clear, use at your own risk.
    
    
    - `4718 &lt;https://github.com/pytest-dev/pytest/issues/4718&gt;`_: The ``-p`` option can now be used to early-load plugins also by entry-point name, instead of just
    by module name.
    
    This makes it possible to early load external plugins like ``pytest-cov`` in the command-line::
    
       pytest -p pytest_cov
    
    
    - `4855 &lt;https://github.com/pytest-dev/pytest/issues/4855&gt;`_: The ``--pdbcls`` option handles classes via module attributes now (e.g.
    ``pdb:pdb.Pdb`` with `pdb++`_), and its validation was improved.
    
    .. _pdb++: https://pypi.org/project/pdbpp/
    
    
    - `4875 &lt;https://github.com/pytest-dev/pytest/issues/4875&gt;`_: The `testpaths &lt;https://docs.pytest.org/en/latest/reference.htmlconfval-testpaths&gt;`__ configuration option is now displayed next
    to the ``rootdir`` and ``inifile`` lines in the pytest header if the option is in effect, i.e., directories or file names were
    not explicitly passed in the command line.
    
    Also, ``inifile`` is only displayed if there&#39;s a configuration file, instead of an empty ``inifile:`` string.
    
    
    - `4911 &lt;https://github.com/pytest-dev/pytest/issues/4911&gt;`_: Doctests can be skipped now dynamically using ``pytest.skip()``.
    
    
    - `4920 &lt;https://github.com/pytest-dev/pytest/issues/4920&gt;`_: Internal refactorings have been made in order to make the implementation of the
    `pytest-subtests &lt;https://github.com/pytest-dev/pytest-subtests&gt;`__ plugin
    possible, which adds unittest sub-test support and a new ``subtests`` fixture as discussed in
    `1367 &lt;https://github.com/pytest-dev/pytest/issues/1367&gt;`__.
    
    For details on the internal refactorings, please see the details on the related PR.
    
    
    - `4931 &lt;https://github.com/pytest-dev/pytest/issues/4931&gt;`_: pytester&#39;s ``LineMatcher`` asserts that the passed lines are a sequence.
    
    
    - `4936 &lt;https://github.com/pytest-dev/pytest/issues/4936&gt;`_: Handle ``-p plug`` after ``-p no:plug``.
    
    This can be used to override a blocked plugin (e.g. in &quot;addopts&quot;) from the
    command line etc.
    
    
    - `4951 &lt;https://github.com/pytest-dev/pytest/issues/4951&gt;`_: Output capturing is handled correctly when only capturing via fixtures (capsys, capfs) with ``pdb.set_trace()``.
    
    
    - `4956 &lt;https://github.com/pytest-dev/pytest/issues/4956&gt;`_: ``pytester`` sets ``$HOME`` and ``$USERPROFILE`` to the temporary directory during test runs.
    
    This ensures to not load configuration files from the real user&#39;s home directory.
    
    
    - `4980 &lt;https://github.com/pytest-dev/pytest/issues/4980&gt;`_: Namespace packages are handled better with ``monkeypatch.syspath_prepend`` and ``testdir.syspathinsert`` (via ``pkg_resources.fixup_namespace_packages``).
    
    
    - `4993 &lt;https://github.com/pytest-dev/pytest/issues/4993&gt;`_: The stepwise plugin reports status information now.
    
    
    - `5008 &lt;https://github.com/pytest-dev/pytest/issues/5008&gt;`_: If a ``setup.cfg`` file contains ``[tool:pytest]`` and also the no longer supported ``[pytest]`` section, pytest will use ``[tool:pytest]`` ignoring ``[pytest]``. Previously it would unconditionally error out.
    
    This makes it simpler for plugins to support old pytest versions.
    
    
    
    Bug Fixes
    ---------
    
    - `1895 &lt;https://github.com/pytest-dev/pytest/issues/1895&gt;`_: Fix bug where fixtures requested dynamically via ``request.getfixturevalue()`` might be teardown
    before the requesting fixture.
    
    
    - `4851 &lt;https://github.com/pytest-dev/pytest/issues/4851&gt;`_: pytester unsets ``PYTEST_ADDOPTS`` now to not use outer options with ``testdir.runpytest()``.
    
    
    - `4903 &lt;https://github.com/pytest-dev/pytest/issues/4903&gt;`_: Use the correct modified time for years after 2038 in rewritten ``.pyc`` files.
    
    
    - `4928 &lt;https://github.com/pytest-dev/pytest/issues/4928&gt;`_: Fix line offsets with ``ScopeMismatch`` errors.
    
    
    - `4957 &lt;https://github.com/pytest-dev/pytest/issues/4957&gt;`_: ``-p no:plugin`` is handled correctly for default (internal) plugins now, e.g. with ``-p no:capture``.
    
    Previously they were loaded (imported) always, making e.g. the ``capfd`` fixture available.
    
    
    - `4968 &lt;https://github.com/pytest-dev/pytest/issues/4968&gt;`_: The pdb ``quit`` command is handled properly when used after the ``debug`` command with `pdb++`_.
    
    .. _pdb++: https://pypi.org/project/pdbpp/
    
    
    - `4975 &lt;https://github.com/pytest-dev/pytest/issues/4975&gt;`_: Fix the interpretation of ``-qq`` option where it was being considered as ``-v`` instead.
    
    
    - `4978 &lt;https://github.com/pytest-dev/pytest/issues/4978&gt;`_: ``outcomes.Exit`` is not swallowed in ``assertrepr_compare`` anymore.
    
    
    - `4988 &lt;https://github.com/pytest-dev/pytest/issues/4988&gt;`_: Close logging&#39;s file handler explicitly when the session finishes.
    
    
    - `5003 &lt;https://github.com/pytest-dev/pytest/issues/5003&gt;`_: Fix line offset with mark collection error (off by one).
    
    
    
    Improved Documentation
    ----------------------
    
    - `4974 &lt;https://github.com/pytest-dev/pytest/issues/4974&gt;`_: Update docs for ``pytest_cmdline_parse`` hook to note availability liminations
    
    
    
    Trivial/Internal Changes
    ------------------------
    
    - `4718 &lt;https://github.com/pytest-dev/pytest/issues/4718&gt;`_: ``pluggy&gt;=0.9`` is now required.
    
    
    - `4815 &lt;https://github.com/pytest-dev/pytest/issues/4815&gt;`_: ``funcsigs&gt;=1.0`` is now required for Python 2.7.
    
    
    - `4829 &lt;https://github.com/pytest-dev/pytest/issues/4829&gt;`_: Some left-over internal code related to ``yield`` tests has been removed.
    
    
    - `4890 &lt;https://github.com/pytest-dev/pytest/issues/4890&gt;`_: Remove internally unused ``anypython`` fixture from the pytester plugin.
    
    
    - `4912 &lt;https://github.com/pytest-dev/pytest/issues/4912&gt;`_: Remove deprecated Sphinx directive, ``add_description_unit()``,
    pin sphinx-removed-in to &gt;= 0.2.0 to support Sphinx 2.0.
    
    
    - `4913 &lt;https://github.com/pytest-dev/pytest/issues/4913&gt;`_: Fix pytest tests invocation with custom ``PYTHONPATH``.
    
    
    - `4965 &lt;https://github.com/pytest-dev/pytest/issues/4965&gt;`_: New ``pytest_report_to_serializable`` and ``pytest_report_from_serializable`` **experimental** hooks.
    
    These hooks will be used by ``pytest-xdist``, ``pytest-subtests``, and the replacement for
    resultlog to serialize and customize reports.
    
    They are experimental, meaning that their details might change or even be removed
    completely in future patch releases without warning.
    
    Feedback is welcome from plugin authors and users alike.
    
    
    - `4987 &lt;https://github.com/pytest-dev/pytest/issues/4987&gt;`_: ``Collector.repr_failure`` respects the ``--tb`` option, but only defaults to ``short`` now (with ``auto``).
    

    4.3.1

    =========================
    
    Bug Fixes
    ---------
    
    - `4810 &lt;https://github.com/pytest-dev/pytest/issues/4810&gt;`_: Logging messages inside ``pytest_runtest_logreport()`` are now properly captured and displayed.
    
    
    - `4861 &lt;https://github.com/pytest-dev/pytest/issues/4861&gt;`_: Improve validation of contents written to captured output so it behaves the same as when capture is disabled.
    
    
    - `4898 &lt;https://github.com/pytest-dev/pytest/issues/4898&gt;`_: Fix ``AttributeError: FixtureRequest has no &#39;confg&#39; attribute`` bug in ``testdir.copy_example``.
    
    
    
    Trivial/Internal Changes
    ------------------------
    
    - `4768 &lt;https://github.com/pytest-dev/pytest/issues/4768&gt;`_: Avoid pkg_resources import at the top-level.
    
    Links
    • PyPI: https://pypi.org/project/pytest
    • Changelog: https://pyup.io/changelogs/pytest/
    • Homepage: https://docs.pytest.org/en/latest/
    opened by pyup-bot 4
  • Scheduled weekly dependency update for week 16

    Scheduled weekly dependency update for week 16

    Update SQLAlchemy from 1.3.1 to 1.3.3.

    Changelog

    1.3.3

    :released: April 15, 2019
    
     .. change::
         :tags: bug, postgresql
         :tickets: 4601
    
         Fixed regression from release 1.3.2 caused by :ticket:`4562` where a URL
         that contained only a query string and no hostname, such as for the
         purposes of specifying a service file with connection information, would no
         longer be propagated to psycopg2 properly.   The change in :ticket:`4562`
         has been adjusted to further suit psycopg2&#39;s exact requirements, which is
         that if there are any connection parameters whatsoever, the &quot;dsn&quot; parameter
         is no longer required, so in this case the query string parameters are
         passed alone.
    
     .. change::
        :tags: bug, pool
        :tickets: 4585
    
        Fixed behavioral regression as a result of deprecating the &quot;use_threadlocal&quot;
        flag for :class:`.Pool`, where the :class:`.SingletonThreadPool` no longer
        makes use of this option which causes the &quot;rollback on return&quot; logic to take
        place when the same :class:`.Engine` is used multiple times in the context
        of a transaction to connect or implicitly execute, thereby cancelling the
        transaction.   While this is not the recommended way to work with engines
        and connections, it is nonetheless a confusing behavioral change as when
        using :class:`.SingletonThreadPool`, the transaction should stay open
        regardless of what else is done with the same engine in the same thread.
        The ``use_threadlocal`` flag remains deprecated however the
        :class:`.SingletonThreadPool` now implements its own version of the same
        logic.
    
    
     .. change::
        :tags: bug, orm
        :tickets: 4584
    
        Fixed 1.3 regression in new &quot;ambiguous FROMs&quot; query logic introduced in
        :ref:`change_4365` where a :class:`.Query` that explicitly places an entity
        in the FROM clause with :meth:`.Query.select_from` and also joins to it
        using :meth:`.Query.join` would later cause an &quot;ambiguous FROM&quot; error if
        that entity were used in additional joins, as the entity appears twice in
        the &quot;from&quot; list of the :class:`.Query`.  The fix resolves this ambiguity by
        folding the standalone entity into the join that it&#39;s already a part of in
        the same way that ultimately happens when the SELECT statement is rendered.
    
     .. change::
         :tags: bug, ext
         :tickets: 4603
    
         Fixed bug where using ``copy.copy()`` or ``copy.deepcopy()`` on
         :class:`.MutableList` would cause the items within the list to be
         duplicated, due to an inconsistency in how Python pickle and copy both make
         use of ``__getstate__()`` and ``__setstate__()`` regarding lists.  In order
         to resolve, a ``__reduce_ex__`` method had to be added to
         :class:`.MutableList`.  In order to maintain backwards compatibility with
         existing pickles based on ``__getstate__()``, the ``__setstate__()`` method
         remains as well; the test suite asserts that pickles made against the old
         version of the class can still be deserialized by the pickle module.
    
     .. change::
        :tags: bug, orm
        :tickets: 4606
    
        Adjusted the :meth:`.Query.filter_by` method to not call :func:`.and()`
        internally against multiple criteria, instead passing it off to
        :meth:`.Query.filter` as a series of criteria, instead of a single criteria.
        This allows :meth:`.Query.filter_by` to defer to :meth:`.Query.filter`&#39;s
        treatment of variable numbers of clauses, including the case where the list
        is empty.  In this case, the :class:`.Query` object will not have a
        ``.whereclause``, which allows subsequent &quot;no whereclause&quot; methods like
        :meth:`.Query.select_from` to behave consistently.
    
     .. change::
        :tags: bug, mssql
        :tickets: 4587
    
        Fixed issue in SQL Server dialect where if a bound parameter were present in
        an ORDER BY expression that would ultimately not be rendered in the SQL
        Server version of the statement, the parameters would still be part of the
        execution parameters, leading to DBAPI-level errors.  Pull request courtesy
        Matt Lewellyn.
    
    .. changelog::
    

    1.3.2

    :released: April 2, 2019
    
     .. change::
        :tags: bug, documentation, sql
        :tickets: 4580
    
        Thanks to :ref:`change_3981`, we no longer need to rely on recipes that
        subclass dialect-specific types directly, :class:`.TypeDecorator` can now
        handle all cases.   Additionally, the above change made it slightly less
        likely that a direct subclass of a base SQLAlchemy type would work as
        expected, which could be misleading.  Documentation has been updated to use
        :class:`.TypeDecorator` for these examples including the PostgreSQL
        &quot;ArrayOfEnum&quot; example datatype and direct support for the &quot;subclass a type
        directly&quot; has been removed.
    
     .. change::
        :tags: bug, postgresql
        :tickets: 4550
    
        Modified the :paramref:`.Select.with_for_update.of` parameter so that if a
        join or other composed selectable is passed, the individual :class:`.Table`
        objects will be filtered from it, allowing one to pass a join() object to
        the parameter, as occurs normally when using joined table inheritance with
        the ORM.  Pull request courtesy Raymond Lu.
    
    
     .. change::
         :tags: feature, postgresql
         :tickets: 4562
    
         Added support for parameter-less connection URLs for the psycopg2 dialect,
         meaning, the URL can be passed to :func:`.create_engine` as
         ``&quot;postgresql+psycopg2://&quot;`` with no additional arguments to indicate an
         empty DSN passed to libpq, which indicates to connect to &quot;localhost&quot; with
         no username, password, or database given. Pull request courtesy Julian
         Mehnle.
    
     .. change::
        :tags: bug, orm, ext
        :tickets: 4574, 4573
    
        Restored instance-level support for plain Python descriptors, e.g.
        ``property`` objects, in conjunction with association proxies, in that if
        the proxied object is not within ORM scope at all, it gets classified as
        &quot;ambiguous&quot; but is proxed directly.  For class level access, a basic class
        level``__get__()`` now returns the
        :class:`.AmbiguousAssociationProxyInstance` directly, rather than raising
        its exception, which is the closest approximation to the previous behavior
        that returned the :class:`.AssociationProxy` itself that&#39;s possible.  Also
        improved the stringification of these objects to be more descriptive of
        current state.
    
     .. change::
        :tags: bug, orm
        :tickets: 4537
    
        Fixed bug where use of :func:`.with_polymorphic` or other aliased construct
        would not properly adapt when the aliased target were used as the
        :meth:`.Select.correlate_except` target of a subquery used inside of a
        :func:`.column_property`. This required a fix to the clause adaption
        mechanics to properly handle a selectable that shows up in the &quot;correlate
        except&quot; list, in a similar manner as which occurs for selectables that show
        up in the &quot;correlate&quot; list.  This is ultimately a fairly fundamental bug
        that has lasted for a long time but it is hard to come across it.
    
    
     .. change::
        :tags: bug, orm
        :tickets: 4566
    
        Fixed regression where a new error message that was supposed to raise when
        attempting to link a relationship option to an AliasedClass without using
        :meth:`.PropComparator.of_type` would instead raise an ``AttributeError``.
        Note that in 1.3, it is no longer valid to create an option path from a
        plain mapper relationship to an :class:`.AliasedClass` without using
        :meth:`.PropComparator.of_type`.
    
    .. changelog::
    
    Links
    • PyPI: https://pypi.org/project/sqlalchemy
    • Changelog: https://pyup.io/changelogs/sqlalchemy/
    • Homepage: http://www.sqlalchemy.org

    Update pytest from 4.3.0 to 4.4.1.

    Changelog

    4.4.1

    =========================
    
    Bug Fixes
    ---------
    
    - `5031 &lt;https://github.com/pytest-dev/pytest/issues/5031&gt;`_: Environment variables are properly restored when using pytester&#39;s ``testdir`` fixture.
    
    
    - `5039 &lt;https://github.com/pytest-dev/pytest/issues/5039&gt;`_: Fix regression with ``--pdbcls``, which stopped working with local modules in 4.0.0.
    
    
    - `5092 &lt;https://github.com/pytest-dev/pytest/issues/5092&gt;`_: Produce a warning when unknown keywords are passed to ``pytest.param(...)``.
    
    
    - `5098 &lt;https://github.com/pytest-dev/pytest/issues/5098&gt;`_: Invalidate import caches with ``monkeypatch.syspath_prepend``, which is required with namespace packages being used.
    

    4.4.0

    =========================
    
    Features
    --------
    
    - `2224 &lt;https://github.com/pytest-dev/pytest/issues/2224&gt;`_: ``async`` test functions are skipped and a warning is emitted when a suitable
    async plugin is not installed (such as ``pytest-asyncio`` or ``pytest-trio``).
    
    Previously ``async`` functions would not execute at all but still be marked as &quot;passed&quot;.
    
    
    - `2482 &lt;https://github.com/pytest-dev/pytest/issues/2482&gt;`_: Include new ``disable_test_id_escaping_and_forfeit_all_rights_to_community_support`` option to disable ascii-escaping in parametrized values. This may cause a series of problems and as the name makes clear, use at your own risk.
    
    
    - `4718 &lt;https://github.com/pytest-dev/pytest/issues/4718&gt;`_: The ``-p`` option can now be used to early-load plugins also by entry-point name, instead of just
    by module name.
    
    This makes it possible to early load external plugins like ``pytest-cov`` in the command-line::
    
       pytest -p pytest_cov
    
    
    - `4855 &lt;https://github.com/pytest-dev/pytest/issues/4855&gt;`_: The ``--pdbcls`` option handles classes via module attributes now (e.g.
    ``pdb:pdb.Pdb`` with `pdb++`_), and its validation was improved.
    
    .. _pdb++: https://pypi.org/project/pdbpp/
    
    
    - `4875 &lt;https://github.com/pytest-dev/pytest/issues/4875&gt;`_: The `testpaths &lt;https://docs.pytest.org/en/latest/reference.htmlconfval-testpaths&gt;`__ configuration option is now displayed next
    to the ``rootdir`` and ``inifile`` lines in the pytest header if the option is in effect, i.e., directories or file names were
    not explicitly passed in the command line.
    
    Also, ``inifile`` is only displayed if there&#39;s a configuration file, instead of an empty ``inifile:`` string.
    
    
    - `4911 &lt;https://github.com/pytest-dev/pytest/issues/4911&gt;`_: Doctests can be skipped now dynamically using ``pytest.skip()``.
    
    
    - `4920 &lt;https://github.com/pytest-dev/pytest/issues/4920&gt;`_: Internal refactorings have been made in order to make the implementation of the
    `pytest-subtests &lt;https://github.com/pytest-dev/pytest-subtests&gt;`__ plugin
    possible, which adds unittest sub-test support and a new ``subtests`` fixture as discussed in
    `1367 &lt;https://github.com/pytest-dev/pytest/issues/1367&gt;`__.
    
    For details on the internal refactorings, please see the details on the related PR.
    
    
    - `4931 &lt;https://github.com/pytest-dev/pytest/issues/4931&gt;`_: pytester&#39;s ``LineMatcher`` asserts that the passed lines are a sequence.
    
    
    - `4936 &lt;https://github.com/pytest-dev/pytest/issues/4936&gt;`_: Handle ``-p plug`` after ``-p no:plug``.
    
    This can be used to override a blocked plugin (e.g. in &quot;addopts&quot;) from the
    command line etc.
    
    
    - `4951 &lt;https://github.com/pytest-dev/pytest/issues/4951&gt;`_: Output capturing is handled correctly when only capturing via fixtures (capsys, capfs) with ``pdb.set_trace()``.
    
    
    - `4956 &lt;https://github.com/pytest-dev/pytest/issues/4956&gt;`_: ``pytester`` sets ``$HOME`` and ``$USERPROFILE`` to the temporary directory during test runs.
    
    This ensures to not load configuration files from the real user&#39;s home directory.
    
    
    - `4980 &lt;https://github.com/pytest-dev/pytest/issues/4980&gt;`_: Namespace packages are handled better with ``monkeypatch.syspath_prepend`` and ``testdir.syspathinsert`` (via ``pkg_resources.fixup_namespace_packages``).
    
    
    - `4993 &lt;https://github.com/pytest-dev/pytest/issues/4993&gt;`_: The stepwise plugin reports status information now.
    
    
    - `5008 &lt;https://github.com/pytest-dev/pytest/issues/5008&gt;`_: If a ``setup.cfg`` file contains ``[tool:pytest]`` and also the no longer supported ``[pytest]`` section, pytest will use ``[tool:pytest]`` ignoring ``[pytest]``. Previously it would unconditionally error out.
    
    This makes it simpler for plugins to support old pytest versions.
    
    
    
    Bug Fixes
    ---------
    
    - `1895 &lt;https://github.com/pytest-dev/pytest/issues/1895&gt;`_: Fix bug where fixtures requested dynamically via ``request.getfixturevalue()`` might be teardown
    before the requesting fixture.
    
    
    - `4851 &lt;https://github.com/pytest-dev/pytest/issues/4851&gt;`_: pytester unsets ``PYTEST_ADDOPTS`` now to not use outer options with ``testdir.runpytest()``.
    
    
    - `4903 &lt;https://github.com/pytest-dev/pytest/issues/4903&gt;`_: Use the correct modified time for years after 2038 in rewritten ``.pyc`` files.
    
    
    - `4928 &lt;https://github.com/pytest-dev/pytest/issues/4928&gt;`_: Fix line offsets with ``ScopeMismatch`` errors.
    
    
    - `4957 &lt;https://github.com/pytest-dev/pytest/issues/4957&gt;`_: ``-p no:plugin`` is handled correctly for default (internal) plugins now, e.g. with ``-p no:capture``.
    
    Previously they were loaded (imported) always, making e.g. the ``capfd`` fixture available.
    
    
    - `4968 &lt;https://github.com/pytest-dev/pytest/issues/4968&gt;`_: The pdb ``quit`` command is handled properly when used after the ``debug`` command with `pdb++`_.
    
    .. _pdb++: https://pypi.org/project/pdbpp/
    
    
    - `4975 &lt;https://github.com/pytest-dev/pytest/issues/4975&gt;`_: Fix the interpretation of ``-qq`` option where it was being considered as ``-v`` instead.
    
    
    - `4978 &lt;https://github.com/pytest-dev/pytest/issues/4978&gt;`_: ``outcomes.Exit`` is not swallowed in ``assertrepr_compare`` anymore.
    
    
    - `4988 &lt;https://github.com/pytest-dev/pytest/issues/4988&gt;`_: Close logging&#39;s file handler explicitly when the session finishes.
    
    
    - `5003 &lt;https://github.com/pytest-dev/pytest/issues/5003&gt;`_: Fix line offset with mark collection error (off by one).
    
    
    
    Improved Documentation
    ----------------------
    
    - `4974 &lt;https://github.com/pytest-dev/pytest/issues/4974&gt;`_: Update docs for ``pytest_cmdline_parse`` hook to note availability liminations
    
    
    
    Trivial/Internal Changes
    ------------------------
    
    - `4718 &lt;https://github.com/pytest-dev/pytest/issues/4718&gt;`_: ``pluggy&gt;=0.9`` is now required.
    
    
    - `4815 &lt;https://github.com/pytest-dev/pytest/issues/4815&gt;`_: ``funcsigs&gt;=1.0`` is now required for Python 2.7.
    
    
    - `4829 &lt;https://github.com/pytest-dev/pytest/issues/4829&gt;`_: Some left-over internal code related to ``yield`` tests has been removed.
    
    
    - `4890 &lt;https://github.com/pytest-dev/pytest/issues/4890&gt;`_: Remove internally unused ``anypython`` fixture from the pytester plugin.
    
    
    - `4912 &lt;https://github.com/pytest-dev/pytest/issues/4912&gt;`_: Remove deprecated Sphinx directive, ``add_description_unit()``,
    pin sphinx-removed-in to &gt;= 0.2.0 to support Sphinx 2.0.
    
    
    - `4913 &lt;https://github.com/pytest-dev/pytest/issues/4913&gt;`_: Fix pytest tests invocation with custom ``PYTHONPATH``.
    
    
    - `4965 &lt;https://github.com/pytest-dev/pytest/issues/4965&gt;`_: New ``pytest_report_to_serializable`` and ``pytest_report_from_serializable`` **experimental** hooks.
    
    These hooks will be used by ``pytest-xdist``, ``pytest-subtests``, and the replacement for
    resultlog to serialize and customize reports.
    
    They are experimental, meaning that their details might change or even be removed
    completely in future patch releases without warning.
    
    Feedback is welcome from plugin authors and users alike.
    
    
    - `4987 &lt;https://github.com/pytest-dev/pytest/issues/4987&gt;`_: ``Collector.repr_failure`` respects the ``--tb`` option, but only defaults to ``short`` now (with ``auto``).
    

    4.3.1

    =========================
    
    Bug Fixes
    ---------
    
    - `4810 &lt;https://github.com/pytest-dev/pytest/issues/4810&gt;`_: Logging messages inside ``pytest_runtest_logreport()`` are now properly captured and displayed.
    
    
    - `4861 &lt;https://github.com/pytest-dev/pytest/issues/4861&gt;`_: Improve validation of contents written to captured output so it behaves the same as when capture is disabled.
    
    
    - `4898 &lt;https://github.com/pytest-dev/pytest/issues/4898&gt;`_: Fix ``AttributeError: FixtureRequest has no &#39;confg&#39; attribute`` bug in ``testdir.copy_example``.
    
    
    
    Trivial/Internal Changes
    ------------------------
    
    - `4768 &lt;https://github.com/pytest-dev/pytest/issues/4768&gt;`_: Avoid pkg_resources import at the top-level.
    
    Links
    • PyPI: https://pypi.org/project/pytest
    • Changelog: https://pyup.io/changelogs/pytest/
    • Homepage: https://docs.pytest.org/en/latest/
    opened by pyup-bot 4
  • Scheduled weekly dependency update for week 13

    Scheduled weekly dependency update for week 13

    Update pytest from 4.3.0 to 4.4.0.

    Changelog

    4.4.0

    =========================
    
    Features
    --------
    
    - `2224 &lt;https://github.com/pytest-dev/pytest/issues/2224&gt;`_: ``async`` test functions are skipped and a warning is emitted when a suitable
    async plugin is not installed (such as ``pytest-asyncio`` or ``pytest-trio``).
    
    Previously ``async`` functions would not execute at all but still be marked as &quot;passed&quot;.
    
    
    - `2482 &lt;https://github.com/pytest-dev/pytest/issues/2482&gt;`_: Include new ``disable_test_id_escaping_and_forfeit_all_rights_to_community_support`` option to disable ascii-escaping in parametrized values. This may cause a series of problems and as the name makes clear, use at your own risk.
    
    
    - `4718 &lt;https://github.com/pytest-dev/pytest/issues/4718&gt;`_: The ``-p`` option can now be used to early-load plugins also by entry-point name, instead of just
    by module name.
    
    This makes it possible to early load external plugins like ``pytest-cov`` in the command-line::
    
       pytest -p pytest_cov
    
    
    - `4855 &lt;https://github.com/pytest-dev/pytest/issues/4855&gt;`_: The ``--pdbcls`` option handles classes via module attributes now (e.g.
    ``pdb:pdb.Pdb`` with `pdb++`_), and its validation was improved.
    
    .. _pdb++: https://pypi.org/project/pdbpp/
    
    
    - `4875 &lt;https://github.com/pytest-dev/pytest/issues/4875&gt;`_: The `testpaths &lt;https://docs.pytest.org/en/latest/reference.htmlconfval-testpaths&gt;`__ configuration option is now displayed next
    to the ``rootdir`` and ``inifile`` lines in the pytest header if the option is in effect, i.e., directories or file names were
    not explicitly passed in the command line.
    
    Also, ``inifile`` is only displayed if there&#39;s a configuration file, instead of an empty ``inifile:`` string.
    
    
    - `4911 &lt;https://github.com/pytest-dev/pytest/issues/4911&gt;`_: Doctests can be skipped now dynamically using ``pytest.skip()``.
    
    
    - `4920 &lt;https://github.com/pytest-dev/pytest/issues/4920&gt;`_: Internal refactorings have been made in order to make the implementation of the
    `pytest-subtests &lt;https://github.com/pytest-dev/pytest-subtests&gt;`__ plugin
    possible, which adds unittest sub-test support and a new ``subtests`` fixture as discussed in
    `1367 &lt;https://github.com/pytest-dev/pytest/issues/1367&gt;`__.
    
    For details on the internal refactorings, please see the details on the related PR.
    
    
    - `4931 &lt;https://github.com/pytest-dev/pytest/issues/4931&gt;`_: pytester&#39;s ``LineMatcher`` asserts that the passed lines are a sequence.
    
    
    - `4936 &lt;https://github.com/pytest-dev/pytest/issues/4936&gt;`_: Handle ``-p plug`` after ``-p no:plug``.
    
    This can be used to override a blocked plugin (e.g. in &quot;addopts&quot;) from the
    command line etc.
    
    
    - `4951 &lt;https://github.com/pytest-dev/pytest/issues/4951&gt;`_: Output capturing is handled correctly when only capturing via fixtures (capsys, capfs) with ``pdb.set_trace()``.
    
    
    - `4956 &lt;https://github.com/pytest-dev/pytest/issues/4956&gt;`_: ``pytester`` sets ``$HOME`` and ``$USERPROFILE`` to the temporary directory during test runs.
    
    This ensures to not load configuration files from the real user&#39;s home directory.
    
    
    - `4980 &lt;https://github.com/pytest-dev/pytest/issues/4980&gt;`_: Namespace packages are handled better with ``monkeypatch.syspath_prepend`` and ``testdir.syspathinsert`` (via ``pkg_resources.fixup_namespace_packages``).
    
    
    - `4993 &lt;https://github.com/pytest-dev/pytest/issues/4993&gt;`_: The stepwise plugin reports status information now.
    
    
    - `5008 &lt;https://github.com/pytest-dev/pytest/issues/5008&gt;`_: If a ``setup.cfg`` file contains ``[tool:pytest]`` and also the no longer supported ``[pytest]`` section, pytest will use ``[tool:pytest]`` ignoring ``[pytest]``. Previously it would unconditionally error out.
    
    This makes it simpler for plugins to support old pytest versions.
    
    
    
    Bug Fixes
    ---------
    
    - `1895 &lt;https://github.com/pytest-dev/pytest/issues/1895&gt;`_: Fix bug where fixtures requested dynamically via ``request.getfixturevalue()`` might be teardown
    before the requesting fixture.
    
    
    - `4851 &lt;https://github.com/pytest-dev/pytest/issues/4851&gt;`_: pytester unsets ``PYTEST_ADDOPTS`` now to not use outer options with ``testdir.runpytest()``.
    
    
    - `4903 &lt;https://github.com/pytest-dev/pytest/issues/4903&gt;`_: Use the correct modified time for years after 2038 in rewritten ``.pyc`` files.
    
    
    - `4928 &lt;https://github.com/pytest-dev/pytest/issues/4928&gt;`_: Fix line offsets with ``ScopeMismatch`` errors.
    
    
    - `4957 &lt;https://github.com/pytest-dev/pytest/issues/4957&gt;`_: ``-p no:plugin`` is handled correctly for default (internal) plugins now, e.g. with ``-p no:capture``.
    
    Previously they were loaded (imported) always, making e.g. the ``capfd`` fixture available.
    
    
    - `4968 &lt;https://github.com/pytest-dev/pytest/issues/4968&gt;`_: The pdb ``quit`` command is handled properly when used after the ``debug`` command with `pdb++`_.
    
    .. _pdb++: https://pypi.org/project/pdbpp/
    
    
    - `4975 &lt;https://github.com/pytest-dev/pytest/issues/4975&gt;`_: Fix the interpretation of ``-qq`` option where it was being considered as ``-v`` instead.
    
    
    - `4978 &lt;https://github.com/pytest-dev/pytest/issues/4978&gt;`_: ``outcomes.Exit`` is not swallowed in ``assertrepr_compare`` anymore.
    
    
    - `4988 &lt;https://github.com/pytest-dev/pytest/issues/4988&gt;`_: Close logging&#39;s file handler explicitly when the session finishes.
    
    
    - `5003 &lt;https://github.com/pytest-dev/pytest/issues/5003&gt;`_: Fix line offset with mark collection error (off by one).
    
    
    
    Improved Documentation
    ----------------------
    
    - `4974 &lt;https://github.com/pytest-dev/pytest/issues/4974&gt;`_: Update docs for ``pytest_cmdline_parse`` hook to note availability liminations
    
    
    
    Trivial/Internal Changes
    ------------------------
    
    - `4718 &lt;https://github.com/pytest-dev/pytest/issues/4718&gt;`_: ``pluggy&gt;=0.9`` is now required.
    
    
    - `4815 &lt;https://github.com/pytest-dev/pytest/issues/4815&gt;`_: ``funcsigs&gt;=1.0`` is now required for Python 2.7.
    
    
    - `4829 &lt;https://github.com/pytest-dev/pytest/issues/4829&gt;`_: Some left-over internal code related to ``yield`` tests has been removed.
    
    
    - `4890 &lt;https://github.com/pytest-dev/pytest/issues/4890&gt;`_: Remove internally unused ``anypython`` fixture from the pytester plugin.
    
    
    - `4912 &lt;https://github.com/pytest-dev/pytest/issues/4912&gt;`_: Remove deprecated Sphinx directive, ``add_description_unit()``,
    pin sphinx-removed-in to &gt;= 0.2.0 to support Sphinx 2.0.
    
    
    - `4913 &lt;https://github.com/pytest-dev/pytest/issues/4913&gt;`_: Fix pytest tests invocation with custom ``PYTHONPATH``.
    
    
    - `4965 &lt;https://github.com/pytest-dev/pytest/issues/4965&gt;`_: New ``pytest_report_to_serializable`` and ``pytest_report_from_serializable`` **experimental** hooks.
    
    These hooks will be used by ``pytest-xdist``, ``pytest-subtests``, and the replacement for
    resultlog to serialize and customize reports.
    
    They are experimental, meaning that their details might change or even be removed
    completely in future patch releases without warning.
    
    Feedback is welcome from plugin authors and users alike.
    
    
    - `4987 &lt;https://github.com/pytest-dev/pytest/issues/4987&gt;`_: ``Collector.repr_failure`` respects the ``--tb`` option, but only defaults to ``short`` now (with ``auto``).
    

    4.3.1

    =========================
    
    Bug Fixes
    ---------
    
    - `4810 &lt;https://github.com/pytest-dev/pytest/issues/4810&gt;`_: Logging messages inside ``pytest_runtest_logreport()`` are now properly captured and displayed.
    
    
    - `4861 &lt;https://github.com/pytest-dev/pytest/issues/4861&gt;`_: Improve validation of contents written to captured output so it behaves the same as when capture is disabled.
    
    
    - `4898 &lt;https://github.com/pytest-dev/pytest/issues/4898&gt;`_: Fix ``AttributeError: FixtureRequest has no &#39;confg&#39; attribute`` bug in ``testdir.copy_example``.
    
    
    
    Trivial/Internal Changes
    ------------------------
    
    - `4768 &lt;https://github.com/pytest-dev/pytest/issues/4768&gt;`_: Avoid pkg_resources import at the top-level.
    
    Links
    • PyPI: https://pypi.org/project/pytest
    • Changelog: https://pyup.io/changelogs/pytest/
    • Homepage: https://docs.pytest.org/en/latest/
    opened by pyup-bot 4
  • Fix InvalidRequestError when page and limit set

    Fix InvalidRequestError when page and limit set

    The call to .paginate() includes an order_by in flask_sqlalchemy. When applied after a limit, this fails with sqlalchemy.exc.InvalidRequestError. This change uses the per_page argument of .paginate() if the page query argument is set, or otherwise just applies the limit last.

    opened by snaplogic-nic 4
  • Scheduled weekly dependency update for week 01

    Scheduled weekly dependency update for week 01

    Update Flask from 1.1.2 to 2.2.2.

    Changelog

    2.2.2

    -------------
    
    Released 2022-08-08
    
    -   Update Werkzeug dependency to &gt;= 2.2.2. This includes fixes related
     to the new faster router, header parsing, and the development
     server. :pr:`4754`
    -   Fix the default value for ``app.env`` to be ``&quot;production&quot;``. This
     attribute remains deprecated. :issue:`4740`
    

    2.2.1

    -------------
    
    Released 2022-08-03
    
    -   Setting or accessing ``json_encoder`` or ``json_decoder`` raises a
     deprecation warning. :issue:`4732`
    

    2.2.0

    -------------
    
    Released 2022-08-01
    
    -   Remove previously deprecated code. :pr:`4667`
    
     -   Old names for some ``send_file`` parameters have been removed.
         ``download_name`` replaces ``attachment_filename``, ``max_age``
         replaces ``cache_timeout``, and ``etag`` replaces ``add_etags``.
         Additionally, ``path`` replaces ``filename`` in
         ``send_from_directory``.
     -   The ``RequestContext.g`` property returning ``AppContext.g`` is
         removed.
    
    -   Update Werkzeug dependency to &gt;= 2.2.
    -   The app and request contexts are managed using Python context vars
     directly rather than Werkzeug&#x27;s ``LocalStack``. This should result
     in better performance and memory use. :pr:`4682`
    
     -   Extension maintainers, be aware that ``_app_ctx_stack.top``
         and ``_request_ctx_stack.top`` are deprecated. Store data on
         ``g`` instead using a unique prefix, like
         ``g._extension_name_attr``.
    
    -   The ``FLASK_ENV`` environment variable and ``app.env`` attribute are
     deprecated, removing the distinction between development and debug
     mode. Debug mode should be controlled directly using the ``--debug``
     option or ``app.run(debug=True)``. :issue:`4714`
    -   Some attributes that proxied config keys on ``app`` are deprecated:
     ``session_cookie_name``, ``send_file_max_age_default``,
     ``use_x_sendfile``, ``propagate_exceptions``, and
     ``templates_auto_reload``. Use the relevant config keys instead.
     :issue:`4716`
    -   Add new customization points to the ``Flask`` app object for many
     previously global behaviors.
    
     -   ``flask.url_for`` will call ``app.url_for``. :issue:`4568`
     -   ``flask.abort`` will call ``app.aborter``.
         ``Flask.aborter_class`` and ``Flask.make_aborter`` can be used
         to customize this aborter. :issue:`4567`
     -   ``flask.redirect`` will call ``app.redirect``. :issue:`4569`
     -   ``flask.json`` is an instance of ``JSONProvider``. A different
         provider can be set to use a different JSON library.
         ``flask.jsonify`` will call ``app.json.response``, other
         functions in ``flask.json`` will call corresponding functions in
         ``app.json``. :pr:`4692`
    
    -   JSON configuration is moved to attributes on the default
     ``app.json`` provider. ``JSON_AS_ASCII``, ``JSON_SORT_KEYS``,
     ``JSONIFY_MIMETYPE``, and ``JSONIFY_PRETTYPRINT_REGULAR`` are
     deprecated. :pr:`4692`
    -   Setting custom ``json_encoder`` and ``json_decoder`` classes on the
     app or a blueprint, and the corresponding ``json.JSONEncoder`` and
     ``JSONDecoder`` classes, are deprecated. JSON behavior can now be
     overridden using the ``app.json`` provider interface. :pr:`4692`
    -   ``json.htmlsafe_dumps`` and ``json.htmlsafe_dump`` are deprecated,
     the function is built-in to Jinja now. :pr:`4692`
    -   Refactor ``register_error_handler`` to consolidate error checking.
     Rewrite some error messages to be more consistent. :issue:`4559`
    -   Use Blueprint decorators and functions intended for setup after
     registering the blueprint will show a warning. In the next version,
     this will become an error just like the application setup methods.
     :issue:`4571`
    -   ``before_first_request`` is deprecated. Run setup code when creating
     the application instead. :issue:`4605`
    -   Added the ``View.init_every_request`` class attribute. If a view
     subclass sets this to ``False``, the view will not create a new
     instance on every request. :issue:`2520`.
    -   A ``flask.cli.FlaskGroup`` Click group can be nested as a
     sub-command in a custom CLI. :issue:`3263`
    -   Add ``--app`` and ``--debug`` options to the ``flask`` CLI, instead
     of requiring that they are set through environment variables.
     :issue:`2836`
    -   Add ``--env-file`` option to the ``flask`` CLI. This allows
     specifying a dotenv file to load in addition to ``.env`` and
     ``.flaskenv``. :issue:`3108`
    -   It is no longer required to decorate custom CLI commands on
     ``app.cli`` or ``blueprint.cli`` with ``with_appcontext``, an app
     context will already be active at that point. :issue:`2410`
    -   ``SessionInterface.get_expiration_time`` uses a timezone-aware
     value. :pr:`4645`
    -   View functions can return generators directly instead of wrapping
     them in a ``Response``. :pr:`4629`
    -   Add ``stream_template`` and ``stream_template_string`` functions to
     render a template as a stream of pieces. :pr:`4629`
    -   A new implementation of context preservation during debugging and
     testing. :pr:`4666`
    
     -   ``request``, ``g``, and other context-locals point to the
         correct data when running code in the interactive debugger
         console. :issue:`2836`
     -   Teardown functions are always run at the end of the request,
         even if the context is preserved. They are also run after the
         preserved context is popped.
     -   ``stream_with_context`` preserves context separately from a
         ``with client`` block. It will be cleaned up when
         ``response.get_data()`` or ``response.close()`` is called.
    
    -   Allow returning a list from a view function, to convert it to a
     JSON response like a dict is. :issue:`4672`
    -   When type checking, allow ``TypedDict`` to be returned from view
     functions. :pr:`4695`
    -   Remove the ``--eager-loading/--lazy-loading`` options from the
     ``flask run`` command. The app is always eager loaded the first
     time, then lazily loaded in the reloader. The reloader always prints
     errors immediately but continues serving. Remove the internal
     ``DispatchingApp`` middleware used by the previous implementation.
     :issue:`4715`
    

    2.1.3

    -------------
    
    Released 2022-07-13
    
    -   Inline some optional imports that are only used for certain CLI
     commands. :pr:`4606`
    -   Relax type annotation for ``after_request`` functions. :issue:`4600`
    -   ``instance_path`` for namespace packages uses the path closest to
     the imported submodule. :issue:`4610`
    -   Clearer error message when ``render_template`` and
     ``render_template_string`` are used outside an application context.
     :pr:`4693`
    

    2.1.2

    -------------
    
    Released 2022-04-28
    
    -   Fix type annotation for ``json.loads``, it accepts str or bytes.
     :issue:`4519`
    -   The ``--cert`` and ``--key`` options on ``flask run`` can be given
     in either order. :issue:`4459`
    

    2.1.1

    -------------
    
    Released on 2022-03-30
    
    -   Set the minimum required version of importlib_metadata to 3.6.0,
     which is required on Python &lt; 3.10. :issue:`4502`
    

    2.1.0

    -------------
    
    Released 2022-03-28
    
    -   Drop support for Python 3.6. :pr:`4335`
    -   Update Click dependency to &gt;= 8.0. :pr:`4008`
    -   Remove previously deprecated code. :pr:`4337`
    
     -   The CLI does not pass ``script_info`` to app factory functions.
     -   ``config.from_json`` is replaced by
         ``config.from_file(name, load=json.load)``.
     -   ``json`` functions no longer take an ``encoding`` parameter.
     -   ``safe_join`` is removed, use ``werkzeug.utils.safe_join``
         instead.
     -   ``total_seconds`` is removed, use ``timedelta.total_seconds``
         instead.
     -   The same blueprint cannot be registered with the same name. Use
         ``name=`` when registering to specify a unique name.
     -   The test client&#x27;s ``as_tuple`` parameter is removed. Use
         ``response.request.environ`` instead. :pr:`4417`
    
    -   Some parameters in ``send_file`` and ``send_from_directory`` were
     renamed in 2.0. The deprecation period for the old names is extended
     to 2.2. Be sure to test with deprecation warnings visible.
    
     -   ``attachment_filename`` is renamed to ``download_name``.
     -   ``cache_timeout`` is renamed to ``max_age``.
     -   ``add_etags`` is renamed to ``etag``.
     -   ``filename`` is renamed to ``path``.
    
    -   The ``RequestContext.g`` property is deprecated. Use ``g`` directly
     or ``AppContext.g`` instead. :issue:`3898`
    -   ``copy_current_request_context`` can decorate async functions.
     :pr:`4303`
    -   The CLI uses ``importlib.metadata`` instead of ``setuptools`` to
     load command entry points. :issue:`4419`
    -   Overriding ``FlaskClient.open`` will not cause an error on redirect.
     :issue:`3396`
    -   Add an ``--exclude-patterns`` option to the ``flask run`` CLI
     command to specify patterns that will be ignored by the reloader.
     :issue:`4188`
    -   When using lazy loading (the default with the debugger), the Click
     context from the ``flask run`` command remains available in the
     loader thread. :issue:`4460`
    -   Deleting the session cookie uses the ``httponly`` flag.
     :issue:`4485`
    -   Relax typing for ``errorhandler`` to allow the user to use more
     precise types and decorate the same function multiple times.
     :issue:`4095, 4295, 4297`
    -   Fix typing for ``__exit__`` methods for better compatibility with
     ``ExitStack``. :issue:`4474`
    -   From Werkzeug, for redirect responses the ``Location`` header URL
     will remain relative, and exclude the scheme and domain, by default.
     :pr:`4496`
    -   Add ``Config.from_prefixed_env()`` to load config values from
     environment variables that start with ``FLASK_`` or another prefix.
     This parses values as JSON by default, and allows setting keys in
     nested dicts. :pr:`4479`
    

    2.0.3

    -------------
    
    Released 2022-02-14
    
    -   The test client&#x27;s ``as_tuple`` parameter is deprecated and will be
     removed in Werkzeug 2.1. It is now also deprecated in Flask, to be
     removed in Flask 2.1, while remaining compatible with both in
     2.0.x. Use ``response.request.environ`` instead. :pr:`4341`
    -   Fix type annotation for ``errorhandler`` decorator. :issue:`4295`
    -   Revert a change to the CLI that caused it to hide ``ImportError``
     tracebacks when importing the application. :issue:`4307`
    -   ``app.json_encoder`` and ``json_decoder`` are only passed to
     ``dumps`` and ``loads`` if they have custom behavior. This improves
     performance, mainly on PyPy. :issue:`4349`
    -   Clearer error message when ``after_this_request`` is used outside a
     request context. :issue:`4333`
    

    2.0.2

    -------------
    
    Released 2021-10-04
    
    -   Fix type annotation for ``teardown_*`` methods. :issue:`4093`
    -   Fix type annotation for ``before_request`` and ``before_app_request``
     decorators. :issue:`4104`
    -   Fixed the issue where typing requires template global
     decorators to accept functions with no arguments. :issue:`4098`
    -   Support View and MethodView instances with async handlers. :issue:`4112`
    -   Enhance typing of ``app.errorhandler`` decorator. :issue:`4095`
    -   Fix registering a blueprint twice with differing names. :issue:`4124`
    -   Fix the type of ``static_folder`` to accept ``pathlib.Path``.
     :issue:`4150`
    -   ``jsonify`` handles ``decimal.Decimal`` by encoding to ``str``.
     :issue:`4157`
    -   Correctly handle raising deferred errors in CLI lazy loading.
     :issue:`4096`
    -   The CLI loader handles ``**kwargs`` in a ``create_app`` function.
     :issue:`4170`
    -   Fix the order of ``before_request`` and other callbacks that trigger
     before the view returns. They are called from the app down to the
     closest nested blueprint. :issue:`4229`
    

    2.0.1

    -------------
    
    Released 2021-05-21
    
    -   Re-add the ``filename`` parameter in ``send_from_directory``. The
     ``filename`` parameter has been renamed to ``path``, the old name
     is deprecated. :pr:`4019`
    -   Mark top-level names as exported so type checking understands
     imports in user projects. :issue:`4024`
    -   Fix type annotation for ``g`` and inform mypy that it is a namespace
     object that has arbitrary attributes. :issue:`4020`
    -   Fix some types that weren&#x27;t available in Python 3.6.0. :issue:`4040`
    -   Improve typing for ``send_file``, ``send_from_directory``, and
     ``get_send_file_max_age``. :issue:`4044`, :pr:`4026`
    -   Show an error when a blueprint name contains a dot. The ``.`` has
     special meaning, it is used to separate (nested) blueprint names and
     the endpoint name. :issue:`4041`
    -   Combine URL prefixes when nesting blueprints that were created with
     a ``url_prefix`` value. :issue:`4037`
    -   Revert a change to the order that URL matching was done. The
     URL is again matched after the session is loaded, so the session is
     available in custom URL converters. :issue:`4053`
    -   Re-add deprecated ``Config.from_json``, which was accidentally
     removed early. :issue:`4078`
    -   Improve typing for some functions using ``Callable`` in their type
     signatures, focusing on decorator factories. :issue:`4060`
    -   Nested blueprints are registered with their dotted name. This allows
     different blueprints with the same name to be nested at different
     locations. :issue:`4069`
    -   ``register_blueprint`` takes a ``name`` option to change the
     (pre-dotted) name the blueprint is registered with. This allows the
     same blueprint to be registered multiple times with unique names for
     ``url_for``. Registering the same blueprint with the same name
     multiple times is deprecated. :issue:`1091`
    -   Improve typing for ``stream_with_context``. :issue:`4052`
    

    2.0.0

    -------------
    
    Released 2021-05-11
    
    -   Drop support for Python 2 and 3.5.
    -   Bump minimum versions of other Pallets projects: Werkzeug &gt;= 2,
     Jinja2 &gt;= 3, MarkupSafe &gt;= 2, ItsDangerous &gt;= 2, Click &gt;= 8. Be sure
     to check the change logs for each project. For better compatibility
     with other applications (e.g. Celery) that still require Click 7,
     there is no hard dependency on Click 8 yet, but using Click 7 will
     trigger a DeprecationWarning and Flask 2.1 will depend on Click 8.
    -   JSON support no longer uses simplejson. To use another JSON module,
     override ``app.json_encoder`` and ``json_decoder``. :issue:`3555`
    -   The ``encoding`` option to JSON functions is deprecated. :pr:`3562`
    -   Passing ``script_info`` to app factory functions is deprecated. This
     was not portable outside the ``flask`` command. Use
     ``click.get_current_context().obj`` if it&#x27;s needed. :issue:`3552`
    -   The CLI shows better error messages when the app failed to load
     when looking up commands. :issue:`2741`
    -   Add ``SessionInterface.get_cookie_name`` to allow setting the
     session cookie name dynamically. :pr:`3369`
    -   Add ``Config.from_file`` to load config using arbitrary file
     loaders, such as ``toml.load`` or ``json.load``.
     ``Config.from_json`` is deprecated in favor of this. :pr:`3398`
    -   The ``flask run`` command will only defer errors on reload. Errors
     present during the initial call will cause the server to exit with
     the traceback immediately. :issue:`3431`
    -   ``send_file`` raises a ``ValueError`` when passed an ``io`` object
     in text mode. Previously, it would respond with 200 OK and an empty
     file. :issue:`3358`
    -   When using ad-hoc certificates, check for the cryptography library
     instead of PyOpenSSL. :pr:`3492`
    -   When specifying a factory function with ``FLASK_APP``, keyword
     argument can be passed. :issue:`3553`
    -   When loading a ``.env`` or ``.flaskenv`` file, the current working
     directory is no longer changed to the location of the file.
     :pr:`3560`
    -   When returning a ``(response, headers)`` tuple from a view, the
     headers replace rather than extend existing headers on the response.
     For example, this allows setting the ``Content-Type`` for
     ``jsonify()``. Use ``response.headers.extend()`` if extending is
     desired. :issue:`3628`
    -   The ``Scaffold`` class provides a common API for the ``Flask`` and
     ``Blueprint`` classes. ``Blueprint`` information is stored in
     attributes just like ``Flask``, rather than opaque lambda functions.
     This is intended to improve consistency and maintainability.
     :issue:`3215`
    -   Include ``samesite`` and ``secure`` options when removing the
     session cookie. :pr:`3726`
    -   Support passing a ``pathlib.Path`` to ``static_folder``. :pr:`3579`
    -   ``send_file`` and ``send_from_directory`` are wrappers around the
     implementations in ``werkzeug.utils``. :pr:`3828`
    -   Some ``send_file`` parameters have been renamed, the old names are
     deprecated. ``attachment_filename`` is renamed to ``download_name``.
     ``cache_timeout`` is renamed to ``max_age``. ``add_etags`` is
     renamed to ``etag``. :pr:`3828, 3883`
    -   ``send_file`` passes ``download_name`` even if
     ``as_attachment=False`` by using ``Content-Disposition: inline``.
     :pr:`3828`
    -   ``send_file`` sets ``conditional=True`` and ``max_age=None`` by
     default. ``Cache-Control`` is set to ``no-cache`` if ``max_age`` is
     not set, otherwise ``public``. This tells browsers to validate
     conditional requests instead of using a timed cache. :pr:`3828`
    -   ``helpers.safe_join`` is deprecated. Use
     ``werkzeug.utils.safe_join`` instead. :pr:`3828`
    -   The request context does route matching before opening the session.
     This could allow a session interface to change behavior based on
     ``request.endpoint``. :issue:`3776`
    -   Use Jinja&#x27;s implementation of the ``|tojson`` filter. :issue:`3881`
    -   Add route decorators for common HTTP methods. For example,
     ``app.post(&quot;/login&quot;)`` is a shortcut for
     ``app.route(&quot;/login&quot;, methods=[&quot;POST&quot;])``. :pr:`3907`
    -   Support async views, error handlers, before and after request, and
     teardown functions. :pr:`3412`
    -   Support nesting blueprints. :issue:`593, 1548`, :pr:`3923`
    -   Set the default encoding to &quot;UTF-8&quot; when loading ``.env`` and
     ``.flaskenv`` files to allow to use non-ASCII characters. :issue:`3931`
    -   ``flask shell`` sets up tab and history completion like the default
     ``python`` shell if ``readline`` is installed. :issue:`3941`
    -   ``helpers.total_seconds()`` is deprecated. Use
     ``timedelta.total_seconds()`` instead. :pr:`3962`
    -   Add type hinting. :pr:`3973`.
    

    1.1.4

    -------------
    
    Released 2021-05-13
    
    -   Update ``static_folder`` to use ``_compat.fspath`` instead of
     ``os.fspath`` to continue supporting Python &lt; 3.6 :issue:`4050`
    

    1.1.3

    -------------
    
    Released 2021-05-13
    
    -   Set maximum versions of Werkzeug, Jinja, Click, and ItsDangerous.
     :issue:`4043`
    -   Re-add support for passing a ``pathlib.Path`` for ``static_folder``.
     :pr:`3579`
    
    Links
    • PyPI: https://pypi.org/project/flask
    • Changelog: https://pyup.io/changelogs/flask/
    • Homepage: https://palletsprojects.com/p/flask

    Update Flask-Admin from 1.5.7 to 1.6.0.

    Changelog

    1.6.0

    -----
    
    * Dropped Python 2 support
    * WTForms 3.0 support
    * Various fixes
    

    1.5.8

    -----
    
    * SQLAlchemy 1.4.5+ compatibility fixes
    * Redis CLI fixes
    
    Links
    • PyPI: https://pypi.org/project/flask-admin
    • Changelog: https://pyup.io/changelogs/flask-admin/
    • Repo: https://github.com/flask-admin/flask-admin/
    • Docs: https://pythonhosted.org/Flask-Admin/

    Update Flask-SQLAlchemy from 2.4.4 to 3.0.2.

    Changelog

    3.0.2

    -------------
    
    Released 2022-10-14
    
    -   Update compatibility with SQLAlchemy 2. :issue:`1122`
    

    3.0.1

    -------------
    
    Released 2022-10-11
    
    -   Export typing information instead of using external typeshed definitions.
     :issue:`1112`
    -   If default engine options are set, but ``SQLALCHEMY_DATABASE_URI`` is not set, an
     invalid default bind will not be configured. :issue:`1117`
    

    3.0.0

    -------------
    
    Released 2022-10-04
    
    -   Drop support for Python 2, 3.4, 3.5, and 3.6.
    -   Bump minimum version of Flask to 2.2.
    -   Bump minimum version of SQLAlchemy to 1.4.18.
    -   Remove previously deprecated code.
    -   The session is scoped to the current app context instead of the thread. This
     requires that an app context is active. This ensures that the session is cleaned up
     after every request.
    -   An active Flask application context is always required to access ``session`` and
     ``engine``, regardless of if an application was passed to the constructor.
     :issue:`508, 944`
    -   Different bind keys use different SQLAlchemy ``MetaData`` registries, allowing
     tables in different databases to have the same name. Bind keys are stored and looked
     up on the resulting metadata rather than the model or table.
    -   ``SQLALCHEMY_DATABASE_URI`` does not default to ``sqlite:///:memory:``. An error is
     raised if neither it nor ``SQLALCHEMY_BINDS`` define any engines. :pr:`731`
    -   Configuring SQLite with a relative path is relative to ``app.instance_path`` instead
     of ``app.root_path``. The instance folder is created if necessary. :issue:`462`
    -   Added ``get_or_404``, ``first_or_404``, ``one_or_404``, and ``paginate`` methods to
     the extension object. These use SQLAlchemy&#x27;s preferred ``session.execute(select())``
     pattern instead of the legacy query interface. :issue:`1088`
    -   Setup methods that create the engines and session are renamed with a leading
     underscore. They are considered internal interfaces which may change at any time.
    -   All parameters to ``SQLAlchemy`` except ``app`` are keyword-only.
    -   Renamed the ``bind`` parameter to ``bind_key`` and removed the ``app`` parameter
     from various ``SQLAlchemy`` methods.
    -   The extension object uses ``__getattr__`` to alias names from the SQLAlchemy
     package, rather than copying them as attributes.
    -   The extension object is stored directly as ``app.extensions[&quot;sqlalchemy&quot;]``.
     :issue:`698`
    -   The session class can be customized by passing the ``class_`` key in the
     ``session_options`` parameter. :issue:`327`
    -   ``SignallingSession`` is renamed to ``Session``.
    -   ``Session.get_bind`` more closely matches the base implementation.
    -   Model classes and the ``db`` instance are available without imports in
     ``flask shell``. :issue:`1089`
    -   The ``CamelCase`` to ``snake_case`` table name converter handles more patterns
     correctly. If model that was already created in the database changed, either use
     Alembic to rename the table, or set ``__tablename__`` to keep the old name.
     :issue:`406`
    -   ``Model`` ``repr`` distinguishes between transient and pending instances.
     :issue:`967`
    -   A custom model class can implement ``__init_subclass__`` with class parameters.
     :issue:`1002`
    -   ``db.Table`` is a subclass instead of a function.
    -   The ``engine_options`` parameter is applied as defaults before per-engine
     configuration.
    -   ``SQLALCHEMY_BINDS`` values can either be an engine URL, or a dict of engine options
     including URL, for each bind. ``SQLALCHEMY_DATABASE_URI`` and
     ``SQLALCHEMY_ENGINE_OPTIONS`` correspond to the ``None`` key and take precedence.
     :issue:`783`
    -   Engines are created when calling ``init_app`` rather than the first time they are
     accessed. :issue:`698`
    -   ``db.engines`` exposes the map of bind keys to engines for the current app.
    -   ``get_engine``, ``get_tables_for_bind``, and ``get_binds`` are deprecated.
    -   SQLite driver-level URIs that look like ``sqlite:///file:name.db?uri=true`` are
     supported. :issue:`998, 1045`
    -   SQLite engines do not use ``NullPool`` if ``pool_size`` is 0.
    -   MySQL engines use the &quot;utf8mb4&quot; charset by default. :issue:`875`
    -   MySQL engines do not set ``pool_size`` to 10.
    -   MySQL engines don&#x27;t set a default for ``pool_recycle`` if not using a queue pool.
     :issue:`803`
    -   ``Query`` is renamed from ``BaseQuery``.
    -   Added ``Query.one_or_404``.
    -   The query class is applied to ``backref`` in ``relationship``. :issue:`417`
    -   Creating ``Pagination`` objects manually is no longer a public API. They should be
     created with ``db.paginate`` or ``query.paginate``. :issue:`1088`
    -   ``Pagination.iter_pages`` and ``Query.paginate`` parameters are keyword-only.
    -   ``Pagination`` is iterable, iterating over its items. :issue:`70`
    -   Pagination count query is more efficient.
    -   ``Pagination.iter_pages`` is more efficient. :issue:`622`
    -   ``Pagination.iter_pages`` ``right_current`` parameter is inclusive.
    -   Pagination ``per_page`` cannot be 0. :issue:`1091`
    -   Pagination ``max_per_page`` defaults to 100. :issue:`1091`
    -   Added ``Pagination.first`` and ``last`` properties, which give the number of the
     first and last item on the page. :issue:`567`
    -   ``SQLALCHEMY_RECORD_QUERIES`` is disabled by default, and is not enabled
     automatically with ``app.debug`` or ``app.testing``. :issue:`1092`
    -   ``get_debug_queries`` is renamed to ``get_recorded_queries`` to better match the
     config and functionality.
    -   Recorded query info is a dataclass instead of a tuple. The ``context`` attribute is
     renamed to ``location``. Finding the location uses a more inclusive check.
    -   ``SQLALCHEMY_TRACK_MODIFICATIONS`` is disabled by default. :pr:`727`
    -   ``SQLALCHEMY_COMMIT_ON_TEARDOWN`` is deprecated. It can cause various design issues
     that are difficult to debug. Call ``db.session.commit()`` directly instead.
     :issue:`216`
    

    2.5.1

    -------------
    
    Released 2021-03-18
    
    -   Fix compatibility with Python 2.7.
    

    2.5.0

    -------------
    
    Released 2021-03-18
    
    -   Update to support SQLAlchemy 1.4.
    -   SQLAlchemy ``URL`` objects are immutable. Some internal methods have
     changed to return a new URL instead of ``None``. :issue:`885`
    
    Links
    • PyPI: https://pypi.org/project/flask-sqlalchemy
    • Changelog: https://pyup.io/changelogs/flask-sqlalchemy/
    • Docs: https://pythonhosted.org/flask-sqlalchemy/

    Update SQLAlchemy from 1.3.20 to 1.4.45.

    Changelog

    1.4.45

    :released: December 10, 2022
    
     .. change::
         :tags: bug, orm
         :tickets: 8862
         :versions: 2.0.0rc1
    
         Fixed bug where :meth:`_orm.Session.merge` would fail to preserve the
         current loaded contents of relationship attributes that were indicated with
         the :paramref:`_orm.relationship.viewonly` parameter, thus defeating
         strategies that use :meth:`_orm.Session.merge` to pull fully loaded objects
         from caches and other similar techniques. In a related change, fixed issue
         where an object that contains a loaded relationship that was nonetheless
         configured as ``lazy=&#x27;raise&#x27;`` on the mapping would fail when passed to
         :meth:`_orm.Session.merge`; checks for &quot;raise&quot; are now suspended within
         the merge process assuming the :paramref:`_orm.Session.merge.load`
         parameter remains at its default of ``True``.
    
         Overall, this is a behavioral adjustment to a change introduced in the 1.4
         series as of :ticket:`4994`, which took &quot;merge&quot; out of the set of cascades
         applied by default to &quot;viewonly&quot; relationships. As &quot;viewonly&quot; relationships
         aren&#x27;t persisted under any circumstances, allowing their contents to
         transfer during &quot;merge&quot; does not impact the persistence behavior of the
         target object. This allows :meth:`_orm.Session.merge` to correctly suit one
         of its use cases, that of adding objects to a :class:`.Session` that were
         loaded elsewhere, often for the purposes of restoring from a cache.
    
    
     .. change::
         :tags: bug, orm
         :tickets: 8881
         :versions: 2.0.0rc1
    
         Fixed issues in :func:`_orm.with_expression` where expressions that were
         composed of columns that were referenced from the enclosing SELECT would
         not render correct SQL in some contexts, in the case where the expression
         had a label name that matched the attribute which used
         :func:`_orm.query_expression`, even when :func:`_orm.query_expression` had
         no default expression. For the moment, if the :func:`_orm.query_expression`
         does have a default expression, that label name is still used for that
         default, and an additional label with the same name will continue to be
         ignored. Overall, this case is pretty thorny so further adjustments might
         be warranted.
    
     .. change::
         :tags: bug, sqlite
         :tickets: 8866
    
         Backported a fix for SQLite reflection of unique constraints in attached
         schemas, released in 2.0 as a small part of :ticket:`4379`. Previously,
         unique constraints in attached schemas would be ignored by SQLite
         reflection. Pull request courtesy Michael Gorven.
    
     .. change::
         :tags: bug, asyncio
         :tickets: 8952
         :versions: 2.0.0rc1
    
         Removed non-functional ``merge()`` method from
         :class:`_asyncio.AsyncResult`.  This method has never worked and was
         included with :class:`_asyncio.AsyncResult` in error.
    
     .. change::
         :tags: bug, oracle
         :tickets: 8708
         :versions: 2.0.0b4
    
         Continued fixes for Oracle fix :ticket:`8708` released in 1.4.43 where
         bound parameter names that start with underscores, which are disallowed by
         Oracle, were still not being properly escaped in all circumstances.
    
    
     .. change::
         :tags: bug, postgresql
         :tickets: 8748
         :versions: 2.0.0rc1
    
         Made an adjustment to how the PostgreSQL dialect considers column types
         when it reflects columns from a table, to accommodate for alternative
         backends which may return NULL from the PG ``format_type()`` function.
    
     .. change::
         :tags: usecase, sqlite
         :tickets: 8903
         :versions: 2.0.0rc1
    
         Added support for the SQLite backend to reflect the &quot;DEFERRABLE&quot; and
         &quot;INITIALLY&quot; keywords which may be present on a foreign key construct. Pull
         request courtesy Michael Gorven.
    
     .. change::
         :tags: usecase, sql
         :tickets: 8800
         :versions: 2.0.0rc1
    
         An informative re-raise is now thrown in the case where any &quot;literal
         bindparam&quot; render operation fails, indicating the value itself and
         the datatype in use, to assist in debugging when literal params
         are being rendered in a statement.
    
     .. change::
         :tags: usecase, sqlite
         :tickets: 8804
         :versions: 2.0.0rc1
    
         Added support for reflection of expression-oriented WHERE criteria included
         in indexes on the SQLite dialect, in a manner similar to that of the
         PostgreSQL dialect. Pull request courtesy Tobias Pfeiffer.
    
     .. change::
         :tags: bug, sql
         :tickets: 8827
         :versions: 2.0.0rc1
    
         Fixed a series of issues regarding the position and sometimes the identity
         of rendered bound parameters, such as those used for SQLite, asyncpg,
         MySQL, Oracle and others. Some compiled forms would not maintain the order
         of parameters correctly, such as the PostgreSQL ``regexp_replace()``
         function, the &quot;nesting&quot; feature of the :class:`.CTE` construct first
         introduced in :ticket:`4123`, and selectable tables formed by using the
         :meth:`.FunctionElement.column_valued` method with Oracle.
    
    
     .. change::
         :tags: bug, oracle
         :tickets: 8945
         :versions: 2.0.0rc1
    
         Fixed issue in Oracle compiler where the syntax for
         :meth:`.FunctionElement.column_valued` was incorrect, rendering the name
         ``COLUMN_VALUE`` without qualifying the source table correctly.
    
     .. change::
         :tags: bug, engine
         :tickets: 8963
         :versions: 2.0.0rc1
    
         Fixed issue where :meth:`_engine.Result.freeze` method would not work for
         textual SQL using either :func:`_sql.text` or
         :meth:`_engine.Connection.exec_driver_sql`.
    
    
    .. changelog::
    

    1.4.44

    :released: November 12, 2022
    
     .. change::
         :tags: bug, sql
         :tickets: 8790
         :versions: 2.0.0b4
    
         Fixed critical memory issue identified in cache key generation, where for
         very large and complex ORM statements that make use of lots of ORM aliases
         with subqueries, cache key generation could produce excessively large keys
         that were orders of magnitude bigger than the statement itself. Much thanks
         to Rollo Konig Brock for their very patient, long term help in finally
         identifying this issue.
    
     .. change::
         :tags: bug, postgresql, mssql
         :tickets: 8770
         :versions: 2.0.0b4
    
         For the PostgreSQL and SQL Server dialects only, adjusted the compiler so
         that when rendering column expressions in the RETURNING clause, the &quot;non
         anon&quot; label that&#x27;s used in SELECT statements is suggested for SQL
         expression elements that generate a label; the primary example is a SQL
         function that may be emitting as part of the column&#x27;s type, where the label
         name should match the column&#x27;s name by default. This restores a not-well
         defined behavior that had changed in version 1.4.21 due to :ticket:`6718`,
         :ticket:`6710`. The Oracle dialect has a different RETURNING implementation
         and was not affected by this issue. Version 2.0 features an across the
         board change for its widely expanded support of RETURNING on other
         backends.
    
    
     .. change::
         :tags: bug, oracle
    
         Fixed issue in the Oracle dialect where an INSERT statement that used
         ``insert(some_table).values(...).returning(some_table)`` against a full
         :class:`.Table` object at once would fail to execute, raising an exception.
    
     .. change::
         :tags: bug, tests
         :tickets: 8793
         :versions: 2.0.0b4
    
         Fixed issue where the ``--disable-asyncio`` parameter to the test suite
         would fail to not actually run greenlet tests and would also not prevent
         the suite from using a &quot;wrapping&quot; greenlet for the whole suite. This
         parameter now ensures that no greenlet or asyncio use will occur within the
         entire run when set.
    
     .. change::
         :tags: bug, tests
    
         Adjusted the test suite which tests the Mypy plugin to accommodate for
         changes in Mypy 0.990 regarding how it handles message output, which affect
         how sys.path is interpreted when determining if notes and errors should be
         printed for particular files. The change broke the test suite as the files
         within the test directory itself no longer produced messaging when run
         under the mypy API.
    
    .. changelog::
    

    1.4.43

    :released: November 4, 2022
    
     .. change::
         :tags: bug, orm
         :tickets: 8738
         :versions: 2.0.0b3
    
         Fixed issue in joined eager loading where an assertion fail would occur
         with a particular combination of outer/inner joined eager loads, when
         eager loading across three mappers where the middle mapper was
         an inherited subclass mapper.
    
    
     .. change::
         :tags: bug, oracle
         :tickets: 8708
         :versions: 2.0.0b3
    
         Fixed issue where bound parameter names, including those automatically
         derived from similarly-named database columns, which contained characters
         that normally require quoting with Oracle would not be escaped when using
         &quot;expanding parameters&quot; with the Oracle dialect, causing execution errors.
         The usual &quot;quoting&quot; for bound parameters used by the Oracle dialect is not
         used with the &quot;expanding parameters&quot; architecture, so escaping for a large
         range of characters is used instead, now using a list of characters/escapes
         that are specific to Oracle.
    
    
    
     .. change::
         :tags: bug, orm
         :tickets: 8721
         :versions: 2.0.0b3
    
         Fixed bug involving :class:`.Select` constructs, where combinations of
         :meth:`.Select.select_from` with :meth:`.Select.join`, as well as when
         using :meth:`.Select.join_from`, would cause the
         :func:`_orm.with_loader_criteria` feature as well as the IN criteria needed
         for single-table inheritance queries to not render, in cases where the
         columns clause of the query did not explicitly include the left-hand side
         entity of the JOIN. The correct entity is now transferred to the
         :class:`.Join` object that&#x27;s generated internally, so that the criteria
         against the left side entity is correctly added.
    
    
     .. change::
         :tags: bug, mssql
         :tickets: 8714
         :versions: 2.0.0b3
    
         Fixed issue with :meth:`.Inspector.has_table`, which when used against a
         temporary table with the SQL Server dialect would fail on some Azure
         variants, due to an unnecessary information schema query that is not
         supported on those server versions. Pull request courtesy Mike Barry.
    
     .. change::
         :tags: bug, orm
         :tickets: 8711
         :versions: 2.0.0b3
    
         An informative exception is now raised when the
         :func:`_orm.with_loader_criteria` option is used as a loader option added
         to a specific &quot;loader path&quot;, such as when using it within
         :meth:`.Load.options`. This use is not supported as
         :func:`_orm.with_loader_criteria` is only intended to be used as a top
         level loader option. Previously, an internal error would be generated.
    
     .. change::
         :tags: bug, oracle
         :tickets: 8744
         :versions: 2.0.0b3
    
         Fixed issue where the ``nls_session_parameters`` view queried on first
         connect in order to get the default decimal point character may not be
         available depending on Oracle connection modes, and would therefore raise
         an error.  The approach to detecting decimal char has been simplified to
         test a decimal value directly, instead of reading system views, which
         works on any backend / driver.
    
    
     .. change::
         :tags: bug, orm
         :tickets: 8753
         :versions: 2.0.0b3
    
         Improved &quot;dictionary mode&quot; for :meth:`_orm.Session.get` so that synonym
         names which refer to primary key attribute names may be indicated in the
         named dictionary.
    
     .. change::
         :tags: bug, engine, regression
         :tickets: 8717
         :versions: 2.0.0b3
    
         Fixed issue where the :meth:`.PoolEvents.reset` event hook would not be be
         called in all cases when a :class:`_engine.Connection` were closed and was
         in the process of returning its DBAPI connection to the connection pool.
    
         The scenario was when the :class:`_engine.Connection` had already emitted
         ``.rollback()`` on its DBAPI connection within the process of returning
         the connection to the pool, where it would then instruct the connection
         pool to forego doing its own &quot;reset&quot; to save on the additional method
         call.  However, this prevented custom pool reset schemes from being
         used within this hook, as such hooks by definition are doing more than
         just calling ``.rollback()``, and need to be invoked under all
         circumstances.  This was a regression that appeared in version 1.4.
    
         For version 1.4, the :meth:`.PoolEvents.checkin` remains viable as an
         alternate event hook to use for custom &quot;reset&quot; implementations. Version 2.0
         will feature an improved version of :meth:`.PoolEvents.reset` which is
         called for additional scenarios such as termination of asyncio connections,
         and is also passed contextual information about the reset, to allow for
         &quot;custom connection reset&quot; schemes which can respond to different reset
         scenarios in different ways.
    
     .. change::
         :tags: bug, orm
         :tickets: 8704
         :versions: 2.0.0b3
    
         Fixed issue where &quot;selectin_polymorphic&quot; loading for inheritance mappers
         would not function correctly if the :paramref:`_orm.Mapper.polymorphic_on`
         parameter referred to a SQL expression that was not directly mapped on the
         class.
    
     .. change::
         :tags: bug, orm
         :tickets: 8710
         :versions: 2.0.0b3
    
         Fixed issue where the underlying DBAPI cursor would not be closed when
         using the :class:`_orm.Query` object as an iterator, if a user-defined exception
         case were raised within the iteration process, thereby causing the iterator
         to be closed by the Python interpreter.  When using
         :meth:`_orm.Query.yield_per` to create server-side cursors, this would lead
         to the usual MySQL-related issues with server side cursors out of sync,
         and without direct access to the :class:`.Result` object, end-user code
         could not access the cursor in order to close it.
    
         To resolve, a catch for ``GeneratorExit`` is applied within the iterator
         method, which will close the result object in those cases when the
         iterator were interrupted, and by definition will be closed by the
         Python interpreter.
    
         As part of this change as implemented for the 1.4 series, ensured that
         ``.close()`` methods are available on all :class:`.Result` implementations
         including :class:`.ScalarResult`, :class:`.MappingResult`.  The 2.0
         version of this change also includes new context manager patterns for use
         with :class:`.Result` classes.
    
     .. change::
         :tags: bug, engine
         :tickets: 8710
    
         Ensured all :class:`.Result` objects include a :meth:`.Result.close` method
         as well as a :attr:`.Result.closed` attribute, including on
         :class:`.ScalarResult` and :class:`.MappingResult`.
    
     .. change::
         :tags: bug, mssql, reflection
         :tickets: 8700
         :versions: 2.0.0b3
    
         Fixed issue with :meth:`.Inspector.has_table`, which when used against a
         view with the SQL Server dialect would erroneously return ``False``, due to
         a regression in the 1.4 series which removed support for this on SQL
         Server. The issue is not present in the 2.0 series which uses a different
         reflection architecture. Test support is added to ensure ``has_table()``
         remains working per spec re: views.
    
     .. change::
         :tags: bug, sql
         :tickets: 8724
         :versions: 2.0.0b3
    
         Fixed issue which prevented the :func:`_sql.literal_column` construct from
         working properly within the context of a :class:`.Select` construct as well
         as other potential places where &quot;anonymized labels&quot; might be generated, if
         the literal expression contained characters which could interfere with
         format strings, such as open parenthesis, due to an implementation detail
         of the &quot;anonymous label&quot; structure.
    
    
    .. changelog::
    

    1.4.42

    :released: October 16, 2022
    
     .. change::
         :tags: bug, asyncio
         :tickets: 8516
    
         Improved implementation of ``asyncio.shield()`` used in context managers as
         added in :ticket:`8145`, such that the &quot;close&quot; operation is enclosed within
         an ``asyncio.Task`` which is then strongly referenced as the operation
         proceeds. This is per Python documentation indicating that the task is
         otherwise not strongly referenced.
    
     .. change::
         :tags: bug, orm
         :tickets: 8614
    
         The :paramref:`_orm.Session.execute.bind_arguments` dictionary is no longer
         mutated when passed to :meth:`_orm.Session.execute` and similar; instead,
         it&#x27;s copied to an internal dictionary for state changes. Among other
         things, this fixes and issue where the &quot;clause&quot; passed to the
         :meth:`_orm.Session.get_bind` method would be incorrectly referring to the
         :class:`_sql.Select` construct used for the &quot;fetch&quot; synchronization
         strategy, when the actual query being emitted was a :class:`_dml.Delete` or
         :class:`_dml.Update`. This would interfere with recipes for &quot;routing
         sessions&quot;.
    
     .. change::
         :tags: bug, orm
         :tickets: 7094
    
         A warning is emitted in ORM configurations when an explicit
         :func:`_orm.remote` annotation is applied to columns that are local to the
         immediate mapped class, when the referenced class does not include any of
         the same table columns. Ideally this would raise an error at some point as
         it&#x27;s not correct from a mapping point of view.
    
     .. change::
         :tags: bug, orm
         :tickets: 7545
    
         A warning is emitted when attempting to configure a mapped class within an
         inheritance hierarchy where the mapper is not given any polymorphic
         identity, however there is a polymorphic discriminator column assigned.
         Such classes should be abstract if they never intend to load directly.
    
    
     .. change::
         :tags: bug, mssql, regression
         :tickets: 8525
    
         Fixed yet another regression in SQL Server isolation level fetch (see
         :ticket:`8231`, :ticket:`8475`), this time with &quot;Microsoft Dynamics CRM
         Database via Azure Active Directory&quot;, which apparently lacks the
         ``system_views`` view entirely. Error catching has been extended that under
         no circumstances will this method ever fail, provided database connectivity
         is present.
    
     .. change::
         :tags: orm, bug, regression
         :tickets: 8569
    
         Fixed regression for 1.4 in :func:`_orm.contains_eager` where the &quot;wrap in
         subquery&quot; logic of :func:`_orm.joinedload` would be inadvertently triggered
         for use of the :func:`_orm.contains_eager` function with similar statements
         (e.g. those that use ``distinct()``, ``limit()`` or ``offset()``), which
         would then lead to secondary issues with queries that used some
         combinations of SQL label names and aliasing. This &quot;wrapping&quot; is not
         appropriate for :func:`_orm.contains_eager` which has always had the
         contract that the user-defined SQL statement is unmodified with the
         exception of adding the appropriate columns to be fetched.
    
     .. change::
         :tags: bug, orm, regression
         :tickets: 8507
    
         Fixed regression where using ORM update() with synchronize_session=&#x27;fetch&#x27;
         would fail due to the use of evaluators that are now used to determine the
         in-Python value for expressions in the the SET clause when refreshing
         objects; if the evaluators make use of math operators against non-numeric
         values such as PostgreSQL JSONB, the non-evaluable condition would fail to
         be detected correctly. The evaluator now limits the use of math mutation
         operators to numeric types only, with the exception of &quot;+&quot; that continues
         to work for strings as well. SQLAlchemy 2.0 may alter this further by
         fetching the SET values completely rather than using evaluation.
    
     .. change::
         :tags: usecase, postgresql
         :tickets: 8574
    
         :class:`_postgresql.aggregate_order_by` now supports cache generation.
    
     .. change::
         :tags: bug, mysql
         :tickets: 8588
    
         Adjusted the regular expression used to match &quot;CREATE VIEW&quot; when
         testing for views to work more flexibly, no longer requiring the
         special keyword &quot;ALGORITHM&quot; in the middle, which was intended to be
         optional but was not working correctly.  The change allows view reflection
         to work more completely on MySQL-compatible variants such as StarRocks.
         Pull request courtesy John Bodley.
    
     .. change::
         :tags: bug, engine
         :tickets: 8536
    
         Fixed issue where mixing &quot;*&quot; with additional explicitly-named column
         expressions within the columns clause of a :func:`_sql.select` construct
         would cause result-column targeting to sometimes consider the label name or
         other non-repeated names to be an ambiguous target.
    
    .. changelog::
    

    1.4.41

    :released: September 6, 2022
    
     .. change::
         :tags: bug, sql
         :tickets: 8441
    
         Fixed issue where use of the :func:`_sql.table` construct, passing a string
         for the :paramref:`_sql.table.schema` parameter, would fail to take the
         &quot;schema&quot; string into account when producing a cache key, thus leading to
         caching collisions if multiple, same-named :func:`_sql.table` constructs
         with different schemas were used.
    
    
     .. change::
         :tags: bug, events, orm
         :tickets: 8467
    
         Fixed event listening issue where event listeners added to a superclass
         would be lost if a subclass were created which then had its own listeners
         associated. The practical example is that of the :class:`.sessionmaker`
         class created after events have been associated with the
         :class:`_orm.Session` class.
    
     .. change::
         :tags: orm, bug
         :tickets: 8401
    
         Hardened the cache key strategy for the :func:`_orm.aliased` and
         :func:`_orm.with_polymorphic` constructs. While no issue involving actual
         statements being cached can easily be demonstrated (if at all), these two
         constructs were not including enough of what makes them unique in their
         cache keys for caching on the aliased construct alone to be accurate.
    
     .. change::
         :tags: bug, orm, regression
         :tickets: 8456
    
         Fixed regression appearing in the 1.4 series where a joined-inheritance
         query placed as a subquery within an enclosing query for that same entity
         would fail to render the JOIN correctly for the inner query. The issue
         manifested in two different ways prior and subsequent to version 1.4.18
         (related issue :ticket:`6595`), in one case rendering JOIN twice, in the
         other losing the JOIN entirely. To resolve, the conditions under which
         &quot;polymorphic loading&quot; are applied have been scaled back to not be invoked
         for simple joined inheritance queries.
    
     .. change::
         :tags: bug, orm
         :tickets: 8446
    
         Fixed issue in :mod:`sqlalchemy.ext.mutable` extension where collection
         links to the parent object would be lost if the object were merged with
         :meth:`.Session.merge` while also passing :paramref:`.Session.merge.load`
         as False.
    
     .. change::
         :tags: bug, orm
         :tickets: 8399
    
         Fixed issue involving :func:`_orm.with_loader_criteria` where a closure
         variable used as bound parameter value within the lambda would not carry
         forward correctly into additional relationship loaders such as
         :func:`_orm.selectinload` and :func:`_orm.lazyload` after the statement
         were cached, using the stale originally-cached value instead.
    
    
     .. change::
         :tags: bug, mssql, regression
         :tickets: 8475
    
         Fixed regression caused by the fix for :ticket:`8231` released in 1.4.40
         where connection would fail if the user did not have permission to query
         the ``dm_exec_sessions`` or ``dm_pdw_nodes_exec_sessions`` system views
         when trying to determine the current transaction isolation level.
    
     .. change::
         :tags: bug, asyncio
         :tickets: 8419
    
         Integrated support for asyncpg&#x27;s ``terminate()`` method call for cases
         where the connection pool is recycling a possibly timed-out connection,
         where a connection is being garbage collected that wasn&#x27;t gracefully
         closed, as well as when the connection has been invalidated. This allows
         asyncpg to abandon the connection without waiting for a response that may
         incur long timeouts.
    
    .. changelog::
    

    1.4.40

    :released: August 8, 2022
    
     .. change::
         :tags: bug, orm
         :tickets: 8357
    
         Fixed issue where referencing a CTE multiple times in conjunction with a
         polymorphic SELECT could result in multiple &quot;clones&quot; of the same CTE being
         constructed, which would then trigger these two CTEs as duplicates. To
         resolve, the two CTEs are deep-compared when this occurs to ensure that
         they are equivalent, then are treated as equivalent.
    
    
     .. change::
         :tags: bug, orm, declarative
         :tickets: 8190
    
         Fixed issue where a hierarchy of classes set up as an abstract or mixin
         declarative classes could not declare standalone columns on a superclass
         that would then be copied correctly to a :class:`_orm.declared_attr`
         callable that wanted to make use of them on a descendant class.
    
     .. change::
         :tags: bug, types
         :tickets: 7249
    
         Fixed issue where :class:`.TypeDecorator` would not correctly proxy the
         ``__getitem__()`` operator when decorating the :class:`_types.ARRAY`
         datatype, without explicit workarounds.
    
     .. change::
         :tags: bug, asyncio
         :tickets: 8145
    
         Added ``asyncio.shield()`` to the connection and session release process
         specifically within the ``__aexit__()`` context manager exit, when using
         :class:`.AsyncConnection` or :class:`.AsyncSession` as a context manager
         that releases the object when the context manager is complete. This appears
         to help with task cancellation when using alternate concurrency libraries
         such as ``anyio``, ``uvloop`` that otherwise don&#x27;t provide an async context
         for the connection pool to release the connection properly during task
         cancellation.
    
    
    
     .. change::
         :tags: bug, postgresql
         :tickets: 4392
    
         Fixed issue in psycopg2 dialect where the &quot;multiple hosts&quot; feature
         implemented for :ticket:`4392`, where multiple ``host:port`` pairs could be
         passed in the query string as
         ``?host=host1:port1&amp;host=host2:port2&amp;host=host3:port3`` was not implemented
         correctly, as it did not propagate the &quot;port&quot; parameter appropriately.
         Connections that didn&#x27;t use a different &quot;port&quot; likely worked without issue,
         and connections that had &quot;port&quot; for some of the entries may have
         incorrectly passed on that hostname. The format is now corrected to pass
         hosts/ports appropriately.
    
         As part of this change, maintained support for another multihost style that
         worked unintentionally, which is comma-separated
         ``?host=h1,h2,h3&amp;port=p1,p2,p3``. This format is more consistent with
         libpq&#x27;s query-string format, whereas the previous format is inspired by a
         different aspect of libpq&#x27;s URI format but is not quite the same thing.
    
         If the two styles are mixed together, an error is raised as this is
         ambiguous.
    
     .. change::
         :tags: bug, sql
         :tickets: 8253
    
         Adjusted the SQL compilation for string containment functions
         ``.contains()``, ``.startswith()``, ``.endswith()`` to force the use of the
         string concatenation operator, rather than relying upon the overload of the
         addition operator, so that non-standard use of these operators with for
         example bytestrings still produces string concatenation operators.
    
    
     .. change::
         :tags: bug, orm
         :tickets: 8235
    
         A :func:`_sql.select` construct that is passed a sole &#x27;*&#x27; argument for
         ``SELECT *``, either via string, :func:`_sql.text`, or
         :func:`_sql.literal_column`, will be interpreted as a Core-level SQL
         statement rather than as an ORM level statement. This is so that the ``*``,
         when expanded to match any number of columns, will result in all columns
         returned in the result. the ORM- level interpretation of
         :func:`_sql.select` needs to know the names and types of all ORM columns up
         front which can&#x27;t be achieved when ``&#x27;*&#x27;`` is used.
    
         If ``&#x27;*`` is used amongst other expressions simultaneously with an ORM
         statement, an error is raised as this can&#x27;t be interpreted correctly by the
         ORM.
    
     .. change::
         :tags: bug, mssql
         :tickets: 8210
    
         Fixed issues that prevented the new usage patterns for using DML with ORM
         objects presented at :ref:`orm_dml_returning_objects` from working
         correctly with the SQL Server pyodbc dialect.
    
    
     .. change::
         :tags: bug, mssql
         :tickets: 8231
    
         Fixed issue where the SQL Server dialect&#x27;s query for the current isolation
         level would fail on Azure Synapse Analytics, due to the way in which this
         database handles transaction rollbacks after an error has occurred. The
         initial query has been modified to no longer rely upon catching an error
         when attempting to detect the appropriate system view. Additionally, to
         better support this database&#x27;s very specific &quot;rollback&quot; behavior,
         implemented new parameter ``ignore_no_transaction_on_rollback`` indicating
         that a rollback should ignore Azure Synapse error &#x27;No corresponding
         transaction found. (111214)&#x27;, which is raised if no transaction is present
         in conflict with the Python DBAPI.
    
         Initial patch and valuable debugging assistance courtesy of ww2406.
    
         .. seealso::
    
             :ref:`azure_synapse_ignore_no_transaction_on_rollback`
    
     .. change::
         :tags: bug, mypy
         :tickets: 8196
    
         Fixed a crash of the mypy plugin when using a lambda as a Column
         default. Pull request courtesy of tchapi.
    
    
     .. change::
         :tags: usecase, engine
    
         Implemented new :paramref:`_engine.Connection.execution_options.yield_per`
         execution option for :class:`_engine.Connection` in Core, to mirror that of
         the same :ref:`yield_per &lt;orm_queryguide_yield_per&gt;` option available in
         the ORM. The option sets both the
         :paramref:`_engine.Connection.execution_options.stream_results` option at
         the same time as invoking :meth:`_engine.Result.yield_per`, to provide the
         most common streaming result configuration which also mirrors that of the
         ORM use case in its usage pattern.
    
         .. seealso::
    
             :ref:`engine_stream_results` - revised documentation
    
    
     .. change::
         :tags: bug, engine
    
         Fixed bug in :class:`_engine.Result` where the usage of a buffered result
         strategy would not be used if the dialect in use did not support an
         explicit &quot;server side cursor&quot; setting, when using
         :paramref:`_engine.Connection.execution_options.stream_results`. This is in
         error as DBAPIs such as that of SQLite and Oracle already use a
         non-buffered result fetching scheme, which still benefits from usage of
         partial result fetching.   The &quot;buffered&quot; strategy is now used in all
         cases where :paramref:`_engine.Connection.execution_options.stream_results`
         is set.
    
    
     .. change::
         :tags: bug, engine
         :tickets: 8199
    
         Added :meth:`.FilterResult.yield_per` so that result implementations
         such as :class:`.MappingResult`, :class:`.ScalarResult` and
         :class:`.AsyncResult` have access to this method.
    
    .. changelog::
    

    1.4.39

    :released: June 24, 2022
    
     .. change::
         :tags: bug, orm, regression
         :tickets: 8133
    
         Fixed regression caused by :ticket:`8133` where the pickle format for
         mutable attributes was changed, without a fallback to recognize the old
         format, causing in-place upgrades of SQLAlchemy to no longer be able to
         read pickled data from previous versions. A check plus a fallback for the
         old format is now in place.
    
    .. changelog::
    

    1.4.38

    :released: June 23, 2022
    
     .. change::
         :tags: bug, orm, regression
         :tickets: 8162
    
         Fixed regression caused by :ticket:`8064` where a particular check for
         column correspondence was made too liberal, resulting in incorrect
         rendering for some ORM subqueries such as those using
         :meth:`.PropComparator.has` or :meth:`.PropComparator.any` in conjunction
         with joined-inheritance queries that also use legacy aliasing features.
    
     .. change::
         :tags: bug, engine
         :tickets: 8115
    
         Repaired a deprecation warning class decorator that was preventing key
         objects such as :class:`_engine.Connection` from having a proper
         ``__weakref__`` attribute, causing operations like Python standard library
         ``inspect.getmembers()`` to fail.
    
    
     .. change::
         :tags: bug, sql
         :tickets: 8098
    
         Fixed multiple observed race conditions related to :func:`.lambda_stmt`,
         including an initial &quot;dogpile&quot; issue when a new Python code object is
         initially analyzed among multiple simultaneous threads which created both a
         performance issue as well as some internal corruption of state.
         Additionally repaired observed race condition which could occur when
         &quot;cloning&quot; an expression construct that is also in the process of being
         compiled or otherwise accessed in a different thread due to memoized
         attributes altering the ``__dict__`` while iterated, for Python versions
         prior to 3.10; in particular the lambda SQL construct is sensitive to this
         as it holds onto a single statement object persistently. The iteration has
         been refined to use ``dict.copy()`` with or without an additional iteration
         instead.
    
     .. change::
         :tags: bug, sql
         :tickets: 8084
    
         Enhanced the mechanism of :class:`.Cast` and other &quot;wrapping&quot;
         column constructs to more fully preserve a wrapped :class:`.Label`
         construct, including that the label name will be preserved in the
         ``.c`` collection of a :class:`.Subquery`.  The label was already
         able to render in the SQL correctly on the outside of the construct
         which it was wrapped inside.
    
     .. change::
         :tags: bug, orm, sql
         :tickets: 8091
    
         Fixed an issue where :meth:`_sql.GenerativeSelect.fetch` would not
         be applied when executing a statement using the ORM.
    
     .. change::
         :tags: bug, orm
         :tickets: 8109
    
         Fixed issue where a :func:`_orm.with_loader_criteria` option could not be
         pickled, as is necessary when it is carried along for propagation to lazy
         loaders in conjunction with a caching scheme. Currently, the only form that
         is supported as picklable is to pass the &quot;where criteria&quot; as a fixed
         module-level callable function that produces a SQL expression. An ad-hoc
         &quot;lambda&quot; can&#x27;t be pickled, and a SQL expression object is usually not fully
         picklable directly.
    
    
     .. change::
         :tags: bug, schema
         :tickets: 8100, 8101
    
         Fixed bugs involving the :paramref:`.Table.include_columns` and the
         :paramref:`.Table.resolve_fks` parameters on :class:`.Table`; these
         little-used parameters were apparently not working for columns that refer
         to foreign key constraints.
    
         In the first case, not-included columns that refer to foreign keys would
         still attempt to create a :class:`.ForeignKey` object, producing errors
         when attempting to resolve the columns for the foreign key constraint
         within reflection; foreign key constraints that refer to skipped columns
         are now omitted from the table reflection process in the same way as
         occurs for :class:`.Index` and :class:`.UniqueConstraint` objects with the
         same conditions. No warning is produc
    opened by pyup-bot 0
  • Support linking via foreign indices

    Support linking via foreign indices

    As much as I can tell, sandman2 can not inspect and link tables via foreign indices. Adding this feature will greatly increase efficiency (reduced round trips, etc).

    I believe possible to achieve same by creating views. However, there is a limit - when there are many tables - number of view become exponential.

    As a starting point, supporting 1:1 relationships will be big step forward.

    rest api tbd.

    opened by yairlenga 0
  • docs: Fix a few typos

    docs: Fix a few typos

    There are small typos in:

    • docs/admin.rst
    • tests/test_user_models.py

    Fixes:

    • Should read merely rather than meerly.
    • Should read existing rather than exisitng.
    • Should read associated rather than assoicated.

    Semi-automated pull request generated by https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md

    opened by timgates42 0
  • 'LocalStack' object has no attribute '__ident_func__' error on launch

    'LocalStack' object has no attribute '__ident_func__' error on launch

    After installing sandman2 in a clean environment, I ran it as follows:

    sandman2ctl 'sqlite+pysqlite:///chinook.db'
    

    (using the chinook sample database from here).

    I get the following error:

    Traceback (most recent call last):
      File "/Users/robin/mambaforge/envs/sandman/bin/sandman2ctl", line 5, in <module>
        from sandman2.__main__ import main
      File "/Users/robin/mambaforge/envs/sandman/lib/python3.8/site-packages/sandman2/__init__.py", line 2, in <module>
        from sandman2.app import get_app, db, AutomapModel
      File "/Users/robin/mambaforge/envs/sandman/lib/python3.8/site-packages/sandman2/app.py", line 18, in <module>
        from sandman2.service import Service
      File "/Users/robin/mambaforge/envs/sandman/lib/python3.8/site-packages/sandman2/service.py", line 12, in <module>
        from sandman2.model import db
      File "/Users/robin/mambaforge/envs/sandman/lib/python3.8/site-packages/sandman2/model.py", line 13, in <module>
        db = SQLAlchemy()
      File "/Users/robin/mambaforge/envs/sandman/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 715, in __init__
        self.session = self.create_scoped_session(session_options)
      File "/Users/robin/mambaforge/envs/sandman/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 748, in create_scoped_session
        scopefunc = options.pop('scopefunc', _app_ctx_stack.__ident_func__)
    AttributeError: 'LocalStack' object has no attribute '__ident_func__'
    

    After some Googling, I found that it might be a version issue with the latest version of werkzeug and the pinned version of flask-sqlalchemy (which was 2.4.0). Upgrading to the latest flask-sqlalchemy (2.5.1 currently) seems to fix it.

    Shall I submit a PR to update setup.py to use the latest flask-sqlalchemy, or might be there be more to this that I'm missing?

    opened by robintw 0
  • Is it possible to get access to stored procedures and functions?

    Is it possible to get access to stored procedures and functions?

    Hi, Sandman2 has been working flawlessly, thanks for making this it's been really helping me. However, I wanted to know if there is a way to get access to stored procedures and functions in the SQL server? Maybe you've been working on it... or if you know any other way please reply, I would really appreciate it.

    opened by J14D 0
Owner
Jeff Knupp
Head of Engineering @enigma-io
Jeff Knupp
Restful API framework wrapped around MongoEngine

Flask-MongoRest A Restful API framework wrapped around MongoEngine. Setup from flask import Flask from flask_mongoengine import MongoEngine from flask

Close 525 Jan 1, 2023
RESTful Todolist API

RESTful Todolist API GET todolist/ POST todolist/ {"desc" : "Description of task to do"} DELETE todolist/<int:id> PUT todolist/<int:id> Requirements D

Gabriel Tavares 5 Dec 20, 2021
Python bindings for Podman's RESTful API

podman-py This python package is a library of bindings to use the RESTful API of Podman. It is currently under development and contributors are welcom

Containers 142 Jan 6, 2023
A RESTful whois

whois-rest A RESTful whois. Installation $ pip install poetry $ poetry install $ uvicorn app:app INFO: Started server process [64616] INFO: W

Manabu Niseki 4 Feb 19, 2022
Django app for handling the server headers required for Cross-Origin Resource Sharing (CORS)

django-cors-headers A Django App that adds Cross-Origin Resource Sharing (CORS) headers to responses. This allows in-browser requests to your Django a

Adam Johnson 4.8k Jan 5, 2023
RESTler is the first stateful REST API fuzzing tool for automatically testing cloud services through their REST APIs and finding security and reliability bugs in these services.

RESTler is the first stateful REST API fuzzing tool for automatically testing cloud services through their REST APIs and finding security and reliability bugs in these services.

Microsoft 1.8k Jan 4, 2023
Generate Views, Serializers, and Urls for your Django Rest Framework application

DRF Generators Writing APIs can be boring and repetitive work. Don't write another CRUDdy view in Django Rest Framework. With DRF Generators, one simp

Tobin Brown 332 Dec 17, 2022
REST API framework designed for human beings

Eve Eve is an open source Python REST API framework designed for human beings. It allows to effortlessly build and deploy highly customizable, fully f

eve 6.6k Jan 4, 2023
The Web API toolkit. đź› 

?? The Web API toolkit. ?? Community: https://discuss.apistar.org ?? ?? ?? ?? ?? Documentation: https://docs.apistar.com ?? Requirements: Python 3.6+

Encode 5.6k Dec 27, 2022
Kong API Manager with Prometheus And Splunk

API Manager Stack Run Kong Server + Konga + Prometheus + Grafana + API & DDBB + Splunk Clone the proyect and run docker-compose up

Santiago Fernandez 82 Nov 26, 2022
Django REST API with React BoilerPlate

This is a setup of Authentication and Registration Integrated with React.js inside the Django Templates for web apps

Faisal Nazik 91 Dec 30, 2022
Estudo e desenvolvimento de uma API REST

Estudo e desenvolvimento de uma API REST ??‍?? Tecnologias Esse projeto utilizará as seguintes tecnologias: Git Python Flask DBeaver Vscode SQLite ??

Deusimar 7 May 30, 2022
Example Starlette REST API application

The idea of this project is to show how Starlette, Marshmallow, and SQLAlchemy can be combined to create a RESTful HTTP API application that is modular, lightweight, and capable of dealing with many simultaneous requests.

Robert Wikman 0 Jan 7, 2022
JSON:API support for Django REST framework

JSON:API and Django REST framework Overview JSON:API support for Django REST framework Documentation: https://django-rest-framework-json-api.readthedo

null 1k Dec 27, 2022
Django-rest-auth provides a set of REST API endpoints for Authentication and Registration

This app makes it extremely easy to build Django powered SPA's (Single Page App) or Mobile apps exposing all registration and authentication related functionality as CBV's (Class Base View) and REST (JSON)

Tivix 2.4k Dec 29, 2022
One package to access multiple different data sources through their respective API platforms.

BESTLab Platform One package to access multiple different data sources through their respective API platforms. Usage HOBO Platform See hobo_example.py

Wei 1 Nov 16, 2021
simple api build with django rest framework

Django Rest API django-rest-framework Employees management simple API in this project wrote test suites for endpoints wrote simple doc string for clas

OMAR.A 1 Mar 31, 2022
Simple Crud Api With Django Rest Framework

SIMPLE CRUD API WITH DJANGO REST FRAMEWORK Django REST framework is a powerful and flexible toolkit for building Web APIs. Requirements Python 3.6 Dja

kibet hillary 1 May 3, 2022