Closed
Bug 1328277
Opened 8 years ago
Closed 8 years ago
Make our custom management commands compatible with Django 1.10
Categories
(Tree Management :: Treeherder, defect, P2)
Tree Management
Treeherder
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: emorley, Assigned: emorley)
References
Details
Attachments
(1 file)
Django 1.8 deprecated optparse support in custom management commands in favour of argparse style argument support.
Django 1.10 has then removed support for optparse entirely, so we need to adjust our management commands accordingly.
eg:
/home/vagrant/treeherder/tests/model/test_cycle_data.py:44: RemovedInDjango110Warning: OptionParser usage for Django management commands is deprecated, use ArgumentParser instead
/home/vagrant/treeherder/tests/model/test_cycle_data.py:112: RemovedInDjango110Warning: OptionParser usage for Django management commands is deprecated, use ArgumentParser instead
/home/vagrant/treeherder/tests/model/test_cycle_data.py:169: RemovedInDjango110Warning: OptionParser usage for Django management commands is deprecated, use ArgumentParser instead
/home/vagrant/treeherder/tests/model/test_cycle_data.py:201: RemovedInDjango110Warning: OptionParser usage for Django management commands is deprecated, use ArgumentParser instead
/home/vagrant/treeherder/tests/model/test_cycle_data.py:237: RemovedInDjango110Warning: OptionParser usage for Django management commands is deprecated, use ArgumentParser instead
tests/model/commands/test_init_datasource.py /home/vagrant/treeherder/tests/model/commands/test_init_datasource.py:27: RemovedInDjango110Warning: OptionParser usage for Django management commands is deprecated, use ArgumentParser instead
./home/vagrant/treeherder/tests/model/commands/test_init_datasource.py:35: RemovedInDjango110Warning: OptionParser usage for Django management commands is deprecated, use ArgumentParser instead
./home/vagrant/treeherder/tests/model/derived/test_jobs_model.py:298: RemovedInDjango110Warning: OptionParser usage for Django management commands is deprecated, use ArgumentParser instead
/home/vagrant/treeherder/tests/model/derived/test_jobs_model.py:312: RemovedInDjango110Warning: OptionParser usage for Django management commands is deprecated, use ArgumentParser instead
Comment 1•8 years ago
|
||
Assignee | ||
Updated•8 years ago
|
Attachment #8823354 -
Flags: review?(wlachance)
Updated•8 years ago
|
Attachment #8823354 -
Flags: review?(wlachance) → review+
Comment 2•8 years ago
|
||
Commits pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/88de42c50b2fa99889d3f14649803213a3d66f21
Bug 1328277 - Remove no longer needed custom management commands
These were used for one-off migration tasks and are now unused.
https://github.com/mozilla/treeherder/commit/de4c189c15e5115c6e8a3f51c59932268a95782b
Bug 1328277 - Make our management commands compatible with Django 1.10
Django 1.10 removed support for optparse, so commands must use the
built-in argparse support instead:
https://docs.djangoproject.com/en/1.10/releases/1.8/#extending-management-command-arguments-through-command-option-list
The remove_perf_signatures command has been converted to a LabelCommand
(since it's slightly more appropriate given the expected arguments):
https://docs.djangoproject.com/en/1.9/howto/custom-management-commands/#django.core.management.LabelCommand
Note: The `LabelCommand.label` property isn't mentioned in the docs
(yet, I'll submit an upstream PR), but can be seen here:
https://github.com/django/django/blob/1.9.12/django/core/management/base.py#L539
Assignee | ||
Updated•8 years ago
|
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•