udata 9.1.3.dev30798__py2.py3-none-any.whl → 9.1.3.dev30842__py2.py3-none-any.whl

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.

Potentially problematic release.


This version of udata might be problematic. Click here for more details.

@@ -23,7 +23,7 @@ _template_hooks = {}
23
23
 
24
24
 
25
25
  @hook.app_template_global()
26
- def package_version(name):
26
+ def package_version(name: str) -> str:
27
27
  return pkg_resources.get_distribution(name).version
28
28
 
29
29
 
udata/sentry.py CHANGED
@@ -8,7 +8,9 @@ from werkzeug.exceptions import HTTPException
8
8
  from udata import entrypoints
9
9
  from udata.core.storages.api import UploadProgress
10
10
 
11
+ from .app import UDataApp
11
12
  from .auth import PermissionDenied
13
+ from .frontend import package_version
12
14
 
13
15
  log = logging.getLogger(__name__)
14
16
 
@@ -24,7 +26,7 @@ ERROR_PARSE_DSN_MSG = "Unable to parse Sentry DSN"
24
26
  IGNORED_EXCEPTIONS = HTTPException, PermissionDenied, UploadProgress
25
27
 
26
28
 
27
- def public_dsn(dsn):
29
+ def public_dsn(dsn: str) -> str | None:
28
30
  """Check if DSN is public or raise a warning and turn it into a public one"""
29
31
  m = RE_DSN.match(dsn)
30
32
  if not m:
@@ -41,7 +43,7 @@ def public_dsn(dsn):
41
43
  return public
42
44
 
43
45
 
44
- def init_app(app):
46
+ def init_app(app: UDataApp):
45
47
  if app.config["SENTRY_DSN"]:
46
48
  try:
47
49
  import sentry_sdk
@@ -62,6 +64,13 @@ def init_app(app):
62
64
  dsn=app.config["SENTRY_PUBLIC_DSN"],
63
65
  integrations=[FlaskIntegration(), CeleryIntegration()],
64
66
  ignore_errors=list(exceptions),
67
+ release=f"udata@{package_version('udata')}",
68
+ environment=app.config.get("SITE_ID", None),
69
+ # Set traces_sample_rate to 1.0 to capture 100%
70
+ # of transactions for performance monitoring.
71
+ # Sentry recommends adjusting this value in production.
72
+ traces_sample_rate=app.config.get("SENTRY_SAMPLE_RATE", None),
73
+ profiles_sample_rate=app.config.get("SENTRY_SAMPLE_RATE", None),
65
74
  )
66
75
 
67
76
  # Set log level
udata/settings.py CHANGED
@@ -113,6 +113,7 @@ class Defaults(object):
113
113
  SENTRY_USER_ATTRS = ["slug", "email", "fullname"]
114
114
  SENTRY_LOGGING = "WARNING"
115
115
  SENTRY_IGNORE_EXCEPTIONS = []
116
+ SENTRY_SAMPLE_RATE: float = 1.0
116
117
 
117
118
  # Flask WTF settings
118
119
  CSRF_SESSION_KEY = "Default uData csrf key"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: udata
3
- Version: 9.1.3.dev30798
3
+ Version: 9.1.3.dev30842
4
4
  Summary: Open data portal
5
5
  Home-page: https://github.com/opendatateam/udata
6
6
  Author: Opendata Team
@@ -96,9 +96,10 @@ Requires-Dist: rdflib ==6.0.0
96
96
  Requires-Dist: redis ==4.5.2
97
97
  Requires-Dist: referencing ==0.35.1
98
98
  Requires-Dist: regex ==2024.5.15
99
- Requires-Dist: requests ==2.24.0
99
+ Requires-Dist: requests ==2.32.3
100
100
  Requires-Dist: rpds-py ==0.19.0
101
101
  Requires-Dist: s3transfer ==0.6.2
102
+ Requires-Dist: sentry-sdk ==2.9.0
102
103
  Requires-Dist: six ==1.16.0
103
104
  Requires-Dist: speaklater ==1.3
104
105
  Requires-Dist: stringdist ==1.0.9
@@ -108,7 +109,7 @@ Requires-Dist: tzdata ==2024.1
108
109
  Requires-Dist: unidecode ==0.4.21
109
110
  Requires-Dist: uritools ==4.0.3
110
111
  Requires-Dist: urlextract ==0.14.0
111
- Requires-Dist: urllib3 ==1.25.11
112
+ Requires-Dist: urllib3 ==1.26.19
112
113
  Requires-Dist: vine ==5.1.0
113
114
  Requires-Dist: voluptuous ==0.11.7
114
115
  Requires-Dist: wcwidth ==0.2.13
@@ -139,7 +140,7 @@ It is collectively taken care of by members of the
139
140
 
140
141
  ## Current (in progress)
141
142
 
142
- - Nothing yet
143
+ - Adds latest `sentry-sdk[flask]` as an install dependency, and update Sentry logic to be able to send environment, app version and profiling/performance info [#3086](https://github.com/opendatateam/udata/pull/3086)
143
144
 
144
145
  ## 9.1.2 (2024-07-29)
145
146
 
@@ -12,8 +12,8 @@ udata/i18n.py,sha256=Q7UELAhKOW7DmUX8BjEMnqqhQxcR6d3ioSmj90A62cg,8992
12
12
  udata/mail.py,sha256=MShopArrtXyn8SnXtNbWUR0C4mTj1gI3a3Lf_1We-j4,2167
13
13
  udata/rdf.py,sha256=GDqnBuJd2KryJDpJjPuH0WpkZIPoOEa2uOACr5mNCik,13835
14
14
  udata/routing.py,sha256=fwtnA7mbV535Jpblm2urhUs2UBgsevYGNE711V8T5oI,7120
15
- udata/sentry.py,sha256=sLkVw-BF_ad4hOveDpnk6oFjLijGTAFS2STMbcg1w84,2678
16
- udata/settings.py,sha256=EUPPsPi3pKxnXSLxmKWhKtdBmtWfJl7torWpSWU9kbA,17817
15
+ udata/sentry.py,sha256=ekcxqUSqxfM98TtvCsPaOoX5i2l6PEcYt7kb4l3od-Q,3223
16
+ udata/settings.py,sha256=ZcLUXKv-nRPjDSmb-vS1gVAT2xqChjdi2GMx1d5zpcw,17853
17
17
  udata/sitemap.py,sha256=oRRWoPI7ZsFFnUAOqGT1YuXFFKHBe8EcRnUCNHD7xjM,979
18
18
  udata/tags.py,sha256=a4o4LtddJR_nxmz9cFxkdtXPs8-_Uiz2T79aWE0Jhy8,594
19
19
  udata/tasks.py,sha256=hLdmHV7ozeq803BRjU6X3DT3oVsZrV1beQILpbjsfQI,4978
@@ -272,7 +272,7 @@ udata/forms/__init__.py,sha256=OXNShgt05tADLYQ-cXPdB16qQtj2i48GxSsCVdR6cfI,843
272
272
  udata/forms/fields.py,sha256=9s8ywCD2LCtHnD5Z2fx9cxH6XI2nbHEj73kz17qZGHk,28576
273
273
  udata/forms/validators.py,sha256=CRgmB6oow5O8LDR45LajlJJ9HX3RBCI08fapoWMH1vo,2727
274
274
  udata/forms/widgets.py,sha256=XMVxBlQMGfb0nQvqwLMsAVcEdsBdaZGQZ82F81FdmlM,1332
275
- udata/frontend/__init__.py,sha256=nzXjOFmzbpseU476gYt0jkHCjkpvmHi42qESi1dJEr8,3555
275
+ udata/frontend/__init__.py,sha256=Aa5BX19jTAcjGiGKszPabbOju5thvA7XFz4aYvxwXQw,3567
276
276
  udata/frontend/csv.py,sha256=FAlIAfcuigo01D_hSRTnvZ7B-HMHXqn5TXeCm6sO230,8520
277
277
  udata/frontend/markdown.py,sha256=ppaiy_Mv6iNRjNqPjVquc9Wx7breY1mcsN41b4fM18w,4353
278
278
  udata/harvest/__init__.py,sha256=C4y5w4vGb_F9Opy62lzV3eHo4DkNyRgPCq-wsarPXiQ,28
@@ -697,9 +697,9 @@ udata/translations/pt/LC_MESSAGES/udata.mo,sha256=WpPzAqVd2Onv_kz45ULUySKPLrpjcc
697
697
  udata/translations/pt/LC_MESSAGES/udata.po,sha256=18Op9RUITewoDRewlOdYzzq6gjsf1lsvepACV1d7zxs,44976
698
698
  udata/translations/sr/LC_MESSAGES/udata.mo,sha256=NIYRNhVoETZUvIvWm3cCW7DtMBAnS2vXzZjMF5ZzD_c,28500
699
699
  udata/translations/sr/LC_MESSAGES/udata.po,sha256=rQB-4V4WJ7bURj6g2j653vItr5TMHadcLQxec7_fDmg,51545
700
- udata-9.1.3.dev30798.dist-info/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
701
- udata-9.1.3.dev30798.dist-info/METADATA,sha256=HxmKT51GVSfEk0jtay0FM8JmkWp39OyxLsKpnOQl29Q,127589
702
- udata-9.1.3.dev30798.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
703
- udata-9.1.3.dev30798.dist-info/entry_points.txt,sha256=3SKiqVy4HUqxf6iWspgMqH8d88Htk6KoLbG1BU-UddQ,451
704
- udata-9.1.3.dev30798.dist-info/top_level.txt,sha256=39OCg-VWFWOq4gCKnjKNu-s3OwFlZIu_dVH8Gl6ndHw,12
705
- udata-9.1.3.dev30798.dist-info/RECORD,,
700
+ udata-9.1.3.dev30842.dist-info/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
701
+ udata-9.1.3.dev30842.dist-info/METADATA,sha256=cmMDltuTHIRcWK9liZJn4pQQ4bJ06c2vRj9N6jnmucM,127825
702
+ udata-9.1.3.dev30842.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
703
+ udata-9.1.3.dev30842.dist-info/entry_points.txt,sha256=3SKiqVy4HUqxf6iWspgMqH8d88Htk6KoLbG1BU-UddQ,451
704
+ udata-9.1.3.dev30842.dist-info/top_level.txt,sha256=39OCg-VWFWOq4gCKnjKNu-s3OwFlZIu_dVH8Gl6ndHw,12
705
+ udata-9.1.3.dev30842.dist-info/RECORD,,