[Django] #29464: collectstatic verbosity

18 views
Skip to first unread message

Django

unread,
Jun 1, 2018, 10:18:01 AM6/1/18
to django-...@googlegroups.com
#29464: collectstatic verbosity
-------------------------------------+-------------------------------------
Reporter: David | Owner: nobody
Szotten |
Type: | Status: new
Uncategorized |
Component: Core | Version: 2.0
(Management commands) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
{{{collectstatic}}} logs {{{"Post-processed foo as bar}}} with level 1,
but this is a lot of output and may be more suitable to
level 2, like {{{"Copying foo"}}}

https://github.com/django/django/blob/e1ebd22558342bb0088a3da3571863a20413fa2a/django/contrib/staticfiles/management/commands/collectstatic.py#L136

--
Ticket URL: <https://code.djangoproject.com/ticket/29464>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 1, 2018, 11:09:15 AM6/1/18
to django-...@googlegroups.com
#29464: Move collectstatic post processing messages to verbosity 2
-------------------------------------+-------------------------------------
Reporter: David Szotten | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.staticfiles | Version: 2.1
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* type: Uncategorized => Cleanup/optimization
* version: 2.0 => 2.1
* component: Core (Management commands) => contrib.staticfiles


Comment:

(Follow up to #28973.)

--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:1>

Django

unread,
Jun 4, 2018, 10:03:43 AM6/4/18
to django-...@googlegroups.com
#29464: Move collectstatic post processing messages to verbosity 2
-------------------------------------+-------------------------------------
Reporter: David Szotten | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.staticfiles | Version: 2.1
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0

-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* easy: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:2>

Django

unread,
Jun 7, 2018, 7:19:02 PM6/7/18
to django-...@googlegroups.com
#29464: Move collectstatic post processing messages to verbosity 2
--------------------------------------+------------------------------------

Reporter: David Szotten | Owner: nobody
Type: Cleanup/optimization | Status: new

Component: contrib.staticfiles | Version: 2.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:3>

Django

unread,
Jun 8, 2018, 1:03:31 AM6/8/18
to django-...@googlegroups.com
#29464: Move collectstatic post processing messages to verbosity 2
-------------------------------------+-------------------------------------
Reporter: David Szotten | Owner: arthurspa
Type: | Status: assigned
Cleanup/optimization |

Component: contrib.staticfiles | Version: 2.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by arthurspa):

* owner: nobody => arthurspa
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:4>

Django

unread,
Jun 8, 2018, 3:16:34 AM6/8/18
to django-...@googlegroups.com
#29464: Move collectstatic post processing messages to verbosity 2
-------------------------------------+-------------------------------------
Reporter: David Szotten | Owner: Arthur
Type: | Silva
Cleanup/optimization | Status: assigned

Component: contrib.staticfiles | Version: 2.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Arthur Silva):

Hi @Tim Graham,

How can I test post_process inside TestCollectionVerbosity class located
in django/tests/staticfiles_tests/test_management.py ?

I've tried:


{{{
def test_verbosity_1(self):
stdout = StringIO()
self.run_collectstatic(verbosity=1, stdout=stdout,
post_process=True)
output = stdout.getvalue()
self.assertIn(self.staticfiles_copied_msg, output)
self.assertNotIn(self.copying_msg, output)
self.assertNotIn(self.post_process_msg, output)
}}}

where self.post_process_msg is equal to 'Post-process'.

However I can't make post_process be triggered. So, the test passes even
message post_process_msg is printed with verbose=1.

I may be missing some 'storage' initialization.

Can you give a hint, please?

Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:5>

Django

unread,
Jun 9, 2018, 10:10:01 AM6/9/18
to django-...@googlegroups.com
#29464: Move collectstatic post processing messages to verbosity 2
-------------------------------------+-------------------------------------
Reporter: David Szotten | Owner: Arthur
Type: | Silva
Cleanup/optimization | Status: assigned
Component: contrib.staticfiles | Version: 2.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by David Szotten):

you probably need to enable a storage backend that uses post processing,
e.g. using


{{{
@override_settings(STATICFILES_STORAGE='django.contrib.staticfiles.storage.CachedStaticFilesStorage')
def test_foo(self):

}}}

see
https://github.com/django/django/blob/7a266e25be1b641111ab5889f9808ff6d258d27f/django/contrib/staticfiles/management/commands/collectstatic.py#L125

--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:6>

Django

unread,
Jun 9, 2018, 6:22:41 PM6/9/18
to django-...@googlegroups.com
#29464: Move collectstatic post processing messages to verbosity 2
-------------------------------------+-------------------------------------
Reporter: David Szotten | Owner: Arthur
Type: | Silva
Cleanup/optimization | Status: closed
Component: contrib.staticfiles | Version: 2.1
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Arthur Silva):

* status: assigned => closed
* resolution: => fixed


Comment:

Thanks David.

I've submitted a [https://github.com/django/django/pull/10042 PR].

--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:7>

Django

unread,
Jun 9, 2018, 6:38:02 PM6/9/18
to django-...@googlegroups.com
#29464: Move collectstatic post processing messages to verbosity 2
-------------------------------------+-------------------------------------
Reporter: David Szotten | Owner: Arthur
Type: | Silva
Cleanup/optimization | Status: new

Component: contrib.staticfiles | Version: 2.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: closed => new
* has_patch: 0 => 1
* resolution: fixed =>


Comment:

The ticket is closed when the PR is merged. You should instead check "Has
patch" when adding a pull request.

--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:8>

Django

unread,
Jun 9, 2018, 7:01:27 PM6/9/18
to django-...@googlegroups.com
#29464: Move collectstatic post processing messages to verbosity 2
-------------------------------------+-------------------------------------
Reporter: David Szotten | Owner: Arthur
Type: | Silva
Cleanup/optimization | Status: new
Component: contrib.staticfiles | Version: 2.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Arthur Silva):

My bad.

Thanks for changing it to "Has patch".

--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:9>

Django

unread,
Jun 11, 2018, 8:49:43 PM6/11/18
to django-...@googlegroups.com
#29464: Move collectstatic post processing messages to verbosity 2
-------------------------------------+-------------------------------------
Reporter: David Szotten | Owner: Arthur
Type: | Silva
Cleanup/optimization | Status: closed
Component: contrib.staticfiles | Version: 2.1
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"bc1435551c0cfaf4a22aff8216990b909005dba9" bc143555]:
{{{
#!CommitTicketReference repository=""
revision="bc1435551c0cfaf4a22aff8216990b909005dba9"
Fixed #29464 -- Silenced post-process messages in collectstatic's default
verbosity.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:10>

Django

unread,
Jun 11, 2018, 8:49:50 PM6/11/18
to django-...@googlegroups.com
#29464: Move collectstatic post processing messages to verbosity 2
-------------------------------------+-------------------------------------
Reporter: David Szotten | Owner: Arthur
Type: | Silva
Cleanup/optimization | Status: closed
Component: contrib.staticfiles | Version: 2.1
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"91a02dce97ec677933527deddcce230e6e7ba7c9" 91a02dce]:
{{{
#!CommitTicketReference repository=""
revision="91a02dce97ec677933527deddcce230e6e7ba7c9"
[2.1.x] Fixed #29464 -- Silenced post-process messages in collectstatic's
default verbosity.

Backport of bc1435551c0cfaf4a22aff8216990b909005dba9 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:11>

Reply all
Reply to author
Forward
0 new messages