Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding script name to 'global_config' during application setup #3735

Merged
merged 8 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add changelog
  • Loading branch information
mmerickel committed Jan 28, 2024
commit fd42b0c8d08f69f88e3728b1c1ff3f50071f4b30
11 changes: 11 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ Features

- Coverage reports in tests based on Python 3.11 instead of Python 3.8.

- All scripts now pass a new option ``__script__`` when loading the WSGI app.
For example, ``pserve`` sets ``__script__ == 'pserve'``. This works for
``pserve``, ``pshell``, ``prequest``, ``proutes``, ``ptweens``, ``pviews``,
as well as when using ``pyramid.paster.bootstrap`` directly.

When using ``plaster-pastedeploy`` to load an INI file, this option will
manifest as a new value passed into the ``global_conf`` arg of your
application factory, where you can use it as part of initializing your app.

See https://github.com/Pylons/pyramid/pull/3735

Bug Fixes
---------

Expand Down
1 change: 1 addition & 0 deletions tests/test_paster.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def test_it_request_with_registry(self):
result = self._callFUT('/foo/bar/myapp.ini', request)
self.assertEqual(result['app'], self.app)
self.assertEqual(result['root'], self.root)
self.assertEqual(self.get_app.kw['options']['__script__'], 'bootstrap')
self.assertTrue('closer' in result)


Expand Down