forked from wbond/package_control_channel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmigrator.py
769 lines (729 loc) · 26.6 KB
/
migrator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
import json
import re
import os
from collections import OrderedDict
from urllib.request import urlopen
# CONFIGURATION FOR MIGRATION PROCESS
old_repositories_json_path = './repositories.json'
new_channel_path = './channel.json'
new_repository_path = './repository.json'
new_repository_url = './repository.json'
new_repository_subfolder_path = './repository/'
client_auth = os.environ['PACKAGE_CONTROL_AUTH']
with open(old_repositories_json_path, encoding='utf-8') as of:
old_data = json.load(of)
previous_names = OrderedDict()
for key, value in old_data['renamed_packages'].items():
if value not in previous_names:
previous_names[value] = []
previous_names[value].append(key)
names = OrderedDict()
master_list = OrderedDict()
repositories = [new_repository_url]
repositories_from_orgs = []
repositories_without_orgs = []
for repository in old_data['repositories']:
user_match = re.match('https://github.com/([^/]+)$', repository)
if user_match:
api_url = 'https://api.github.com/users/%s/repos?per_page=100&%s' % (user_match.group(1), client_auth)
json_string = urlopen(api_url).read()
data = json.loads(str(json_string, encoding='utf-8'))
for repo in data:
repositories_from_orgs.append(repo['html_url'])
else:
repositories_without_orgs.append(repository)
repositories_to_process = repositories_without_orgs + repositories_from_orgs
for repository in repositories_to_process:
repo_match = re.match('https://(github.com|bitbucket.org)/([^/]+)/([^/]+)(?:/tree/([^/]+))?$', repository)
if repo_match:
old_name = None
prev_names = None
name = repo_match.group(3)
branch = 'master' if repo_match.group(1) == 'github.com' else 'default'
if repo_match.group(4):
branch = repo_match.group(4)
# BitBucket repos that don't use the branch named "default"
if name in ['html-crush-switch', 'whocalled', 'jsonlint',
'symfonytools-for-sublimetext-2', 'html-compress-and-replace',
'sublime-aml', 'quick-rails', 'quickref', 'smartmovetotheeol',
'sublime-http-response-headers-snippets', 'sublimesourcetree',
'zap-gremlins', 'andrew', 'bootstrap-jade']:
branch = 'master'
if name in old_data['package_name_map']:
old_name = name
name = old_data['package_name_map'][name]
# Fixes for bitbucket repos that are using a package_name_map
if name == 'pythonpep8autoformat':
old_name = name
name = 'Python PEP8 Autoformat'
if name == 'sublimesourcetree':
old_name = name
name = 'SourceTree'
if name == 'sublime-http-response-headers-snippets':
old_name = name
name = 'HTTP Response Headers Snippets'
if name == 'symfonytools-for-sublimetext-2':
old_name = name
name = 'SymfonyTools'
if name == 'statusbarextension':
old_name = name
name = 'Status Bar Extension'
# Skip duplicate sources for packages
if name in master_list:
continue
if name in previous_names:
prev_names = previous_names[name]
letter = name[0].lower()
if letter in [str(num) for num in range(0, 9)]:
letter = '0-9'
if letter not in names:
names[letter] = []
names[letter].append(name)
entry = OrderedDict()
if old_name:
entry['name'] = name
# According to the wiki, these are compatible with
# ST3 without any extra work
st3_compatiable = [
'ADBView',
'AdvancedNewFile',
'Andrew',
'AngularJS',
'AutoBackups',
'Better CoffeeScript',
'Case Conversion',
'CheckBounce',
'CodeFormatter',
'ColorPicker',
'CompleteSharp',
'ConvertToUTF8',
'CopyEdit',
'CriticMarkup',
'Cscope',
'CSScomb',
'CSSFontFamily',
'CursorRuler',
'DeleteBlankLines',
'Djaneiro',
'DocBlockr',
'EditorConfig',
'EditPreferences',
'ElasticTabstops',
'Emmet',
'Expand Selection to Function (JavaScript)',
'eZ Publish Syntax',
'File History',
'Filter Lines',
'FindKeyConflicts',
'Floobits',
'GenerateUUID',
'GitGutter',
'google-search',
'GoSublime',
'Hex to HSL Color Converter',
'HighlightWords',
'Hipster Ipsum',
'IMESupport',
'InactivePanes',
'JavaPropertiesEditor',
'JavaScript Refactor',
'JsFormat',
'JsRun',
'Laravel Blade Highlighter',
'LaTeXTools',
'Less2Css',
'Local History',
'MarkAndMove',
'Marked.app Menu',
'Mediawiker',
'memTask',
'Modific',
'NaturalSelection',
'Nettuts+ Fetch',
'ObjC2RubyMotion',
'OmniMarkupPreviewer',
'Open-Include',
'orgmode',
'Origami',
'PackageResourceViewer',
'Pandown',
'PersistentRegexHighlight',
'PgSQL',
'Phpcs',
'PHPUnit',
'PlainTasks',
'Python PEP8 Autoformat',
'Rails Latest Migration',
'Rails Migrations List',
'Random Text',
'Ruby Hash Converter',
'RubyTest',
'ScalaFormat',
'Schemr',
'SelectUntil',
'SimpleSync',
'Smart Delete',
'Solarized Toggle',
'sublime-github',
'SublimeAStyleFormatter',
'SublimeClang',
'SublimeGDB',
'SublimeGit',
'SublimeInsertDatetime',
'SublimeREPL',
'SublimeSBT',
'SublimeTmpl',
'Surround',
'SyncedSideBar',
'Table Editor',
'Theme - Flatland',
'Theme - Nil',
'Theme - Phoenix',
'Theme - Soda',
'Themr',
'TOML',
'Tradsim',
'TrailingSpaces',
'TWiki',
'URLEncode',
'View In Browser',
'Wind',
'Worksheet',
'Xdebug',
'Xdebug Client',
'Transience',
'RemoteOpen',
'Path Tools',
'WakaTime',
'AutoSoftWrap',
'fido',
'Preference Helper',
'HTML-CSS-JS Prettify',
'JSHint Gutter',
'Vintage Escape',
'Ruby Pipe Text Processing',
'Crypto',
'Preset Command',
'SublimeLog',
'PHP Code Coverage',
'Status Bar Extension',
'To Hastebin',
'Alphpetize',
'BeautifyRuby',
'BoundKeys',
'Evaluate',
'FindSelected',
'JSONLint',
'Pretty JSON',
'Restructured Text (RST) Snippets',
'PySide',
'Diagram',
'Japanize',
'SimpleClone',
'rsub',
'Pman',
'Gist'
]
# These packages have a separate branch for ST3
st3_with_branch = {
'BracketHighlighter': 'BH2ST3',
'BufferScroll': 'st3',
'ChangeQuotes': 'st3',
'Ensime': 'ST3',
'ExportHtml': 'ST3',
'FavoriteFiles': 'ST3',
'FileDiffs': 'st3',
'FuzzyFileNav': 'ST3',
'Git': 'python3',
'HexViewer': 'ST3',
'LineEndings': 'st3',
'Markdown Preview': 'ST3',
'Nodejs': 'sublime-text-3',
'PlistJsonConverter': 'ST3',
'RegReplace': 'ST3',
'ScopeHunter': 'ST3',
'SideBarEnhancements': 'st3',
'SideBarGit': 'st3',
'Clipboard Manager': 'st3',
'SublimeLinter': 'sublime-text-3',
'Highlight': 'python3',
'Http Requester': 'st3',
'SublimePeek': 'ST3',
'StringUtilities': 'ST3',
'sublimelint': 'st3',
'SublimeXiki': 'st3',
'Tag': 'st3',
'WordCount': 'st3',
'Code Runner': 'SublimeText3',
'Sublimerge': 'sublime-text-3'
}
no_python = [
'3024 Color Scheme',
'4GL',
'ABC Notation',
'ActionScript 3',
'Additional PHP Snippets',
'Alternate VIM Navigation',
'AmpScript Highlighter',
'AMPScript',
'AndyPHP',
'AngelScript',
'AngularJS (CoffeeScript)',
'AngularJS Snippets',
'Ant Buildfile',
'Ant',
'APDL (ANSYS) Syntax Highlighting',
'Aqueducts',
'AriaTemplates Highlighter',
'AriaTemplates Snippets',
'ARM Assembly',
'Arnold Clark Snippets for Ruby',
'ASCII Comment Snippets',
'AsciiDoc',
'Async Snippets',
'AVR-ASM-Sublime',
'Awk',
'Backbone Baguette',
'Backbone.js',
'Backbone.Marionette',
'Base16 Color Schemes',
'Behat Features',
'Behat Snippets',
'Behat',
'BEMHTML',
'BHT-BASIC',
'Blade Snippets',
'Blusted Scheme',
'Boo',
'Bootstrap 3 Snippets',
'Boron Color Scheme',
'Bubububububad and Boneyfied Color Schemes',
'C# Compile & Run',
'CakePHP (Native)',
'CakePHP (tmbundle)',
'Capybara Snippets',
'CasperJS',
'CFeather',
'Chai Completions',
'Chaplin.js',
'Cheetah Syntax Highlighting',
'Chef',
'ChordPro',
'Chuby Ninja Color Scheme',
'ChucK Syntax',
'Ciapre Color Scheme',
'Clay Schubiner Color Schemes',
'CLIPS Rules',
'ClosureMyJS',
'CMake',
'CMS Made Simple Snippets',
'Coco R Syntax Highlighting',
'CodeIgniter 2 ModelController',
'CodeIgniter Snippets',
'CodeIgniter Utilities',
'CoffeeScriptHaml',
'ColdBox Platform',
'Color Scheme - Eggplant Parm',
'Color Scheme - Frontend Delight',
'Color Scheme - saulhudson',
'Color Scheme - Sleeplessmind',
'Color Schemes by carlcalderon',
'Comment-Snippets',
'ComputerCraft Package',
'CoreBuilder',
'Creole',
'CSS Media Query Snippets',
'CSS Snippets',
'Cube2Media Color Scheme',
'CUDA C++',
'CUE Sheet',
'Dafny',
'Dark Pastel Color Scheme',
'Dayle Rees Color Schemes',
'DBTextWorks',
'Derby - Bourbon & Neat Autocompletions',
'DFML (for Dwarf Fortress raws)',
'Dictionaries',
'Dimmed Color Scheme',
'DobDark Color Scheme',
'Doctrine Snippets',
'Doctypes',
'Dogs Colour Scheme',
'Dotfiles Syntax Highlighting',
'DotNetNuke Snippets',
'Drupal Snippets',
'Drupal',
'Dust.js',
'Dylan',
'eco',
'ECT',
'Elixir',
'Elm Language Support',
'Ember.js Snippets',
'Emmet Css Snippets',
'EmoKid Color Scheme',
'Enhanced Clojure',
'Enhanced HTML and CFML',
'Enlightened Color Scheme',
'ERB Snippets',
'Esuna Framework Snippets',
'Express Color Scheme',
'ExpressionEngine',
'F#',
'Failcoder Color Scheme',
'FakeImg.pl Image Placeholder Snippet',
'FarCry',
'FASM x86',
'Fat-Free Framework Snippets',
'fish-shell',
'FLAC',
'Flex',
'Focus',
'Foundation Snippets',
'Fountain',
'FreeMarker',
'Front End Snippets',
'Future Funk - Color Scheme',
'Gaelyk',
'Gauche',
'Genesis',
'Git Config',
'GMod Lua',
'Google Closure Library snippets',
'GoogleTesting',
'Grandson-of-Obsidian',
'Grid6',
'GYP',
'Haml',
'Hamlpy',
'Handlebars',
'hlsl',
'Homebrew-formula-syntax',
'hosts',
'HTML Compressor',
'HTML Email Snippets',
'HTML Mustache',
'HTML Snippets',
'HTML5 Doctor CSS Reset snippet',
'HTML5',
'HTMLAttributes',
'IcedCoffeeScript',
'Idiomatic-CSS-Comments-Snippets',
'Idoc',
'ImpactJS',
'INI',
'Issues',
'Jade Snippets',
'Jade',
'Java Velocity',
'JavaScript Console',
'JavaScript Patterns',
'JavaScript Snippets',
'JavaScriptNext - ES6 Syntax',
'Jinja2',
'jQuery Mobile Snippets',
'jQuery Snippets for Coffeescript',
'jQuery Snippets pack',
'jQuery',
'JS Snippets',
'JsBDD',
'Julia',
'knockdown',
'KnowledgeBase',
'Kohana 2.x Snippets',
'Kohana',
'Koken',
'Kotlin',
'KWrite Color Scheme',
'Language - Up-Goer-5',
'Laravel 4 Snippets',
'Laravel Bootstrapper Snippets',
'Laravel Color Scheme',
'Laravel Snippets',
'Lasso',
'LaTeX Blindtext',
'LaTeX Track Changes',
'LaTeX-cwl',
'Lazy Backbone.js',
'Ledger syntax highlighting',
'Legal Document Snippets',
'LESS',
'LESS-build',
'Lift Snippets',
'lioshi Color Scheme',
'Liquid',
'Lithium Snippets',
'LLVM',
'Lo-Dash Snippets for CoffeeScript',
'Logger Snippets',
'Loom Game Engine',
'M68k Assembly',
'Madebyphunky Color Scheme',
'Mako',
'Maperitive',
'Markdown Extended',
'MasmAssembly',
'Mason',
'MelonJS Completions',
'MinimalFortran',
'MinkExtension default feature step completions',
'MIPS Syntax',
'Mirodark Color Scheme',
'Missing Palette Commands',
'Mocha Snippets',
'MODx Revolution Snippets',
'Mojolicious',
'MongoDB - PHP Completions',
'Mongomapper Snippets',
'Monokai Blueberry Color Scheme',
'Monokai Extended',
'Moscow ML',
'Mplus',
'Mreq Color Scheme',
'MultiLang Color Scheme',
'Neat Sass Snippets',
'Nemerle',
'Neon Theme',
'NESASM',
'Nette',
'nginx',
'Nimrod',
'NSIS Autocomplete (Add-ons)',
'NSIS Autocomplete and Snippets',
'NSIS',
'objc .strings syntax language',
'Oblivion Color Scheme',
'Oceanic Color Scheme',
'OpenEdge ABL',
'OpenGL Shading Language (GLSL)',
'Papyrus Assembly',
'PEG.js',
'Perv - Color Scheme',
'Phix Color Scheme',
'PHP Haml',
'PHP MySQLi connection',
'PHP-Twig',
'PHPUnit Completions',
'PHPUnit Snippets',
'PKs Color Scheme',
'Placeholders',
'Placester',
'Play 2.0',
'Pre language syntax highlighting',
'Processing',
'Prolog',
'Puppet',
'PyroCMS Snippets',
'Python Auto-Complete',
'Python Nose Testing Snippets',
'Racket',
'Rails Developer Snippets',
'RailsCasts Colour Scheme',
'Raydric - Color Scheme',
'Red Planet Color Scheme',
'RPM Spec Syntax',
'RSpec (snippets and syntax)',
'rspec-snippets',
'Ruby on Rails snippets',
'ruby-slim.tmbundle',
'RubyMotion Autocomplete',
'RubyMotion Sparrow Framework Autocomplete',
'Rust',
'SASS Build',
'SASS Snippets',
'Sass',
'scriptcs',
'SCSS Snippets',
'Selenium Snippets',
'Sencha',
'Silk Web Toolkit Snippets',
'SilverStripe',
'SimpleTesting',
'Six - Future JavaScript Syntax',
'SJSON',
'Slate',
'SLAX',
'Smali',
'Smarty',
'SML (Standard ML)',
'Solarized Color Scheme',
'SourcePawn Syntax Highlighting',
'SPARC Assembly',
'Spark',
'SQF Language',
'SSH Config',
'StackMob JS Snippets',
'Stan',
'Stylus',
'SubLilyPond',
'Sublime-KnockoutJS-Snippets',
'sublime-MuPAD',
'SublimeClarion',
'SublimeDancer',
'SublimeLove',
'SublimePeek-R-help',
'SublimeSL',
'sublimetext.github.com',
'Summerfruit Color Scheme',
'Sundried Color Scheme',
'Superman Color Scheme',
'Susy Snippets',
'Symfony2 Snippets',
'Syntax Highlighting for Sass',
'Test Double',
# Skipped since unsure if themes port well 'Theme - Aqua',
# Skipped since unsure if themes port well 'Theme - Centurion',
# Skipped since unsure if themes port well 'Theme - Cobalt2',
# Skipped since unsure if themes port well 'Theme - Farzher',
# Skipped since unsure if themes port well 'Theme - Nexus',
# Skipped since unsure if themes port well 'Theme - Night',
# Skipped since unsure if themes port well 'Theme - Pseudo OSX',
# Skipped since unsure if themes port well 'Theme - Reeder',
# Skipped since unsure if themes port well 'Theme - Refined',
# Skipped since unsure if themes port well 'Theme - Refresh',
# Skipped since unsure if themes port well 'Theme - Tech49',
'Three.js Autocomplete',
'TideSDK Autocomplete',
'tipJS Snippets',
'TJ3-syntax-sublimetext2',
'Tmux',
'Todo',
'TomDoc',
'Tomorrow Color Schemes',
'tQuery',
'TreeTop',
'Tritium',
'Tubaina (afc)',
'Twee',
'Twig',
'Twitter Bootstrap ClassNames Completions',
'Twitter Bootstrap Snippets',
'TypeScript',
'Ublime Color Schemes',
'Underscore.js Snippets',
'UnindentPreprocessor',
'Unittest (python)',
'Unity C# Snippets',
'Unity3D Build System',
'Unity3d LeanTween Snippets',
'Unity3D Shader Highlighter and Snippets',
'Unity3D Snippets and Completes',
'Unity3D',
'UnofficialDocs',
'Vala',
'Various Ipsum Snippets',
'VBScript',
'VDF',
'Verilog',
'VGR-Assistant',
'Vintage Surround',
'Vintage-Origami',
'WebExPert - ColorScheme',
'WebFocus',
'Wombat Theme',
'WooCommerce Autocomplete',
'Wordpress',
'World of Warcraft TOC file Syntax',
'World of Warcraft XML file Syntax',
'WoW Development',
'XAML',
'XpressEngine',
'XQuery',
'XSLT Snippets',
'Yate',
'Yii Framework Snippets',
'YUI Compressor',
'ZenGarden',
'Zenoss',
'Zissou Color Schemes',
'Zurb Foundation 4 Snippets',
'Mustang Color Scheme',
'Kimbie Color Scheme'
]
st3_only = [
'Less Tabs',
'Toggl Timer',
'Javatar',
'WordPress Generate Salts',
'subDrush',
'LaTeXing3',
'Markboard3',
'Web Inspector 3',
'PHP Companion',
'Python IDE',
'ScalaWorksheet',
'Vintageous',
'Strapdown Markdown Preview',
'StripHTML',
'MiniPy',
'Package Bundler',
'Koan',
'StickySearch',
'CodeSearch',
'Anaconda'
]
compatible_version = '<3000'
if name in st3_compatiable:
compatible_version = '*'
if name in no_python:
compatible_version = '*'
if name in st3_only:
compatible_version = '>=3000'
entry['details'] = repository
if repo_match.group(1).lower() == 'github.com':
release_url = 'https://github.com/%s/%s/tree/%s' % (repo_match.group(2), repo_match.group(3), branch)
else:
release_url = 'https://bitbucket.org/%s/%s/src/%s' % (repo_match.group(2), repo_match.group(3), branch)
entry['releases'] = [
OrderedDict([
('sublime_text', compatible_version),
('details', release_url)
])
]
if name in st3_with_branch:
if repo_match.group(1).lower() == 'github.com':
release_url = 'https://github.com/%s/%s/tree/%s' % (repo_match.group(2), repo_match.group(3), st3_with_branch[name])
else:
release_url = 'https://bitbucket.org/%s/%s/src/%s' % (repo_match.group(2), repo_match.group(3), st3_with_branch[name])
entry['releases'].append(
OrderedDict([
('sublime_text', '>=3000'),
('details', release_url)
])
)
if prev_names:
entry['previous_names'] = prev_names
master_list[name] = entry
else:
repository = repository.replace('http://sublime.wbond.net/', 'https://sublime.wbond.net/')
repositories.append(repository)
def dump(data, f):
json.dump(data, f, indent="\t", separators=(',', ': '))
includes = []
if not os.path.exists(new_repository_subfolder_path):
os.mkdir(new_repository_subfolder_path)
for letter in names:
include_path = '%s%s.json' % (new_repository_subfolder_path, letter)
includes.append(include_path)
sorted_names = sorted(names[letter], key=str.lower)
sorted_packages = []
for name in sorted_names:
sorted_packages.append(master_list[name])
with open(include_path, 'w', encoding='utf-8') as f:
data = OrderedDict([
('schema_version', '2.0'),
('packages', [])
])
data['packages'] = sorted_packages
dump(data, f)
with open(new_channel_path, 'w', encoding='utf-8') as f:
data = OrderedDict()
data['schema_version'] = '2.0'
data['repositories'] = repositories
dump(data, f)
with open(new_repository_path, 'w', encoding='utf-8') as f:
data = OrderedDict()
data['schema_version'] = '2.0'
data['packages'] = []
data['includes'] = sorted(includes)
dump(data, f)