libmozdata 0.2.7__tar.gz → 0.2.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {libmozdata-0.2.7/libmozdata.egg-info → libmozdata-0.2.9}/PKG-INFO +1 -1
- libmozdata-0.2.9/VERSION +1 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/buildhub.py +7 -1
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/config.py +10 -4
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/connection.py +4 -1
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/fx_trains.py +8 -1
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/lando.py +1 -1
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/phabricator.py +1 -1
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/release_owners.py +5 -2
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/versions.py +17 -5
- {libmozdata-0.2.7 → libmozdata-0.2.9/libmozdata.egg-info}/PKG-INFO +1 -1
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata.egg-info/requires.txt +1 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/requirements.txt +1 -0
- libmozdata-0.2.7/VERSION +0 -1
- {libmozdata-0.2.7 → libmozdata-0.2.9}/MANIFEST.in +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/README.md +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/BZInfo.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/FXRevision.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/FileStats.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/HGFileInfo.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/__init__.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/bugzilla.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/clouseau.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/handler.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/hgmozilla.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/modules.json +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/modules.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/patchanalysis.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/redash.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/socorro.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/utils.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/vcs_map.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata/wiki_parser.py +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata.egg-info/SOURCES.txt +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata.egg-info/dependency_links.txt +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata.egg-info/not-zip-safe +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/libmozdata.egg-info/top_level.txt +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/setup.cfg +0 -0
- {libmozdata-0.2.7 → libmozdata-0.2.9}/setup.py +0 -0
libmozdata-0.2.9/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.2.9
|
|
@@ -10,6 +10,8 @@ from distutils.version import LooseVersion
|
|
|
10
10
|
|
|
11
11
|
import requests
|
|
12
12
|
|
|
13
|
+
from . import config
|
|
14
|
+
|
|
13
15
|
SEARCH_URL = os.getenv("BUILDHUB_SEARCH_URL", "https://buildhub.moz.tools/api/search")
|
|
14
16
|
|
|
15
17
|
|
|
@@ -18,7 +20,11 @@ class BadBuildhubRequest(Exception):
|
|
|
18
20
|
|
|
19
21
|
|
|
20
22
|
def fetch(search_url, json):
|
|
21
|
-
response = requests.post(
|
|
23
|
+
response = requests.post(
|
|
24
|
+
search_url,
|
|
25
|
+
json=json,
|
|
26
|
+
headers={"User-Agent": config.get("User-Agent", "name", required=True)},
|
|
27
|
+
)
|
|
22
28
|
if response.status_code == 400:
|
|
23
29
|
raise BadBuildhubRequest(search_url)
|
|
24
30
|
response.raise_for_status()
|
|
@@ -45,12 +45,15 @@ class ConfigIni(Config):
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
class ConfigEnv(Config):
|
|
48
|
-
def get(self, section, option, default=None):
|
|
48
|
+
def get(self, section, option, default=None, type=str):
|
|
49
49
|
env = os.environ.get("LIBMOZDATA_CFG_" + section.upper() + "_" + option.upper())
|
|
50
50
|
if not env:
|
|
51
51
|
return default
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
if type == list or type == set:
|
|
54
|
+
return type([s.strip(" /t") for s in env.split(",")])
|
|
55
|
+
else:
|
|
56
|
+
return type(env)
|
|
54
57
|
|
|
55
58
|
|
|
56
59
|
__config = ConfigIni()
|
|
@@ -63,6 +66,9 @@ def set_config(conf):
|
|
|
63
66
|
__config = conf
|
|
64
67
|
|
|
65
68
|
|
|
66
|
-
def get(section, option, default=None, type=str):
|
|
69
|
+
def get(section, option, default=None, type=str, required=False):
|
|
67
70
|
global __config
|
|
68
|
-
|
|
71
|
+
value = __config.get(section, option, default=default, type=type)
|
|
72
|
+
if required:
|
|
73
|
+
assert value is not None, f"Option {option} in section {section} is not set"
|
|
74
|
+
return value
|
|
@@ -55,7 +55,7 @@ class Connection(object):
|
|
|
55
55
|
RAISE_ERROR = True
|
|
56
56
|
CHUNK_SIZE = 32
|
|
57
57
|
TOKEN = ""
|
|
58
|
-
USER_AGENT =
|
|
58
|
+
USER_AGENT = None
|
|
59
59
|
X_FORWARDED_FOR = utils.get_x_fwed_for_str(
|
|
60
60
|
config.get("X-Forwarded-For", "data", "")
|
|
61
61
|
)
|
|
@@ -97,6 +97,9 @@ class Connection(object):
|
|
|
97
97
|
if "raise_error" in kwargs:
|
|
98
98
|
self.RAISE_ERROR = kwargs["raise_error"]
|
|
99
99
|
|
|
100
|
+
if not self.USER_AGENT:
|
|
101
|
+
config.get("User-Agent", "name", required=True)
|
|
102
|
+
|
|
100
103
|
self.exec_queries()
|
|
101
104
|
|
|
102
105
|
def __get_cb(self, query):
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import requests
|
|
6
6
|
|
|
7
|
+
from . import config
|
|
8
|
+
|
|
7
9
|
|
|
8
10
|
class FirefoxTrains:
|
|
9
11
|
"""Firefox Trains
|
|
@@ -24,6 +26,7 @@ class FirefoxTrains:
|
|
|
24
26
|
"""
|
|
25
27
|
|
|
26
28
|
self._cache = {} if cache else None
|
|
29
|
+
self.USER_AGENT = config.get("User-Agent", "name", required=True)
|
|
27
30
|
|
|
28
31
|
@classmethod
|
|
29
32
|
def get_instance(cls):
|
|
@@ -36,7 +39,11 @@ class FirefoxTrains:
|
|
|
36
39
|
if self._cache is not None and path in self._cache:
|
|
37
40
|
return self._cache[path]
|
|
38
41
|
|
|
39
|
-
resp = requests.get(
|
|
42
|
+
resp = requests.get(
|
|
43
|
+
self.URL + path,
|
|
44
|
+
timeout=self.TIMEOUT,
|
|
45
|
+
headers={"User-Agent": self.USER_AGENT},
|
|
46
|
+
)
|
|
40
47
|
resp.raise_for_status()
|
|
41
48
|
resp_json = resp.json()
|
|
42
49
|
|
|
@@ -16,7 +16,7 @@ class LandoWarnings(object):
|
|
|
16
16
|
def __init__(self, api_url, api_key):
|
|
17
17
|
self.api_url = f"{api_url}/diff_warnings"
|
|
18
18
|
self.api_key = api_key
|
|
19
|
-
self.USER_AGENT = config.get("User-Agent", "name",
|
|
19
|
+
self.USER_AGENT = config.get("User-Agent", "name", required=True)
|
|
20
20
|
|
|
21
21
|
def del_warnings(self, warnings):
|
|
22
22
|
"""
|
|
@@ -209,7 +209,7 @@ class PhabricatorAPI(object):
|
|
|
209
209
|
"""
|
|
210
210
|
|
|
211
211
|
def __init__(self, api_key, url=MOZILLA_PHABRICATOR_PROD):
|
|
212
|
-
self.USER_AGENT = config.get("User-Agent", "name",
|
|
212
|
+
self.USER_AGENT = config.get("User-Agent", "name", required=True)
|
|
213
213
|
self.api_key = api_key
|
|
214
214
|
self.url = url
|
|
215
215
|
assert self.url.endswith("/api/"), "Phabricator API must end with /api/"
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import requests
|
|
6
6
|
|
|
7
|
-
from . import utils
|
|
7
|
+
from . import config, utils
|
|
8
8
|
from .wiki_parser import InvalidWiki, WikiParser
|
|
9
9
|
|
|
10
10
|
OWNERS_URL = "https://wiki.mozilla.org/Release_Management/Release_owners"
|
|
@@ -36,7 +36,10 @@ def get_owners():
|
|
|
36
36
|
if _OWNERS is not None:
|
|
37
37
|
return _OWNERS
|
|
38
38
|
|
|
39
|
-
html = requests.get(
|
|
39
|
+
html = requests.get(
|
|
40
|
+
OWNERS_URL,
|
|
41
|
+
headers={"User-Agent": config.get("User-Agent", "name", required=True)},
|
|
42
|
+
).text.encode("ascii", errors="ignore")
|
|
40
43
|
parser = WikiParser(tables=[0])
|
|
41
44
|
try:
|
|
42
45
|
parser.feed(html)
|
|
@@ -9,7 +9,7 @@ from os.path import commonprefix
|
|
|
9
9
|
import requests
|
|
10
10
|
from icalendar import Calendar
|
|
11
11
|
|
|
12
|
-
from . import utils
|
|
12
|
+
from . import config, utils
|
|
13
13
|
|
|
14
14
|
__versions = None
|
|
15
15
|
__version_dates = None
|
|
@@ -46,7 +46,10 @@ def __getVersions():
|
|
|
46
46
|
return
|
|
47
47
|
return esr.endswith("esr") and esr[:-3] or esr
|
|
48
48
|
|
|
49
|
-
resp = requests.get(
|
|
49
|
+
resp = requests.get(
|
|
50
|
+
URL_VERSIONS,
|
|
51
|
+
headers={"User-Agent": config.get("User-Agent", "name", required=True)},
|
|
52
|
+
)
|
|
50
53
|
data = resp.json()
|
|
51
54
|
|
|
52
55
|
nightly = data["FIREFOX_NIGHTLY"]
|
|
@@ -63,12 +66,18 @@ def __getVersions():
|
|
|
63
66
|
|
|
64
67
|
|
|
65
68
|
def __getVersionDates():
|
|
66
|
-
resp = requests.get(
|
|
69
|
+
resp = requests.get(
|
|
70
|
+
URL_HISTORY,
|
|
71
|
+
headers={"User-Agent": config.get("User-Agent", "name", required=True)},
|
|
72
|
+
)
|
|
67
73
|
data = resp.json()
|
|
68
74
|
|
|
69
75
|
data = dict([(v, utils.get_moz_date(d)) for v, d in data.items()])
|
|
70
76
|
|
|
71
|
-
resp = requests.get(
|
|
77
|
+
resp = requests.get(
|
|
78
|
+
URL_CALENDAR,
|
|
79
|
+
headers={"User-Agent": config.get("User-Agent", "name", required=True)},
|
|
80
|
+
)
|
|
72
81
|
calendar = Calendar.from_ical(resp.content)
|
|
73
82
|
|
|
74
83
|
for component in calendar.walk():
|
|
@@ -85,7 +94,10 @@ def __getVersionDates():
|
|
|
85
94
|
|
|
86
95
|
|
|
87
96
|
def __getStabilityVersionDates():
|
|
88
|
-
resp = requests.get(
|
|
97
|
+
resp = requests.get(
|
|
98
|
+
URL_STABILITY,
|
|
99
|
+
headers={"User-Agent": config.get("User-Agent", "name", required=True)},
|
|
100
|
+
)
|
|
89
101
|
|
|
90
102
|
return dict([(v, utils.get_moz_date(d)) for v, d in resp.json().items()])
|
|
91
103
|
|
libmozdata-0.2.7/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.2.7
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|