forked from conda-forge/admin-requests
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_feedstocks.py
More file actions
executable file
·713 lines (617 loc) · 26 KB
/
create_feedstocks.py
File metadata and controls
executable file
·713 lines (617 loc) · 26 KB
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
#!/usr/bin/env python
"""
Convert all recipes into feedstocks.
This script is to be run in a TravisCI context, with all secret environment
variables defined (STAGING_BINSTAR_TOKEN, GH_TOKEN)
Such as:
export GH_TOKEN=$(cat ~/.conda-smithy/github.token)
"""
from __future__ import annotations, print_function
import json
import os.path
import shutil
import subprocess
import sys
import tempfile
import time
import traceback
from contextlib import contextmanager
from datetime import datetime, timezone
from pathlib import Path
from typing import Iterator
import github
from conda_build.metadata import MetaData
from conda_build.utils import create_file_with_permissions
from conda_forge_feedstock_ops.parse_package_and_feedstock_names import (
parse_package_and_feedstock_names,
)
from conda_forge_metadata.feedstock_outputs import sharded_path as _get_sharded_path
from conda_smithy.utils import get_feedstock_name_from_meta
from github import Github, GithubException
from rattler_build_conda_compat.render import MetaData as RattlerBuildMetaData
from ruamel.yaml import YAML
import requests
# Enable DEBUG to run the diagnostics, without actually creating new feedstocks.
DEBUG = False
REPO_SKIP_LIST = ["core", "bot", "staged-recipes", "arm-arch", "systems", "ctx"]
recipe_directory_name = "recipes"
def _test_and_raise_besides_file_not_exists(e: github.GithubException):
if isinstance(e, github.UnknownObjectException):
return
if e.status == 404 and "No object found" in e.data["message"]:
return
raise e
def _register_package_for_feedstock(feedstock, pkg_name, gh):
repo = gh.get_repo("conda-forge/feedstock-outputs")
try:
contents = repo.get_contents(_get_sharded_path(pkg_name))
except github.GithubException as e:
_test_and_raise_besides_file_not_exists(e)
contents = None
if contents is None:
data = {"feedstocks": [feedstock]}
repo.create_file(
_get_sharded_path(pkg_name),
f"[cf admin skip] ***NO_CI*** add output {pkg_name} for conda-forge/{feedstock}-feedstock",
json.dumps(data),
)
print(f" output {pkg_name} added for feedstock {feedstock}", flush=True)
else:
# we proceed anyways and do not raise since it could be a rerun of staged recipes
# print a warning for the users
data = json.loads(contents.decoded_content.decode("utf-8"))
print(
f" WARNING: output {pkg_name} already exists from feedstock(s) {data['feedstocks']}",
flush=True,
)
def list_recipes() -> Iterator[tuple[str, str]]:
"""
Locates all the recipes in the `recipes/` folder at the root of the repository.
For each found recipe this function returns a tuple consisting of
* the path to the recipe directory
* the name of the feedstock
"""
repository_root = Path(__file__).parent.parent.parent.parent.absolute()
repository_recipe_dir = repository_root / recipe_directory_name
# Ignore if the recipe directory does not exist.
if not repository_recipe_dir.is_dir:
return
for recipe_dir in repository_recipe_dir.iterdir():
# We don't list the "example" feedstock. It is an example, and is there
# to be helpful.
# .DS_Store is created by macOS to store custom attributes of its
# containing folder.
if recipe_dir.name in ["example", "example-v1", ".DS_Store"]:
continue
# Try to look for a conda-build recipe.
absolute_feedstock_path = repository_recipe_dir / recipe_dir
try:
yield (
str(absolute_feedstock_path),
get_feedstock_name_from_meta(MetaData(absolute_feedstock_path)),
)
continue
except OSError:
pass
# If no conda-build recipe was found, try to load a rattler-build recipe.
yield (
str(absolute_feedstock_path),
get_feedstock_name_from_meta(RattlerBuildMetaData(absolute_feedstock_path)),
)
@contextmanager
def tmp_dir(*args, **kwargs):
temp_dir = tempfile.mkdtemp(*args, **kwargs)
try:
yield temp_dir
finally:
shutil.rmtree(temp_dir)
def repo_exists(gh, organization, name):
# Use the organization provided.
org = gh.get_organization(organization)
try:
org.get_repo(name)
return True
except GithubException as e:
if e.status == 404:
return False
raise
def repo_default_branch(gh, organization, name):
# Use the organization provided.
org = gh.get_organization(organization)
try:
repo = org.get_repo(name)
return repo.default_branch
except GithubException as e:
if e.status == 404:
return "main"
raise
def _set_default_branch(feedstock_dir, default_branch):
yaml = YAML()
with open(os.path.join(feedstock_dir, "conda-forge.yml"), "r") as fp:
cfg = yaml.load(fp.read())
if "github" not in cfg:
cfg["github"] = {}
cfg["github"]["branch_name"] = default_branch
cfg["github"]["tooling_branch_name"] = "main"
if (
"upload_on_branch" in cfg
and cfg["upload_on_branch"] != default_branch
and cfg["upload_on_branch"] in ["master", "main"]
):
cfg["upload_on_branch"] = default_branch
if "conda_build" not in cfg:
cfg["conda_build"] = {}
if "error_overlinking" not in cfg["conda_build"]:
cfg["conda_build"]["error_overlinking"] = True
with open(os.path.join(feedstock_dir, "conda-forge.yml"), "w") as fp:
yaml.dump(cfg, fp)
def feedstock_token_exists(organization, name):
r = requests.get(
"https://api.github.com/repos/%s/"
"feedstock-tokens/contents/tokens/%s.json" % (organization, name),
headers={"Authorization": "token %s" % os.environ["GH_TOKEN"]},
)
if r.status_code != 200:
return False
else:
return True
def get_rate_limit(gh):
# Get GitHub API Rate Limit usage and total
rate_limit = gh.get_rate_limit()
# unfortunately, PyGithub doesn't have a __version__
# so we have to use hasattr/getattr tricks to
# ensure compatibility with older versions
# PyGithub 2.7.0 and later
# get_rate_limit return RateLimitOverview
# https://github.com/PyGithub/PyGithub/pull/3205
# If the attribute "resources" exists, we return it (2.7.0 and later).
# if it doesn't, we return the rate_limit object itself (older versions).
return getattr(rate_limit, "resources", rate_limit)
def print_rate_limiting_info(gh, user):
# Compute some info about our GitHub API Rate Limit.
# Note that it doesn't count against our limit to
# get this info. So, we should be doing this regularly
# to better know when it is going to run out. Also,
# this will help us better understand where we are
# spending it and how to better optimize it.
rate_limit = get_rate_limit(gh)
gh_api_remaining = rate_limit.core.remaining
gh_api_total = rate_limit.core.limit
# Compute time until GitHub API Rate Limit reset
gh_api_reset_time = rate_limit.core.reset
gh_api_reset_time -= datetime.now(timezone.utc)
print("")
print("GitHub API Rate Limit Info:")
print("---------------------------")
print("token: ", user)
print(
"Currently remaining {remaining} out of {total}.".format(
remaining=gh_api_remaining, total=gh_api_total
)
)
print("Will reset in {time}.".format(time=gh_api_reset_time))
print("")
return gh_api_remaining
def sleep_until_reset(gh):
# sleep the job with printing every minute if we are out
# of github api requests
rate_limit = get_rate_limit(gh)
gh_api_remaining = rate_limit.core.remaining
if gh_api_remaining == 0:
gh_api_reset_time = rate_limit.core.reset
gh_api_reset_time -= datetime.now(timezone.utc)
mins_to_sleep = int(gh_api_reset_time.total_seconds() / 60)
mins_to_sleep += 2
print("Sleeping until GitHub API resets.")
for i in range(mins_to_sleep):
time.sleep(60)
print(
"slept for minute {curr} out of {tot}.".format(
curr=i + 1, tot=mins_to_sleep
)
)
return True
else:
return False
if __name__ == "__main__":
exit_code = 0
is_merged_pr = os.environ.get("CF_CURRENT_BRANCH") == "main"
smithy_conf = os.path.expanduser("~/.conda-smithy")
if not os.path.exists(smithy_conf):
os.mkdir(smithy_conf)
def write_token(name, token):
path = os.path.join(smithy_conf, name + ".token")
with create_file_with_permissions(path, 0o600) as fh:
fh.write(token)
if "APPVEYOR_TOKEN" in os.environ:
write_token("appveyor", os.environ["APPVEYOR_TOKEN"])
# if "CIRCLE_TOKEN" in os.environ:
# write_token("circle", os.environ["CIRCLE_TOKEN"])
if "AZURE_TOKEN" in os.environ:
write_token("azure", os.environ["AZURE_TOKEN"])
# if "DRONE_TOKEN" in os.environ:
# write_token("drone", os.environ["DRONE_TOKEN"])
# if "TRAVIS_TOKEN" in os.environ:
# write_token("travis", os.environ["TRAVIS_TOKEN"])
if "STAGING_BINSTAR_TOKEN" in os.environ:
write_token("anaconda", os.environ["STAGING_BINSTAR_TOKEN"])
# gh_drone = Github(os.environ['GH_DRONE_TOKEN'])
# gh_drone_remaining = print_rate_limiting_info(gh_drone, 'GH_DRONE_TOKEN')
# gh_travis = Github(os.environ['GH_TRAVIS_TOKEN'])
gh_travis = None
gh = None
if "GH_TOKEN" in os.environ:
write_token("github", os.environ["GH_TOKEN"])
gh = Github(os.environ["GH_TOKEN"])
# Get our initial rate limit info.
gh_remaining = print_rate_limiting_info(gh, "GH_TOKEN")
# if we are out, exit early
# if sleep_until_reset(gh):
# sys.exit(1)
# try the other token maybe?
# if gh_remaining < gh_drone_remaining and gh_remaining < 100:
# write_token('github', os.environ['GH_DRONE_TOKEN'])
# gh = Github(os.environ['GH_DRONE_TOKEN'])
owner_info = ["--organization", "conda-forge"]
print("Calculating the recipes which need to be turned into feedstocks.")
with tmp_dir("__feedstocks") as feedstocks_dir:
feedstock_dirs = []
for recipe_dir, name in list_recipes():
if name.lower() in REPO_SKIP_LIST:
continue
if name.lower() == "ctx":
sys.exit(1)
feedstock_dir = os.path.join(feedstocks_dir, name + "-feedstock")
print("Making feedstock for {}".format(name))
try:
subprocess.check_call(
[
"conda-smithy",
"init",
recipe_dir,
"--feedstock-directory",
feedstock_dir,
]
)
except subprocess.CalledProcessError:
traceback.print_exception(*sys.exc_info())
continue
if not is_merged_pr:
# We just want to check that conda-smithy is doing its
# thing without having any metadata issues.
continue
subprocess.check_call(
[
"git",
"remote",
"add",
"upstream_with_token",
"https://conda-forge-manager:{}@github.com/"
"conda-forge/{}-feedstock".format(os.environ["GH_TOKEN"], name),
],
cwd=feedstock_dir,
)
# print_rate_limiting_info(gh_drone, 'GH_DRONE_TOKEN')
# Sometimes we already have the feedstock created. We need to
# deal with that case.
if repo_exists(gh, "conda-forge", name + "-feedstock"):
default_branch = repo_default_branch(
gh, "conda-forge", name + "-feedstock"
)
subprocess.check_call(
["git", "fetch", "upstream_with_token"], cwd=feedstock_dir
)
subprocess.check_call(
["git", "branch", "-m", default_branch, "old"], cwd=feedstock_dir
)
try:
subprocess.check_call(
[
"git",
"checkout",
"-b",
default_branch,
"upstream_with_token/%s" % default_branch,
],
cwd=feedstock_dir,
)
except subprocess.CalledProcessError:
# Sometimes, we have a repo, but there are no commits on
# it! Just catch that case.
subprocess.check_call(
["git", "checkout", "-b", default_branch], cwd=feedstock_dir
)
else:
default_branch = "main"
feedstock_dirs.append([feedstock_dir, name, recipe_dir, default_branch])
# print_rate_limiting_info(gh_drone, 'GH_DRONE_TOKEN')
# set the default branch in the conda-forge.yml
_set_default_branch(feedstock_dir, default_branch)
# now register with github
subprocess.check_call(
["conda-smithy", "register-github", feedstock_dir]
+ owner_info
# hack to help travis work
# + ['--extra-admin-users', gh_travis.get_user().login]
# end of hack
)
# print_rate_limiting_info(gh_drone, 'GH_DRONE_TOKEN')
if gh:
# Get our final rate limit info.
print_rate_limiting_info(gh, "GH_TOKEN")
# drone doesn't run our jobs any more so no reason to do this
# from conda_smithy.ci_register import drone_sync
# print("Running drone sync (can take ~100s)", flush=True)
# print_rate_limiting_info(gh_drone, 'GH_DRONE_TOKEN')
# drone_sync()
# for _drone_i in range(10):
# print(
# "syncing drone - %d seconds left" % (10*(10 - _drone_i)),
# flush=True,
# )
# time.sleep(10) # actually wait
# print_rate_limiting_info(gh_drone, 'GH_DRONE_TOKEN')
# Break the previous loop to allow the TravisCI registering
# to take place only once per function call.
# Without this, intermittent failures to synch the TravisCI repos ensue.
# Hang on to any CI registration errors that occur and raise them at the end.
for num, (feedstock_dir, name, recipe_dir, default_branch) in enumerate(
feedstock_dirs
):
if name.lower() in REPO_SKIP_LIST:
continue
print("\n\nregistering CI services for %s..." % name)
if num >= 10:
exit_code = 0
break
# Try to register each feedstock with CI.
# However sometimes their APIs have issues for whatever reason.
# In order to bank our progress, we note the error and handle it.
# After going through all the recipes and removing the converted ones,
# we fail the build so that people are aware that things did not clear.
# hack to help travis work
# from conda_smithy.ci_register import add_project_to_travis
# add_project_to_travis("conda-forge", name + "-feedstock")
# print_rate_limiting_info(gh_travis, 'GH_TRAVIS_TOKEN')
# end of hack
try:
subprocess.check_call(
[
"conda-smithy",
"register-ci",
"--without-appveyor",
"--without-circle",
"--without-travis",
"--without-drone",
"--without-cirun",
"--without-cirrus-runners",
"--without-namespace",
"--without-blacksmith",
"--without-webservice",
"--feedstock_directory",
feedstock_dir,
]
+ owner_info
)
subprocess.check_call(
["conda-smithy", "rerender", "--no-check-uptodate"],
cwd=feedstock_dir,
)
except subprocess.CalledProcessError:
exit_code = 0
traceback.print_exception(*sys.exc_info())
continue
# slow down so we make sure we are registered
for i in range(1, 13):
time.sleep(10)
print("Waiting for registration: {i} s".format(i=i * 10))
# if we get here, now we make the feedstock token and add the staging token
print("making the feedstock token and adding the staging binstar token")
try:
if not feedstock_token_exists("conda-forge", name + "-feedstock"):
subprocess.check_call(
[
"conda-smithy",
"generate-feedstock-token",
"--unique-token-per-provider",
"--feedstock_directory",
feedstock_dir,
]
+ owner_info
)
subprocess.check_call(
[
"conda-smithy",
"register-feedstock-token",
"--unique-token-per-provider",
"--without-circle",
"--without-travis",
"--without-drone",
"--feedstock_directory",
feedstock_dir,
]
+ owner_info
)
# add staging token env var to all CI providers except appveyor
# and azure
# azure has it by default and appveyor is not used
subprocess.check_call(
[
"conda-smithy",
"rotate-binstar-token",
"--without-appveyor",
"--without-azure",
"--without-github-actions",
"--without-circle",
"--without-drone",
"--without-travis",
"--token_name",
"STAGING_BINSTAR_TOKEN",
],
cwd=feedstock_dir,
)
yaml = YAML()
with open(os.path.join(feedstock_dir, "conda-forge.yml"), "r") as fp:
_cfg = yaml.load(fp.read())
_cfg["conda_forge_output_validation"] = True
with open(os.path.join(feedstock_dir, "conda-forge.yml"), "w") as fp:
yaml.dump(_cfg, fp)
subprocess.check_call(
["git", "add", "conda-forge.yml"], cwd=feedstock_dir
)
subprocess.check_call(
["conda-smithy", "rerender", "--no-check-uptodate"],
cwd=feedstock_dir,
)
# pre-register outputs
print("registering outputs...")
_, pkg_names, _ = parse_package_and_feedstock_names(
feedstock_dir, use_container=False
)
for pkg_name in pkg_names:
_register_package_for_feedstock(name, pkg_name, gh)
except subprocess.CalledProcessError:
exit_code = 0
traceback.print_exception(*sys.exc_info())
continue
print("making a commit and pushing...")
subprocess.check_call(
[
"git",
"commit",
"--allow-empty",
"-am",
"Re-render the feedstock after CI registration.",
],
cwd=feedstock_dir,
)
for i in range(5):
try:
# Capture the output, as it may contain the GH_TOKEN.
out = subprocess.check_output(
[
"git",
"push",
"upstream_with_token",
"HEAD:%s" % default_branch,
],
cwd=feedstock_dir,
stderr=subprocess.STDOUT,
)
break
except subprocess.CalledProcessError:
pass
# Likely another job has already pushed to this repo.
# Place our changes on top of theirs and try again.
out = subprocess.check_output(
["git", "fetch", "upstream_with_token", default_branch],
cwd=feedstock_dir,
stderr=subprocess.STDOUT,
)
try:
subprocess.check_call(
[
"git",
"rebase",
"upstream_with_token/%s" % default_branch,
default_branch,
],
cwd=feedstock_dir,
)
except subprocess.CalledProcessError:
# Handle rebase failure by choosing the changes in default_branch.
subprocess.check_call(
["git", "checkout", default_branch, "--", "."],
cwd=feedstock_dir,
)
subprocess.check_call(
["git", "rebase", "--continue"], cwd=feedstock_dir
)
# Remove this recipe from the repo.
if is_merged_pr:
subprocess.check_call(["git", "rm", "-rf", recipe_dir])
# hack to help travis work
# from conda_smithy.ci_register import travis_cleanup
# travis_cleanup("conda-forge", name + "-feedstock")
# end of hack
if gh:
# Get our final rate limit info.
print_rate_limiting_info(gh, "GH_TOKEN")
# Update status based on the remote.
subprocess.check_call(["git", "stash", "--keep-index", "--include-untracked"])
subprocess.check_call(["git", "fetch"])
# CBURR: Debugging
subprocess.check_call(["git", "status"])
subprocess.check_call(["git", "rebase", "--autostash"])
subprocess.check_call(["git", "add", "."])
try:
subprocess.check_call(["git", "stash", "pop"])
except subprocess.CalledProcessError:
# In case there was nothing to stash.
# Finish quietly.
pass
# Parse `git status --porcelain` to handle some merge conflicts and
# generate the removed recipe list.
changed_files = subprocess.check_output(
["git", "status", "--porcelain", recipe_directory_name], universal_newlines=True
)
changed_files = changed_files.splitlines()
# Add all files from AU conflicts. They are new files that we
# weren't tracking previously.
# Adding them resolves the conflict and doesn't actually add anything to the index.
new_file_conflicts = filter(lambda _: _.startswith("AU "), changed_files)
new_file_conflicts = map(
lambda _: _.replace("AU", "", 1).lstrip(), new_file_conflicts
)
for each_new_file in new_file_conflicts:
subprocess.check_call(["git", "add", each_new_file])
# Generate a fresh listing of recipes removed.
#
# * Each line we get back is a change to a file in the recipe directory.
# * We narrow the list down to recipes that are staged for deletion
# (ignores examples).
# * Then we clean up the list so that it only has the recipe names.
removed_recipes = filter(lambda _: _.startswith("D "), changed_files)
removed_recipes = map(lambda _: _.replace("D", "", 1).lstrip(), removed_recipes)
removed_recipes = map(
lambda _: os.path.relpath(_, recipe_directory_name), removed_recipes
)
removed_recipes = map(lambda _: _.split(os.path.sep)[0], removed_recipes)
removed_recipes = sorted(set(removed_recipes))
# Commit any removed packages.
subprocess.check_call(["git", "status"])
if removed_recipes:
msg = "Removed recipe{s} ({}) after converting into feedstock{s}.".format(
", ".join(removed_recipes), s=("s" if len(removed_recipes) > 1 else "")
)
msg += " [ci skip]"
if is_merged_pr:
# Capture the output, as it may contain the GH_TOKEN.
out = subprocess.check_output(
[
"git",
"remote",
"add",
"upstream_with_token",
"https://x-access-token:{}@github.com/"
"conda-forge/staged-recipes".format(os.environ["GH_TOKEN"]),
],
stderr=subprocess.STDOUT,
)
subprocess.check_call(["git", "commit", "-m", msg])
# Capture the output, as it may contain the GH_TOKEN.
branch = os.environ.get("CF_CURRENT_BRANCH")
out = subprocess.check_output(
["git", "push", "upstream_with_token", "HEAD:%s" % branch],
stderr=subprocess.STDOUT,
)
else:
print("Would git commit, with the following message: \n {}".format(msg))
if gh:
# Get our final rate limit info.
print_rate_limiting_info(gh, "GH_TOKEN")
# if gh_drone:
# print_rate_limiting_info(gh_drone, 'GH_DRONE_TOKEN')
# if gh_travis:
# print_rate_limiting_info(gh_travis, 'GH_TRAVIS_TOKEN')
sys.exit(exit_code)