Skip to content

limit setuptools version#149

Open
mishaschwartz wants to merge 1 commit into
bird-house:masterfrom
mishaschwartz:limit-setuptools
Open

limit setuptools version#149
mishaschwartz wants to merge 1 commit into
bird-house:masterfrom
mishaschwartz:limit-setuptools

Conversation

@mishaschwartz
Copy link
Copy Markdown

Pin setuptools<82 to ensure that pkg_resources is installed (required until we upgrade to pyramid>2).

I noticed this issue when trying to test this library and I had to rebuild the python environment from scratch. The newest version of setuptools was installed which no longer contains pkg_resources. Pyramid version 1 uses pkg_resources for asset resolution (finding static files) and so the whole app breaks if that library doesn't exist.

@fmigneault
Copy link
Copy Markdown
Member

That quick fix works for me.

Wondering if we might as well unpin pyramid>=2,<3 and apply the changes right away?

I think the main items affected by v2 are the security/authentication class refactor like:

if asbool(settings.get('twitcher.basicauth', True)):
authn_policy = BasicAuthAuthenticationPolicy(check=check_credentials, debug=True)
authz_policy = ACLAuthorizationPolicy()
config.set_authorization_policy(authz_policy)
config.set_authentication_policy(authn_policy)
config.set_root_factory(lambda request: Root())

Given: https://docs.pylonsproject.org/projects/pyramid/en/latest/whatsnew-2.0.html#upgrading-auth-20

What's weird though is that Magpie does handle pyramid>2 although it employs the same pyramid.authentication module: https://github.com/Ouranosinc/Magpie/blob/9a35799db2365b06d1a741ea26cb8e6e9d6a5cdd/magpie/security.py#L13-L16

So they are possibly deprecated, but still functional? To be tested...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants