Global base classes for Pyramid SQLAlchemy applications.

Overview

pyramid_basemodel

pyramid_basemodel is a thin, low level package that provides an SQLAlchemy declarative Base and a thread local scoped Session that can be used by different packages whilst only needing to be bound to a db engine once.

Usage

You can use these as base classes for declarative model definitions, e.g.::

from pyramid_basemodel import Base, BaseMixin, Session, save

class MyModel(Base, BaseMixin):
    """Example model class."""
    
    @classmethod
    def do_foo(cls):
        instance = Session.query(cls).first()
        save(instance)

You can then bind these to the sqlalchemy.url in your paster .ini config by importing your model and this package, e.g.:

# for example in yourapp.__init__.py
import mymodel

def main(global_config, **settings):
    config = Configurator(settings=settings)
    config.include('pyramid_basemodel')
    config.include('pyramid_tm')
    return config.make_wsgi_app()

Or if this is all too much voodoo, you can just use the bind_engine function::

from pyramid_basemodel import bind_engine
from mypackage import mymodel

# assuming `engine` is a bound SQLAlchemy engine.
bind_engine(engine)

Note that the Session is designed to be used in tandem with pyramid_tm. If you don't include pyramid_tm, you'll need to take care of committing transactions yourself.

Tests

To run the tests use:

py.test -v --cov pyramid_basemodel tests/
Comments
  • build(deps): bump sqlalchemy from 1.4.0 to 1.4.1

    build(deps): bump sqlalchemy from 1.4.0 to 1.4.1

    Bumps sqlalchemy from 1.4.0 to 1.4.1.

    Release notes

    Sourced from sqlalchemy's releases.

    1.4.1

    Released: March 17, 2021

    orm

    • [orm] [bug] [regression] Fixed regression where producing a Core expression construct such as _sql.select() using ORM entities would eagerly configure the mappers, in an effort to maintain compatibility with the _orm.Query object which necessarily does this to support many backref-related legacy cases. However, core _sql.select() constructs are also used in mapper configurations and such, and to that degree this eager configuration is more of an inconvenience, so eager configure has been disabled for the _sql.select() and other Core constructs in the absence of ORM loading types of functions such as _orm.Load.

      The change maintains the behavior of _orm.Query so that backwards compatibility is maintained. However, when using a _sql.select() in conjunction with ORM entities, a "backref" that isn't explicitly placed on one of the classes until mapper configure time won't be available unless _orm.configure_mappers() or the newer _orm.registry.configure() has been called elsewhere. Prefer using _orm.relationship.back_populates for more explicit relationship configuration which does not have the eager configure requirement.

      References: #6066

    • [orm] [bug] [regression] Fixed a critical regression in the relationship lazy loader where the SQL criteria used to fetch a related many-to-one object could go stale in relation to other memoized structures within the loader if the mapper had configuration changes, such as can occur when mappers are late configured or configured on demand, producing a comparison to None and returning no object. Huge thanks to Alan Hamlett for their help tracking this down late into the night.

      References: #6055

    • [orm] [bug] [regression] Fixed regression where the _orm.Query.exists() method would fail to create an expression if the entity list of the _orm.Query were an arbitrary SQL column expression.

      References: #6076

    • [orm] [bug] [regression] Fixed regression where calling upon _orm.Query.count() in conjunction with a loader option such as _orm.joinedload() would fail to ignore the loader option. This is a behavior that has always been very specific to the _orm.Query.count() method; an error is normally raised if a given _orm.Query has options that don't apply to what it is returning.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 9
  • pyramid_basemodel is incompatible with zope.sqlalchemy 1.2

    pyramid_basemodel is incompatible with zope.sqlalchemy 1.2

    https://github.com/zopefoundation/zope.sqlalchemy/blob/master/CHANGES.rst

    That's due to

    To make things clearer we renamed the ZopeTransactionExtension class to ZopeTransactionEvents. Existing code using the 'register' version stays compatible.
    
    opened by fizyk 7
  • build(deps): bump fizyk/actions-reuse from 1.5.2 to 1.6.0

    build(deps): bump fizyk/actions-reuse from 1.5.2 to 1.6.0

    Bumps fizyk/actions-reuse from 1.5.2 to 1.6.0.

    Changelog

    Sourced from fizyk/actions-reuse's changelog.

    1.6.0 (2022-11-29)

    Features

    • Add automerge-shared shared workflow to re-usable workflows. ([#76](https://github.com/fizyk/actions-reuse/issues/76) <https://https://github.com/fizyk/actions-reuse/issues/76>_)

    Misc

    • [#74](https://github.com/fizyk/actions-reuse/issues/74) <https://https://github.com/fizyk/actions-reuse/issues/74>, [#75](https://github.com/fizyk/actions-reuse/issues/75) <https://https://github.com/fizyk/actions-reuse/issues/75>
    Commits
    • 4538c16 Bump to 1.6.0
    • a5caefe typo
    • 1d59c03 Merge pull request #76 from fizyk/automerge-shared
    • 2932414 Add automerge shared workflow
    • d501796 Bump ridedott/merge-me-action from 2.10.32 to 2.10.34
    • 48a9a88 Bump ridedott/merge-me-action from 2.10.32 to 2.10.34
    • ca91a01 Merge pull request #75 from fizyk/action-token
    • ef5470f Use github action token for merge me
    • 1a205ef Merge pull request #74 from fizyk/automerge
    • e6e6923 Change automerge conditions
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 4
  • Defer binding with `config.action`

    Defer binding with `config.action`

    I think it would be more in line with Pyramid patterns for extensible applications if the engine was bound in a deferred action. That would allow multiple, independent modules that depend on basemodel to call config.include('pyramid_basemodel') and just work. Right now, one has to be sure that all modules that subclass the Base are imported before pyramid_basemodel is included.

    opened by tilgovi 4
  • build(deps): bump fizyk/actions-reuse from 1.5.2 to 1.6.1

    build(deps): bump fizyk/actions-reuse from 1.5.2 to 1.6.1

    Bumps fizyk/actions-reuse from 1.5.2 to 1.6.1.

    Changelog

    Sourced from fizyk/actions-reuse's changelog.

    1.6.1 (2022-11-29)

    Bugfixes

    • Add your info here ([#77](https://github.com/fizyk/actions-reuse/issues/77) <https://https://github.com/fizyk/actions-reuse/issues/77>_)

    1.6.0 (2022-11-29)

    Features

    • Add automerge-shared shared workflow to re-usable workflows. ([#76](https://github.com/fizyk/actions-reuse/issues/76) <https://https://github.com/fizyk/actions-reuse/issues/76>_)

    Misc

    • [#74](https://github.com/fizyk/actions-reuse/issues/74) <https://https://github.com/fizyk/actions-reuse/issues/74>, [#75](https://github.com/fizyk/actions-reuse/issues/75) <https://https://github.com/fizyk/actions-reuse/issues/75>
    Commits
    • 666bd8c Bump to 1.6.1
    • 99b79d7 Merge pull request #77 from fizyk/secrets
    • 117011b Convert automerge-shared inputs into secrets
    • 3393f0d Auto-reference automerge workflow
    • 4538c16 Bump to 1.6.0
    • a5caefe typo
    • 1d59c03 Merge pull request #76 from fizyk/automerge-shared
    • 2932414 Add automerge shared workflow
    • d501796 Bump ridedott/merge-me-action from 2.10.32 to 2.10.34
    • 48a9a88 Bump ridedott/merge-me-action from 2.10.32 to 2.10.34
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 3
  • build(deps): bump ridedott/merge-me-action from 2.10.31 to 2.10.32

    build(deps): bump ridedott/merge-me-action from 2.10.31 to 2.10.32

    Bumps ridedott/merge-me-action from 2.10.31 to 2.10.32.

    Release notes

    Sourced from ridedott/merge-me-action's releases.

    v2.10.32

    2.10.32 (2022-11-16)

    Chores

    • deps-dev: bump @​commitlint/cli from 17.1.2 to 17.2.0 (bb85bfa)
    • deps-dev: bump @​commitlint/config-conventional (968ce11)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.44 to 2.20.45 (5ae8508)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.45 to 2.20.47 (9ca7f63)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.47 to 2.20.49 (2185912)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.49 to 2.20.50 (f618293)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.50 to 2.20.51 (464c3f5)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.51 to 2.20.52 (8f971f5)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.52 to 2.20.54 (2b66c9f)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.54 to 2.20.55 (621ecb5)
    • deps-dev: bump cspell from 6.12.0 to 6.13.1 (0fd46d8)
    • deps-dev: bump cspell from 6.13.1 to 6.13.3 (1c174f6)
    • deps-dev: bump cspell from 6.13.3 to 6.14.1 (8d04bc9)
    • deps-dev: bump cspell from 6.14.1 to 6.14.2 (da65d03)
    • deps-dev: bump husky from 8.0.1 to 8.0.2 (dce1c5a)
    • deps: bump ridedott/release-me-action from 3.6.61 to 3.6.63 (ae7bd1a)
    Changelog

    Sourced from ridedott/merge-me-action's changelog.

    2.10.32 (2022-11-16)

    Chores

    • deps-dev: bump @​commitlint/cli from 17.1.2 to 17.2.0 (bb85bfa)
    • deps-dev: bump @​commitlint/config-conventional (968ce11)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.44 to 2.20.45 (5ae8508)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.45 to 2.20.47 (9ca7f63)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.47 to 2.20.49 (2185912)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.49 to 2.20.50 (f618293)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.50 to 2.20.51 (464c3f5)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.51 to 2.20.52 (8f971f5)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.52 to 2.20.54 (2b66c9f)
    • deps-dev: bump @​ridedott/eslint-config from 2.20.54 to 2.20.55 (621ecb5)
    • deps-dev: bump cspell from 6.12.0 to 6.13.1 (0fd46d8)
    • deps-dev: bump cspell from 6.13.1 to 6.13.3 (1c174f6)
    • deps-dev: bump cspell from 6.13.3 to 6.14.1 (8d04bc9)
    • deps-dev: bump cspell from 6.14.1 to 6.14.2 (da65d03)
    • deps-dev: bump husky from 8.0.1 to 8.0.2 (dce1c5a)
    • deps: bump ridedott/release-me-action from 3.6.61 to 3.6.63 (ae7bd1a)
    Commits
    • ae53ddc chore(release): v2.10.32
    • ae7bd1a chore(deps): bump ridedott/release-me-action from 3.6.61 to 3.6.63
    • 621ecb5 chore(deps-dev): bump @​ridedott/eslint-config from 2.20.54 to 2.20.55
    • da65d03 chore(deps-dev): bump cspell from 6.14.1 to 6.14.2
    • 2b66c9f chore(deps-dev): bump @​ridedott/eslint-config from 2.20.52 to 2.20.54
    • dce1c5a chore(deps-dev): bump husky from 8.0.1 to 8.0.2
    • 8d04bc9 chore(deps-dev): bump cspell from 6.13.3 to 6.14.1
    • 8f971f5 chore(deps-dev): bump @​ridedott/eslint-config from 2.20.51 to 2.20.52
    • 968ce11 chore(deps-dev): bump @​commitlint/config-conventional
    • bb85bfa chore(deps-dev): bump @​commitlint/cli from 17.1.2 to 17.2.0
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 3
  • build(deps): bump zope-interface from 5.1.0 to 5.2.0

    build(deps): bump zope-interface from 5.1.0 to 5.2.0

    Bumps zope-interface from 5.1.0 to 5.2.0.

    Changelog

    Sourced from zope-interface's changelog.

    5.2.0 (2020-11-05)

    • Add documentation section Persistency and Equality (#218).
    • Create arm64 wheels.
    • Add support for Python 3.9.

    5.1.2 (2020-10-01)

    • Make sure to call each invariant only once when validating invariants. Previously, invariants could be called multiple times because when an invariant is defined in an interface, it's found by in all interfaces inheriting from that interface. See pull request 215.

    5.1.1 (2020-09-30)

    • Fix the method definitions of IAdapterRegistry.subscribe, subscriptions and subscribers. Previously, they all were defined to accept a name keyword argument, but subscribers have no names and the implementation of that interface did not accept that argument. See issue 208.

    • Fix a potential reference leak in the C optimizations. Previously, applications that dynamically created unique Specification objects (e.g., used @implementer on dynamic classes) could notice a growth of small objects over time leading to increased garbage collection times. See issue 216.

      This leak could prevent interfaces used as the bases of other interfaces from being garbage collected. Those interfaces will now be collected.

      One way in which this would manifest was that weakref.ref objects (and things built upon them, like Weak[Key|Value]Dictionary) would continue to have access to the original object even if there were no other visible references to Python and the original object should have been collected. This could be especially problematic for the WeakKeyDictionary when combined with dynamic or local (created in the scope of a function) interfaces, since interfaces are hashed based just on their name and module name. See the linked issue for an example of a resulting KeyError.

      Note that such potential errors are not new, they are just once again a possibility.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Note: This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

    You can always request more updates by clicking Bump now in your Dependabot dashboard.

    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Automerge options (never/patch/minor, and dev/runtime dependencies)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    dependencies 
    opened by dependabot-preview[bot] 3
  • Installing 0.3.2 on windows produces an error

    Installing 0.3.2 on windows produces an error

    Complete output from command c:\Users\drozdyuka\Projects\LPSS\env-1092\Scrip
    

    ts\python.exe -c "import setuptools, tokenize;file='c:\users\drozdy~1\app data\local\temp\pip-build-esnblr\pyramid-basemodel\setup.py';exec(compile(g etattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record c:\users\drozdy~1\appdata\local\temp\pip-mojzdh-reco rd\install-record.txt --single-version-externally-managed --compile --install-he aders c:\Users\drozdyuka\Projects\LPSS\env-1092\include\site\python2.7\pyramid-b asemodel: for pastedeploy==1.5.2 running installploy 1.5.2 running buildeploy-1.5.2-py2.7.egg running build_py already the active version in easy-install.pth creating build creating build\libka\projects\lpss\env-1092\lib\site-packages\pastedeploy-1. creating build\lib\pyramid_basemodel copying src\pyramid_basemodel\blob.py -> build\lib\pyramid_basemodel copying src\pyramid_basemodel\container.py -> build\lib\pyramid_basemodel copying src\pyramid_basemodel\interfaces.py -> build\lib\pyramid_basemodel copying src\pyramid_basemodel\mixin.py -> build\lib\pyramid_basemodel copying src\pyramid_basemodel\root.py -> build\lib\pyramid_basemodel copying src\pyramid_basemodel\slug.py -> build\lib\pyramid_basemodelationstr copying src\pyramid_basemodel\tree.py -> build\lib\pyramid_basemodel copying src\pyramid_basemodel\util.py -> build\lib\pyramid_basemodel copying src\pyramid_basemodel__init__.py -> build\lib\pyramid_basemodel running egg_info1.0-py2.7.egg writing requirements to src\pyramid_basemodel.egg-info\requires.txt writing src\pyramid_basemodel.egg-info\PKG-INFO writing top-level names to src\pyramid_basemodel.egg-info\top_level.txt1.0-p writing dependency_links to src\pyramid_basemodel.egg-info\dependency_links. txtrching for zope.deprecation==4.1.2 warning: manifest_maker: standard file '-c' not found essing zope.deprecation-4.1.2-py2.7.egg reading manifest file 'src\pyramid_basemodel.egg-info\SOURCES.txt'th Traceback (most recent call last): File "", line 1, in -1092\lib\site-packages\zope.deprecati File "c:\users\drozdy~1\appdata\local\temp\pip-build-esnblr\pyramid-basemo del\setup.py", line 59, in install_requires=requirements File "c:\Python27\Lib\distutils\core.py", line 151, in setup dist.run_commands()active version in easy-install.pth File "c:\Python27\Lib\distutils\dist.py", line 953, in run_commands self.run_command(cmd)ects\lpss\env-1092\lib\site-packages\webob-1.4.1-py File "c:\Python27\Lib\distutils\dist.py", line 972, in run_command cmd_obj.run()==0.2.5 File "c:\Users\drozdyuka\Projects\LPSS\env-1092\lib\site-packages\setuptoo ls\command\install.py", line 61, in runh file return orig.install.run(self) File "c:\Python27\Lib\distutils\command\install.py", line 563, in run self.run_command('build') File "c:\Python27\Lib\distutils\cmd.py", line 326, in run_command self.distribution.run_command(command) File "c:\Python27\Lib\distutils\dist.py", line 972, in run_command cmd_obj.run()uka\projects\lpss\env-1092\lib\site-packages File "c:\Python27\Lib\distutils\command\build.py", line 127, in run self.run_command(cmd_name) File "c:\Python27\Lib\distutils\cmd.py", line 326, in run_commandSSAGES\C self.distribution.run_command(command) File "c:\Python27\Lib\distutils\dist.py", line 972, in run_commandork.po' cmd_obj.run()ocale\en\LC_MESSAGES\CommonFramework.mo' File "c:\Users\drozdyuka\Projects\LPSS\env-1092\lib\site-packages\setuptoo ls\command\build_py.py", line 47, in run self.build_package_data()k/locale\fr\LC_MESSAGES\CommonFramework.po' File "c:\Users\drozdyuka\Projects\LPSS\env-1092\lib\site-packages\setuptoo ls\command\build_py.py", line 103, in build_package_data for package, src_dir, build_dir, filenames in self.data_files:e\en\LC_ File "c:\Users\drozdyuka\Projects\LPSS\env-1092\lib\site-packages\setuptoo ls\command\build_py.py", line 59, in __getattr__ale\en\LC_MESSAGES\PersonalLe self.data_files = files = self._get_data_files()\en\LC_MESSAGES\Perso File "c:\Users\drozdyuka\Projects\LPSS\env-1092\lib\site-packages\setuptoo ls\command\build_py.py", line 72, in _get_data_filesrningassistant/locale\fr\L self.analyze_manifest()istant.po' File "c:\Users\drozdyuka\Projects\LPSS\env-1092\lib\site-packages\setuptoo ls\command\build_py.py", line 123, in analyze_manifestle\fr\LC_MESSAGES\Perso self.run_command('egg_info') File "c:\Python27\Lib\distutils\cmd.py", line 326, in run_command self.distribution.run_command(command) File "c:\Python27\Lib\distutils\dist.py", line 972, in run_command cmd_obj.run()ase File "c:\Users\drozdyuka\Projects\LPSS\env-1092\lib\site-packages\setuptoo ls\command\egg_info.py", line 180, in run self.find_sources() File "c:\Users\drozdyuka\Projects\LPSS\env-1092\lib\site-packages\setuptoo ls\command\egg_info.py", line 207, in find_sources mm.run()ATABASE ===== File "c:\Users\drozdyuka\Projects\LPSS\env-1092\lib\site-packages\setuptoo ls\command\egg_info.py", line 291, in run self.add_defaults() File "c:\Users\drozdyuka\Projects\LPSS\env-1092\lib\site-packages\setuptoo ls\command\egg_info.py", line 327, in add_defaults self.read_manifest()ed, ignoring the state of the harvester. File "c:\Users\drozdyuka\Projects\LPSS\env-1092\lib\site-packages\setuptoo ls\command\sdist.py", line 196, in read_manifest self.filelist.append(line) File "c:\Users\drozdyuka\Projects\LPSS\env-1092\lib\site-packages\setuptoo ls\command\egg_info.py", line 232, in append path = convert_path(item) File "c:\Python27\Lib\distutils\util.py", line 124, in convert_path raise ValueError, "path '%s' cannot be absolute" % pathnameFile|✚ 1…402] ValueError: path '/Users/thruflo/Development/pyramid/basemodel/CHANGES.md' c annot be absolute

    ---------------
    
    opened by drozzy 3
  • Defer engine binding using a config action

    Defer engine binding using a config action

    This means that it's no longer necessary to ensure that all models are imported before including pyramid_basemodel. Whenever the next commit of the Configurator happens all defined models will be bound.

    Close #6

    opened by tilgovi 3
  • build(deps): bump python-slugify from 6.1.2 to 7.0.0

    build(deps): bump python-slugify from 6.1.2 to 7.0.0

    Bumps python-slugify from 6.1.2 to 7.0.0.

    Changelog

    Sourced from python-slugify's changelog.

    7.0.0

    • Drop python 3.6, add python 3.11 (@​hugovk - thx)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 2
  • build(deps): bump zope-interface from 5.5.0 to 5.5.2

    build(deps): bump zope-interface from 5.5.0 to 5.5.2

    Bumps zope-interface from 5.5.0 to 5.5.2.

    Changelog

    Sourced from zope-interface's changelog.

    5.5.2 (2022-11-17)

    • Add support for building arm64 wheels on macOS.

    5.5.1 (2022-11-03)

    • Add support for final Python 3.11 release.
    Commits
    • 946e037 - prepare release 5.5.2
    • eb1af6e - Add support for building arm64 wheels on macOS.
    • 50773ad - vb [ci skip]
    • d672d91 - prepare release 5.5.1
    • 391db8a - update to the latest meta/config and declare Python 3.11 support
    • d65b997 Back to development: 5.5.1
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 2
  • build(deps-dev): bump mock from 4.0.3 to 5.0.0

    build(deps-dev): bump mock from 4.0.3 to 5.0.0

    Bumps mock from 4.0.3 to 5.0.0.

    Changelog

    Sourced from mock's changelog.

    5.0.0

    • gh-98624: Add a mutex to unittest.mock.NonCallableMock to protect concurrent access to mock attributes.

    • bpo-43478: Mocks can no longer be used as the specs for other Mocks. As a result, an already-mocked object cannot have an attribute mocked using autospec=True or be the subject of a create_autospec(...) call. This can uncover bugs in tests since these Mock-derived Mocks will always pass certain tests (e.g. isinstance) and builtin assert functions (e.g. assert_called_once_with) will unconditionally pass.

    • bpo-45156: Fixes infinite loop on :func:unittest.mock.seal of mocks created by :func:~unittest.create_autospec.

    • bpo-41403: Make :meth:mock.patch raise a :exc:TypeError with a relevant error message on invalid arg. Previously it allowed a cryptic :exc:AttributeError to escape.

    • gh-91803: Fix an error when using a method of objects mocked with :func:unittest.mock.create_autospec after it was sealed with :func:unittest.mock.seal function.

    • bpo-41877: AttributeError for suspected misspellings of assertions on mocks are now pointing out that the cause are misspelled assertions and also what to do if the misspelling is actually an intended attribute name. The unittest.mock document is also updated to reflect the current set of recognised misspellings.

    • bpo-43478: Mocks can no longer be provided as the specs for other Mocks. As a result, an already-mocked object cannot be passed to mock.Mock(). This can uncover bugs in tests since these Mock-derived Mocks will always pass certain tests (e.g. isinstance) and builtin assert functions (e.g. assert_called_once_with) will unconditionally pass.

    • bpo-45010: Remove support of special method __div__ in :mod:unittest.mock. It is not used in Python 3.

    • gh-84753: :func:inspect.iscoroutinefunction now properly returns True when an instance of :class:unittest.mock.AsyncMock is passed to it. This makes it consistent with behavior of :func:asyncio.iscoroutinefunction. Patch by Mehdi ABAAKOUK.

    • bpo-46852: Remove the undocumented private float.__set_format__() method, previously known as float.__setformat__() in Python 3.7. Its docstring said: "You probably don't want to use this function. It exists mainly to be used in Python's test suite." Patch by Victor Stinner.

    • gh-98086: Make sure patch.dict() can be applied on async functions.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 1
  • A few additions

    A few additions

    Hey @thruflo!

    At NiteoWeb we've been using your package for over a year now. During this time we've grown a few of our own utility additions on top of pyramid_basemodel. While some are quite specific to our use-cases, I believe some could be useful for the general public. I'll go through two of them below and ask for your opinion if this is something that could go into pyramid_basemodel, so I start submitting Pull Requests.

    1. "get by" mixins Basically all our classes inherit from these. We have GetByIDMixin, GetByNameMixin, GetByTitleMixin and GetByEmailMixin. These mixins give you the ability to then do MyModel.by_id(1), MyModel.by_name('foo'), MyModel.by_title(u'Foö) and MyModel.by_email('[email protected]), respectively. They don't add any fields, just getter methods. Our code has been cleaned up considerably since we started using these.

      Example implementation:

      # Marker object for checking if parameter was passed
      sentinel = object()
      
      class GetByIdMixin(object):
          """A mixin for adding by_id method to models."""
      
          @classmethod
          def by_id(cls, id, default=sentinel):
              """Get a Model object by id."""
              try:
                  id = int(id)
                  return cls.query.filter_by(id=id).first()
              except (ValueError, TypeError) as exc:
                  if default == sentinel:
                      raise exc
                  else:
                      return default
      
    2. repr mixin Set a repr method that returns more meaningful representation for sqlalchemy models. These representations are especially useful in Sentry error reports and live debugging sessions. The fields that are displayed in representation are limited to the fields from mixins above

      Example: MyModel that has fields id, name and title, but not email, would have such a representation: <MyModel:1 (name=foo, title=Foö)>.

    opened by zupo 2
A curated list of awesome tools for SQLAlchemy

Awesome SQLAlchemy A curated list of awesome extra libraries and resources for SQLAlchemy. Inspired by awesome-python. (See also other awesome lists!)

Hong Minhee (洪 民憙) 2.5k Dec 31, 2022
Adds SQLAlchemy support to Flask

Flask-SQLAlchemy Flask-SQLAlchemy is an extension for Flask that adds support for SQLAlchemy to your application. It aims to simplify using SQLAlchemy

The Pallets Projects 3.9k Jan 9, 2023
SQLAlchemy support for aiohttp.

aiohttp-sqlalchemy SQLAlchemy 1.4 / 2.0 support for AIOHTTP. The library provides the next features: initializing asynchronous sessions through a midd

Ruslan Ilyasovich Gilfanov 5 Dec 11, 2022
Sqlalchemy seeder that supports nested relationships.

sqlalchemyseed Sqlalchemy seeder that supports nested relationships. Supported file types json yaml csv Installation Default installation pip install

Jedy Matt Tabasco 10 Aug 13, 2022
Kotti is a high-level, Pythonic web application framework based on Pyramid and SQLAlchemy. It includes an extensible Content Management System called the Kotti CMS.

Kotti Kotti is a high-level, Pythonic web application framework based on Pyramid and SQLAlchemy. It includes an extensible Content Management System c

Kotti 394 Jan 7, 2023
PEP-484 typing stubs for SQLAlchemy 1.4 and SQLAlchemy 2.0

SQLAlchemy 2 Stubs These are PEP-484 typing stubs for SQLAlchemy 1.4 and 2.0. They are released concurrently along with a Mypy extension which is desi

SQLAlchemy 139 Dec 30, 2022
Sqlalchemy-databricks - SQLAlchemy dialect for Databricks

sqlalchemy-databricks A SQLAlchemy Dialect for Databricks using the officially s

Flynn 19 Nov 3, 2022
A program that takes Python classes and turns them into CSS classes.

PyCSS What is it? PyCSS is a micro-framework to speed up the process of writing bulk CSS classes. How does it do it? With Python!!! First download the

T.R Batt 0 Aug 3, 2021
Python Bot that attends classes, answers polls, and then again waits for classes to start.

LPU_myclass_Bot LPU_myclass_Bot is a Python bot that waits for class to start, attends class, answers polls, and then again waits for another class to

Saurabh Kumar 6 Apr 7, 2022
An image base contains 490 images for learning (400 cars and 90 boats), and another 21 images for testingAn image base contains 490 images for learning (400 cars and 90 boats), and another 21 images for testing

SVM Données Une base d’images contient 490 images pour l’apprentissage (400 voitures et 90 bateaux), et encore 21 images pour fait des tests. Prétrait

Achraf Rahouti 3 Nov 30, 2021
pytest_pyramid provides basic fixtures for testing pyramid applications with pytest test suite

pytest_pyramid pytest_pyramid provides basic fixtures for testing pyramid applications with pytest test suite. By default, pytest_pyramid will create

Grzegorz Śliwiński 12 Dec 4, 2022
SQLAlchemy database migrations for Flask applications using Alembic

Flask-Migrate Flask-Migrate is an extension that handles SQLAlchemy database migrations for Flask applications using Alembic. The database operations

Miguel Grinberg 2.2k Dec 28, 2022
A friendly library for parsing HTTP request arguments, with built-in support for popular web frameworks, including Flask, Django, Bottle, Tornado, Pyramid, webapp2, Falcon, and aiohttp.

webargs Homepage: https://webargs.readthedocs.io/ webargs is a Python library for parsing and validating HTTP request objects, with built-in support f

marshmallow-code 1.3k Jan 1, 2023
Pyramid - A Python web framework

Pyramid Pyramid is a small, fast, down-to-earth, open source Python web framework. It makes real-world web application development and deployment more

Pylons Project 3.7k Dec 30, 2022
JWT authentication for Pyramid

JWT authentication for Pyramid This package implements an authentication policy for Pyramid that using JSON Web Tokens. This standard (RFC 7519) is of

Wichert Akkerman 73 Dec 3, 2021
Toolkit for Pyramid, a Pylons Project, to add Authentication and Authorization using Velruse (OAuth) and/or a local database, CSRF, ReCaptcha, Sessions, Flash messages and I18N

Apex Authentication, Form Library, I18N/L10N, Flash Message Template (not associated with Pyramid, a Pylons project) Uses alchemy Authentication Authe

null 95 Nov 28, 2022
Pyramid debug toolbar

pyramid_debugtoolbar pyramid_debugtoolbar provides a debug toolbar useful while you're developing your Pyramid application. Note that pyramid_debugtoo

Pylons Project 95 Sep 17, 2022
A package for sending email from your Pyramid application

pyramid_mailer pyramid_mailer is a package for sending email from your Pyramid application. It is compatible with Python 2.7, 3.4, 3.5, 3.6, and 3.7 a

Pylons Project 50 Sep 17, 2022
Pytorch implementation of PSEnet with Pyramid Attention Network as feature extractor

Scene Text-Spotting based on PSEnet+CRNN Pytorch implementation of an end to end Text-Spotter with a PSEnet text detector and CRNN text recognizer. We

azhar shaikh 62 Oct 10, 2022
Repository for Scene Text Detection with Supervised Pyramid Context Network with tensorflow.

Scene-Text-Detection-with-SPCNET Unofficial repository for [Scene Text Detection with Supervised Pyramid Context Network][https://arxiv.org/abs/1811.0

null 121 Oct 15, 2021