libmozdata 0.2.7__tar.gz → 0.2.8__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.
Files changed (39) hide show
  1. {libmozdata-0.2.7/libmozdata.egg-info → libmozdata-0.2.8}/PKG-INFO +1 -1
  2. libmozdata-0.2.8/VERSION +1 -0
  3. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/buildhub.py +7 -1
  4. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/config.py +5 -2
  5. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/connection.py +4 -1
  6. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/fx_trains.py +8 -1
  7. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/lando.py +1 -1
  8. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/phabricator.py +1 -1
  9. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/release_owners.py +5 -2
  10. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/versions.py +17 -5
  11. {libmozdata-0.2.7 → libmozdata-0.2.8/libmozdata.egg-info}/PKG-INFO +1 -1
  12. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata.egg-info/requires.txt +1 -0
  13. {libmozdata-0.2.7 → libmozdata-0.2.8}/requirements.txt +1 -0
  14. libmozdata-0.2.7/VERSION +0 -1
  15. {libmozdata-0.2.7 → libmozdata-0.2.8}/MANIFEST.in +0 -0
  16. {libmozdata-0.2.7 → libmozdata-0.2.8}/README.md +0 -0
  17. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/BZInfo.py +0 -0
  18. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/FXRevision.py +0 -0
  19. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/FileStats.py +0 -0
  20. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/HGFileInfo.py +0 -0
  21. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/__init__.py +0 -0
  22. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/bugzilla.py +0 -0
  23. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/clouseau.py +0 -0
  24. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/handler.py +0 -0
  25. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/hgmozilla.py +0 -0
  26. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/modules.json +0 -0
  27. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/modules.py +0 -0
  28. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/patchanalysis.py +0 -0
  29. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/redash.py +0 -0
  30. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/socorro.py +0 -0
  31. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/utils.py +0 -0
  32. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/vcs_map.py +0 -0
  33. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata/wiki_parser.py +0 -0
  34. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata.egg-info/SOURCES.txt +0 -0
  35. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata.egg-info/dependency_links.txt +0 -0
  36. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata.egg-info/not-zip-safe +0 -0
  37. {libmozdata-0.2.7 → libmozdata-0.2.8}/libmozdata.egg-info/top_level.txt +0 -0
  38. {libmozdata-0.2.7 → libmozdata-0.2.8}/setup.cfg +0 -0
  39. {libmozdata-0.2.7 → libmozdata-0.2.8}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: libmozdata
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Library to access and aggregate several Mozilla data sources.
5
5
  Home-page: https://github.com/mozilla/libmozdata
6
6
  Author: Mozilla Release Management
@@ -0,0 +1 @@
1
+ 0.2.8
@@ -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(search_url, json=json)
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()
@@ -63,6 +63,9 @@ def set_config(conf):
63
63
  __config = conf
64
64
 
65
65
 
66
- def get(section, option, default=None, type=str):
66
+ def get(section, option, default=None, type=str, required=False):
67
67
  global __config
68
- return __config.get(section, option, default=default, type=type)
68
+ value = __config.get(section, option, default=default, type=type)
69
+ if required:
70
+ assert value is not None, f"Option {option} in section {section} is not set"
71
+ 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 = config.get("User-Agent", "name", "libmozdata")
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(self.URL + path, timeout=self.TIMEOUT)
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", "libmozdata")
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", "libmozdata")
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(OWNERS_URL).text.encode("ascii", errors="ignore")
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(URL_VERSIONS)
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(URL_HISTORY)
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(URL_CALENDAR)
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(URL_STABILITY)
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: libmozdata
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Library to access and aggregate several Mozilla data sources.
5
5
  Home-page: https://github.com/mozilla/libmozdata
6
6
  Author: Mozilla Release Management
@@ -1,6 +1,7 @@
1
1
  icalendar>=3.10
2
2
  python-dateutil>=2.5.2
3
3
  python-hglib>=2.6.1
4
+ pytz>=2022
4
5
  requests-futures>=0.9.8
5
6
  requests[security]>=2.7.0
6
7
  setuptools>=28.6.1
@@ -1,6 +1,7 @@
1
1
  icalendar>=3.10
2
2
  python-dateutil>=2.5.2
3
3
  python-hglib>=2.6.1
4
+ pytz>=2022
4
5
  requests-futures>=0.9.8
5
6
  requests[security]>=2.7.0
6
7
  setuptools>=28.6.1
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