Let's talk
monitor

The Monitor

Live supply-chain watchboard — critical npm & PyPI packages, watched for compromise.

35
watched
11
nominal
0
watch
2
active alerts
22
incidents on record
updated…
npm — by dependents
axios npm
1.18.1 20d ago incident on record
DELETION ×2BURST ×4
latest 1.18.1 versions 142 maintainers 1
1.15.0
0.31.0
1.15.1
0.31.1
1.15.2
1.16.0
0.32.0
1.16.1
1.17.0
0.33.0
1.18.0
1.18.1
DELETION
1.14.1 published then removed
high · registry-verified · 2026-03-31 · 3mo ago
DELETION
0.30.4 published then removed
high · registry-verified · 2026-03-31 · 3mo ago
BURST
2 releases in 60m: 1.1.1, 1.1.2
info · registry-verified · 2022-10-07 · 3y ago
BURST
2 releases in 39m: 1.14.1, 0.30.4
info · registry-verified · 2026-03-31 · 3mo ago
BURST
2 releases in 4m: 1.15.1, 0.31.1
info · registry-verified · 2026-04-19 · 2mo ago
BURST
2 releases in 0m: 0.33.0, 1.18.0 · ACTIVE
info · registry-verified · 2026-06-14 · 28d ago
release diff 1.18.0 → 1.18.1
+0 added · -0 removed · ~28 modified
dist/node/axios.cjs +123 lines · 3 flagged
--- +++ @@ -1,2 +1,2 @@-/*! Axios v1.18.0 Copyright (c) 2026 Matt Zabriskie and contributors */+/*! Axios v1.18.1 Copyright (c) 2026 Matt Zabriskie and contributors */ 'use strict';@@ -1355,3 +1355,15 @@     const axiosError = new AxiosError(error.message, code || error.code, config, request, response);-    axiosError.cause = error;+    // Match native `Error` `cause` semantics: non-enumerable. The wrapped+    // error often carries circular internals (sockets, requests, agents), so+    // an enumerable `cause` makes structured loggers (pino/winston) and any+    // own-property walk throw "Converting circular structure to JSON".+    // Regression from #6982; see #7205. `__proto__: null` mirrors the+    // `message` descriptor below (prototype-pollution-safe descriptor).+    Object.defineProperty(axiosError, 'cause', {+      __proto__: null,+      value: error,+      writable: true,+      enumerable: false,+      configurable: true+    });     axiosError.name = error.name;@@ -1568,3 +1580,9 @@     if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {-      return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);+      if (useBlob && typeof _Blob === 'function') {+        return new _Blob([value]);+      }+      if (typeof Buffer !== 'undefined') {+        return Buffer.from(value);+      }+      throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT);     }@@ -1700,5 +1718,3 @@ prototype.toString = function toString(encoder) {-  const _encode = encoder ? function (value) {-    return encoder.call(this, value, encode$1);-  } : encode$1;+  const _encode = encoder ? value => encoder.call(this, value, encode$1) : encode$1;   return this._pairs.map(function each(pair) {@@ -1733,2 +1749,3 @@   }+  url = url || '';   const _options = utils$1.isFunction(options) ? {@@ -2365,3 +2382,3 @@ -const VERSION = "1.18.0";+const VERSION = "1.18.1"; @@ -2405,3 +2422,3 @@     // Bare `data:,` leaves mime undefined; Blob normalises that to "" per spec.-    let mime;+    let mime = '';     if (type) {@@ -2411,3 +2428,3 @@     }-    const buffer = Buffer.from(decodeURIComponent(body), encoding);+    const buffer = encoding === 'base64' ? Buffer.from(body, 'base64') : Buffer.from(decodeURIComponent(body), encoding);     if (asBlob) {@@ -3166,2 +3183,32 @@ const tunnelingAgentCacheUser = new WeakMap();+// Minimum minor versions where Node's HTTP Agent supports native proxyEnv+// handling. Checking the selected agent below also covers startup modes such+// as NODE_OPTIONS=--use-env-proxy and --no-use-env-proxy precedence.+const NODE_NATIVE_ENV_PROXY_SUPPORT = {+  22: 21,+  24: 5+};+function isNodeNativeEnvProxySupported(nodeVersion = process.versions && process.versions.node) {+  if (!nodeVersion) {+    return false;+  }+  const [major, minor] = nodeVersion.split('.').map(part => Number(part));+  if (!Number.isInteger(major) || !Number.isInteger(minor)) {+    return false;+  }+  if (major > 24) {+    return true;+  }+  return NODE_NATIVE_ENV_PROXY_SUPPORT[major] != null && minor >= NODE_NATIVE_ENV_PROXY_SUPPORT[major];+}+function isNodeEnvProxyEnabled(agent, nodeVersion = process.versions && process.versions.node) {+  if (!isNodeNativeEnvProxySupported(nodeVersion)) {+    return false;+  }+  const agentOptions = agent && agent.options;+  return Boolean(agentOptions && utils$1.hasOwnProp(agentOptions, 'proxyEnv') && agentOptions.proxyEnv != null);+}+function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) {+  return isHttps.test(options.protocol) ? configHttpsAgent || https.globalAgent : configHttpAgent || http.globalAgent;+} function getTunnelingAgent(agentOptions, userHttpsAgent) {@@ -3273,5 +3320,6 @@  */-function setProxy(options, configProxy, location, isRedirect, configHttpsAgent) {+function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) {   let proxy = configProxy;-  if (!proxy && proxy !== false) {+  const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent);+  if (!proxy && proxy !== false && !isNodeEnvProxyEnabled(proxyEnvAgent)) {     const proxyUrl = getProxyForUrl(location);@@ -3410,3 +3458,3 @@     // the exact same logic as if the redirected request was performed by axios directly.-    setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent);+    setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent);   };@@ -3506,6 +3554,8 @@     let http2Options = own('http2Options');+    const httpAgent = own('httpAgent');+    const httpsAgent = own('httpsAgent');+    const configProxy = own('proxy');     const responseType = own('responseType');     const responseEncoding = own('responseEncoding');-    const httpAgent = own('httpAgent');-    const httpsAgent = own('httpsAgent');+    const socketPath = own('socketPath');     const method = own('method').toUpperCase();@@ -3603,3 +3653,8 @@     const fullPath = buildFullPath(own('baseURL'), own('url'), own('allowAbsoluteUrls'), config);-    const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);+    // Unix-socket requests (own socketPath) commonly pass a path-only url+    // like '/foo'; supply a synthetic base so new URL() can still parse it.+    // Use the own-property value (not config.socketPath) so a polluted+    // prototype cannot influence URL base selection.+    const urlBase = socketPath ? 'http://localhost' : platform.hasBrowserEnv ? platform.origin : undefined;+    const parsed = new URL(fullPath, urlBase);     const protocol = parsed.protocol || supportedProtocols[0];@@ -3740,7 +3795,6 @@     } catch (err) {-      const customErr = new Error(err.message);-      customErr.config = config;-      customErr.url = own('url');-      customErr.exists = true;-      return reject(customErr);+      return reject(AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config, null, null, {+        url: own('url'),+        exists: true+      }));     }@@ -3768,3 +3822,2 @@     !utils$1.isUndefined(lookup) && (options.lookup = lookup);-    const socketPath = own('socketPath');     if (socketPath) {@@ -3786,3 +3839,3 @@       options.port = parsed.port;-      setProxy(options, own('proxy'), protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path, false, httpsAgent);+      setProxy(options, configProxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path, false, httpsAgent, httpAgent);     }@@ -3861,2 +3914,6 @@     }++    // Set an explicit maxBodyLength option for transports that inspect it.+    // When maxBodyLength is -1 (default/unlimited), use Infinity so+    // follow-redirects does not fall back to its own 10MB default.     if (maxBodyLength > -1) {@@ -3864,3 +3921,2 @@     } else {-      // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited       options.maxBodyLength = Infinity;@@ -4040,3 +4096,7 @@       // default interval of sending ack packet is 1 minute-      socket.setKeepAlive(true, 1000 * 60);+      // proxy agents (e.g. agent-base) may return a generic Duplex stream+      // that doesn't have setKeepAlive, so guard before calling+      if (typeof socket.setKeepAlive === 'function') {+        socket.setKeepAlive(true, 1000 * 60);+      } @@ -4185,3 +4245,7 @@       if (eq !== -1 && cookie.slice(0, eq) === name) {-        return decodeURIComponent(cookie.slice(eq + 1));+        try {+          return decodeURIComponent(cookie.slice(eq + 1));+        } catch (e) {+          return cookie.slice(eq + 1);+        }       }@@ -4218,2 +4282,3 @@   // eslint-disable-next-line no-param-reassign+  config1 = config1 || {};   config2 = config2 || {};@@ -4354,3 +4419,3 @@   }-  Object.entries(formHeaders).forEach(([key, val]) => {+  Object.entries(formHeaders || {}).forEach(([key, val]) => {     if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {@@ -4392,3 +4457,7 @@     const password = utils$1.getSafeProp(auth, 'password') || '';-    headers.set('Authorization', 'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : '')));+    try {+      headers.set('Authorization', 'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : '')));+    } catch (e) {+      throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);+    }   }@@ -4593,2 +4662,3 @@       reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));+      done();       return;@@ -4631,3 +4701,5 @@   };-  signals.forEach(signal => signal.addEventListener('abort', onabort));+  signals.forEach(signal => signal.addEventListener('abort', onabort, {+    once: true+  }));   const {@@ -5081,3 +5153,13 @@         request && (canceledError.request = request);-        err !== canceledError && (canceledError.cause = err);+        if (err !== canceledError) {+          // Non-enumerable to match native Error `cause` semantics so loggers+          // don't recurse into circular fetch internals (see #7205).+          Object.defineProperty(canceledError, 'cause', {+            __proto__: null,+            value: err,+            writable: true,+            enumerable: false,+            configurable: true+          });+        }         throw canceledError;@@ -5102,5 +5184,13 @@       if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {-        throw Object.assign(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response), {-          cause: err.cause || err+        const networkError = new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response);+        // Non-enumerable to match native Error `cause` semantics so loggers+        // don't recurse into circular fetch internals (see #7205).+        Object.defineProperty(networkError, 'cause', {+          __proto__: null,+          value: err.cause || err,+          writable: true,+          enumerable: false,+          configurable: true         });+        throw networkError;       }@@ -5223,3 +5313,3 @@     let s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';-    throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, 'ERR_NOT_SUPPORT');+    throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, AxiosError.ERR_NOT_SUPPORT);   }@@ -5366,3 +5456,3 @@ function assertOptions(options, schema, allowUnknown) {-  if (typeof options !== 'object') {+  if (typeof options !== 'object' || options === null) {     throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
lib/adapters/http.js +88 lines · 2 flagged
--- +++ @@ -91,2 +91,49 @@ const tunnelingAgentCacheUser = new WeakMap();+// Minimum minor versions where Node's HTTP Agent supports native proxyEnv+// handling. Checking the selected agent below also covers startup modes such+// as NODE_OPTIONS=--use-env-proxy and --no-use-env-proxy precedence.+const NODE_NATIVE_ENV_PROXY_SUPPORT = {+  22: 21,+  24: 5,+};++function isNodeNativeEnvProxySupported(nodeVersion = process.versions && process.versions.node) {+  if (!nodeVersion) {+    return false;+  }++  const [major, minor] = nodeVersion.split('.').map((part) => Number(part));++  if (!Number.isInteger(major) || !Number.isInteger(minor)) {+    return false;+  }++  if (major > 24) {+    return true;+  }++  return (+    NODE_NATIVE_ENV_PROXY_SUPPORT[major] != null && minor >= NODE_NATIVE_ENV_PROXY_SUPPORT[major]+  );+}++function isNodeEnvProxyEnabled(agent, nodeVersion = process.versions && process.versions.node) {+  if (!isNodeNativeEnvProxySupported(nodeVersion)) {+    return false;+  }++  const agentOptions = agent && agent.options;++  return Boolean(+    agentOptions &&+      utils.hasOwnProp(agentOptions, 'proxyEnv') &&+      agentOptions.proxyEnv != null+  );+}++function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) {+  return isHttps.test(options.protocol)+    ? (configHttpsAgent || https.globalAgent)+    : (configHttpAgent || http.globalAgent);+} @@ -212,5 +259,6 @@  */-function setProxy(options, configProxy, location, isRedirect, configHttpsAgent) {+function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) {   let proxy = configProxy;-  if (!proxy && proxy !== false) {+  const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent);+  if (!proxy && proxy !== false && !isNodeEnvProxyEnabled(proxyEnvAgent)) {     const proxyUrl = getProxyForUrl(location);@@ -365,3 +413,10 @@     // the exact same logic as if the redirected request was performed by axios directly.-    setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent);+    setProxy(+      redirectOptions,+      configProxy,+      redirectOptions.href,+      true,+      configHttpsAgent,+      configHttpAgent+    );   };@@ -477,6 +532,8 @@       let http2Options = own('http2Options');+      const httpAgent = own('httpAgent');+      const httpsAgent = own('httpsAgent');+      const configProxy = own('proxy');       const responseType = own('responseType');       const responseEncoding = own('responseEncoding');-      const httpAgent = own('httpAgent');-      const httpsAgent = own('httpsAgent');+      const socketPath = own('socketPath');       const method = own('method').toUpperCase();@@ -605,3 +662,10 @@       const fullPath = buildFullPath(own('baseURL'), own('url'), own('allowAbsoluteUrls'), config);-      const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);+      // Unix-socket requests (own socketPath) commonly pass a path-only url+      // like '/foo'; supply a synthetic base so new URL() can still parse it.+      // Use the own-property value (not config.socketPath) so a polluted+      // prototype cannot influence URL base selection.+      const urlBase = socketPath+        ? 'http://localhost'+        : (platform.hasBrowserEnv ? platform.origin : undefined);+      const parsed = new URL(fullPath, urlBase);       const protocol = parsed.protocol || supportedProtocols[0];@@ -812,7 +876,8 @@       } catch (err) {-        const customErr = new Error(err.message);-        customErr.config = config;-        customErr.url = own('url');-        customErr.exists = true;-        return reject(customErr);+        return reject(+          AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config, null, null, {+            url: own('url'),+            exists: true+          })+        );       }@@ -844,3 +909,2 @@ -      const socketPath = own('socketPath');       if (socketPath) {@@ -882,6 +946,7 @@           options,-          own('proxy'),+          configProxy,           protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path,           false,-          httpsAgent+          httpsAgent,+          httpAgent         );@@ -981,2 +1046,5 @@ +      // Set an explicit maxBodyLength option for transports that inspect it.+      // When maxBodyLength is -1 (default/unlimited), use Infinity so+      // follow-redirects does not fall back to its own 10MB default.       if (maxBodyLength > -1) {@@ -984,3 +1052,2 @@       } else {-        // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited         options.maxBodyLength = Infinity;@@ -1207,3 +1274,7 @@         // default interval of sending ack packet is 1 minute-        socket.setKeepAlive(true, 1000 * 60);+        // proxy agents (e.g. agent-base) may return a generic Duplex stream+        // that doesn't have setKeepAlive, so guard before calling+        if (typeof socket.setKeepAlive === 'function') {+          socket.setKeepAlive(true, 1000 * 60);+        } @@ -1344,2 +1415,3 @@ export const __setProxy = setProxy;+export const __isNodeEnvProxyEnabled = isNodeEnvProxyEnabled; export const __isSameOriginRedirect = isSameOriginRedirect;
lib/helpers/fromDataURI.js +4 lines · 1 flagged
--- +++ @@ -44,3 +44,3 @@     // Bare `data:,` leaves mime undefined; Blob normalises that to "" per spec.-    let mime;+    let mime = '';     if (type) {@@ -51,3 +51,5 @@ -    const buffer = Buffer.from(decodeURIComponent(body), encoding);+    const buffer = encoding === 'base64'+      ? Buffer.from(body, 'base64')+      : Buffer.from(decodeURIComponent(body), encoding); 
dist/axios.js +64 lines
--- +++ @@ -1,2 +1,2 @@-/*! Axios v1.18.0 Copyright (c) 2026 Matt Zabriskie and contributors */+/*! Axios v1.18.1 Copyright (c) 2026 Matt Zabriskie and contributors */ (function (global, factory) {@@ -2042,3 +2042,15 @@         var axiosError = new AxiosError(error.message, code || error.code, config, request, response);-        axiosError.cause = error;+        // Match native `Error` `cause` semantics: non-enumerable. The wrapped+        // error often carries circular internals (sockets, requests, agents), so+        // an enumerable `cause` makes structured loggers (pino/winston) and any+        // own-property walk throw "Converting circular structure to JSON".+        // Regression from #6982; see #7205. `__proto__: null` mirrors the+        // `message` descriptor below (prototype-pollution-safe descriptor).+        Object.defineProperty(axiosError, 'cause', {+          __proto__: null,+          value: error,+          writable: true,+          enumerable: false,+          configurable: true+        });         axiosError.name = error.name;@@ -2194,3 +2206,9 @@       if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {-        return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);+        if (useBlob && typeof _Blob === 'function') {+          return new _Blob([value]);+        }+        if (typeof Buffer !== 'undefined') {+          return Buffer.from(value);+        }+        throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT);       }@@ -2327,4 +2345,5 @@   prototype.toString = function toString(encoder) {+    var _this = this;     var _encode = encoder ? function (value) {-      return encoder.call(this, value, encode$1);+      return encoder.call(_this, value, encode$1);     } : encode$1;@@ -2360,2 +2379,3 @@     }+    url = url || '';     var _options = utils$1.isFunction(options) ? {@@ -3007,3 +3027,7 @@         if (eq !== -1 && cookie.slice(0, eq) === name) {-          return decodeURIComponent(cookie.slice(eq + 1));+          try {+            return decodeURIComponent(cookie.slice(eq + 1));+          } catch (e) {+            return cookie.slice(eq + 1);+          }         }@@ -3107,2 +3131,3 @@     // eslint-disable-next-line no-param-reassign+    config1 = config1 || {};     config2 = config2 || {};@@ -3242,3 +3267,3 @@     }-    Object.entries(formHeaders).forEach(function (_ref) {+    Object.entries(formHeaders || {}).forEach(function (_ref) {       var _ref2 = _slicedToArray(_ref, 2),@@ -3289,3 +3314,7 @@       var password = utils$1.getSafeProp(auth, 'password') || '';-      headers.set('Authorization', 'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : '')));+      try {+        headers.set('Authorization', 'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : '')));+      } catch (e) {+        throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);+      }     }@@ -3494,2 +3523,3 @@         reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));+        done();         return;@@ -3533,3 +3563,5 @@     signals.forEach(function (signal) {-      return signal.addEventListener('abort', onabort);+      return signal.addEventListener('abort', onabort, {+        once: true+      });     });@@ -3843,3 +3875,3 @@ -  var VERSION = "1.18.0";+  var VERSION = "1.18.1"; @@ -4047,3 +4079,3 @@       var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(config) {-        var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, maxContentLength, maxBodyLength, hasMaxContentLength, hasMaxBodyLength, own, _fetch, composedSignal, request, unsubscribe, requestContentLength, pendingBodyError, maxBodyLengthError, auth, configAuth, username, password, parsedURL, urlUsername, urlPassword, estimated, outboundLength, mustEnforceStreamBody, trackRequestStream, _request, contentTypeHeader, _ref5, _ref6, onProgress, flush, isCredentialsSupported, contentType, resolvedOptions, response, responseHeaders, declaredLength, isStreamResponse, options, responseContentLength, _ref7, _ref8, _onProgress, _flush, bytesRead, onChunkProgress, responseData, materializedSize, canceledError, _t3, _t4;+        var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, maxContentLength, maxBodyLength, hasMaxContentLength, hasMaxBodyLength, own, _fetch, composedSignal, request, unsubscribe, requestContentLength, pendingBodyError, maxBodyLengthError, auth, configAuth, username, password, parsedURL, urlUsername, urlPassword, estimated, outboundLength, mustEnforceStreamBody, trackRequestStream, _request, contentTypeHeader, _ref5, _ref6, onProgress, flush, isCredentialsSupported, contentType, resolvedOptions, response, responseHeaders, declaredLength, isStreamResponse, options, responseContentLength, _ref7, _ref8, _onProgress, _flush, bytesRead, onChunkProgress, responseData, materializedSize, canceledError, networkError, _t3, _t4;         return _regenerator().w(function (_context4) {@@ -4319,3 +4351,13 @@               request && (canceledError.request = request);-              _t4 !== canceledError && (canceledError.cause = _t4);+              if (_t4 !== canceledError) {+                // Non-enumerable to match native Error `cause` semantics so loggers+                // don't recurse into circular fetch internals (see #7205).+                Object.defineProperty(canceledError, 'cause', {+                  __proto__: null,+                  value: _t4,+                  writable: true,+                  enumerable: false,+                  configurable: true+                });+              }               throw canceledError;@@ -4340,5 +4382,12 @@               }-              throw Object.assign(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, _t4 && _t4.response), {-                cause: _t4.cause || _t4+              networkError = new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, _t4 && _t4.response); // Non-enumerable to match native Error `cause` semantics so loggers+              // don't recurse into circular fetch internals (see #7205).+              Object.defineProperty(networkError, 'cause', {+                __proto__: null,+                value: _t4.cause || _t4,+                writable: true,+                enumerable: false,+                configurable: true               });+              throw networkError;             case 20:@@ -4474,3 +4523,3 @@       var s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';-      throw new AxiosError("There is no suitable adapter to dispatch the request " + s, 'ERR_NOT_SUPPORT');+      throw new AxiosError("There is no suitable adapter to dispatch the request " + s, AxiosError.ERR_NOT_SUPPORT);     }@@ -4617,3 +4666,3 @@   function assertOptions(options, schema, allowUnknown) {-    if (_typeof(options) !== 'object') {+    if (_typeof(options) !== 'object' || options === null) {       throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
dist/browser/axios.cjs +70 lines
--- +++ @@ -1,2 +1,2 @@-/*! Axios v1.18.0 Copyright (c) 2026 Matt Zabriskie and contributors */+/*! Axios v1.18.1 Copyright (c) 2026 Matt Zabriskie and contributors */ 'use strict';@@ -1569,3 +1569,15 @@     const axiosError = new AxiosError(error.message, code || error.code, config, request, response);-    axiosError.cause = error;+    // Match native `Error` `cause` semantics: non-enumerable. The wrapped+    // error often carries circular internals (sockets, requests, agents), so+    // an enumerable `cause` makes structured loggers (pino/winston) and any+    // own-property walk throw "Converting circular structure to JSON".+    // Regression from #6982; see #7205. `__proto__: null` mirrors the+    // `message` descriptor below (prototype-pollution-safe descriptor).+    Object.defineProperty(axiosError, 'cause', {+      __proto__: null,+      value: error,+      writable: true,+      enumerable: false,+      configurable: true,+    });     axiosError.name = error.name;@@ -1808,3 +1820,9 @@     if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {-      return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);+      if (useBlob && typeof _Blob === 'function') {+        return new _Blob([value]);+      }+      if (typeof Buffer !== 'undefined') {+        return Buffer.from(value);+      }+      throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT);     }@@ -1985,5 +2003,3 @@   const _encode = encoder-    ? function (value) {-        return encoder.call(this, value, encode$1);-      }+    ? (value) => encoder.call(this, value, encode$1)     : encode$1;@@ -2026,2 +2042,3 @@   }+  url = url || ''; @@ -2777,3 +2794,7 @@           if (eq !== -1 && cookie.slice(0, eq) === name) {-            return decodeURIComponent(cookie.slice(eq + 1));+            try {+              return decodeURIComponent(cookie.slice(eq + 1));+            } catch (e) {+              return cookie.slice(eq + 1);+            }           }@@ -2886,2 +2907,3 @@   // eslint-disable-next-line no-param-reassign+  config1 = config1 || {};   config2 = config2 || {};@@ -3035,3 +3057,3 @@ -  Object.entries(formHeaders).forEach(([key, val]) => {+  Object.entries(formHeaders || {}).forEach(([key, val]) => {     if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {@@ -3085,6 +3107,10 @@ -    headers.set(-      'Authorization',-      'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : ''))-    );+    try {+      headers.set(+        'Authorization',+        'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : ''))+      );+    } catch (e) {+      throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);+    }   }@@ -3339,2 +3365,3 @@         );+        done();         return;@@ -3390,3 +3417,3 @@ -  signals.forEach((signal) => signal.addEventListener('abort', onabort));+  signals.forEach((signal) => signal.addEventListener('abort', onabort, { once: true })); @@ -3595,3 +3622,3 @@ -const VERSION = "1.18.0";+const VERSION = "1.18.1"; @@ -4139,3 +4166,13 @@         request && (canceledError.request = request);-        err !== canceledError && (canceledError.cause = err);+        if (err !== canceledError) {+          // Non-enumerable to match native Error `cause` semantics so loggers+          // don't recurse into circular fetch internals (see #7205).+          Object.defineProperty(canceledError, 'cause', {+            __proto__: null,+            value: err,+            writable: true,+            enumerable: false,+            configurable: true,+          });+        }         throw canceledError;@@ -4161,14 +4198,19 @@       if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {-        throw Object.assign(-          new AxiosError(-            'Network Error',-            AxiosError.ERR_NETWORK,-            config,-            request,-            err && err.response-          ),-          {-            cause: err.cause || err,-          }+        const networkError = new AxiosError(+          'Network Error',+          AxiosError.ERR_NETWORK,+          config,+          request,+          err && err.response         );+        // Non-enumerable to match native Error `cause` semantics so loggers+        // don't recurse into circular fetch internals (see #7205).+        Object.defineProperty(networkError, 'cause', {+          __proto__: null,+          value: err.cause || err,+          writable: true,+          enumerable: false,+          configurable: true,+        });+        throw networkError;       }@@ -4310,3 +4352,3 @@       `There is no suitable adapter to dispatch the request ` + s,-      'ERR_NOT_SUPPORT'+      AxiosError.ERR_NOT_SUPPORT     );@@ -4491,3 +4533,3 @@ function assertOptions(options, schema, allowUnknown) {-  if (typeof options !== 'object') {+  if (typeof options !== 'object' || options === null) {     throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
dist/esm/axios.js +70 lines
--- +++ @@ -1,2 +1,2 @@-/*! Axios v1.18.0 Copyright (c) 2026 Matt Zabriskie and contributors */+/*! Axios v1.18.1 Copyright (c) 2026 Matt Zabriskie and contributors */ /**@@ -1567,3 +1567,15 @@     const axiosError = new AxiosError(error.message, code || error.code, config, request, response);-    axiosError.cause = error;+    // Match native `Error` `cause` semantics: non-enumerable. The wrapped+    // error often carries circular internals (sockets, requests, agents), so+    // an enumerable `cause` makes structured loggers (pino/winston) and any+    // own-property walk throw "Converting circular structure to JSON".+    // Regression from #6982; see #7205. `__proto__: null` mirrors the+    // `message` descriptor below (prototype-pollution-safe descriptor).+    Object.defineProperty(axiosError, 'cause', {+      __proto__: null,+      value: error,+      writable: true,+      enumerable: false,+      configurable: true,+    });     axiosError.name = error.name;@@ -1806,3 +1818,9 @@     if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {-      return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);+      if (useBlob && typeof _Blob === 'function') {+        return new _Blob([value]);+      }+      if (typeof Buffer !== 'undefined') {+        return Buffer.from(value);+      }+      throw new AxiosError$1('Blob is not supported. Use a Buffer instead.', AxiosError$1.ERR_NOT_SUPPORT);     }@@ -1983,5 +2001,3 @@   const _encode = encoder-    ? function (value) {-        return encoder.call(this, value, encode$1);-      }+    ? (value) => encoder.call(this, value, encode$1)     : encode$1;@@ -2024,2 +2040,3 @@   }+  url = url || ''; @@ -2775,3 +2792,7 @@           if (eq !== -1 && cookie.slice(0, eq) === name) {-            return decodeURIComponent(cookie.slice(eq + 1));+            try {+              return decodeURIComponent(cookie.slice(eq + 1));+            } catch (e) {+              return cookie.slice(eq + 1);+            }           }@@ -2884,2 +2905,3 @@   // eslint-disable-next-line no-param-reassign+  config1 = config1 || {};   config2 = config2 || {};@@ -3033,3 +3055,3 @@ -  Object.entries(formHeaders).forEach(([key, val]) => {+  Object.entries(formHeaders || {}).forEach(([key, val]) => {     if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {@@ -3083,6 +3105,10 @@ -    headers.set(-      'Authorization',-      'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : ''))-    );+    try {+      headers.set(+        'Authorization',+        'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : ''))+      );+    } catch (e) {+      throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_OPTION_VALUE, config);+    }   }@@ -3337,2 +3363,3 @@         );+        done();         return;@@ -3388,3 +3415,3 @@ -  signals.forEach((signal) => signal.addEventListener('abort', onabort));+  signals.forEach((signal) => signal.addEventListener('abort', onabort, { once: true })); @@ -3593,3 +3620,3 @@ -const VERSION$1 = "1.18.0";+const VERSION$1 = "1.18.1"; @@ -4137,3 +4164,13 @@         request && (canceledError.request = request);-        err !== canceledError && (canceledError.cause = err);+        if (err !== canceledError) {+          // Non-enumerable to match native Error `cause` semantics so loggers+          // don't recurse into circular fetch internals (see #7205).+          Object.defineProperty(canceledError, 'cause', {+            __proto__: null,+            value: err,+            writable: true,+            enumerable: false,+            configurable: true,+          });+        }         throw canceledError;@@ -4159,14 +4196,19 @@       if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {-        throw Object.assign(-          new AxiosError$1(-            'Network Error',-            AxiosError$1.ERR_NETWORK,-            config,-            request,-            err && err.response-          ),-          {-            cause: err.cause || err,-          }+        const networkError = new AxiosError$1(+          'Network Error',+          AxiosError$1.ERR_NETWORK,+          config,+          request,+          err && err.response         );+        // Non-enumerable to match native Error `cause` semantics so loggers+        // don't recurse into circular fetch internals (see #7205).+        Object.defineProperty(networkError, 'cause', {+          __proto__: null,+          value: err.cause || err,+          writable: true,+          enumerable: false,+          configurable: true,+        });+        throw networkError;       }@@ -4308,3 +4350,3 @@       `There is no suitable adapter to dispatch the request ` + s,-      'ERR_NOT_SUPPORT'+      AxiosError$1.ERR_NOT_SUPPORT     );@@ -4489,3 +4531,3 @@ function assertOptions(options, schema, allowUnknown) {-  if (typeof options !== 'object') {+  if (typeof options !== 'object' || options === null) {     throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
index.d.ts +17 lines
--- +++ @@ -33,2 +33,3 @@   set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;+  set(headers?: Iterable<[string, AxiosHeaderValue]>, rewrite?: boolean): AxiosHeaders; @@ -92,2 +93,4 @@   getSetCookie(): string[];++  toString(): string; @@ -235,2 +238,8 @@   NetworkAuthenticationRequired = 511,+  WebServerIsDown = 521,+  ConnectionTimedOut = 522,+  OriginIsUnreachable = 523,+  TimeoutOccurred = 524,+  SslHandshakeFailed = 525,+  InvalidSslCertificate = 526, }@@ -317,2 +326,4 @@   indexes?: boolean | null;+  maxDepth?: number;+  Blob?: { new (...args: any[]): any }; }@@ -540,3 +551,5 @@ export class CanceledError<T> extends AxiosError<T> {+  constructor(message?: string, config?: InternalAxiosRequestConfig, request?: any);   readonly name: 'CanceledError';+  __CANCEL__?: boolean; }@@ -566,2 +579,5 @@   throwIfRequested(): void;+  subscribe(listener: (cancel: Cancel | any) => void): void;+  unsubscribe(listener: (cancel: Cancel | any) => void): void;+  toAbortSignal(): AbortSignal; }@@ -718,3 +734,3 @@ export interface AxiosStatic extends AxiosInstance {-  Cancel: CancelStatic;+  Cancel: typeof CanceledError;   CancelToken: CancelTokenStatic;
lib/adapters/adapters.js +1 lines
--- +++ @@ -109,3 +109,3 @@       `There is no suitable adapter to dispatch the request ` + s,-      'ERR_NOT_SUPPORT'+      AxiosError.ERR_NOT_SUPPORT     );
lib/adapters/fetch.js +27 lines
--- +++ @@ -559,3 +559,13 @@         request && (canceledError.request = request);-        err !== canceledError && (canceledError.cause = err);+        if (err !== canceledError) {+          // Non-enumerable to match native Error `cause` semantics so loggers+          // don't recurse into circular fetch internals (see #7205).+          Object.defineProperty(canceledError, 'cause', {+            __proto__: null,+            value: err,+            writable: true,+            enumerable: false,+            configurable: true,+          });+        }         throw canceledError;@@ -581,14 +591,19 @@       if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {-        throw Object.assign(-          new AxiosError(-            'Network Error',-            AxiosError.ERR_NETWORK,-            config,-            request,-            err && err.response-          ),-          {-            cause: err.cause || err,-          }+        const networkError = new AxiosError(+          'Network Error',+          AxiosError.ERR_NETWORK,+          config,+          request,+          err && err.response         );+        // Non-enumerable to match native Error `cause` semantics so loggers+        // don't recurse into circular fetch internals (see #7205).+        Object.defineProperty(networkError, 'cause', {+          __proto__: null,+          value: err.cause || err,+          writable: true,+          enumerable: false,+          configurable: true,+        });+        throw networkError;       }
lib/adapters/xhr.js +1 lines
--- +++ @@ -220,2 +220,3 @@         );+        done();         return;
lib/core/AxiosError.js +13 lines
--- +++ @@ -77,3 +77,15 @@     const axiosError = new AxiosError(error.message, code || error.code, config, request, response);-    axiosError.cause = error;+    // Match native `Error` `cause` semantics: non-enumerable. The wrapped+    // error often carries circular internals (sockets, requests, agents), so+    // an enumerable `cause` makes structured loggers (pino/winston) and any+    // own-property walk throw "Converting circular structure to JSON".+    // Regression from #6982; see #7205. `__proto__: null` mirrors the+    // `message` descriptor below (prototype-pollution-safe descriptor).+    Object.defineProperty(axiosError, 'cause', {+      __proto__: null,+      value: error,+      writable: true,+      enumerable: false,+      configurable: true,+    });     axiosError.name = error.name;
lib/core/mergeConfig.js +1 lines
--- +++ @@ -18,2 +18,3 @@   // eslint-disable-next-line no-param-reassign+  config1 = config1 || {};   config2 = config2 || {};
lib/env/data.js +1 lines
--- +++ @@ -1 +1 @@-export const VERSION = "1.18.0";+export const VERSION = "1.18.1";
lib/helpers/AxiosURLSearchParams.js +1 lines
--- +++ @@ -48,5 +48,3 @@   const _encode = encoder-    ? function (value) {-        return encoder.call(this, value, encode);-      }+    ? (value) => encoder.call(this, value, encode)     : encode;
lib/helpers/buildURL.js +1 lines
--- +++ @@ -34,2 +34,3 @@   }+  url = url || ''; 
lib/helpers/composeSignals.js +1 lines
--- +++ @@ -47,3 +47,3 @@ -  signals.forEach((signal) => signal.addEventListener('abort', onabort));+  signals.forEach((signal) => signal.addEventListener('abort', onabort, { once: true })); 
lib/helpers/cookies.js +5 lines
--- +++ @@ -42,3 +42,7 @@           if (eq !== -1 && cookie.slice(0, eq) === name) {-            return decodeURIComponent(cookie.slice(eq + 1));+            try {+              return decodeURIComponent(cookie.slice(eq + 1));+            } catch (e) {+              return cookie.slice(eq + 1);+            }           }
lib/helpers/resolveConfig.js +10 lines
--- +++ @@ -2,2 +2,3 @@ import utils from '../utils.js';+import AxiosError from '../core/AxiosError.js'; import isURLSameOrigin from './isURLSameOrigin.js';@@ -17,3 +18,3 @@ -  Object.entries(formHeaders).forEach(([key, val]) => {+  Object.entries(formHeaders || {}).forEach(([key, val]) => {     if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {@@ -67,6 +68,10 @@ -    headers.set(-      'Authorization',-      'Basic ' + btoa(username + ':' + (password ? encodeUTF8(password) : ''))-    );+    try {+      headers.set(+        'Authorization',+        'Basic ' + btoa(username + ':' + (password ? encodeUTF8(password) : ''))+      );+    } catch (e) {+      throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);+    }   }
lib/helpers/toFormData.js +7 lines
--- +++ @@ -145,3 +145,9 @@     if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {-      return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);+      if (useBlob && typeof _Blob === 'function') {+        return new _Blob([value]);+      }+      if (typeof Buffer !== 'undefined') {+        return Buffer.from(value);+      }+      throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT);     }
lib/helpers/validator.js +1 lines
--- +++ @@ -81,3 +81,3 @@ function assertOptions(options, schema, allowUnknown) {-  if (typeof options !== 'object') {+  if (typeof options !== 'object' || options === null) {     throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
package.json +2 lines
--- +++ @@ -2,3 +2,3 @@   "name": "axios",-  "version": "1.18.0",+  "version": "1.18.1",   "description": "Promise based HTTP client for the browser and node.js",@@ -89,4 +89,4 @@     "Shaan Majid (https://github.com/shaanmajid)",+    "Remco Haszing (https://github.com/remcohaszing)",     "Willian Agostini (https://github.com/WillianAgostini)",-    "Remco Haszing (https://github.com/remcohaszing)",     "Rikki Gibson (https://github.com/RikkiGibson)"
@ctrl/tinycolor npm
4.2.0 9mo ago incident on record
DELETION ×2BURST ×3
latest 4.2.0 versions 49 maintainers 1
3.5.1
3.6.0
3.6.1
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
4.1.0
4.1.1
4.1.2
4.2.0
DELETION
4.1.1 published then removed
high · registry-verified · 2025-09-15 · 9mo ago
DELETION
4.1.2 published then removed
high · registry-verified · 2025-09-15 · 9mo ago
BURST
3 releases in 29m: 3.0.0, 3.0.1, 3.0.2
info · registry-verified · 2020-04-22 · 6y ago
BURST
2 releases in 50m: 3.6.1, 4.0.0
info · registry-verified · 2023-08-23 · 2y ago
BURST
2 releases in 21m: 4.1.1, 4.1.2
info · registry-verified · 2025-09-15 · 9mo ago
release diff 4.1.0 → 4.2.0
+0 added · -0 removed · ~2 modified
package.json +3 lines
--- +++ @@ -2,3 +2,3 @@   "name": "@ctrl/tinycolor",-  "version": "4.1.0",+  "version": "4.2.0",   "description": "Fast, small color manipulation and conversion for JavaScript",@@ -6,3 +6,4 @@   "publishConfig": {-    "access": "public"+    "access": "public",+    "provenance": true   },
event-stream npm
4.0.1 7y ago incident on record
DELETIONBURST ×10
latest 4.0.1 versions 84 maintainers 1
3.2.0
3.2.1
3.2.2
3.3.0
3.3.1
3.3.2
3.3.3
3.3.4
3.3.5
3.3.6
4.0.0
4.0.1
DELETION
3.3.6 published then removed
high · registry-verified · 2018-09-09 · 7y ago
BURST
2 releases in 43m: 0.5.2, 0.5.3
info · registry-verified · 2011-11-01 · 14y ago
BURST
8 releases in 0m: 0.1.0, 0.2.0, 0.2.1, 0.3.0, 0.4.0, 0.5.0, 0.5.1, 0.7.0
info · registry-verified · 2011-12-07 · 14y ago
BURST
2 releases in 10m: 0.9.0, 0.9.1
info · registry-verified · 2012-04-21 · 14y ago
BURST
3 releases in 39m: 0.9.4, 0.9.6, 0.9.7
info · registry-verified · 2012-04-25 · 14y ago
BURST
2 releases in 38m: 1.0.0, 1.1.0
info · registry-verified · 2012-05-21 · 14y ago
BURST
3 releases in 15m: 2.0.1, 2.0.2, 2.0.3
info · registry-verified · 2012-06-12 · 14y ago
BURST
2 releases in 41m: 2.1.3, 2.1.4
info · registry-verified · 2012-07-04 · 14y ago
BURST
2 releases in 28m: 2.2.3, 3.0.0
info · registry-verified · 2012-08-18 · 13y ago
BURST
2 releases in 4m: 3.0.6, 3.0.7
info · registry-verified · 2012-09-30 · 13y ago
BURST
2 releases in 16m: 3.0.17, 3.0.18
info · registry-verified · 2013-12-04 · 12y ago
release diff 4.0.0 → 4.0.1
+0 added · -0 removed · ~2 modified
package.json +4 lines
--- +++ @@ -2,3 +2,3 @@   "name": "event-stream",-  "version": "4.0.0",+  "version": "4.0.1",   "description": "construct pipes of streams of events",@@ -30,23 +30,5 @@   },-  "testling": {-    "files": "test/*.js",-    "browsers": {-      "ie": [-        8,-        9-      ],-      "firefox": [-        13-      ],-      "chrome": [-        20-      ],-      "safari": [-        5.1-      ],-      "opera": [-        12-      ]-    }-  },+  "keywords": [+    "stream", "map", "flatmap", "filter", "split", "join", "merge", "replace"+  ],   "license": "MIT",
rc npm
1.2.8 8y ago incident on record
DELETION ×3BURST ×3
latest 1.2.8 versions 48 maintainers 9
1.2.0
1.2.1
1.2.2
1.2.3
1.2.4
1.2.5
1.2.6
1.2.7
1.2.8
1.2.9
1.3.9
2.3.9
DELETION
1.2.9 published then removed
high · registry-verified · 2021-11-04 · 4y ago
DELETION
1.3.9 published then removed
high · registry-verified · 2021-11-04 · 4y ago
DELETION
2.3.9 published then removed
high · registry-verified · 2021-11-04 · 4y ago
BURST
2 releases in 1m: 0.1.2, 0.1.3
info · registry-verified · 2013-04-27 · 13y ago
BURST
2 releases in 1m: 1.1.3, 1.1.4
info · registry-verified · 2015-11-05 · 10y ago
BURST
3 releases in 0m: 1.2.9, 1.3.9, 2.3.9
info · registry-verified · 2021-11-04 · 4y ago
release diff 1.2.7 → 1.2.8
+0 added · -0 removed · ~1 modified
package.json +2 lines
--- +++ @@ -2,3 +2,3 @@   "name": "rc",-  "version": "1.2.7",+  "version": "1.2.8",   "description": "hardwired configuration loader",@@ -23,3 +23,3 @@   "dependencies": {-    "deep-extend": "^0.5.1",+    "deep-extend": "^0.6.0",     "ini": "~1.3.0",
ua-parser-js npm
2.0.10 1mo ago incident on record
DELETION ×3BURST ×11
latest 2.0.10 versions 94 maintainers 1
2.0.1
2.0.2
2.0.3
2.0.4
0.7.41
1.0.41
2.0.5
2.0.6
2.0.7
2.0.8
2.0.9
2.0.10
DELETION
0.7.29 published then removed
high · registry-verified · 2021-10-22 · 4y ago
DELETION
0.8.0 published then removed
high · registry-verified · 2021-10-22 · 4y ago
DELETION
1.0.0 published then removed
high · registry-verified · 2021-10-22 · 4y ago
BURST
3 releases in 1m: 0.7.29, 0.8.0, 1.0.0
info · registry-verified · 2021-10-22 · 4y ago
BURST
3 releases in 10m: 0.7.30, 0.8.1, 1.0.1
info · registry-verified · 2021-10-22 · 4y ago
BURST
2 releases in 0m: 0.7.32, 1.0.32
info · registry-verified · 2022-10-15 · 3y ago
BURST
2 releases in 0m: 1.0.33, 0.7.33
info · registry-verified · 2023-01-22 · 3y ago
BURST
2 releases in 0m: 0.7.34, 1.0.34
info · registry-verified · 2023-03-05 · 3y ago
BURST
2 releases in 0m: 0.7.35, 1.0.35
info · registry-verified · 2023-04-01 · 3y ago
BURST
2 releases in 3m: 0.7.36, 1.0.36
info · registry-verified · 2023-09-09 · 2y ago
BURST
2 releases in 4m: 0.7.37, 1.0.37
info · registry-verified · 2023-10-27 · 2y ago
BURST
2 releases in 1m: 0.7.38, 1.0.38
info · registry-verified · 2024-05-28 · 2y ago
BURST
2 releases in 5m: 0.7.40, 1.0.40
info · registry-verified · 2024-12-21 · 1y ago
BURST
2 releases in 1m: 0.7.41, 1.0.41
info · registry-verified · 2025-08-19 · 10mo ago
release diff 2.0.9 → 2.0.10
+0 added · -0 removed · ~27 modified
dist/ua-parser.pack.js +2 lines · 1 flagged
--- +++ @@ -1,4 +1,4 @@-/* UAParser.js v2.0.9+/* UAParser.js v2.0.10    Copyright © 2012-2026 Faisal Salman <[email protected]>    AGPLv3 License */-((i,c)=>{function A(i){for(var e={},t=0;t<i.length;t++)e[i[t].toUpperCase()]=i[t];return e}function B(i){return Ti(i)?Oi(/[^\d\.]/g,i).split(".")[0]:c}function H(i,e){if(i&&e)for(var t,o,r,a,s,n=0;n<e.length&&!a;){for(var w=e[n],b=e[n+1],d=t=0;d<w.length&&!a&&w[d];)if(a=w[d++].exec(i))for(o=0;o<b.length;o++)s=a[++t],typeof(r=b[o])===l.OBJECT&&0<r.length?2===r.length?typeof r[1]==l.FUNCTION?this[r[0]]=r[1].call(this,s):this[r[0]]=r[1]:3<=r.length&&(typeof r[1]!==l.FUNCTION||r[1].exec&&r[1].test?3==r.length?this[r[0]]=s?s.replace(r[1],r[2]):c:4==r.length?this[r[0]]=s?r[3].call(this,s.replace(r[1],r[2])):c:4<r.length&&(this[r[0]]=s?r[3].apply(this,[s.replace(r[1],r[2])].concat(r.slice(4))):c):3<r.length?this[r[0]]=s?r[1].apply(this,r.slice(2)):c:this[r[0]]=s?r[1].call(this,s,r[2]):c):this[r]=s||c;n+=2}}function p(i,e){for(var t in e)if(typeof e[t]===l.OBJECT&&0<e[t].length){for(var o=0;o<e[t].length;o++)if(Ei(e[t][o],i))return"?"===t?c:t}else if(Ei(e[t],i))return"?"===t?c:t;return e.hasOwnProperty("*")?e["*"]:i}function M(e,i){var t=Ai.init[i],o=Ai.isIgnore[i]||0,r=Ai.isIgnoreRgx[i]||0,a=Ai.toString[i]||0;function s(){D.call(this,t)}return s.prototype.getItem=function(){return e},s.prototype.withClientHints=function(){return _?_.getHighEntropyValues(oi).then(function(i){return e.setCH(new Bi(i,!1)).parseCH().get()}):e.parseCH().get()},s.prototype.withFeatureCheck=function(){return e.detectFeature().get()},i!=v&&(s.prototype.is=function(i){var e,t=!1;for(e in this)if(this.hasOwnProperty(e)&&!Ei(o,e)&&q(r?Oi(r,this[e]):this[e])==q(r?Oi(r,i):i)){if(t=!0,i!=l.UNDEFINED)break}else if(i==l.UNDEFINED&&t){t=!t;break}return t},s.prototype.toString=function(){var i,e=d;for(i in a)typeof this[a[i]]!==l.UNDEFINED&&(e+=(e?" ":d)+this[a[i]]);return e||l.UNDEFINED}),s.prototype.then=function(i){function e(){for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i])}var t=this,o=(e.prototype={is:s.prototype.is,toString:s.prototype.toString,withClientHints:s.prototype.withClientHints,withFeatureCheck:s.prototype.withFeatureCheck},new e);return i(o),o},new s}var V="user-agent",d="",l={FUNCTION:"function",OBJECT:"object",STRING:"string",UNDEFINED:"undefined"},h="browser",u="cpu",m="device",f="engine",g="os",v="result",k="name",x="type",y="vendor",C="version",N="architecture",j="major",E="model",P="console",S="mobile",t="tablet",e="smarttv",o="wearable",R="xr",G="embedded",r="inapp",L="brands",T="formFactors",$="fullVersionList",I="platform",W="platformVersion",J="bitness",a="sec-ch-ua",X=a+"-full-version-list",Y=a+"-arch",Z=a+"-"+J,Q=a+"-form-factors",K=a+"-"+S,ii=a+"-"+E,ei=a+"-"+I,ti=ei+"-version",oi=[L,$,S,E,I,W,N,T,J],ri="Amazon",s="Apple",ai="ASUS",si="BlackBerry",n="Google",ni="Huawei",wi="Lenovo",bi="Honor",di="Microsoft",li="Motorola",ci="OnePlus",pi="OPPO",hi="Samsung",ui="Sony",mi="Xiaomi",fi="Zebra",gi="Chromium",w="Chromecast",vi="Edge",ki="Firefox",b="Opera",xi="Facebook",O="Mobile ",yi=" Browser",Ci="Windows",Ni=typeof i!==l.UNDEFINED,U=Ni&&i.navigator?i.navigator:c,_=U&&U.userAgentData?U.userAgentData:c,Ei=function(i,e){if(typeof i===l.OBJECT&&0<i.length){for(var t in i)if(q(e)==q(i[t]))return!0;return!1}return!!Ti(i)&&q(e)==q(i)},Si=function(i,e){for(var t in i)return/^(browser|cpu|device|engine|os)$/.test(t)||!!e&&Si(i[t])},Ti=function(i){return typeof i===l.STRING},Ii=function(i){if(!i)return c;for(var e,t=[],o=Oi(/\\?\"/g,i).split(","),r=0;r<o.length;r++)-1<o[r].indexOf(";")?(e=_i(o[r]).split(";v="),t[r]={brand:e[0],version:e[1]}):t[r]=_i(o[r]);return t},q=function(i){return Ti(i)?i.toLowerCase():i},D=function(i){for(var e in i)i.hasOwnProperty(e)&&(typeof(e=i[e])==l.OBJECT&&2==e.length?this[e[0]]=e[1]:this[e]=c);return this},Oi=function(i,e){return Ti(e)?e.replace(i,d):e},Ui=function(i){return Oi(/\\?\"/g,i)},_i=function(i,e){return i=Oi(/^\s\s*/,String(i)),typeof e===l.UNDEFINED?i:i.substring(0,e)},qi={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2",8.1:"6.3",10:["6.4","10.0"],NT:""},Di={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":c},Fi={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},zi={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[C,[k,O+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[C,[k,vi+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[C,[k,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[k,C],[/opios[\/ ]+([\w\.]+)/i],[C,[k,b+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[C,[k,b+" GX"]],[/\bopr\/([\w\.]+)/i],[C,[k,b]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[C,[k,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[C,[k,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:hi|lg |ovi|qute)browser|palemoon)\/v?([-\w\.]+)/i,/(brave)(?: chrome)?\/([\d\.]+)/i,/(aloha|heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[k,C],[/quark(?:pc)?\/([-\w\.]+)/i],[C,[k,"Quark"]],[/\bddg\/([\w\.]+)/i],[C,[k,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[C,[k,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[C,[k,"WeChat"]],[/konqueror\/([\w\.]+)/i],[C,[k,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[C,[k,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[C,[k,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[C,[k,"Smart "+wi+yi]],[/(av(?:ast|g|ira))\/([\w\.]+)/i],[[k,/(.+)/,"$1 Secure"+yi],C],[/norton\/([\w\.]+)/i],[C,[k,"Norton Private"+yi]],[/\bfocus\/([\w\.]+)/i],[C,[k,ki+" Focus"]],[/ mms\/([\w\.]+)$/i],[C,[k,b+" Neon"]],[/ opt\/([\w\.]+)$/i],[C,[k,b+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[C,[k,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[C,[k,"Dolphin"]],[/coast\/([\w\.]+)/i],[C,[k,b+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[C,[k,"MIUI"+yi]],[/fxios\/([\w\.-]+)/i],[C,[k,O+ki]],[/\bqihoobrowser\/?([\w\.]*)/i],[C,[k,"360"]],[/\b(qq)\/([\w\.]+)/i],[[k,/(.+)/,"$1Browser"],C],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[k,/(.+)/,"$1"+yi],C],[/samsungbrowser\/([\w\.]+)/i],[C,[k,hi+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[C,[k,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[k,"Sogou Mobile"],C],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[k,C],[/(lbbrowser|luakit|rekonq|steam(?= (clie|tenf|gameo)))/i],[k],[/ome\/([\w\.]+).+(iron(?= saf)|360(?=[es]e$))/i],[C,k],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[k,xi],C,[x,r]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[k,C,[x,r]],[/\bgsa\/([\w\.]+) .*safari\//i],[C,[k,"GSA"],[x,r]],[/(?:musical_ly|trill)(?:.+app_?version\/|_)([\w\.]+)/i],[C,[k,"TikTok"],[x,r]],[/\[(linkedin)app\]/i],[k,[x,r]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[k,/(.+)/,"Zalo"],C,[x,r]],[/(chromium)[\/ ]([-\w\.]+)/i],[k,C],[/ome-(lighthouse)$/i],[k,[x,"fetcher"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[C,[k,"Chrome Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[C,[k,vi+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[k,"Chrome WebView"],C],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[C,[k,"Android"+yi]],[/chrome\/([\w\.]+) mobile/i],[C,[k,O+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[k,C],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[C,[k,O+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[k,O+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[C,k],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[k,[C,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[k,C],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[k,O+ki],C],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[k,"Netscape"],C],[/(wolvic|librewolf)\/([\w\.]+)/i],[k,C],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[C,[k,ki+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[k,[C,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[k,[C,/[^\d\.]+./,d]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[N,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[N,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[N,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[N,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[N,"arm"]],[/ sun4\w[;\)]/i],[[N,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[N,/ower/,d,q]],[/mc680.0/i],[[N,"68k"]],[/winnt.+\[axp/i],[[N,"alpha"]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[E,[y,hi],[x,t]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[E,[y,hi],[x,S]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[E,[y,s],[x,S]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[E,[y,s],[x,t]],[/(macintosh);/i],[E,[y,s]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[E,[y,"Sharp"],[x,S]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[E,[y,bi],[x,t]],[/honor([-\w ]+)[;\)]/i],[E,[y,bi],[x,S]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[E,[y,ni],[x,t]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[E,[y,ni],[x,S]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[E,/_/g," "],[y,mi],[x,t]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[E,/_/g," "],[y,mi],[x,S]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-l]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[E,[y,ci],[x,S]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[E,[y,pi],[x,S]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[E,[y,p,{OnePlus:["203","304","403","404","413","415"],"*":pi}],[x,t]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[E,[y,"BLU"],[x,S]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[E,[y,"Vivo"],[x,S]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[E,[y,"Realme"],[x,S]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[E,[y,wi],[x,t]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[E,[y,wi],[x,S]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[E,[y,li],[x,S]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[E,[y,li],[x,t]],[/\b(?:lg)?([vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[E,[y,"LG"],[x,t]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[E,[y,"LG"],[x,S]],[/(nokia) (t[12][01])/i],[y,E,[x,t]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[E,/_/g," "],[x,S],[y,"Nokia"]],[/(pixel (c|tablet))\b/i],[E,[y,n],[x,t]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[E,[y,n],[x,S]],[/(google) (pixelbook( go)?)/i],[y,E],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[E,[y,ui],[x,S]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[E,"Xperia Tablet"],[y,ui],[x,t]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[E,[y,ri],[x,t]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[E,/(.+)/g,"Fire Phone $1"],[y,ri],[x,S]],[/(playbook);[-\w\),; ]+(rim)/i],[E,y,[x,t]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[E,[y,si],[x,S]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[E,[y,ai],[x,t]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[E,[y,ai],[x,S]],[/(nexus 9)/i],[E,[y,"HTC"],[x,t]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[y,[E,/_/g," "],[x,S]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[E,[y,"TCL"],[x,t]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[E,[y,"TCL"],[x,S]],[/(itel) ((\w+))/i],[[y,q],E,[x,p,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[E,[y,"Acer"],[x,t]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[E,[y,"Meizu"],[x,S]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[E,[y,"Ulefone"],[x,S]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[E,[y,"Energizer"],[x,S]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[E,[y,"Cat"],[x,S]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[E,[y,"Smartfren"],[x,S]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[E,[y,"Nothing"],[x,S]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[E,[y,"Archos"],[x,t]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[E,[y,"Archos"],[x,S]],[/; (n159v)/i],[E,[y,"HMD"],[x,S]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[y,E,[x,t]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[y,E,[x,S]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[y,E,[x,t]],[/(surface duo)/i],[E,[y,di],[x,t]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[E,[y,"Fairphone"],[x,S]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[E,[y,"Nvidia"],[x,t]],[/(sprint) (\w+)/i],[y,E,[x,S]],[/(kin\.[onetw]{3})/i],[[E,/\./g," "],[y,di],[x,S]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[E,[y,fi],[x,t]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[E,[y,fi],[x,S]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[y,[x,e]],[/hbbtv.+maple;(\d+)/i],[[E,/^/,"SmartTV"],[y,hi],[x,e]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[y,E,[x,e]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[y,"LG"],[x,e]],[/(apple) ?tv/i],[y,[E,s+" TV"],[x,e]],[/crkey.*devicetype\/chromecast/i],[[E,w+" Third Generation"],[y,n],[x,e]],[/crkey.*devicetype\/([^/]*)/i],[[E,/^/,"Chromecast "],[y,n],[x,e]],[/fuchsia.*crkey/i],[[E,w+" Nest Hub"],[y,n],[x,e]],[/crkey/i],[[E,w],[y,n],[x,e]],[/(portaltv)/i],[E,[y,xi],[x,e]],[/droid.+aft(\w+)( bui|\))/i],[E,[y,ri],[x,e]],[/(shield \w+ tv)/i],[E,[y,"Nvidia"],[x,e]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[E,[y,"Sharp"],[x,e]],[/(bravia[\w ]+)( bui|\))/i],[E,[y,ui],[x,e]],[/(mi(tv|box)-?\w+) bui/i],[E,[y,mi],[x,e]],[/Hbbtv.*(technisat) (.*);/i],[y,E,[x,e]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[y,/.+\/(\w+)/,"$1",p,{LG:"lge"}],[E,_i],[x,e]],[/(playstation \w+)/i],[E,[y,ui],[x,P]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[E,[y,di],[x,P]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[y,p,{Nvidia:"Shield",Anbernic:"RGCUBE",Logitech:"GR0006"}],E,[x,P]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[E,[y,hi],[x,o]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[y,E,[x,o]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[E,[y,pi],[x,o]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[E,[y,s],[x,o]],[/(opwwe\d{3})/i],[E,[y,ci],[x,o]],[/(moto 360)/i],[E,[y,li],[x,o]],[/(smartwatch 3)/i],[E,[y,ui],[x,o]],[/(g watch r)/i],[E,[y,"LG"],[x,o]],[/droid.+; (wt63?0{2,3})\)/i],[E,[y,fi],[x,o]],[/droid.+; (glass) \d/i],[E,[y,n],[x,R]],[/(pico) ([\w ]+) os\d/i],[y,E,[x,R]],[/(quest( \d| pro)?s?).+vr/i],[E,[y,xi],[x,R]],[/mobile vr; rv.+firefox/i],[[x,R]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[y,[x,G]],[/(aeobc)\b/i],[E,[y,ri],[x,G]],[/(homepod).+mac os/i],[E,[y,s],[x,G]],[/windows iot/i],[[x,G]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[E,[x,e]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[x,e]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[E,[x,p,{mobile:"Mobile",xr:"VR","*":t}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[x,t]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[x,S]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[E,[y,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[C,[k,vi+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[k,C],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[C,[k,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links|dillo)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[k,C],[/ladybird\//i],[[k,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[C,k]],os:[[/(windows nt) (6\.[23]); arm/i],[[k,/N/,"R"],[C,p,qi]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[k,C],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[C,/(;|\))/g,"",p,qi],[k,Ci]],[/(windows ce)\/?([\d\.]*)/i],[k,C],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[C,/_/g,"."],[k,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[k,"macOS"],[C,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[C,[k,w+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[C,[k,w+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[C,[k,w+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[C,[k,w+" Linux"]],[/crkey\/([\d\.]+)/i],[C,[k,w]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[C,k],[/(ubuntu) ([\w\.]+) like android/i],[[k,/(.+)/,"$1 Touch"],C],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[k,C],[/\(bb(10);/i],[C,[k,si]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[C,[k,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile[;\w ]*|tablet|tv|[^\)]*(?:viera|lg(?:l25|-d300)|alcatel ?o.+|y300-f1)); rv:([\w\.]+)\).+gecko\//i],[C,[k,ki+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[C,[k,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[C,p,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[k,"webOS"]],[/watch(?: ?os[,\/ ]|\d,\d\/)([\d\.]+)/i],[C,[k,"watchOS"]],[/cros [\w]+(?:\)| ([\w\.]+)\b)/i],[C,[k,"Chrome OS"]],[/kepler ([\w\.]+); (aft|aeo)/i],[C,[k,"Vega OS"]],[/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[k,C],[/(sunos) ?([\d\.]*)/i],[[k,"Solaris"],C],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[k,C]]},Ai=(b={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}},D.call(b.init,[[h,[k,C,j,x]],[u,[N]],[m,[x,E,y]],[f,[k,C]],[g,[k,C]]]),D.call(b.isIgnore,[[h,[C,j]],[f,[C]],[g,[C]]]),D.call(b.isIgnoreRgx,[[h,/ ?browser$/i],[g,/ ?os$/i]]),D.call(b.toString,[[h,[k,C]],[u,[N]],[m,[y,E]],[f,[k,C]],[g,[k,C]]]),b);function Bi(i,e){if(i=i||{},D.call(this,oi),e)D.call(this,[[L,Ii(i[a])],[$,Ii(i[X])],[S,/\?1/.test(i[K])],[E,Ui(i[ii])],[I,Ui(i[ei])],[W,Ui(i[ti])],[N,Ui(i[Y])],[T,Ii(i[Q])],[J,Ui(i[Z])]]);else for(var t in i)this.hasOwnProperty(t)&&typeof i[t]!==l.UNDEFINED&&(this[t]=i[t])}function F(i,e,t,o){return D.call(this,[["itemType",i],["ua",e],["uaCH",o],["rgxMap",t],["data",M(this,i)]]),this}function z(i,e,t){if(typeof i===l.OBJECT?(e=Si(i,!0)?(typeof e===l.OBJECT&&(t=e),i):(t=i,c),i=c):typeof i!==l.STRING||Si(e,!0)||(t=e,e=c),t)if(typeof t.append===l.FUNCTION){var o={};t.forEach(function(i,e){o[String(e).toLowerCase()]=i}),t=o}else{var r,a={};for(r in t)t.hasOwnProperty(r)&&(a[String(r).toLowerCase()]=t[r]);t=a}var s,n,w,b;return this instanceof z?(s=typeof i===l.STRING?i:t&&t[V]?t[V]:U&&U.userAgent?U.userAgent:d,n=new Bi(t,!0),w=e?((i,e)=>{var t,o={},r=e;if(!Si(e))for(var a in r={},e)for(var s in e[a])r[s]=e[a][s].concat(r[s]||[]);for(t in i)o[t]=r[t]&&r[t].length%2==0?r[t].concat(i[t]):i[t];return o})(zi,e):zi,D.call(this,[["getBrowser",(b=function(i){return i==v?function(){return new F(i,s,w,n).set("ua",s).set(h,this.getBrowser()).set(u,this.getCPU()).set(m,this.getDevice()).set(f,this.getEngine()).set(g,this.getOS()).get()}:function(){return new F(i,s,w[i],n).parseUA().get()}})(h)],["getCPU",b(u)],["getDevice",b(m)],["getEngine",b(f)],["getOS",b(g)],["getResult",b(v)],["getUA",function(){return s}],["setUA",function(i){return Ti(i)&&(s=_i(i,500)),this}]]).setUA(s),this):new z(i,e,t).getResult()}F.prototype.get=function(i){return i?this.data.hasOwnProperty(i)?this.data[i]:c:this.data},F.prototype.set=function(i,e){return this.data[i]=e,this},F.prototype.setCH=function(i){return this.uaCH=i,this},F.prototype.detectFeature=function(){if(U&&U.userAgent==this.ua)switch(this.itemType){case h:U.brave&&typeof U.brave.isBrave==l.FUNCTION&&this.set(k,"Brave");break;case m:!this.get(x)&&_&&_[S]&&this.set(x,S),"Macintosh"==this.get(E)&&U&&typeof U.standalone!==l.UNDEFINED&&U.maxTouchPoints&&2<U.maxTouchPoints&&this.set(E,"iPad").set(x,t);break;case g:!this.get(k)&&_&&_[I]&&this.set(k,_[I]);break;case v:var e=this.data,i=function(i){return e[i].getItem().detectFeature().get()};this.set(h,i(h)).set(u,i(u)).set(m,i(m)).set(f,i(f)).set(g,i(g))}return this},F.prototype.parseUA=function(){switch(this.itemType!=v&&H.call(this.data,this.ua,this.rgxMap),this.itemType){case h:this.set(j,B(this.get(C)));break;case g:var i;"iOS"==this.get(k)&&"18.6"==this.get(C)&&(i=/\) Version\/([\d\.]+)/.exec(this.ua))&&26<=parseInt(i[1].substring(0,2),10)&&this.set(C,i[1])}return this},F.prototype.parseCH=function(){var i,e=this.uaCH,t=this.rgxMap;switch(this.itemType){case h:case f:var o,r=e[$]||e[L];if(r)for(var a=0;a<r.length;a++){var s=r[a].brand||r[a],n=r[a].version;this.itemType==h&&!/not.a.brand/i.test(s)&&(!o||/Chrom/.test(o)&&s!=gi||o==vi&&/WebView2/.test(s))&&(s=p(s,Fi),(o=this.get(k))&&!/Chrom/.test(o)&&/Chrom/.test(s)||this.set(k,s).set(C,n).set(j,B(n)),o=s),this.itemType==f&&s==gi&&this.set(C,n)}break;case u:var w=e[N];w&&("64"==e[J]&&(w+="64"),H.call(this.data,w+";",t));break;case m:if(e[S]&&this.set(x,S),e[E]&&(this.set(E,e[E]),this.get(x)&&this.get(y)||(H.call(w={},"droid 9; "+e[E]+")",t),!this.get(x)&&w.type&&this.set(x,w.type),!this.get(y)&&w.vendor&&this.set(y,w.vendor))),e[T]){if("string"!=typeof e[T])for(var b=0;!i&&b<e[T].length;)i=p(e[T][b++],Di);else i=p(e[T],Di);this.set(x,i)}break;case g:var d,w=e[I];w&&(d=e[W],w==Ci&&(d=13<=parseInt(B(d),10)?"11":"10"),this.set(k,w).set(C,d)),this.get(k)==Ci&&"Xbox"==e[E]&&this.set(k,"Xbox").set(C,c);break;case v:var l=this.data,w=function(i){return l[i].getItem().setCH(e).parseCH().get()};this.set(h,w(h)).set(u,w(u)).set(m,w(m)).set(f,w(f)).set(g,w(g))}return this},z.VERSION="2.0.9",z.BROWSER=A([k,C,j,x]),z.CPU=A([N]),z.DEVICE=A([E,y,x,P,S,e,t,o,G]),z.ENGINE=z.OS=A([k,C]),typeof exports!==l.UNDEFINED?(exports=typeof module!==l.UNDEFINED&&module.exports?module.exports=z:exports).UAParser=z:typeof define===l.FUNCTION&&define.amd?define(function(){return z}):Ni&&(i.UAParser=z);var Hi,Mi=Ni&&(i.jQuery||i.Zepto);Mi&&!Mi.ua&&(Hi=new z,Mi.ua=Hi.getResult(),Mi.ua.get=function(){return Hi.getUA()},Mi.ua.set=function(i){Hi.setUA(i);var e,t=Hi.getResult();for(e in t)Mi.ua[e]=t[e]})})("object"==typeof window?window:this);+((i,c)=>{function B(i){for(var e={},t=0;t<i.length;t++)e[i[t].toUpperCase()]=i[t];return e}function H(i){return Ii(i)?_i(/[^\d\.]/g,i).split(".")[0]:c}function A(i,e){if(i&&e)for(var t,o,r,a,s,n=0;n<e.length&&!a;){for(var w=e[n],b=e[n+1],d=t=0;d<w.length&&!a&&w[d];)if(a=w[d++].exec(i))for(o=0;o<b.length;o++)s=a[++t],typeof(r=b[o])===l.OBJECT&&0<r.length?2===r.length?typeof r[1]==l.FUNCTION?this[r[0]]=r[1].call(this,s):this[r[0]]=r[1]:3<=r.length&&(typeof r[1]!==l.FUNCTION||r[1].exec&&r[1].test?3==r.length?this[r[0]]=s?s.replace(r[1],r[2]):c:4==r.length?this[r[0]]=s?r[3].call(this,s.replace(r[1],r[2])):c:4<r.length&&(this[r[0]]=s?r[3].apply(this,[s.replace(r[1],r[2])].concat(r.slice(4))):c):3<r.length?this[r[0]]=s?r[1].apply(this,r.slice(2)):c:this[r[0]]=s?r[1].call(this,s,r[2]):c):this[r]=s||c;n+=2}}function p(i,e){for(var t in e)if(typeof e[t]===l.OBJECT&&0<e[t].length){for(var o=0;o<e[t].length;o++)if(Si(e[t][o],i))return"?"===t?c:t}else if(Si(e[t],i))return"?"===t?c:t;return e.hasOwnProperty("*")?e["*"]:i}function M(e,i){var t=Hi.init[i],o=Hi.isIgnore[i]||0,r=Hi.isIgnoreRgx[i]||0,a=Hi.toString[i]||0;function s(){D.call(this,t)}return s.prototype.getItem=function(){return e},s.prototype.withClientHints=function(){return _?_.getHighEntropyValues(ri).then(function(i){return e.setCH(new Ai(i,!1)).parseCH().get()}):e.parseCH().get()},s.prototype.withFeatureCheck=function(){return e.detectFeature().get()},i!=v&&(s.prototype.is=function(i){var e,t=!1;for(e in this)if(this.hasOwnProperty(e)&&!Si(o,e)&&q(r?_i(r,this[e]):this[e])==q(r?_i(r,i):i)){if(t=!0,i!=l.UNDEFINED)break}else if(i==l.UNDEFINED&&t){t=!t;break}return t},s.prototype.toString=function(){var i,e=d;for(i in a)typeof this[a[i]]!==l.UNDEFINED&&(e+=(e?" ":d)+this[a[i]]);return e||l.UNDEFINED}),s.prototype.then=function(i){function e(){for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i])}var t=this,o=(e.prototype={is:s.prototype.is,toString:s.prototype.toString,withClientHints:s.prototype.withClientHints,withFeatureCheck:s.prototype.withFeatureCheck},new e);return i(o),o},new s}var P=500,V="user-agent",d="",l={FUNCTION:"function",OBJECT:"object",STRING:"string",UNDEFINED:"undefined"},u="browser",h="cpu",m="device",f="engine",g="os",v="result",k="name",x="type",y="vendor",C="version",N="architecture",j="major",E="model",R="console",S="mobile",t="tablet",e="smarttv",o="wearable",G="xr",L="embedded",r="inapp",$="brands",T="formFactors",W="fullVersionList",I="platform",J="platformVersion",X="bitness",a="sec-ch-ua",Y=a+"-full-version-list",Z=a+"-arch",Q=a+"-"+X,K=a+"-form-factors",ii=a+"-"+S,ei=a+"-"+E,ti=a+"-"+I,oi=ti+"-version",ri=[$,W,S,E,I,J,N,T,X],ai="Amazon",s="Apple",si="ASUS",ni="BlackBerry",n="Google",wi="Huawei",bi="Lenovo",di="Honor",li="Microsoft",ci="Motorola",pi="OnePlus",ui="OPPO",hi="Samsung",mi="Sony",fi="Xiaomi",gi="Zebra",vi="Chromium",w="Chromecast",ki="Edge",xi="Firefox",b="Opera",yi="Facebook",Ci="Mobile ",O=" Browser",Ni="Windows",Ei=typeof i!==l.UNDEFINED,U=Ei&&i.navigator?i.navigator:c,_=U&&U.userAgentData?U.userAgentData:c,Si=function(i,e){if(typeof i===l.OBJECT&&0<i.length){for(var t in i)if(q(e)==q(i[t]))return!0;return!1}return!!Ii(i)&&q(e)==q(i)},Ti=function(i,e){for(var t in i)return/^(browser|cpu|device|engine|os)$/.test(t)||!!e&&Ti(i[t])},Ii=function(i){return typeof i===l.STRING},Oi=function(i){if(!i)return c;for(var e,t=[],o=Ui(i).split(","),r=0;r<o.length;r++)-1<o[r].indexOf(";")?(e=qi(o[r]).split(";v="),t[r]={brand:e[0],version:e[1]}):t[r]=qi(o[r]);return t},q=function(i){return Ii(i)?i.toLowerCase():i},Ui=function(i){return Ii(i)?qi(_i(/\\?\"/g,i),P):c},D=function(i){for(var e in i)i.hasOwnProperty(e)&&(typeof(e=i[e])==l.OBJECT&&2==e.length?this[e[0]]=e[1]:this[e]=c);return this},_i=function(i,e){return Ii(e)?e.replace(i,d):e},qi=function(i,e){return i=_i(/^\s\s*/,String(i)),typeof e===l.UNDEFINED?i:i.substring(0,e)},Di={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2",8.1:"6.3",10:["6.4","10.0"],NT:""},Fi={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":c},zi={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Bi={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[C,[k,Ci+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[C,[k,ki+" WebView"],[x,r]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[C,[k,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[k,C],[/opios[\/ ]+([\w\.]+)/i],[C,[k,b+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[C,[k,b+" GX"]],[/\bopr\/([\w\.]+)/i],[C,[k,b]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[C,[k,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[C,[k,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:hi|lg |ovi|qute)browser|palemoon)\/v?([-\w\.]+)/i,/(brave)(?: chrome)?\/([\d\.]+)/i,/(aloha|heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[k,C],[/quark(?:pc)?\/([-\w\.]+)/i],[C,[k,"Quark"]],[/\bddg\/([\w\.]+)/i],[C,[k,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb| ucpc)[\/ ]?([\w\.]+)/i],[C,[k,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[C,[k,"WeChat"]],[/konqueror\/([\w\.]+)/i],[C,[k,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[C,[k,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[C,[k,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[C,[k,"Smart "+bi+O]],[/(av(?:ast|g|ira))\/([\w\.]+)/i],[[k,/(.+)/,"$1 Secure"+O],C],[/norton\/([\w\.]+)/i],[C,[k,"Norton Private"+O]],[/\bfocus\/([\w\.]+)/i],[C,[k,xi+" Focus"]],[/ mms\/([\w\.]+)$/i],[C,[k,b+" Neon"]],[/ opt\/([\w\.]+)$/i],[C,[k,b+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[C,[k,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[C,[k,"Dolphin"]],[/coast\/([\w\.]+)/i],[C,[k,b+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[C,[k,"MIUI"+O]],[/fxios\/([\w\.-]+)/i],[C,[k,Ci+xi]],[/\bqihoobrowser\/?([\w\.]*)/i],[C,[k,"360"]],[/\b(qq)\/([\w\.]+)/i],[[k,/(.+)/,"$1Browser"],C],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[k,/(.+)/,"$1"+O],C],[/ HBPC\/([\w\.]+)/],[C,[k,wi+O]],[/samsungbrowser\/([\w\.]+)/i],[C,[k,hi+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[C,[k,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[k,"Sogou Mobile"],C],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[k,C],[/(lbbrowser|luakit|rekonq|steam(?= (clie|tenf|gameo)))/i],[k],[/ome\/([\w\.]+).+(iron(?= saf)|360(?=[es]e$))/i],[C,k],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[k,yi],C,[x,r]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[k,C,[x,r]],[/\bgsa\/([\w\.]+) .*safari\//i],[C,[k,"GSA"],[x,r]],[/(?:musical_ly|trill)(?:.+app_?version\/|_)([\w\.]+)/i],[C,[k,"TikTok"],[x,r]],[/\[(linkedin)app\]/i],[k,[x,r]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[k,/(.+)/,"Zalo"],C,[x,r]],[/(chromium)[\/ ]([-\w\.]+)/i],[k,C],[/ome-(lighthouse)$/i],[k,[x,"fetcher"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[C,[k,"Chrome Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[C,[k,ki+" WebView2"],[x,r]],[/; wv\).+(chrome)\/([\w\.]+)/i],[[k,"Chrome WebView"],C,[x,r]],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[C,[k,"Android"+O]],[/chrome\/([\w\.]+) mobile/i],[C,[k,Ci+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[k,C],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[C,[k,Ci+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[k,Ci+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[C,k],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[k,[C,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[k,C],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[k,Ci+xi],C],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[k,"Netscape"],C],[/(wolvic|librewolf)\/([\w\.]+)/i],[k,C],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[C,[k,xi+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[k,[C,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[k,[C,/[^\d\.]+./,d]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[N,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[N,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[N,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[N,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[N,"arm"]],[/ sun4\w[;\)]/i],[[N,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[N,/ower/,d,q]],[/mc680.0/i],[[N,"68k"]],[/winnt.+\[axp/i],[[N,"alpha"]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[E,[y,hi],[x,t]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[E,[y,hi],[x,S]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[E,[y,s],[x,S]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[E,[y,s],[x,t]],[/(macintosh);/i],[E,[y,s]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[E,[y,"Sharp"],[x,S]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[E,[y,di],[x,t]],[/honor([-\w ]+)[;\)]/i],[E,[y,di],[x,S]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[E,[y,wi],[x,t]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[E,[y,wi],[x,S]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[E,/_/g," "],[y,fi],[x,t]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/; ([\w ]+) miui\/v?\d/i],[[E,/_/g," "],[y,fi],[x,S]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-l]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[E,[y,pi],[x,S]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[E,[y,ui],[x,S]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[E,[y,p,{OnePlus:["203","304","403","404","413","415"],"*":ui}],[x,t]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[E,[y,"BLU"],[x,S]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[E,[y,"Vivo"],[x,S]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[E,[y,"Realme"],[x,S]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[E,[y,bi],[x,t]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[E,[y,bi],[x,S]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[E,[y,ci],[x,S]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[E,[y,ci],[x,t]],[/\b(?:lg)?([vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[E,[y,"LG"],[x,t]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[E,[y,"LG"],[x,S]],[/(nokia) (t[12][01])/i],[y,E,[x,t]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[E,/_/g," "],[x,S],[y,"Nokia"]],[/(pixel (c|tablet))\b/i],[E,[y,n],[x,t]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[E,[y,n],[x,S]],[/(google) (pixelbook( go)?)/i],[y,E],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[E,[y,mi],[x,S]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[E,"Xperia Tablet"],[y,mi],[x,t]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[E,[y,ai],[x,t]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[E,/(.+)/g,"Fire Phone $1"],[y,ai],[x,S]],[/(playbook);[-\w\),; ]+(rim)/i],[E,y,[x,t]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[E,[y,ni],[x,S]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[E,[y,si],[x,t]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[E,[y,si],[x,S]],[/(nexus 9)/i],[E,[y,"HTC"],[x,t]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[y,[E,/_/g," "],[x,S]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[E,[y,"TCL"],[x,t]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[E,[y,"TCL"],[x,S]],[/(itel) ((\w+))/i],[[y,q],E,[x,p,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[E,[y,"Acer"],[x,t]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[E,[y,"Meizu"],[x,S]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[E,[y,"Ulefone"],[x,S]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[E,[y,"Energizer"],[x,S]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[E,[y,"Cat"],[x,S]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[E,[y,"Smartfren"],[x,S]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[E,[y,"Nothing"],[x,S]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[E,[y,"Archos"],[x,t]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[E,[y,"Archos"],[x,S]],[/blackview ([-\w ]+)( b|\))/i,/; (bv\d{4}[-\w ]*)( b|\))/i],[E,[y,"Blackview"],[x,S]],[/; (n159v)/i],[E,[y,"HMD"],[x,S]],[/((revvl[ \w\+]+|tm(?:rv|af)\w*[45]g(?:tb)?))( b|\))/i],[E,[x,function(i,e){return e.test.test(i)?e.ifTrue:e.ifFalse},{test:/ta?b/i,ifTrue:t,ifFalse:S}],[y,"T-Mobile"]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[y,E,[x,t]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|coolpad|cubot|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([-\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[y,E,[x,S]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[y,E,[x,t]],[/(surface duo)/i],[E,[y,li],[x,t]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[E,[y,"Fairphone"],[x,S]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[E,[y,"Nvidia"],[x,t]],[/(sprint) (\w+)/i],[y,E,[x,S]],[/(kin\.[onetw]{3})/i],[[E,/\./g," "],[y,li],[x,S]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[E,[y,gi],[x,t]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[E,[y,gi],[x,S]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[y,[x,e]],[/hbbtv.+maple;(\d+)/i],[[E,/^/,"SmartTV"],[y,hi],[x,e]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[y,E,[x,e]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[y,"LG"],[x,e]],[/(apple) ?tv/i],[y,[E,s+" TV"],[x,e]],[/crkey.*devicetype\/chromecast/i],[[E,w+" Third Generation"],[y,n],[x,e]],[/crkey.*devicetype\/([^/]*)/i],[[E,/^/,"Chromecast "],[y,n],[x,e]],[/fuchsia.*crkey/i],[[E,w+" Nest Hub"],[y,n],[x,e]],[/crkey/i],[[E,w],[y,n],[x,e]],[/(portaltv)/i],[E,[y,yi],[x,e]],[/droid.+aft(\w+)( bui|\))/i],[E,[y,ai],[x,e]],[/(shield \w+ tv)/i],[E,[y,"Nvidia"],[x,e]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[E,[y,"Sharp"],[x,e]],[/(bravia[\w ]+)( bui|\))/i],[E,[y,mi],[x,e]],[/(mi(tv|box)-?\w+) bui/i],[E,[y,fi],[x,e]],[/Hbbtv.*(technisat) (.*);/i],[y,E,[x,e]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[y,/.+\/(\w+)/,"$1",p,{LG:"lge"}],[E,qi],[x,e]],[/(playstation \w+)/i],[E,[y,mi],[x,R]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[E,[y,li],[x,R]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[y,p,{Nvidia:"Shield",Anbernic:"RGCUBE",Logitech:"GR0006"}],E,[x,R]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[E,[y,hi],[x,o]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[y,E,[x,o]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[E,[y,ui],[x,o]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[E,[y,s],[x,o]],[/(opwwe\d{3})/i],[E,[y,pi],[x,o]],[/(moto 360)/i],[E,[y,ci],[x,o]],[/(smartwatch 3)/i],[E,[y,mi],[x,o]],[/(g watch r)/i],[E,[y,"LG"],[x,o]],[/droid.+; (wt63?0{2,3})\)/i],[E,[y,gi],[x,o]],[/droid.+; (glass) \d/i],[E,[y,n],[x,G]],[/(pico) ([\w ]+) os\d/i],[y,E,[x,G]],[/(quest( \d| pro)?s?).+vr/i],[E,[y,yi],[x,G]],[/mobile vr; rv.+firefox/i],[[x,G]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[y,[x,L]],[/(aeobc)\b/i],[E,[y,ai],[x,L]],[/(homepod).+mac os/i],[E,[y,s],[x,L]],[/windows iot/i],[[x,L]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[E,[x,e]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[x,e]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[E,[x,p,{mobile:"Mobile",xr:"VR","*":t}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[x,t]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[x,S]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[E,[y,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[C,[k,ki+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[k,C],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[C,[k,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links|dillo)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[k,C],[/ladybird\//i],[[k,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[C,k]],os:[[/(windows nt) (6\.[23]); arm/i],[[k,/N/,"R"],[C,p,Di]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[k,C],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[C,/(;|\))/g,"",p,Di],[k,Ni]],[/(windows ce)\/?([\d\.]*)/i],[k,C],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[C,/_/g,"."],[k,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[k,"macOS"],[C,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[C,[k,w+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[C,[k,w+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[C,[k,w+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[C,[k,w+" Linux"]],[/crkey\/([\d\.]+)/i],[C,[k,w]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[C,k],[/(ubuntu) ([\w\.]+) like android/i],[[k,/(.+)/,"$1 Touch"],C],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[k,C],[/\(bb(10);/i],[C,[k,ni]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[C,[k,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile[;\w ]*|tablet|tv|[^\)]*(?:viera|lg(?:l25|-d300)|alcatel ?o.+|y300-f1)); rv:([\w\.]+)\).+gecko\//i],[C,[k,xi+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[C,[k,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[C,p,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[k,"webOS"]],[/watch(?: ?os[,\/ ]|\d,\d\/)([\d\.]+)/i],[C,[k,"watchOS"]],[/cros [\w]+(?:\)| ([\w\.]+)\b)/i],[C,[k,"Chrome OS"]],[/kepler ([\w\.]+); (aft|aeo)/i],[C,[k,"Vega OS"]],[/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[k,C],[/(sunos) ?([\d\.]*)/i],[[k,"Solaris"],C],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[k,C]]},Hi=(b={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}},D.call(b.init,[[u,[k,C,j,x]],[h,[N]],[m,[x,E,y]],[f,[k,C]],[g,[k,C]]]),D.call(b.isIgnore,[[u,[C,j]],[f,[C]],[g,[C]]]),D.call(b.isIgnoreRgx,[[u,/ ?browser$/i],[g,/ ?os$/i]]),D.call(b.toString,[[u,[k,C]],[h,[N]],[m,[y,E]],[f,[k,C]],[g,[k,C]]]),b);function Ai(i,e){if(i=i||{},D.call(this,ri),e)D.call(this,[[$,Oi(i[a])],[W,Oi(i[Y])],[S,/\?1/.test(i[ii])],[E,Ui(i[ei])],[I,Ui(i[ti])],[J,Ui(i[oi])],[N,Ui(i[Z])],[T,Oi(i[K])],[X,Ui(i[Q])]]);else for(var t in i)this.hasOwnProperty(t)&&typeof i[t]!==l.UNDEFINED&&(this[t]=i[t])}function F(i,e,t,o){return D.call(this,[["itemType",i],["ua",e],["uaCH",o],["rgxMap",t],["data",M(this,i)]]),this}function z(i,e,t){if(typeof i===l.OBJECT?(e=Ti(i,!0)?(typeof e===l.OBJECT&&(t=e),i):(t=i,c),i=c):typeof i!==l.STRING||Ti(e,!0)||(t=e,e=c),t)if(typeof t.append===l.FUNCTION){var o={};t.forEach(function(i,e){o[String(e).toLowerCase()]=i}),t=o}else{var r,a={};for(r in t)t.hasOwnProperty(r)&&(a[String(r).toLowerCase()]=t[r]);t=a}var s,n,w,b;return this instanceof z?(s=typeof i===l.STRING?i:t&&t[V]?t[V]:U&&U.userAgent?U.userAgent:d,n=new Ai(t,!0),w=Bi,D.call(this,[["getBrowser",(b=function(i){return i==v?function(){return new F(i,s,w,n).set("ua",s).set(u,this.getBrowser()).set(h,this.getCPU()).set(m,this.getDevice()).set(f,this.getEngine()).set(g,this.getOS()).get()}:function(){return new F(i,s,w[i],n).parseUA().get()}})(u)],["getCPU",b(h)],["getDevice",b(m)],["getEngine",b(f)],["getOS",b(g)],["getResult",b(v)],["getUA",function(){return s}],["setUA",function(i){return Ii(i)&&(s=qi(i,P)),this}],["useExtension",function(i){return i&&(w=((i,e)=>{var t,o={},r=e;if(!Ti(e))for(var a in r={},e)for(var s in e[a])r[s]=e[a][s].concat(r[s]||[]);for(t in i)o[t]=r[t]&&r[t].length%2==0?r[t].concat(i[t]):i[t];return o})(w,i)),this}]]).setUA(s).useExtension(e),this):new z(i,e,t).getResult()}F.prototype.get=function(i){return i?this.data.hasOwnProperty(i)?this.data[i]:c:this.data},F.prototype.set=function(i,e){return this.data[i]=e,this},F.prototype.setCH=function(i){return this.uaCH=i,this},F.prototype.detectFeature=function(){if(U&&U.userAgent==this.ua)switch(this.itemType){case u:U.brave&&typeof U.brave.isBrave==l.FUNCTION&&this.set(k,"Brave");break;case m:!this.get(x)&&_&&_[S]&&this.set(x,S),"Macintosh"==this.get(E)&&U&&typeof U.standalone!==l.UNDEFINED&&U.maxTouchPoints&&2<U.maxTouchPoints&&this.set(E,"iPad").set(x,t);break;case g:!this.get(k)&&_&&_[I]&&this.set(k,_[I]);break;case v:var e=this.data,i=function(i){return e[i].getItem().detectFeature().get()};this.set(u,i(u)).set(h,i(h)).set(m,i(m)).set(f,i(f)).set(g,i(g))}return this},F.prototype.parseUA=function(){switch(this.itemType!=v&&A.call(this.data,this.ua,this.rgxMap),this.itemType){case u:this.set(j,H(this.get(C)));break;case g:var i;"iOS"==this.get(k)&&this.get(C)&&/^1[89][^\d]/.exec(this.get(C))&&(i=/\) Version\/((\d+)[\d\.]*)/.exec(this.ua))&&26<=parseInt(i[2],10)&&this.set(C,i[1])}return this},F.prototype.parseCH=function(){var i,e=this.uaCH,t=this.rgxMap;switch(this.itemType){case u:case f:var o,r=e[W]||e[$];if(r)for(var a=0;a<r.length;a++){var s=r[a].brand||r[a],n=r[a].version;this.itemType==u&&!/not.a.brand/i.test(s)&&(!o||/Chrom/.test(o)&&s!=vi||o==ki&&/WebView2/.test(s))&&(s=p(s,zi),(o=this.get(k))&&!/Chrom/.test(o)&&/Chrom/.test(s)||this.set(k,s).set(C,n).set(j,H(n)),o=s),this.itemType==f&&s==vi&&this.set(C,n)}break;case h:var w=e[N];w&&("64"==e[X]&&(w+="64"),A.call(this.data,w+";",t));break;case m:if(e[S]&&this.set(x,S),e[E]&&(this.set(E,e[E]),this.get(x)&&this.get(y)||(A.call(w={},"droid 9; "+e[E]+")",t),!this.get(x)&&w.type&&this.set(x,w.type),!this.get(y)&&w.vendor&&this.set(y,w.vendor))),e[T]){if("string"!=typeof e[T])for(var b=0;!i&&b<e[T].length;)i=p(e[T][b++],Fi);else i=p(e[T],Fi);this.set(x,i)}break;case g:var d,w=e[I];w&&(d=e[J],w==Ni&&(d=13<=parseInt(H(d),10)?"11":"10"),this.set(k,w).set(C,d)),this.get(k)==Ni&&"Xbox"==e[E]&&this.set(k,"Xbox").set(C,c);break;case v:var l=this.data,w=function(i){return l[i].getItem().setCH(e).parseCH().get()};this.set(u,w(u)).set(h,w(h)).set(m,w(m)).set(f,w(f)).set(g,w(g))}return this},z.VERSION="2.0.10",z.BROWSER=B([k,C,j,x]),z.CPU=B([N]),z.DEVICE=B([E,y,x,R,S,e,t,o,L]),z.ENGINE=z.OS=B([k,C]),typeof exports!==l.UNDEFINED?(exports=typeof module!==l.UNDEFINED&&module.exports?module.exports=z:exports).UAParser=z:typeof define===l.FUNCTION&&define.amd?define(function(){return z}):Ei&&(i.UAParser=z);var Mi,Pi=Ei&&(i.jQuery||i.Zepto);Pi&&!Pi.ua&&(Mi=new z,Pi.ua=Mi.getResult(),Pi.ua.get=function(){return Mi.getUA()},Pi.ua.set=function(i){Mi.setUA(i);var e,t=Mi.getResult();for(e in t)Pi.ua[e]=t[e]})})("object"==typeof window?window:this);
dist/ua-parser.pack.mjs +2 lines · 1 flagged
--- +++ @@ -1,4 +1,4 @@-/* UAParser.js v2.0.9+/* UAParser.js v2.0.10    Copyright © 2012-2026 Faisal Salman <[email protected]>    AGPLv3 License */-function B(i){for(var e={},o=0;o<i.length;o++)e[i[o].toUpperCase()]=i[o];return e}function H(i){return Si(i)?z(/[^\d\.]/g,i).split(".")[0]:void 0}function A(i,e){if(i&&e)for(var o,t,r,a,s,n=0;n<e.length&&!a;){for(var w=e[n],d=e[n+1],b=o=0;b<w.length&&!a&&w[b];)if(a=w[b++].exec(i))for(t=0;t<d.length;t++)s=a[++o],typeof(r=d[t])===l.OBJECT&&0<r.length?2===r.length?typeof r[1]==l.FUNCTION?this[r[0]]=r[1].call(this,s):this[r[0]]=r[1]:3<=r.length&&(typeof r[1]!==l.FUNCTION||r[1].exec&&r[1].test?3==r.length?this[r[0]]=s?s.replace(r[1],r[2]):void 0:4==r.length?this[r[0]]=s?r[3].call(this,s.replace(r[1],r[2])):void 0:4<r.length&&(this[r[0]]=s?r[3].apply(this,[s.replace(r[1],r[2])].concat(r.slice(4))):void 0):3<r.length?this[r[0]]=s?r[1].apply(this,r.slice(2)):void 0:this[r[0]]=s?r[1].call(this,s,r[2]):void 0):this[r]=s||void 0;n+=2}}function c(i,e){for(var o in e)if(typeof e[o]===l.OBJECT&&0<e[o].length){for(var t=0;t<e[o].length;t++)if(Ni(e[o][t],i))return"?"===o?void 0:o}else if(Ni(e[o],i))return"?"===o?void 0:o;return e.hasOwnProperty("*")?e["*"]:i}function M(e,i){var o=Di.init[i],t=Di.isIgnore[i]||0,r=Di.isIgnoreRgx[i]||0,a=Di.toString[i]||0;function s(){U.call(this,o)}return s.prototype.getItem=function(){return e},s.prototype.withClientHints=function(){return _?_.getHighEntropyValues(ti).then(function(i){return e.setCH(new Fi(i,!1)).parseCH().get()}):e.parseCH().get()},s.prototype.withFeatureCheck=function(){return e.detectFeature().get()},i!=f&&(s.prototype.is=function(i){var e,o=!1;for(e in this)if(this.hasOwnProperty(e)&&!Ni(t,e)&&q(r?z(r,this[e]):this[e])==q(r?z(r,i):i)){if(o=!0,i!=l.UNDEFINED)break}else if(i==l.UNDEFINED&&o){o=!o;break}return o},s.prototype.toString=function(){var i,e=b;for(i in a)typeof this[a[i]]!==l.UNDEFINED&&(e+=(e?" ":b)+this[a[i]]);return e||l.UNDEFINED}),s.prototype.then=function(i){function e(){for(var i in o)o.hasOwnProperty(i)&&(this[i]=o[i])}var o=this,t=(e.prototype={is:s.prototype.is,toString:s.prototype.toString,withClientHints:s.prototype.withClientHints,withFeatureCheck:s.prototype.withFeatureCheck},new e);return i(t),t},new s}var V="user-agent",b="",l={FUNCTION:"function",OBJECT:"object",STRING:"string",UNDEFINED:"undefined"},h="browser",p="cpu",u="device",m="engine",g="os",f="result",v="name",k="type",x="vendor",y="version",C="architecture",P="major",N="model",j="console",E="mobile",o="tablet",i="smarttv",e="wearable",R="xr",G="embedded",t="inapp",L="brands",S="formFactors",$="fullVersionList",T="platform",W="platformVersion",J="bitness",r="sec-ch-ua",X=r+"-full-version-list",Y=r+"-arch",Z=r+"-"+J,K=r+"-form-factors",Q=r+"-"+E,ii=r+"-"+N,ei=r+"-"+T,oi=ei+"-version",ti=[L,$,E,N,T,W,C,S,J],ri="Amazon",a="Apple",ai="ASUS",si="BlackBerry",s="Google",ni="Huawei",wi="Lenovo",di="Honor",bi="LG",li="Microsoft",ci="Motorola",hi="OnePlus",pi="OPPO",ui="Samsung",mi="Sony",gi="Xiaomi",fi="Zebra",vi="Chromium",n="Chromecast",ki="Edge",xi="Firefox",w="Opera",yi="Facebook",d="Mobile ",O=" Browser",Ci="Windows",I=typeof window!==l.UNDEFINED&&window.navigator?window.navigator:void 0,_=I&&I.userAgentData?I.userAgentData:void 0,Ni=function(i,e){if(typeof i===l.OBJECT&&0<i.length){for(var o in i)if(q(e)==q(i[o]))return!0;return!1}return!!Si(i)&&q(e)==q(i)},Ei=function(i,e){for(var o in i)return/^(browser|cpu|device|engine|os)$/.test(o)||!!e&&Ei(i[o])},Si=function(i){return typeof i===l.STRING},Ti=function(i){if(i){for(var e,o=[],t=z(/\\?\"/g,i).split(","),r=0;r<t.length;r++)-1<t[r].indexOf(";")?(e=Ii(t[r]).split(";v="),o[r]={brand:e[0],version:e[1]}):o[r]=Ii(t[r]);return o}},q=function(i){return Si(i)?i.toLowerCase():i},U=function(i){for(var e in i)i.hasOwnProperty(e)&&(typeof(e=i[e])==l.OBJECT&&2==e.length?this[e[0]]=e[1]:this[e]=void 0);return this},z=function(i,e){return Si(e)?e.replace(i,b):e},Oi=function(i){return z(/\\?\"/g,i)},Ii=function(i,e){return i=z(/^\s\s*/,String(i)),typeof e===l.UNDEFINED?i:i.substring(0,e)},_i={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2",8.1:"6.3",10:["6.4","10.0"],NT:""},qi={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Ui={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},zi={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[v,d+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[y,[v,ki+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[v,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[v,y],[/opios[\/ ]+([\w\.]+)/i],[y,[v,w+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[y,[v,w+" GX"]],[/\bopr\/([\w\.]+)/i],[y,[v,w]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[v,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[y,[v,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:hi|lg |ovi|qute)browser|palemoon)\/v?([-\w\.]+)/i,/(brave)(?: chrome)?\/([\d\.]+)/i,/(aloha|heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[v,y],[/quark(?:pc)?\/([-\w\.]+)/i],[y,[v,"Quark"]],[/\bddg\/([\w\.]+)/i],[y,[v,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[v,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[v,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[v,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[v,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[v,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[v,"Smart "+wi+O]],[/(av(?:ast|g|ira))\/([\w\.]+)/i],[[v,/(.+)/,"$1 Secure"+O],y],[/norton\/([\w\.]+)/i],[y,[v,"Norton Private"+O]],[/\bfocus\/([\w\.]+)/i],[y,[v,xi+" Focus"]],[/ mms\/([\w\.]+)$/i],[y,[v,w+" Neon"]],[/ opt\/([\w\.]+)$/i],[y,[v,w+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[v,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[v,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[v,w+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[v,"MIUI"+O]],[/fxios\/([\w\.-]+)/i],[y,[v,d+xi]],[/\bqihoobrowser\/?([\w\.]*)/i],[y,[v,"360"]],[/\b(qq)\/([\w\.]+)/i],[[v,/(.+)/,"$1Browser"],y],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[v,/(.+)/,"$1"+O],y],[/samsungbrowser\/([\w\.]+)/i],[y,[v,ui+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[y,[v,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[v,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[v,y],[/(lbbrowser|luakit|rekonq|steam(?= (clie|tenf|gameo)))/i],[v],[/ome\/([\w\.]+).+(iron(?= saf)|360(?=[es]e$))/i],[y,v],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[v,yi],y,[k,t]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[v,y,[k,t]],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[v,"GSA"],[k,t]],[/(?:musical_ly|trill)(?:.+app_?version\/|_)([\w\.]+)/i],[y,[v,"TikTok"],[k,t]],[/\[(linkedin)app\]/i],[v,[k,t]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[v,/(.+)/,"Zalo"],y,[k,t]],[/(chromium)[\/ ]([-\w\.]+)/i],[v,y],[/ome-(lighthouse)$/i],[v,[k,"fetcher"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[v,"Chrome Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[y,[v,ki+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[v,"Chrome WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[v,"Android"+O]],[/chrome\/([\w\.]+) mobile/i],[y,[v,d+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[v,y],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[y,[v,d+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[v,d+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[y,v],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[v,[y,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[v,y],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[v,d+xi],y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[v,"Netscape"],y],[/(wolvic|librewolf)\/([\w\.]+)/i],[v,y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[v,xi+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[v,[y,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[v,[y,/[^\d\.]+./,b]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[C,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[C,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[C,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[C,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[C,"arm"]],[/ sun4\w[;\)]/i],[[C,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[C,/ower/,b,q]],[/mc680.0/i],[[C,"68k"]],[/winnt.+\[axp/i],[[C,"alpha"]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[N,[x,ui],[k,o]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[N,[x,ui],[k,E]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[N,[x,a],[k,E]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[N,[x,a],[k,o]],[/(macintosh);/i],[N,[x,a]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[N,[x,"Sharp"],[k,E]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[N,[x,di],[k,o]],[/honor([-\w ]+)[;\)]/i],[N,[x,di],[k,E]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[N,[x,ni],[k,o]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[N,[x,ni],[k,E]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[N,/_/g," "],[x,gi],[k,o]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[N,/_/g," "],[x,gi],[k,E]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-l]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[N,[x,hi],[k,E]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[N,[x,pi],[k,E]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[N,[x,c,{OnePlus:["203","304","403","404","413","415"],"*":pi}],[k,o]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[N,[x,"BLU"],[k,E]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[N,[x,"Vivo"],[k,E]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[N,[x,"Realme"],[k,E]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[N,[x,wi],[k,o]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[N,[x,wi],[k,E]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[N,[x,ci],[k,E]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[N,[x,ci],[k,o]],[/\b(?:lg)?([vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[N,[x,bi],[k,o]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[N,[x,bi],[k,E]],[/(nokia) (t[12][01])/i],[x,N,[k,o]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[N,/_/g," "],[k,E],[x,"Nokia"]],[/(pixel (c|tablet))\b/i],[N,[x,s],[k,o]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[N,[x,s],[k,E]],[/(google) (pixelbook( go)?)/i],[x,N],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[N,[x,mi],[k,E]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[N,"Xperia Tablet"],[x,mi],[k,o]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[N,[x,ri],[k,o]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[N,/(.+)/g,"Fire Phone $1"],[x,ri],[k,E]],[/(playbook);[-\w\),; ]+(rim)/i],[N,x,[k,o]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[N,[x,si],[k,E]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[N,[x,ai],[k,o]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[N,[x,ai],[k,E]],[/(nexus 9)/i],[N,[x,"HTC"],[k,o]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[x,[N,/_/g," "],[k,E]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[N,[x,"TCL"],[k,o]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[N,[x,"TCL"],[k,E]],[/(itel) ((\w+))/i],[[x,q],N,[k,c,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[N,[x,"Acer"],[k,o]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[N,[x,"Meizu"],[k,E]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[N,[x,"Ulefone"],[k,E]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[N,[x,"Energizer"],[k,E]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[N,[x,"Cat"],[k,E]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[N,[x,"Smartfren"],[k,E]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[N,[x,"Nothing"],[k,E]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[N,[x,"Archos"],[k,o]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[N,[x,"Archos"],[k,E]],[/; (n159v)/i],[N,[x,"HMD"],[k,E]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[x,N,[k,o]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[x,N,[k,E]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[x,N,[k,o]],[/(surface duo)/i],[N,[x,li],[k,o]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[N,[x,"Fairphone"],[k,E]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[N,[x,"Nvidia"],[k,o]],[/(sprint) (\w+)/i],[x,N,[k,E]],[/(kin\.[onetw]{3})/i],[[N,/\./g," "],[x,li],[k,E]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[N,[x,fi],[k,o]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[N,[x,fi],[k,E]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[x,[k,i]],[/hbbtv.+maple;(\d+)/i],[[N,/^/,"SmartTV"],[x,ui],[k,i]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[x,N,[k,i]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[x,bi],[k,i]],[/(apple) ?tv/i],[x,[N,a+" TV"],[k,i]],[/crkey.*devicetype\/chromecast/i],[[N,n+" Third Generation"],[x,s],[k,i]],[/crkey.*devicetype\/([^/]*)/i],[[N,/^/,"Chromecast "],[x,s],[k,i]],[/fuchsia.*crkey/i],[[N,n+" Nest Hub"],[x,s],[k,i]],[/crkey/i],[[N,n],[x,s],[k,i]],[/(portaltv)/i],[N,[x,yi],[k,i]],[/droid.+aft(\w+)( bui|\))/i],[N,[x,ri],[k,i]],[/(shield \w+ tv)/i],[N,[x,"Nvidia"],[k,i]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[N,[x,"Sharp"],[k,i]],[/(bravia[\w ]+)( bui|\))/i],[N,[x,mi],[k,i]],[/(mi(tv|box)-?\w+) bui/i],[N,[x,gi],[k,i]],[/Hbbtv.*(technisat) (.*);/i],[x,N,[k,i]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[x,/.+\/(\w+)/,"$1",c,{LG:"lge"}],[N,Ii],[k,i]],[/(playstation \w+)/i],[N,[x,mi],[k,j]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[N,[x,li],[k,j]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[x,c,{Nvidia:"Shield",Anbernic:"RGCUBE",Logitech:"GR0006"}],N,[k,j]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[N,[x,ui],[k,e]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[x,N,[k,e]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[N,[x,pi],[k,e]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[N,[x,a],[k,e]],[/(opwwe\d{3})/i],[N,[x,hi],[k,e]],[/(moto 360)/i],[N,[x,ci],[k,e]],[/(smartwatch 3)/i],[N,[x,mi],[k,e]],[/(g watch r)/i],[N,[x,bi],[k,e]],[/droid.+; (wt63?0{2,3})\)/i],[N,[x,fi],[k,e]],[/droid.+; (glass) \d/i],[N,[x,s],[k,R]],[/(pico) ([\w ]+) os\d/i],[x,N,[k,R]],[/(quest( \d| pro)?s?).+vr/i],[N,[x,yi],[k,R]],[/mobile vr; rv.+firefox/i],[[k,R]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[x,[k,G]],[/(aeobc)\b/i],[N,[x,ri],[k,G]],[/(homepod).+mac os/i],[N,[x,a],[k,G]],[/windows iot/i],[[k,G]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[N,[k,i]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[k,i]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[N,[k,c,{mobile:"Mobile",xr:"VR","*":o}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[k,o]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[k,E]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[N,[x,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[v,ki+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[v,y],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[v,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links|dillo)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[v,y],[/ladybird\//i],[[v,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,v]],os:[[/(windows nt) (6\.[23]); arm/i],[[v,/N/,"R"],[y,c,_i]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[v,y],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[y,/(;|\))/g,"",c,_i],[v,Ci]],[/(windows ce)\/?([\d\.]*)/i],[v,y],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[v,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[v,"macOS"],[y,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[y,[v,n+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[y,[v,n+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[y,[v,n+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[y,[v,n+" Linux"]],[/crkey\/([\d\.]+)/i],[y,[v,n]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[y,v],[/(ubuntu) ([\w\.]+) like android/i],[[v,/(.+)/,"$1 Touch"],y],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[v,y],[/\(bb(10);/i],[y,[v,si]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[y,[v,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile[;\w ]*|tablet|tv|[^\)]*(?:viera|lg(?:l25|-d300)|alcatel ?o.+|y300-f1)); rv:([\w\.]+)\).+gecko\//i],[y,[v,xi+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[y,[v,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[y,c,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[v,"webOS"]],[/watch(?: ?os[,\/ ]|\d,\d\/)([\d\.]+)/i],[y,[v,"watchOS"]],[/cros [\w]+(?:\)| ([\w\.]+)\b)/i],[y,[v,"Chrome OS"]],[/kepler ([\w\.]+); (aft|aeo)/i],[y,[v,"Vega OS"]],[/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[v,y],[/(sunos) ?([\d\.]*)/i],[[v,"Solaris"],y],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[v,y]]},Di=(w={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}},U.call(w.init,[[h,[v,y,P,k]],[p,[C]],[u,[k,N,x]],[m,[v,y]],[g,[v,y]]]),U.call(w.isIgnore,[[h,[y,P]],[m,[y]],[g,[y]]]),U.call(w.isIgnoreRgx,[[h,/ ?browser$/i],[g,/ ?os$/i]]),U.call(w.toString,[[h,[v,y]],[p,[C]],[u,[x,N]],[m,[v,y]],[g,[v,y]]]),w);function Fi(i,e){if(i=i||{},U.call(this,ti),e)U.call(this,[[L,Ti(i[r])],[$,Ti(i[X])],[E,/\?1/.test(i[Q])],[N,Oi(i[ii])],[T,Oi(i[ei])],[W,Oi(i[oi])],[C,Oi(i[Y])],[S,Ti(i[K])],[J,Oi(i[Z])]]);else for(var o in i)this.hasOwnProperty(o)&&typeof i[o]!==l.UNDEFINED&&(this[o]=i[o])}function D(i,e,o,t){return U.call(this,[["itemType",i],["ua",e],["uaCH",t],["rgxMap",o],["data",M(this,i)]]),this}function F(i,e,o){if(typeof i===l.OBJECT?(e=Ei(i,!0)?(typeof e===l.OBJECT&&(o=e),i):void(o=i),i=void 0):typeof i!==l.STRING||Ei(e,!0)||(o=e,e=void 0),o)if(typeof o.append===l.FUNCTION){var t={};o.forEach(function(i,e){t[String(e).toLowerCase()]=i}),o=t}else{var r,a={};for(r in o)o.hasOwnProperty(r)&&(a[String(r).toLowerCase()]=o[r]);o=a}var s,n,w,d;return this instanceof F?(s=typeof i===l.STRING?i:o&&o[V]?o[V]:I&&I.userAgent?I.userAgent:b,n=new Fi(o,!0),w=e?((i,e)=>{var o,t={},r=e;if(!Ei(e))for(var a in r={},e)for(var s in e[a])r[s]=e[a][s].concat(r[s]||[]);for(o in i)t[o]=r[o]&&r[o].length%2==0?r[o].concat(i[o]):i[o];return t})(zi,e):zi,U.call(this,[["getBrowser",(d=function(i){return i==f?function(){return new D(i,s,w,n).set("ua",s).set(h,this.getBrowser()).set(p,this.getCPU()).set(u,this.getDevice()).set(m,this.getEngine()).set(g,this.getOS()).get()}:function(){return new D(i,s,w[i],n).parseUA().get()}})(h)],["getCPU",d(p)],["getDevice",d(u)],["getEngine",d(m)],["getOS",d(g)],["getResult",d(f)],["getUA",function(){return s}],["setUA",function(i){return Si(i)&&(s=Ii(i,500)),this}]]).setUA(s),this):new F(i,e,o).getResult()}D.prototype.get=function(i){return i?this.data.hasOwnProperty(i)?this.data[i]:void 0:this.data},D.prototype.set=function(i,e){return this.data[i]=e,this},D.prototype.setCH=function(i){return this.uaCH=i,this},D.prototype.detectFeature=function(){if(I&&I.userAgent==this.ua)switch(this.itemType){case h:I.brave&&typeof I.brave.isBrave==l.FUNCTION&&this.set(v,"Brave");break;case u:!this.get(k)&&_&&_[E]&&this.set(k,E),"Macintosh"==this.get(N)&&I&&typeof I.standalone!==l.UNDEFINED&&I.maxTouchPoints&&2<I.maxTouchPoints&&this.set(N,"iPad").set(k,o);break;case g:!this.get(v)&&_&&_[T]&&this.set(v,_[T]);break;case f:var e=this.data,i=function(i){return e[i].getItem().detectFeature().get()};this.set(h,i(h)).set(p,i(p)).set(u,i(u)).set(m,i(m)).set(g,i(g))}return this},D.prototype.parseUA=function(){switch(this.itemType!=f&&A.call(this.data,this.ua,this.rgxMap),this.itemType){case h:this.set(P,H(this.get(y)));break;case g:var i;"iOS"==this.get(v)&&"18.6"==this.get(y)&&(i=/\) Version\/([\d\.]+)/.exec(this.ua))&&26<=parseInt(i[1].substring(0,2),10)&&this.set(y,i[1])}return this},D.prototype.parseCH=function(){var i,e=this.uaCH,o=this.rgxMap;switch(this.itemType){case h:case m:var t,r=e[$]||e[L];if(r)for(var a=0;a<r.length;a++){var s=r[a].brand||r[a],n=r[a].version;this.itemType==h&&!/not.a.brand/i.test(s)&&(!t||/Chrom/.test(t)&&s!=vi||t==ki&&/WebView2/.test(s))&&(s=c(s,Ui),(t=this.get(v))&&!/Chrom/.test(t)&&/Chrom/.test(s)||this.set(v,s).set(y,n).set(P,H(n)),t=s),this.itemType==m&&s==vi&&this.set(y,n)}break;case p:var w=e[C];w&&("64"==e[J]&&(w+="64"),A.call(this.data,w+";",o));break;case u:if(e[E]&&this.set(k,E),e[N]&&(this.set(N,e[N]),this.get(k)&&this.get(x)||(A.call(w={},"droid 9; "+e[N]+")",o),!this.get(k)&&w.type&&this.set(k,w.type),!this.get(x)&&w.vendor&&this.set(x,w.vendor))),e[S]){if("string"!=typeof e[S])for(var d=0;!i&&d<e[S].length;)i=c(e[S][d++],qi);else i=c(e[S],qi);this.set(k,i)}break;case g:var b,w=e[T];w&&(b=e[W],w==Ci&&(b=13<=parseInt(H(b),10)?"11":"10"),this.set(v,w).set(y,b)),this.get(v)==Ci&&"Xbox"==e[N]&&this.set(v,"Xbox").set(y,void 0);break;case f:var l=this.data,w=function(i){return l[i].getItem().setCH(e).parseCH().get()};this.set(h,w(h)).set(p,w(p)).set(u,w(u)).set(m,w(m)).set(g,w(g))}return this},F.VERSION="2.0.9",F.BROWSER=B([v,y,P,k]),F.CPU=B([C]),F.DEVICE=B([N,x,k,j,E,i,o,e,G]),F.ENGINE=F.OS=B([v,y]);export{F as UAParser};+function D(i){for(var e={},t=0;t<i.length;t++)e[i[t].toUpperCase()]=i[t];return e}function H(i){return q(i)?Ii(/[^\d\.]/g,i).split(".")[0]:void 0}function M(i,e){if(i&&e)for(var t,o,r,a,s,n=0;n<e.length&&!a;){for(var w=e[n],b=e[n+1],d=t=0;d<w.length&&!a&&w[d];)if(a=w[d++].exec(i))for(o=0;o<b.length;o++)s=a[++t],typeof(r=b[o])===l.OBJECT&&0<r.length?2===r.length?typeof r[1]==l.FUNCTION?this[r[0]]=r[1].call(this,s):this[r[0]]=r[1]:3<=r.length&&(typeof r[1]!==l.FUNCTION||r[1].exec&&r[1].test?3==r.length?this[r[0]]=s?s.replace(r[1],r[2]):void 0:4==r.length?this[r[0]]=s?r[3].call(this,s.replace(r[1],r[2])):void 0:4<r.length&&(this[r[0]]=s?r[3].apply(this,[s.replace(r[1],r[2])].concat(r.slice(4))):void 0):3<r.length?this[r[0]]=s?r[1].apply(this,r.slice(2)):void 0:this[r[0]]=s?r[1].call(this,s,r[2]):void 0):this[r]=s||void 0;n+=2}}function c(i,e){for(var t in e)if(typeof e[t]===l.OBJECT&&0<e[t].length){for(var o=0;o<e[t].length;o++)if(Ni(e[t][o],i))return"?"===t?void 0:t}else if(Ni(e[t],i))return"?"===t?void 0:t;return e.hasOwnProperty("*")?e["*"]:i}function A(e,i){var t=Bi.init[i],o=Bi.isIgnore[i]||0,r=Bi.isIgnoreRgx[i]||0,a=Bi.toString[i]||0;function s(){z.call(this,t)}return s.prototype.getItem=function(){return e},s.prototype.withClientHints=function(){return _?_.getHighEntropyValues(ri).then(function(i){return e.setCH(new Di(i,!1)).parseCH().get()}):e.parseCH().get()},s.prototype.withFeatureCheck=function(){return e.detectFeature().get()},i!=g&&(s.prototype.is=function(i){var e,t=!1;for(e in this)if(this.hasOwnProperty(e)&&!Ni(o,e)&&U(r?Ii(r,this[e]):this[e])==U(r?Ii(r,i):i)){if(t=!0,i!=l.UNDEFINED)break}else if(i==l.UNDEFINED&&t){t=!t;break}return t},s.prototype.toString=function(){var i,e=d;for(i in a)typeof this[a[i]]!==l.UNDEFINED&&(e+=(e?" ":d)+this[a[i]]);return e||l.UNDEFINED}),s.prototype.then=function(i){function e(){for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i])}var t=this,o=(e.prototype={is:s.prototype.is,toString:s.prototype.toString,withClientHints:s.prototype.withClientHints,withFeatureCheck:s.prototype.withFeatureCheck},new e);return i(o),o},new s}var V=500,P="user-agent",d="",l={FUNCTION:"function",OBJECT:"object",STRING:"string",UNDEFINED:"undefined"},h="browser",p="cpu",u="device",m="engine",f="os",g="result",v="name",k="type",x="vendor",y="version",C="architecture",j="major",E="model",R="console",N="mobile",t="tablet",i="smarttv",e="wearable",G="xr",L="embedded",o="inapp",$="brands",S="formFactors",W="fullVersionList",T="platform",J="platformVersion",X="bitness",r="sec-ch-ua",Y=r+"-full-version-list",Z=r+"-arch",K=r+"-"+X,Q=r+"-form-factors",ii=r+"-"+N,ei=r+"-"+E,ti=r+"-"+T,oi=ti+"-version",ri=[$,W,N,E,T,J,C,S,X],ai="Amazon",a="Apple",si="ASUS",ni="BlackBerry",s="Google",wi="Huawei",bi="Lenovo",di="Honor",li="LG",ci="Microsoft",hi="Motorola",pi="OnePlus",ui="OPPO",mi="Samsung",fi="Sony",gi="Xiaomi",vi="Zebra",ki="Chromium",n="Chromecast",xi="Edge",yi="Firefox",w="Opera",Ci="Facebook",b="Mobile ",O=" Browser",Ei="Windows",I=typeof window!==l.UNDEFINED&&window.navigator?window.navigator:void 0,_=I&&I.userAgentData?I.userAgentData:void 0,Ni=function(i,e){if(typeof i===l.OBJECT&&0<i.length){for(var t in i)if(U(e)==U(i[t]))return!0;return!1}return!!q(i)&&U(e)==U(i)},Si=function(i,e){for(var t in i)return/^(browser|cpu|device|engine|os)$/.test(t)||!!e&&Si(i[t])},q=function(i){return typeof i===l.STRING},Ti=function(i){if(i){for(var e,t=[],o=Oi(i).split(","),r=0;r<o.length;r++)-1<o[r].indexOf(";")?(e=_i(o[r]).split(";v="),t[r]={brand:e[0],version:e[1]}):t[r]=_i(o[r]);return t}},U=function(i){return q(i)?i.toLowerCase():i},Oi=function(i){return q(i)?_i(Ii(/\\?\"/g,i),V):void 0},z=function(i){for(var e in i)i.hasOwnProperty(e)&&(typeof(e=i[e])==l.OBJECT&&2==e.length?this[e[0]]=e[1]:this[e]=void 0);return this},Ii=function(i,e){return q(e)?e.replace(i,d):e},_i=function(i,e){return i=Ii(/^\s\s*/,String(i)),typeof e===l.UNDEFINED?i:i.substring(0,e)},qi={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2",8.1:"6.3",10:["6.4","10.0"],NT:""},Ui={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},zi={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Fi={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[v,b+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[y,[v,xi+" WebView"],[k,o]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[v,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[v,y],[/opios[\/ ]+([\w\.]+)/i],[y,[v,w+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[y,[v,w+" GX"]],[/\bopr\/([\w\.]+)/i],[y,[v,w]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[v,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[y,[v,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:hi|lg |ovi|qute)browser|palemoon)\/v?([-\w\.]+)/i,/(brave)(?: chrome)?\/([\d\.]+)/i,/(aloha|heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[v,y],[/quark(?:pc)?\/([-\w\.]+)/i],[y,[v,"Quark"]],[/\bddg\/([\w\.]+)/i],[y,[v,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb| ucpc)[\/ ]?([\w\.]+)/i],[y,[v,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[v,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[v,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[v,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[v,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[v,"Smart "+bi+O]],[/(av(?:ast|g|ira))\/([\w\.]+)/i],[[v,/(.+)/,"$1 Secure"+O],y],[/norton\/([\w\.]+)/i],[y,[v,"Norton Private"+O]],[/\bfocus\/([\w\.]+)/i],[y,[v,yi+" Focus"]],[/ mms\/([\w\.]+)$/i],[y,[v,w+" Neon"]],[/ opt\/([\w\.]+)$/i],[y,[v,w+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[v,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[v,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[v,w+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[v,"MIUI"+O]],[/fxios\/([\w\.-]+)/i],[y,[v,b+yi]],[/\bqihoobrowser\/?([\w\.]*)/i],[y,[v,"360"]],[/\b(qq)\/([\w\.]+)/i],[[v,/(.+)/,"$1Browser"],y],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[v,/(.+)/,"$1"+O],y],[/ HBPC\/([\w\.]+)/],[y,[v,wi+O]],[/samsungbrowser\/([\w\.]+)/i],[y,[v,mi+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[y,[v,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[v,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[v,y],[/(lbbrowser|luakit|rekonq|steam(?= (clie|tenf|gameo)))/i],[v],[/ome\/([\w\.]+).+(iron(?= saf)|360(?=[es]e$))/i],[y,v],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[v,Ci],y,[k,o]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[v,y,[k,o]],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[v,"GSA"],[k,o]],[/(?:musical_ly|trill)(?:.+app_?version\/|_)([\w\.]+)/i],[y,[v,"TikTok"],[k,o]],[/\[(linkedin)app\]/i],[v,[k,o]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[v,/(.+)/,"Zalo"],y,[k,o]],[/(chromium)[\/ ]([-\w\.]+)/i],[v,y],[/ome-(lighthouse)$/i],[v,[k,"fetcher"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[v,"Chrome Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[y,[v,xi+" WebView2"],[k,o]],[/; wv\).+(chrome)\/([\w\.]+)/i],[[v,"Chrome WebView"],y,[k,o]],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[v,"Android"+O]],[/chrome\/([\w\.]+) mobile/i],[y,[v,b+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[v,y],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[y,[v,b+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[v,b+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[y,v],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[v,[y,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[v,y],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[v,b+yi],y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[v,"Netscape"],y],[/(wolvic|librewolf)\/([\w\.]+)/i],[v,y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[v,yi+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[v,[y,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[v,[y,/[^\d\.]+./,d]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[C,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[C,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[C,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[C,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[C,"arm"]],[/ sun4\w[;\)]/i],[[C,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[C,/ower/,d,U]],[/mc680.0/i],[[C,"68k"]],[/winnt.+\[axp/i],[[C,"alpha"]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[E,[x,mi],[k,t]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[E,[x,mi],[k,N]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[E,[x,a],[k,N]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[E,[x,a],[k,t]],[/(macintosh);/i],[E,[x,a]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[E,[x,"Sharp"],[k,N]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[E,[x,di],[k,t]],[/honor([-\w ]+)[;\)]/i],[E,[x,di],[k,N]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[E,[x,wi],[k,t]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[E,[x,wi],[k,N]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[E,/_/g," "],[x,gi],[k,t]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/; ([\w ]+) miui\/v?\d/i],[[E,/_/g," "],[x,gi],[k,N]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-l]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[E,[x,pi],[k,N]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[E,[x,ui],[k,N]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[E,[x,c,{OnePlus:["203","304","403","404","413","415"],"*":ui}],[k,t]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[E,[x,"BLU"],[k,N]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[E,[x,"Vivo"],[k,N]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[E,[x,"Realme"],[k,N]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[E,[x,bi],[k,t]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[E,[x,bi],[k,N]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[E,[x,hi],[k,N]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[E,[x,hi],[k,t]],[/\b(?:lg)?([vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[E,[x,li],[k,t]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[E,[x,li],[k,N]],[/(nokia) (t[12][01])/i],[x,E,[k,t]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[E,/_/g," "],[k,N],[x,"Nokia"]],[/(pixel (c|tablet))\b/i],[E,[x,s],[k,t]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[E,[x,s],[k,N]],[/(google) (pixelbook( go)?)/i],[x,E],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[E,[x,fi],[k,N]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[E,"Xperia Tablet"],[x,fi],[k,t]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[E,[x,ai],[k,t]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[E,/(.+)/g,"Fire Phone $1"],[x,ai],[k,N]],[/(playbook);[-\w\),; ]+(rim)/i],[E,x,[k,t]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[E,[x,ni],[k,N]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[E,[x,si],[k,t]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[E,[x,si],[k,N]],[/(nexus 9)/i],[E,[x,"HTC"],[k,t]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[x,[E,/_/g," "],[k,N]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[E,[x,"TCL"],[k,t]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[E,[x,"TCL"],[k,N]],[/(itel) ((\w+))/i],[[x,U],E,[k,c,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[E,[x,"Acer"],[k,t]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[E,[x,"Meizu"],[k,N]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[E,[x,"Ulefone"],[k,N]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[E,[x,"Energizer"],[k,N]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[E,[x,"Cat"],[k,N]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[E,[x,"Smartfren"],[k,N]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[E,[x,"Nothing"],[k,N]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[E,[x,"Archos"],[k,t]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[E,[x,"Archos"],[k,N]],[/blackview ([-\w ]+)( b|\))/i,/; (bv\d{4}[-\w ]*)( b|\))/i],[E,[x,"Blackview"],[k,N]],[/; (n159v)/i],[E,[x,"HMD"],[k,N]],[/((revvl[ \w\+]+|tm(?:rv|af)\w*[45]g(?:tb)?))( b|\))/i],[E,[k,function(i,e){return e.test.test(i)?e.ifTrue:e.ifFalse},{test:/ta?b/i,ifTrue:t,ifFalse:N}],[x,"T-Mobile"]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[x,E,[k,t]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|coolpad|cubot|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([-\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[x,E,[k,N]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[x,E,[k,t]],[/(surface duo)/i],[E,[x,ci],[k,t]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[E,[x,"Fairphone"],[k,N]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[E,[x,"Nvidia"],[k,t]],[/(sprint) (\w+)/i],[x,E,[k,N]],[/(kin\.[onetw]{3})/i],[[E,/\./g," "],[x,ci],[k,N]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[E,[x,vi],[k,t]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[E,[x,vi],[k,N]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[x,[k,i]],[/hbbtv.+maple;(\d+)/i],[[E,/^/,"SmartTV"],[x,mi],[k,i]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[x,E,[k,i]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[x,li],[k,i]],[/(apple) ?tv/i],[x,[E,a+" TV"],[k,i]],[/crkey.*devicetype\/chromecast/i],[[E,n+" Third Generation"],[x,s],[k,i]],[/crkey.*devicetype\/([^/]*)/i],[[E,/^/,"Chromecast "],[x,s],[k,i]],[/fuchsia.*crkey/i],[[E,n+" Nest Hub"],[x,s],[k,i]],[/crkey/i],[[E,n],[x,s],[k,i]],[/(portaltv)/i],[E,[x,Ci],[k,i]],[/droid.+aft(\w+)( bui|\))/i],[E,[x,ai],[k,i]],[/(shield \w+ tv)/i],[E,[x,"Nvidia"],[k,i]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[E,[x,"Sharp"],[k,i]],[/(bravia[\w ]+)( bui|\))/i],[E,[x,fi],[k,i]],[/(mi(tv|box)-?\w+) bui/i],[E,[x,gi],[k,i]],[/Hbbtv.*(technisat) (.*);/i],[x,E,[k,i]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[x,/.+\/(\w+)/,"$1",c,{LG:"lge"}],[E,_i],[k,i]],[/(playstation \w+)/i],[E,[x,fi],[k,R]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[E,[x,ci],[k,R]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[x,c,{Nvidia:"Shield",Anbernic:"RGCUBE",Logitech:"GR0006"}],E,[k,R]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[E,[x,mi],[k,e]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[x,E,[k,e]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[E,[x,ui],[k,e]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[E,[x,a],[k,e]],[/(opwwe\d{3})/i],[E,[x,pi],[k,e]],[/(moto 360)/i],[E,[x,hi],[k,e]],[/(smartwatch 3)/i],[E,[x,fi],[k,e]],[/(g watch r)/i],[E,[x,li],[k,e]],[/droid.+; (wt63?0{2,3})\)/i],[E,[x,vi],[k,e]],[/droid.+; (glass) \d/i],[E,[x,s],[k,G]],[/(pico) ([\w ]+) os\d/i],[x,E,[k,G]],[/(quest( \d| pro)?s?).+vr/i],[E,[x,Ci],[k,G]],[/mobile vr; rv.+firefox/i],[[k,G]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[x,[k,L]],[/(aeobc)\b/i],[E,[x,ai],[k,L]],[/(homepod).+mac os/i],[E,[x,a],[k,L]],[/windows iot/i],[[k,L]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[E,[k,i]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[k,i]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[E,[k,c,{mobile:"Mobile",xr:"VR","*":t}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[k,t]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[k,N]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[E,[x,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[v,xi+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[v,y],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[v,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links|dillo)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[v,y],[/ladybird\//i],[[v,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,v]],os:[[/(windows nt) (6\.[23]); arm/i],[[v,/N/,"R"],[y,c,qi]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[v,y],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[y,/(;|\))/g,"",c,qi],[v,Ei]],[/(windows ce)\/?([\d\.]*)/i],[v,y],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[v,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[v,"macOS"],[y,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[y,[v,n+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[y,[v,n+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[y,[v,n+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[y,[v,n+" Linux"]],[/crkey\/([\d\.]+)/i],[y,[v,n]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[y,v],[/(ubuntu) ([\w\.]+) like android/i],[[v,/(.+)/,"$1 Touch"],y],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[v,y],[/\(bb(10);/i],[y,[v,ni]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[y,[v,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile[;\w ]*|tablet|tv|[^\)]*(?:viera|lg(?:l25|-d300)|alcatel ?o.+|y300-f1)); rv:([\w\.]+)\).+gecko\//i],[y,[v,yi+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[y,[v,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[y,c,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[v,"webOS"]],[/watch(?: ?os[,\/ ]|\d,\d\/)([\d\.]+)/i],[y,[v,"watchOS"]],[/cros [\w]+(?:\)| ([\w\.]+)\b)/i],[y,[v,"Chrome OS"]],[/kepler ([\w\.]+); (aft|aeo)/i],[y,[v,"Vega OS"]],[/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[v,y],[/(sunos) ?([\d\.]*)/i],[[v,"Solaris"],y],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[v,y]]},Bi=(w={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}},z.call(w.init,[[h,[v,y,j,k]],[p,[C]],[u,[k,E,x]],[m,[v,y]],[f,[v,y]]]),z.call(w.isIgnore,[[h,[y,j]],[m,[y]],[f,[y]]]),z.call(w.isIgnoreRgx,[[h,/ ?browser$/i],[f,/ ?os$/i]]),z.call(w.toString,[[h,[v,y]],[p,[C]],[u,[x,E]],[m,[v,y]],[f,[v,y]]]),w);function Di(i,e){if(i=i||{},z.call(this,ri),e)z.call(this,[[$,Ti(i[r])],[W,Ti(i[Y])],[N,/\?1/.test(i[ii])],[E,Oi(i[ei])],[T,Oi(i[ti])],[J,Oi(i[oi])],[C,Oi(i[Z])],[S,Ti(i[Q])],[X,Oi(i[K])]]);else for(var t in i)this.hasOwnProperty(t)&&typeof i[t]!==l.UNDEFINED&&(this[t]=i[t])}function F(i,e,t,o){return z.call(this,[["itemType",i],["ua",e],["uaCH",o],["rgxMap",t],["data",A(this,i)]]),this}function B(i,e,t){if(typeof i===l.OBJECT?(e=Si(i,!0)?(typeof e===l.OBJECT&&(t=e),i):void(t=i),i=void 0):typeof i!==l.STRING||Si(e,!0)||(t=e,e=void 0),t)if(typeof t.append===l.FUNCTION){var o={};t.forEach(function(i,e){o[String(e).toLowerCase()]=i}),t=o}else{var r,a={};for(r in t)t.hasOwnProperty(r)&&(a[String(r).toLowerCase()]=t[r]);t=a}var s,n,w,b;return this instanceof B?(s=typeof i===l.STRING?i:t&&t[P]?t[P]:I&&I.userAgent?I.userAgent:d,n=new Di(t,!0),w=Fi,z.call(this,[["getBrowser",(b=function(i){return i==g?function(){return new F(i,s,w,n).set("ua",s).set(h,this.getBrowser()).set(p,this.getCPU()).set(u,this.getDevice()).set(m,this.getEngine()).set(f,this.getOS()).get()}:function(){return new F(i,s,w[i],n).parseUA().get()}})(h)],["getCPU",b(p)],["getDevice",b(u)],["getEngine",b(m)],["getOS",b(f)],["getResult",b(g)],["getUA",function(){return s}],["setUA",function(i){return q(i)&&(s=_i(i,V)),this}],["useExtension",function(i){return i&&(w=((i,e)=>{var t,o={},r=e;if(!Si(e))for(var a in r={},e)for(var s in e[a])r[s]=e[a][s].concat(r[s]||[]);for(t in i)o[t]=r[t]&&r[t].length%2==0?r[t].concat(i[t]):i[t];return o})(w,i)),this}]]).setUA(s).useExtension(e),this):new B(i,e,t).getResult()}F.prototype.get=function(i){return i?this.data.hasOwnProperty(i)?this.data[i]:void 0:this.data},F.prototype.set=function(i,e){return this.data[i]=e,this},F.prototype.setCH=function(i){return this.uaCH=i,this},F.prototype.detectFeature=function(){if(I&&I.userAgent==this.ua)switch(this.itemType){case h:I.brave&&typeof I.brave.isBrave==l.FUNCTION&&this.set(v,"Brave");break;case u:!this.get(k)&&_&&_[N]&&this.set(k,N),"Macintosh"==this.get(E)&&I&&typeof I.standalone!==l.UNDEFINED&&I.maxTouchPoints&&2<I.maxTouchPoints&&this.set(E,"iPad").set(k,t);break;case f:!this.get(v)&&_&&_[T]&&this.set(v,_[T]);break;case g:var e=this.data,i=function(i){return e[i].getItem().detectFeature().get()};this.set(h,i(h)).set(p,i(p)).set(u,i(u)).set(m,i(m)).set(f,i(f))}return this},F.prototype.parseUA=function(){switch(this.itemType!=g&&M.call(this.data,this.ua,this.rgxMap),this.itemType){case h:this.set(j,H(this.get(y)));break;case f:var i;"iOS"==this.get(v)&&this.get(y)&&/^1[89][^\d]/.exec(this.get(y))&&(i=/\) Version\/((\d+)[\d\.]*)/.exec(this.ua))&&26<=parseInt(i[2],10)&&this.set(y,i[1])}return this},F.prototype.parseCH=function(){var i,e=this.uaCH,t=this.rgxMap;switch(this.itemType){case h:case m:var o,r=e[W]||e[$];if(r)for(var a=0;a<r.length;a++){var s=r[a].brand||r[a],n=r[a].version;this.itemType==h&&!/not.a.brand/i.test(s)&&(!o||/Chrom/.test(o)&&s!=ki||o==xi&&/WebView2/.test(s))&&(s=c(s,zi),(o=this.get(v))&&!/Chrom/.test(o)&&/Chrom/.test(s)||this.set(v,s).set(y,n).set(j,H(n)),o=s),this.itemType==m&&s==ki&&this.set(y,n)}break;case p:var w=e[C];w&&("64"==e[X]&&(w+="64"),M.call(this.data,w+";",t));break;case u:if(e[N]&&this.set(k,N),e[E]&&(this.set(E,e[E]),this.get(k)&&this.get(x)||(M.call(w={},"droid 9; "+e[E]+")",t),!this.get(k)&&w.type&&this.set(k,w.type),!this.get(x)&&w.vendor&&this.set(x,w.vendor))),e[S]){if("string"!=typeof e[S])for(var b=0;!i&&b<e[S].length;)i=c(e[S][b++],Ui);else i=c(e[S],Ui);this.set(k,i)}break;case f:var d,w=e[T];w&&(d=e[J],w==Ei&&(d=13<=parseInt(H(d),10)?"11":"10"),this.set(v,w).set(y,d)),this.get(v)==Ei&&"Xbox"==e[E]&&this.set(v,"Xbox").set(y,void 0);break;case g:var l=this.data,w=function(i){return l[i].getItem().setCH(e).parseCH().get()};this.set(h,w(h)).set(p,w(p)).set(u,w(u)).set(m,w(m)).set(f,w(f))}return this},B.VERSION="2.0.10",B.BROWSER=D([v,y,j,k]),B.CPU=D([C]),B.DEVICE=D([E,x,k,R,N,i,t,e,L]),B.ENGINE=B.OS=D([v,y]);export{B as UAParser};
src/main/ua-parser.js +54 lines · 2 flagged
--- +++ @@ -1,3 +1,3 @@ /////////////////////////////////////////////////////////////////////////////////-/* UAParser.js v2.0.9+/* UAParser.js v2.0.10    Copyright © 2012-2026 Faisal Salman <[email protected]>@@ -21,3 +21,3 @@ -    var LIBVERSION  = '2.0.9',+    var LIBVERSION  = '2.0.10',         UA_MAX_LENGTH = 500,@@ -172,3 +172,3 @@             var arr = [];-            var tokens = strip(/\\?\"/g, header).split(',');+            var tokens = normalizeHeaderValue(header).split(',');             for (var i = 0; i < tokens.length; i++) {@@ -189,2 +189,5 @@         },+        normalizeHeaderValue = function (str) {+            return isString(str) ? trim(strip(/\\?\"/g, str), UA_MAX_LENGTH) : undefined;+        },         setProps = function (arr) {@@ -204,5 +207,2 @@             return isString(str) ? str.replace(pattern, EMPTY) : str;-        },-        stripQuotes = function (str) {-            return strip(/\\?\"/g, str);          },@@ -280,2 +280,6 @@ +        strTest = function (str, map) {+            return map.test.test(str) ? map.ifTrue : map.ifFalse;+        },+         strMapper = function (str, map) {@@ -350,3 +354,3 @@             /webview.+edge\/([\w\.]+)/i                                         // Microsoft Edge-            ], [VERSION, [NAME, EDGE+' WebView']], [+            ], [VERSION, [NAME, EDGE+' WebView'], [TYPE, INAPP]], [             /edg(?:e|ios|a)?\/([\w\.]+)/i                                       @@ -390,3 +394,3 @@             ], [VERSION, [NAME, 'DuckDuckGo']], [-            /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i                 // UCBrowser+            /(?:\buc? ?browser|(?:juc.+)ucweb| ucpc)[\/ ]?([\w\.]+)/i           // UCBrowser             ], [VERSION, [NAME, 'UCBrowser']], [@@ -429,3 +433,5 @@             /(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i-            ], [[NAME, /(.+)/, '$1' + SUFFIX_BROWSER], VERSION], [              // Oculus/Sailfish/HuaweiBrowser/VivoBrowser/PicoBrowser+            ], [[NAME, /(.+)/, '$1' + SUFFIX_BROWSER], VERSION], [              // Oculus/Sailfish/VivoBrowser/PicoBrowser+            / HBPC\/([\w\.]+)/                                                  // Huawei Browser+            ], [VERSION, [NAME, HUAWEI + SUFFIX_BROWSER]], [             /samsungbrowser\/([\w\.]+)/i                                        // Samsung Internet@@ -477,6 +483,6 @@             /wv\).+chrome\/([\w\.]+).+edgw\//i                                  // Edge WebView2-            ], [VERSION, [NAME, EDGE+' WebView2']], [--            / wv\).+(chrome)\/([\w\.]+)/i                                       // Chrome WebView-            ], [[NAME, CHROME+' WebView'], VERSION], [+            ], [VERSION, [NAME, EDGE+' WebView2'], [TYPE, INAPP]], [++            /; wv\).+(chrome)\/([\w\.]+)/i                                      // Chrome WebView+            ], [[NAME, CHROME+' WebView'], VERSION, [TYPE, INAPP]], [ @@ -614,3 +620,3 @@             /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,-            / ([\w ]+) miui\/v?\d/i+            /; ([\w ]+) miui\/v?\d/i             ], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, MOBILE]], [@@ -769,2 +775,7 @@ +            // Blackview+            /blackview ([-\w ]+)( b|\))/i,+            /; (bv\d{4}[-\w ]*)( b|\))/i+            ], [MODEL, [VENDOR, 'Blackview'], [TYPE, MOBILE]], [+             // HMD@@ -772,2 +783,6 @@             ], [MODEL, [VENDOR, 'HMD'], [TYPE, MOBILE]], [++            // T-Mobile+            /((revvl[ \w\+]+|tm(?:rv|af)\w*[45]g(?:tb)?))( b|\))/i+            ], [MODEL, [TYPE, strTest, { 'test': /ta?b/i, 'ifTrue': TABLET, 'ifFalse': MOBILE }], [VENDOR, 'T-Mobile']], [ @@ -780,4 +795,4 @@                                                                                 // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron/Tecno/Micromax/Advan-                                                                                // BLU/HMD/IMO/Infinix/Lava/OnePlus/TCL/Wiko-            /; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,+                                                                                // BLU/Coolpad/CUBOT/HMD/IMO/Infinix/Lava/OnePlus/TCL/Wiko+            /; (blu|coolpad|cubot|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([-\w\+ ]+?)(?: bui|\)|; r)/i,             /(hp) ([\w ]+\w)/i,                                                 // HP iPAQ@@ -1189,8 +1204,8 @@                 [MOBILE, /\?1/.test(uach[CH_MOBILE])],-                [MODEL, stripQuotes(uach[CH_MODEL])],-                [PLATFORM, stripQuotes(uach[CH_PLATFORM])],-                [PLATFORMVER, stripQuotes(uach[CH_PLATFORM_VER])],-                [ARCHITECTURE, stripQuotes(uach[CH_ARCH])],+                [MODEL, normalizeHeaderValue(uach[CH_MODEL])],+                [PLATFORM, normalizeHeaderValue(uach[CH_PLATFORM])],+                [PLATFORMVER, normalizeHeaderValue(uach[CH_PLATFORM_VER])],+                [ARCHITECTURE, normalizeHeaderValue(uach[CH_ARCH])],                 [FORMFACTORS, itemListToArray(uach[CH_FORM_FACTORS])],-                [BITNESS, stripQuotes(uach[CH_BITNESS])]+                [BITNESS, normalizeHeaderValue(uach[CH_BITNESS])]             ]);@@ -1282,7 +1297,13 @@             case OS:-                if (this.get(NAME) == 'iOS' && this.get(VERSION) == '18.6') {-                    // Based on the assumption that iOS version is tightly coupled with Safari version-                    var realVersion = /\) Version\/([\d\.]+)/.exec(this.ua); // Get Safari version-                    if (realVersion && parseInt(realVersion[1].substring(0,2), 10) >= 26) {-                        this.set(VERSION, realVersion[1]);  // Set as iOS version+                // Since iOS 26, Safari's UA reports the OS version as frozen at 18:+                // https://webkit.org/blog/17333/webkit-features-in-safari-26-0/#update-to-ua-string+                if (this.get(NAME) == 'iOS' && this.get(VERSION)) {+                    // Only perform this if iOS version is 18/19+                    if (/^1[89][^\d]/.exec(this.get(VERSION))) {+                        // Based on the assumption that "iOS" version is tightly coupled with "Safari" version+                        var realVersion = /\) Version\/((\d+)[\d\.]*)/.exec(this.ua);+                        if (realVersion && parseInt(realVersion[2], 10) >= 26) {+                            // iOS version = Safari version+                            this.set(VERSION, realVersion[1]);+                        }                     }@@ -1442,5 +1463,3 @@             httpUACH = new UACHData(headers, true),-            regexMap = extensions ? -                        extend(defaultRegexes, extensions) : -                        defaultRegexes,+            regexMap = defaultRegexes, @@ -1479,5 +1498,10 @@                 return this;+            }],+            ['useExtension', function (exts) {+                if (exts) regexMap = extend(regexMap, exts);+                return this;             }]         ])-        .setUA(userAgent);+        .setUA(userAgent)+        .useExtension(extensions); 
src/main/ua-parser.mjs +54 lines · 2 flagged
--- +++ @@ -5,3 +5,3 @@ /////////////////////////////////////////////////////////////////////////////////-/* UAParser.js v2.0.9+/* UAParser.js v2.0.10    Copyright © 2012-2026 Faisal Salman <[email protected]>@@ -23,3 +23,3 @@ -    var LIBVERSION  = '2.0.9',+    var LIBVERSION  = '2.0.10',         UA_MAX_LENGTH = 500,@@ -174,3 +174,3 @@             var arr = [];-            var tokens = strip(/\\?\"/g, header).split(',');+            var tokens = normalizeHeaderValue(header).split(',');             for (var i = 0; i < tokens.length; i++) {@@ -191,2 +191,5 @@         },+        normalizeHeaderValue = function (str) {+            return isString(str) ? trim(strip(/\\?\"/g, str), UA_MAX_LENGTH) : undefined;+        },         setProps = function (arr) {@@ -206,5 +209,2 @@             return isString(str) ? str.replace(pattern, EMPTY) : str;-        },-        stripQuotes = function (str) {-            return strip(/\\?\"/g, str);          },@@ -282,2 +282,6 @@ +        strTest = function (str, map) {+            return map.test.test(str) ? map.ifTrue : map.ifFalse;+        },+         strMapper = function (str, map) {@@ -352,3 +356,3 @@             /webview.+edge\/([\w\.]+)/i                                         // Microsoft Edge-            ], [VERSION, [NAME, EDGE+' WebView']], [+            ], [VERSION, [NAME, EDGE+' WebView'], [TYPE, INAPP]], [             /edg(?:e|ios|a)?\/([\w\.]+)/i                                       @@ -392,3 +396,3 @@             ], [VERSION, [NAME, 'DuckDuckGo']], [-            /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i                 // UCBrowser+            /(?:\buc? ?browser|(?:juc.+)ucweb| ucpc)[\/ ]?([\w\.]+)/i           // UCBrowser             ], [VERSION, [NAME, 'UCBrowser']], [@@ -431,3 +435,5 @@             /(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i-            ], [[NAME, /(.+)/, '$1' + SUFFIX_BROWSER], VERSION], [              // Oculus/Sailfish/HuaweiBrowser/VivoBrowser/PicoBrowser+            ], [[NAME, /(.+)/, '$1' + SUFFIX_BROWSER], VERSION], [              // Oculus/Sailfish/VivoBrowser/PicoBrowser+            / HBPC\/([\w\.]+)/                                                  // Huawei Browser+            ], [VERSION, [NAME, HUAWEI + SUFFIX_BROWSER]], [             /samsungbrowser\/([\w\.]+)/i                                        // Samsung Internet@@ -479,6 +485,6 @@             /wv\).+chrome\/([\w\.]+).+edgw\//i                                  // Edge WebView2-            ], [VERSION, [NAME, EDGE+' WebView2']], [--            / wv\).+(chrome)\/([\w\.]+)/i                                       // Chrome WebView-            ], [[NAME, CHROME+' WebView'], VERSION], [+            ], [VERSION, [NAME, EDGE+' WebView2'], [TYPE, INAPP]], [++            /; wv\).+(chrome)\/([\w\.]+)/i                                      // Chrome WebView+            ], [[NAME, CHROME+' WebView'], VERSION, [TYPE, INAPP]], [ @@ -616,3 +622,3 @@             /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,-            / ([\w ]+) miui\/v?\d/i+            /; ([\w ]+) miui\/v?\d/i             ], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, MOBILE]], [@@ -771,2 +777,7 @@ +            // Blackview+            /blackview ([-\w ]+)( b|\))/i,+            /; (bv\d{4}[-\w ]*)( b|\))/i+            ], [MODEL, [VENDOR, 'Blackview'], [TYPE, MOBILE]], [+             // HMD@@ -774,2 +785,6 @@             ], [MODEL, [VENDOR, 'HMD'], [TYPE, MOBILE]], [++            // T-Mobile+            /((revvl[ \w\+]+|tm(?:rv|af)\w*[45]g(?:tb)?))( b|\))/i+            ], [MODEL, [TYPE, strTest, { 'test': /ta?b/i, 'ifTrue': TABLET, 'ifFalse': MOBILE }], [VENDOR, 'T-Mobile']], [ @@ -782,4 +797,4 @@                                                                                 // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron/Tecno/Micromax/Advan-                                                                                // BLU/HMD/IMO/Infinix/Lava/OnePlus/TCL/Wiko-            /; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,+                                                                                // BLU/Coolpad/CUBOT/HMD/IMO/Infinix/Lava/OnePlus/TCL/Wiko+            /; (blu|coolpad|cubot|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([-\w\+ ]+?)(?: bui|\)|; r)/i,             /(hp) ([\w ]+\w)/i,                                                 // HP iPAQ@@ -1191,8 +1206,8 @@                 [MOBILE, /\?1/.test(uach[CH_MOBILE])],-                [MODEL, stripQuotes(uach[CH_MODEL])],-                [PLATFORM, stripQuotes(uach[CH_PLATFORM])],-                [PLATFORMVER, stripQuotes(uach[CH_PLATFORM_VER])],-                [ARCHITECTURE, stripQuotes(uach[CH_ARCH])],+                [MODEL, normalizeHeaderValue(uach[CH_MODEL])],+                [PLATFORM, normalizeHeaderValue(uach[CH_PLATFORM])],+                [PLATFORMVER, normalizeHeaderValue(uach[CH_PLATFORM_VER])],+                [ARCHITECTURE, normalizeHeaderValue(uach[CH_ARCH])],                 [FORMFACTORS, itemListToArray(uach[CH_FORM_FACTORS])],-                [BITNESS, stripQuotes(uach[CH_BITNESS])]+                [BITNESS, normalizeHeaderValue(uach[CH_BITNESS])]             ]);@@ -1284,7 +1299,13 @@             case OS:-                if (this.get(NAME) == 'iOS' && this.get(VERSION) == '18.6') {-                    // Based on the assumption that iOS version is tightly coupled with Safari version-                    var realVersion = /\) Version\/([\d\.]+)/.exec(this.ua); // Get Safari version-                    if (realVersion && parseInt(realVersion[1].substring(0,2), 10) >= 26) {-                        this.set(VERSION, realVersion[1]);  // Set as iOS version+                // Since iOS 26, Safari's UA reports the OS version as frozen at 18:+                // https://webkit.org/blog/17333/webkit-features-in-safari-26-0/#update-to-ua-string+                if (this.get(NAME) == 'iOS' && this.get(VERSION)) {+                    // Only perform this if iOS version is 18/19+                    if (/^1[89][^\d]/.exec(this.get(VERSION))) {+                        // Based on the assumption that "iOS" version is tightly coupled with "Safari" version+                        var realVersion = /\) Version\/((\d+)[\d\.]*)/.exec(this.ua);+                        if (realVersion && parseInt(realVersion[2], 10) >= 26) {+                            // iOS version = Safari version+                            this.set(VERSION, realVersion[1]);+                        }                     }@@ -1444,5 +1465,3 @@             httpUACH = new UACHData(headers, true),-            regexMap = extensions ? -                        extend(defaultRegexes, extensions) : -                        defaultRegexes,+            regexMap = defaultRegexes, @@ -1481,5 +1500,10 @@                 return this;+            }],+            ['useExtension', function (exts) {+                if (exts) regexMap = extend(regexMap, exts);+                return this;             }]         ])-        .setUA(userAgent);+        .setUA(userAgent)+        .useExtension(extensions); 
package.json +19 lines
--- +++ @@ -3,3 +3,3 @@   "name": "ua-parser-js",-  "version": "2.0.9",+  "version": "2.0.10",   "author": "Faisal Salman <[email protected]> (http://faisalman.com)",@@ -25,4 +25,6 @@   "contributors": [+    "23tux <[email protected]>",     "Aamir Poonawalla <[email protected]>",     "Admas <[email protected]>",+    "Aidan Nulman <[email protected]>",     "Aiyush <[email protected]>",@@ -41,4 +43,7 @@     "Benjamin Urban <[email protected]>",+    "Benxamin <[email protected]>",     "boneyao <[email protected]>",+    "carel155 <[email protected]>",     "Carl C Von Lewin <[email protected]>",+    "Casey Grimes <[email protected]>",     "CESAR RAMOS <[email protected]>",@@ -77,2 +82,3 @@     "Germán M. Bravo <[email protected]>",+    "giantyo26 <[email protected]>",     "Grigory Dmitrenko <[email protected]>",@@ -81,2 +87,3 @@     "Harald Reingruber <[email protected]>",+    "Harlan Brawer <[email protected]>",     "Hendrik Helwich <[email protected]>",@@ -85,2 +92,3 @@     "Hyewon Kang <[email protected]>",+    "Hyper-Z11 <[email protected]>",     "Hyunbin <[email protected]>",@@ -114,2 +122,3 @@     "Lukas Eipert <[email protected]>",+    "Maksim Otto <[email protected]>",     "Malash <[email protected]>",@@ -157,2 +166,3 @@     "Sandro Sonntag <[email protected]>",+    "Sébastien Règne <[email protected]>",     "sgautrea <[email protected]>",@@ -167,2 +177,3 @@     "sUP <[email protected]>",+    "Suryaansh Chawla <[email protected]>",     "Sylvain Gizard <[email protected]>",@@ -172,3 +183,5 @@     "Ulrich Schmidt <[email protected]>",+    "undefined <[email protected]>",     "Vadim Kurachevsky <[email protected]>",+    "Valentina <[email protected]>",     "Varun Sharma <[email protected]>",@@ -229,2 +242,3 @@   "bin": "./script/cli.js",+  "sideEffects": false,   "scripts": {@@ -232,3 +246,2 @@     "build+test": "npm run build && npm run test",-    "fuzz": "jazzer ./test/fuzz/redos.js --sync",     "test": "./script/test-all.sh",@@ -236,2 +249,3 @@     "test:eslint": "eslint --no-config-lookup src",+    "test:fuzz": "jazzer ./test/fuzz/redos.js --sync",     "test:jshint": "jshint src/main",@@ -239,2 +253,3 @@     "test:mocha": "mocha --recursive test/unit",+    "test:nyc": "nyc --timeout=50000 --include=src/**/*.js npm run test",     "test:playwright": "npx playwright install && playwright test test/e2e --browser all"@@ -249,2 +264,3 @@     "@babel/traverse": "7.23.2",+    "@jazzer.js/core": "^4.0.0",     "@playwright/test": "^1.57.0",@@ -254,2 +270,3 @@     "mocha": "~8.2.0",+    "nyc": "^18.0.0",     "requirejs": "2.3.2",
src/bot-detection/bot-detection.d.ts +6 lines
--- +++ @@ -1,2 +1,2 @@-// Type definitions for bot-detection submodule of UAParser.js v2.0.9+// Type definitions for bot-detection submodule of UAParser.js v2.0.10 // Project: https://github.com/faisalman/ua-parser-js@@ -4,4 +4,6 @@ -export function isAIAssistant(ua: string): boolean;-export function isAICrawler(ua: string): boolean;-export function isBot(ua: string): boolean;+import type { IResult } from "../main/ua-parser";++export function isAIAssistant(resultOrUA: IResult | string): boolean;+export function isAICrawler(resultOrUA: IResult | string): boolean;+export function isBot(resultOrUA: IResult | string): boolean;
src/bot-detection/bot-detection.js +2 lines
--- +++ @@ -1,3 +1,3 @@ //////////////////////////////////////////////////-/*  bot-detection submodule of UAParser.js v2.0.9+/*  bot-detection submodule of UAParser.js v2.0.10     https://github.com/faisalman/ua-parser-js@@ -139,2 +139,3 @@     Crawler.META_EXTERNALAGENT,+    Crawler.META_WEBINDEXER, 
src/bot-detection/bot-detection.mjs +2 lines
--- +++ @@ -5,3 +5,3 @@ //////////////////////////////////////////////////-/*  bot-detection submodule of UAParser.js v2.0.9+/*  bot-detection submodule of UAParser.js v2.0.10     https://github.com/faisalman/ua-parser-js@@ -143,2 +143,3 @@     Crawler.META_EXTERNALAGENT,+    Crawler.META_WEBINDEXER, 
src/browser-detection/browser-detection.d.ts +1 lines
--- +++ @@ -1,2 +1,2 @@-// Type definitions for browser-detection submodule of UAParser.js v2.0.9+// Type definitions for browser-detection submodule of UAParser.js v2.0.10 // Project: https://github.com/faisalman/ua-parser-js
src/browser-detection/browser-detection.js +6 lines
--- +++ @@ -1,3 +1,3 @@ //////////////////////////////////////////////////////-/*  browser-detection submodule of UAParser.js v2.0.9+/*  browser-detection submodule of UAParser.js v2.0.10     https://github.com/faisalman/ua-parser-js@@ -21,4 +21,7 @@ const isElectron = () => !!(-    process?.versions?.hasOwnProperty('electron') ||    // node.js-    / electron\//i.test(navigator?.userAgent));         // browser+    // in node.js environment+    (typeof process !== 'undefined' && process.versions?.hasOwnProperty('electron')) ||+    // in browser environment+    (typeof navigator !== 'undefined' && / electron\//i.test(navigator.userAgent))+); 
src/browser-detection/browser-detection.mjs +6 lines
--- +++ @@ -5,3 +5,3 @@ //////////////////////////////////////////////////////-/*  browser-detection submodule of UAParser.js v2.0.9+/*  browser-detection submodule of UAParser.js v2.0.10     https://github.com/faisalman/ua-parser-js@@ -25,4 +25,7 @@ const isElectron = () => !!(-    process?.versions?.hasOwnProperty('electron') ||    // node.js-    / electron\//i.test(navigator?.userAgent));         // browser+    // in node.js environment+    (typeof process !== 'undefined' && process.versions?.hasOwnProperty('electron')) ||+    // in browser environment+    (typeof navigator !== 'undefined' && / electron\//i.test(navigator.userAgent))+); 
src/device-detection/device-detection.d.ts +1 lines
--- +++ @@ -1,2 +1,2 @@-// Type definitions for device-detection submodule of UAParser.js v2.0.9+// Type definitions for device-detection submodule of UAParser.js v2.0.10 // Project: https://github.com/faisalman/ua-parser-js
src/device-detection/device-detection.js +1 lines
--- +++ @@ -1,3 +1,3 @@ /////////////////////////////////////////////////////-/*  device-detection submodule of UAParser.js v2.0.9+/*  device-detection submodule of UAParser.js v2.0.10     https://github.com/faisalman/ua-parser-js
src/device-detection/device-detection.mjs +1 lines
--- +++ @@ -5,3 +5,3 @@ /////////////////////////////////////////////////////-/*  device-detection submodule of UAParser.js v2.0.9+/*  device-detection submodule of UAParser.js v2.0.10     https://github.com/faisalman/ua-parser-js
src/enums/ua-parser-enums.d.ts +29 lines
--- +++ @@ -5,3 +5,3 @@ ///////////////////////////////////////////////-/*  Enums for UAParser.js v2.0.9+/*  Enums for UAParser.js v2.0.10     https://github.com/faisalman/ua-parser-js@@ -222,3 +222,2 @@     CONSOLE: 'console',-    DESKTOP: 'desktop',     EMBEDDED: 'embedded',@@ -228,3 +227,7 @@     WEARABLE: 'wearable',-    XR: 'xr'+    XR: 'xr',+    /**+     * @deprecated UAParser doesn't support `desktop` type, see https://docs.uaparser.dev/info/device/type+     */+    DESKTOP: 'desktop' }>;@@ -247,4 +250,7 @@     BLACKBERRY: 'BlackBerry',+    BLACKVIEW: 'Blackview',     BLU: 'BLU',     CAT: 'Cat',+    COOLPAD: 'Coolpad',+    CUBOT: 'CUBOT',     DELL: 'Dell',@@ -303,2 +309,3 @@     TESLA: 'Tesla',+    T_MOBILE: 'T-Mobile',     ULEFONE: 'Ulefone',@@ -475,2 +482,3 @@             AMAZON_CONTXBOT: 'contxbot',+            AMAZON_SEARCHBOT: 'Amzn-SearchBot',             ANTHROPIC_AI: 'anthropic-ai',@@ -479,4 +487,8 @@             ANTHROPIC_CLAUDE_WEB: 'Claude-Web',+            ARCHIVEORG_BOT: 'archive.org_bot',             ATLASSIAN_BOT: 'atlassian-bot',-            ARCHIVEORG_BOT: 'archive.org_bot',+            AUDISTO_CRAWLER: 'Audisto Crawler',+            AWARIO_BOT: 'AwarioBot',+            AWARIO_SMARTBOT: 'AwarioSmartBot',+            AWARIO_RSSBOT: 'AwarioRssBot',             BAIDU_ADS: 'Baidu-ADS',@@ -493,2 +505,3 @@             BRAVE_BOT: 'Bravebot',+            BRIGHTEDGE_CRAWLER: 'BrightEdge Crawler',             BYTEDANCE_BYTESPIDER: 'Bytespider',@@ -500,2 +513,3 @@             COHERE_TRAINING_DATA_CRAWLER: 'cohere-training-data-crawler',+            COMSCORE_PROXIMIC: 'proximic',             COTOYOGI: 'Cotoyogi',@@ -533,2 +547,3 @@             GOOGLE_STOREBOT: 'Storebot-Google',+            HEADLINE: 'Headline',             HIVE_IMAGESIFTBOT: 'ImagesiftBot',@@ -536,2 +551,3 @@             HUAWEI_PETALBOT: 'PetalBot',+            HUBSPOT_CRAWLER: 'HubSpot Crawler',             HUGGINGFACE_BOT: 'HuggingFace-Bot',@@ -546,2 +562,3 @@             MARGINALIA: 'marginalia',+            META_EXTERNALADS: 'meta-externalads',             META_EXTERNALAGENT: 'meta-externalagent',@@ -550,2 +567,3 @@             META_FACEBOOKEXTERNALHIT: 'facebookexternalhit',+            META_WEBINDEXER: 'meta-webindexer',             MAJESTIC_MJ12BOT: 'MJ12bot',@@ -589,2 +607,3 @@             XAI_BOT: 'xAI-Bot',+            YACY_BOT: 'yacybot',             YAHOO_JAPAN: 'Y!J-BRW',@@ -695,2 +714,3 @@             AMAZON_NOVA_ACT: 'NovaAct',+            AMAZON_USER: 'Amzn-User',             ANTHROPIC_CLAUDE_USER: 'Claude-User',@@ -704,4 +724,6 @@             DUCKDUCKGO_ASSISTBOT: 'DuckAssistBot',+            FEEDLY: 'Feedly',             FLIPBOARD_PROXY: 'FlipboardProxy',             GOOGLE_CHROME_LIGHTHOUSE: 'Lighthouse',+            GOOGLE_DOCS: 'GoogleDocs',             GOOGLE_FEEDFETCHER: 'FeedFetcher-Google',@@ -735,2 +757,3 @@             UPTIMEROBOT: 'UptimeRobot',+            UPTIMEBOT: 'UptimeBot',             VERCEL_FAVICON_BOT: 'vercel-favicon-bot',@@ -740,2 +763,3 @@             VERCEL_TRACING: 'verceltracing',+            VIRUSTOTAL: 'virustotal',             X_TWITTERBOT: 'Twitterbot',@@ -794,2 +818,3 @@             OCAML_COHTTP: 'ocaml-cohttp',+            PHP_CRAWL: 'phpcrawl',             PHP_SOAP: 'PHP-SOAP',
src/enums/ua-parser-enums.js +29 lines
--- +++ @@ -1,3 +1,3 @@ ///////////////////////////////////////////////-/*  Enums for UAParser.js v2.0.9+/*  Enums for UAParser.js v2.0.10     https://github.com/faisalman/ua-parser-js@@ -218,3 +218,2 @@     CONSOLE: 'console',-    DESKTOP: 'desktop',     EMBEDDED: 'embedded',@@ -224,3 +223,7 @@     WEARABLE: 'wearable',-    XR: 'xr'+    XR: 'xr',+    /**+     * @deprecated UAParser doesn't support `desktop` type, see https://docs.uaparser.dev/info/device/type+     */+    DESKTOP: 'desktop' });@@ -243,4 +246,7 @@     BLACKBERRY: 'BlackBerry',+    BLACKVIEW: 'Blackview',     BLU: 'BLU',     CAT: 'Cat',+    COOLPAD: 'Coolpad',+    CUBOT: 'CUBOT',     DELL: 'Dell',@@ -299,2 +305,3 @@     TESLA: 'Tesla',+    T_MOBILE: 'T-Mobile',     ULEFONE: 'Ulefone',@@ -471,2 +478,3 @@             AMAZON_CONTXBOT: 'contxbot',+            AMAZON_SEARCHBOT: 'Amzn-SearchBot',             ANTHROPIC_AI: 'anthropic-ai',@@ -475,4 +483,8 @@             ANTHROPIC_CLAUDE_WEB: 'Claude-Web',+            ARCHIVEORG_BOT: 'archive.org_bot',             ATLASSIAN_BOT: 'atlassian-bot',-            ARCHIVEORG_BOT: 'archive.org_bot',+            AUDISTO_CRAWLER: 'Audisto Crawler',+            AWARIO_BOT: 'AwarioBot',+            AWARIO_SMARTBOT: 'AwarioSmartBot',+            AWARIO_RSSBOT: 'AwarioRssBot',             BAIDU_ADS: 'Baidu-ADS',@@ -489,2 +501,3 @@             BRAVE_BOT: 'Bravebot',+            BRIGHTEDGE_CRAWLER: 'BrightEdge Crawler',             BYTEDANCE_BYTESPIDER: 'Bytespider',@@ -496,2 +509,3 @@             COHERE_TRAINING_DATA_CRAWLER: 'cohere-training-data-crawler',+            COMSCORE_PROXIMIC: 'proximic',             COTOYOGI: 'Cotoyogi',@@ -529,2 +543,3 @@             GOOGLE_STOREBOT: 'Storebot-Google',+            HEADLINE: 'Headline',             HIVE_IMAGESIFTBOT: 'ImagesiftBot',@@ -532,2 +547,3 @@             HUAWEI_PETALBOT: 'PetalBot',+            HUBSPOT_CRAWLER: 'HubSpot Crawler',             HUGGINGFACE_BOT: 'HuggingFace-Bot',@@ -542,2 +558,3 @@             MARGINALIA: 'marginalia',+            META_EXTERNALADS: 'meta-externalads',             META_EXTERNALAGENT: 'meta-externalagent',@@ -546,2 +563,3 @@             META_FACEBOOKEXTERNALHIT: 'facebookexternalhit',+            META_WEBINDEXER: 'meta-webindexer',             MAJESTIC_MJ12BOT: 'MJ12bot',@@ -585,2 +603,3 @@             XAI_BOT: 'xAI-Bot',+            YACY_BOT: 'yacybot',             YAHOO_JAPAN: 'Y!J-BRW',@@ -691,2 +710,3 @@             AMAZON_NOVA_ACT: 'NovaAct',+            AMAZON_USER: 'Amzn-User',             ANTHROPIC_CLAUDE_USER: 'Claude-User',@@ -700,4 +720,6 @@             DUCKDUCKGO_ASSISTBOT: 'DuckAssistBot',+            FEEDLY: 'Feedly',             FLIPBOARD_PROXY: 'FlipboardProxy',             GOOGLE_CHROME_LIGHTHOUSE: 'Lighthouse',+            GOOGLE_DOCS: 'GoogleDocs',             GOOGLE_FEEDFETCHER: 'FeedFetcher-Google',@@ -731,2 +753,3 @@             UPTIMEROBOT: 'UptimeRobot',+            UPTIMEBOT: 'UptimeBot',             VERCEL_FAVICON_BOT: 'vercel-favicon-bot',@@ -736,2 +759,3 @@             VERCEL_TRACING: 'verceltracing',+            VIRUSTOTAL: 'virustotal',             X_TWITTERBOT: 'Twitterbot',@@ -790,2 +814,3 @@             OCAML_COHTTP: 'ocaml-cohttp',+            PHP_CRAWL: 'phpcrawl',             PHP_SOAP: 'PHP-SOAP',
src/enums/ua-parser-enums.mjs +29 lines
--- +++ @@ -5,3 +5,3 @@ ///////////////////////////////////////////////-/*  Enums for UAParser.js v2.0.9+/*  Enums for UAParser.js v2.0.10     https://github.com/faisalman/ua-parser-js@@ -222,3 +222,2 @@     CONSOLE: 'console',-    DESKTOP: 'desktop',     EMBEDDED: 'embedded',@@ -228,3 +227,7 @@     WEARABLE: 'wearable',-    XR: 'xr'+    XR: 'xr',+    /**+     * @deprecated UAParser doesn't support `desktop` type, see https://docs.uaparser.dev/info/device/type+     */+    DESKTOP: 'desktop' });@@ -247,4 +250,7 @@     BLACKBERRY: 'BlackBerry',+    BLACKVIEW: 'Blackview',     BLU: 'BLU',     CAT: 'Cat',+    COOLPAD: 'Coolpad',+    CUBOT: 'CUBOT',     DELL: 'Dell',@@ -303,2 +309,3 @@     TESLA: 'Tesla',+    T_MOBILE: 'T-Mobile',     ULEFONE: 'Ulefone',@@ -475,2 +482,3 @@             AMAZON_CONTXBOT: 'contxbot',+            AMAZON_SEARCHBOT: 'Amzn-SearchBot',             ANTHROPIC_AI: 'anthropic-ai',@@ -479,4 +487,8 @@             ANTHROPIC_CLAUDE_WEB: 'Claude-Web',+            ARCHIVEORG_BOT: 'archive.org_bot',             ATLASSIAN_BOT: 'atlassian-bot',-            ARCHIVEORG_BOT: 'archive.org_bot',+            AUDISTO_CRAWLER: 'Audisto Crawler',+            AWARIO_BOT: 'AwarioBot',+            AWARIO_SMARTBOT: 'AwarioSmartBot',+            AWARIO_RSSBOT: 'AwarioRssBot',             BAIDU_ADS: 'Baidu-ADS',@@ -493,2 +505,3 @@             BRAVE_BOT: 'Bravebot',+            BRIGHTEDGE_CRAWLER: 'BrightEdge Crawler',             BYTEDANCE_BYTESPIDER: 'Bytespider',@@ -500,2 +513,3 @@             COHERE_TRAINING_DATA_CRAWLER: 'cohere-training-data-crawler',+            COMSCORE_PROXIMIC: 'proximic',             COTOYOGI: 'Cotoyogi',@@ -533,2 +547,3 @@             GOOGLE_STOREBOT: 'Storebot-Google',+            HEADLINE: 'Headline',             HIVE_IMAGESIFTBOT: 'ImagesiftBot',@@ -536,2 +551,3 @@             HUAWEI_PETALBOT: 'PetalBot',+            HUBSPOT_CRAWLER: 'HubSpot Crawler',             HUGGINGFACE_BOT: 'HuggingFace-Bot',@@ -546,2 +562,3 @@             MARGINALIA: 'marginalia',+            META_EXTERNALADS: 'meta-externalads',             META_EXTERNALAGENT: 'meta-externalagent',@@ -550,2 +567,3 @@             META_FACEBOOKEXTERNALHIT: 'facebookexternalhit',+            META_WEBINDEXER: 'meta-webindexer',             MAJESTIC_MJ12BOT: 'MJ12bot',@@ -589,2 +607,3 @@             XAI_BOT: 'xAI-Bot',+            YACY_BOT: 'yacybot',             YAHOO_JAPAN: 'Y!J-BRW',@@ -695,2 +714,3 @@             AMAZON_NOVA_ACT: 'NovaAct',+            AMAZON_USER: 'Amzn-User',             ANTHROPIC_CLAUDE_USER: 'Claude-User',@@ -704,4 +724,6 @@             DUCKDUCKGO_ASSISTBOT: 'DuckAssistBot',+            FEEDLY: 'Feedly',             FLIPBOARD_PROXY: 'FlipboardProxy',             GOOGLE_CHROME_LIGHTHOUSE: 'Lighthouse',+            GOOGLE_DOCS: 'GoogleDocs',             GOOGLE_FEEDFETCHER: 'FeedFetcher-Google',@@ -735,2 +757,3 @@             UPTIMEROBOT: 'UptimeRobot',+            UPTIMEBOT: 'UptimeBot',             VERCEL_FAVICON_BOT: 'vercel-favicon-bot',@@ -740,2 +763,3 @@             VERCEL_TRACING: 'verceltracing',+            VIRUSTOTAL: 'virustotal',             X_TWITTERBOT: 'Twitterbot',@@ -794,2 +818,3 @@             OCAML_COHTTP: 'ocaml-cohttp',+            PHP_CRAWL: 'phpcrawl',             PHP_SOAP: 'PHP-SOAP',
src/extensions/ua-parser-extensions.d.ts +1 lines
--- +++ @@ -1,2 +1,2 @@-// Type definitions for Helpers submodule of UAParser.js v2.0.9+// Type definitions for Helpers submodule of UAParser.js v2.0.10 // Project: https://github.com/faisalman/ua-parser-js
src/extensions/ua-parser-extensions.js +22 lines
--- +++ @@ -1,3 +1,3 @@ ///////////////////////////////////////////////-/*  Extensions for UAParser.js v2.0.9+/*  Extensions for UAParser.js v2.0.10     https://github.com/faisalman/ua-parser-js@@ -57,2 +57,3 @@             // Amazonbot - https://developer.amazon.com/amazonbot+            // Awario - https://awario.com/bots.html             // Bingbot / AdIdxBot - https://www.bing.com/webmasters/help/which-crawlers-does-bing-use-8c184ec0@@ -81,3 +82,3 @@             // YepBot - https://yep.com/yepbot/-            /((?:adidx|ahrefs|amazon|bing|brave|cc|contx|coveo|criteo|dot|duckduck(?:go-favicons-)?|exa|facebook|gpt|iask|kagi|kangaroo |linkedin|mj12|mojeek|oai-search|onespot-scraper|perplexity|sbintuitions|semrush|seznam|surdotly|swift|yep)bot)\/([\w\.-]+)/i,+            /((?:adidx|ahrefs|amazon|(?:amzn|oai)-search|awario(?:smart|rss)?|bing|brave|cc|contx|coveo|criteo|dot|duckduck(?:go-favicons-)?|exa|facebook|gpt|iask|kagi|kangaroo |linkedin|mj12|mojeek|onespot-scraper|perplexity|sbintuitions|semrush|seznam|surdotly|swift|yep)bot)\/([\w\.-]+)/i, @@ -98,4 +99,4 @@ -            // Daum-            /(daum(?:oa)?(?:-image)?)[ \/]([\w\.]+)/i,+            // Daum / HubSpot Crawler+            /(daum(?:oa)?(?:-image)?|hubspot crawler)[ \/]([\w\.]+)/i, @@ -103,3 +104,3 @@             // https://developers.facebook.com/docs/sharing/webmasters/web-crawlers-            /(facebook(?:externalhit|catalog)|meta-externalagent)\/([\w\.]+)/i,+            /(facebook(?:externalhit|catalog)|meta-(?:externalagent|externalads|webindexer))\/([\w\.]+)/i, @@ -132,8 +133,14 @@ -            // aiHitBot / Algolia Crawler / BLEXBot / Cloudflare AutoRAG / Diffbot / FirecrawlAgent / HuggingFace-Bot / Linespider / MSNBot / Magpie-Crawler / Omgilibot / OpenAI Image Downloader / PanguBot / Replicate-Bot / RunPod-Bot / Webzio-Extended / Screaming Frog SEO Spider / Startpage / Timpibot / Together-Bot / VelenPublicWebCrawler / xAI-Bot / YisouSpider / YouBot / ZumBot+            // aiHitBot / Algolia Crawler / Audisto Crawler / BLEXBot / BrightEdge Crawler / Cloudflare AutoRAG / Diffbot / FirecrawlAgent / HuggingFace-Bot / Linespider / MSNBot / Magpie-Crawler / Omgilibot / OpenAI Image Downloader / PanguBot / Replicate-Bot / RunPod-Bot / Webzio-Extended / Screaming Frog SEO Spider / Startpage / Timpibot / Together-Bot / VelenPublicWebCrawler / xAI-Bot / YisouSpider / YouBot / ZumBot             // Cotoyogi - https://ds.rois.ac.jp/en_center8/en_crawler/             // Freespoke - https://docs.freespoke.com/search/bot/-            /((?:aihit|blex|diff|huggingface-|msn|pangu|replicate-|runpod-|timpi|together-|xai-|you|zum)bot|(?:magpie-|velenpublicweb)crawler|(?:chatglm-|line|screaming frog seo |yisou)spider|cloudflare-autorag|cotoyogi|(?:firecrawl|twin)agent|freespoke|omgili(?:bot)?|openai image downloader|startpageprivateimageproxy|webzio-extended)\/?([\w\.]*)/i+            /((?:aihit|blex|diff|huggingface-|msn|pangu|replicate-|runpod-|timpi|together-|xai-|you|zum)bot|(?:audisto |brightedge |magpie-|velenpublicweb)crawler|(?:chatglm-|line|screaming frog seo |yisou)spider|cloudflare-autorag|cotoyogi|(?:firecrawl|twin)agent|freespoke|omgili(?:bot)?|openai image downloader|startpageprivateimageproxy|webzio-extended)\/?([\w\.]*)/i         ],         [NAME, VERSION, [TYPE, CRAWLER]],++        [+            // Headline - https://headline.com/legal/crawler+            /(ev-crawler)\/([\w\.]+)/i+        ],+        [[NAME, 'Headline'], VERSION, [TYPE, CRAWLER]], @@ -158,3 +165,3 @@             // Botify / Bytespider / DeepSeekBot / Qihoo 360Spider / SeekportBot / TikTokSpider-            /\b((ai2|aspiegel|atlassian-|dataforseo|deepseek|imagesift|petal|seekport|turnitin|v0)bot|360spider-?(image|video)?|baidu-ads|botify|(byte|tiktok)spider|cohere-training-data-crawler|elastic(?=\/s)|marginalia|siteimprove(?=bot|\.com)|teoma|webzio|yahoo! slurp)/i+            /\b((ai2|aspiegel|atlassian-|dataforseo|deepseek|imagesift|petal|seekport|turnitin|v0|yacy)bot|360spider-?(image|video)?|baidu-ads|botify|(byte|tiktok)spider|cohere-training-data-crawler|elastic(?=\/s)|marginalia|proximic|siteimprove(?=bot|\.com)|teoma|webzio|yahoo! slurp)/i         ], @@ -308,2 +315,3 @@             // DuckAssistBot - https://duckduckgo.com/duckassistbot/+            // Feedly - https://feedly.com/fetcher.html             // FlipboardProxy - https://about.flipboard.com/proxy-service/@@ -314,3 +322,3 @@             // Yandex Bots - https://yandex.com/bots-            /(asana|ahrefssiteaudit|(?:bing|microsoft)preview|blueno|(?:chatgpt|claude|mistralai|perplexity)-user|cohere-ai|flipboardproxy|hubspot page fetcher|mastodon|(?:bitly|bufferlinkpreview|discord|duckassist|linkedin|pinterest|reddit|roger|siteaudit|twitter|uptimero|zoom)bot|google-site-verification|iframely|kakaotalk-scrap|meta-externalfetcher|y!?j-dlc|yandex(?:calendar|direct(?:dyn)?|fordomain|pagechecker|searchshop)|yadirectfetcher|whatsapp)\/([\w\.]+)/i,+            /(asana|ahrefssiteaudit|(?:bing|microsoft)preview|blueno|(?:amzn|chatgpt|claude|mistralai|perplexity)-user|cohere-ai|flipboardproxy|hubspot page fetcher|mastodon|(?:bitly|bufferlinkpreview|discord|duckassist|linkedin|pinterest|reddit|roger|siteaudit|twitter|uptime(?:ro)?|zoom)bot|google-site-verification|iframely|kakaotalk-scrap|meta-externalfetcher|y!?j-dlc|yandex(?:calendar|direct(?:dyn)?|fordomain|pagechecker|searchshop)|yadirectfetcher|whatsapp)\/([\w\.]+)/i, @@ -318,2 +326,5 @@             /(bluesky) cardyb\/([\w\.]+)/i,++            // Feedly+            /(feedly)(?:bot)?\/([\w\.]+)/i, @@ -332,3 +343,3 @@             // Google Bots / Chrome-Lighthouse / Gemini-Deep-Research / KeybaseBot / Snapchat / Vercelbot / Yandex Bots-            /((?:better uptime |keybase|telegram|vercel)bot|lighthouse$|feedfetcher-google|gemini-deep-research|google(?:imageproxy|-read-aloud|-pagerenderer|producer)|snap url preview|vercel(flags|tracing|-(favicon|screenshot)-bot)|yandex(?:sitelinks|userproxy))/i+            /((?:better uptime |keybase|telegram|vercel)bot|lighthouse$|feedfetcher-google|gemini-deep-research|google(?:docs|imageproxy|-read-aloud|-pagerenderer|producer)|snap url preview|vercel(flags|tracing|-(favicon|screenshot)-bot)|virustotal(?=cloud)|yandex(?:sitelinks|userproxy))/i         ], @@ -442,3 +453,3 @@         ], [NAME, VERSION, [TYPE, LIBRARY]], [-            /(node-fetch|undici)/i+            /(node-fetch|phpcrawl|undici)/i         ], [NAME, [TYPE, LIBRARY]]
src/extensions/ua-parser-extensions.mjs +22 lines
--- +++ @@ -5,3 +5,3 @@ ///////////////////////////////////////////////-/*  Extensions for UAParser.js v2.0.9+/*  Extensions for UAParser.js v2.0.10     https://github.com/faisalman/ua-parser-js@@ -61,2 +61,3 @@             // Amazonbot - https://developer.amazon.com/amazonbot+            // Awario - https://awario.com/bots.html             // Bingbot / AdIdxBot - https://www.bing.com/webmasters/help/which-crawlers-does-bing-use-8c184ec0@@ -85,3 +86,3 @@             // YepBot - https://yep.com/yepbot/-            /((?:adidx|ahrefs|amazon|bing|brave|cc|contx|coveo|criteo|dot|duckduck(?:go-favicons-)?|exa|facebook|gpt|iask|kagi|kangaroo |linkedin|mj12|mojeek|oai-search|onespot-scraper|perplexity|sbintuitions|semrush|seznam|surdotly|swift|yep)bot)\/([\w\.-]+)/i,+            /((?:adidx|ahrefs|amazon|(?:amzn|oai)-search|awario(?:smart|rss)?|bing|brave|cc|contx|coveo|criteo|dot|duckduck(?:go-favicons-)?|exa|facebook|gpt|iask|kagi|kangaroo |linkedin|mj12|mojeek|onespot-scraper|perplexity|sbintuitions|semrush|seznam|surdotly|swift|yep)bot)\/([\w\.-]+)/i, @@ -102,4 +103,4 @@ -            // Daum-            /(daum(?:oa)?(?:-image)?)[ \/]([\w\.]+)/i,+            // Daum / HubSpot Crawler+            /(daum(?:oa)?(?:-image)?|hubspot crawler)[ \/]([\w\.]+)/i, @@ -107,3 +108,3 @@             // https://developers.facebook.com/docs/sharing/webmasters/web-crawlers-            /(facebook(?:externalhit|catalog)|meta-externalagent)\/([\w\.]+)/i,+            /(facebook(?:externalhit|catalog)|meta-(?:externalagent|externalads|webindexer))\/([\w\.]+)/i, @@ -136,8 +137,14 @@ -            // aiHitBot / Algolia Crawler / BLEXBot / Cloudflare AutoRAG / Diffbot / FirecrawlAgent / HuggingFace-Bot / Linespider / MSNBot / Magpie-Crawler / Omgilibot / OpenAI Image Downloader / PanguBot / Replicate-Bot / RunPod-Bot / Webzio-Extended / Screaming Frog SEO Spider / Startpage / Timpibot / Together-Bot / VelenPublicWebCrawler / xAI-Bot / YisouSpider / YouBot / ZumBot+            // aiHitBot / Algolia Crawler / Audisto Crawler / BLEXBot / BrightEdge Crawler / Cloudflare AutoRAG / Diffbot / FirecrawlAgent / HuggingFace-Bot / Linespider / MSNBot / Magpie-Crawler / Omgilibot / OpenAI Image Downloader / PanguBot / Replicate-Bot / RunPod-Bot / Webzio-Extended / Screaming Frog SEO Spider / Startpage / Timpibot / Together-Bot / VelenPublicWebCrawler / xAI-Bot / YisouSpider / YouBot / ZumBot             // Cotoyogi - https://ds.rois.ac.jp/en_center8/en_crawler/             // Freespoke - https://docs.freespoke.com/search/bot/-            /((?:aihit|blex|diff|huggingface-|msn|pangu|replicate-|runpod-|timpi|together-|xai-|you|zum)bot|(?:magpie-|velenpublicweb)crawler|(?:chatglm-|line|screaming frog seo |yisou)spider|cloudflare-autorag|cotoyogi|(?:firecrawl|twin)agent|freespoke|omgili(?:bot)?|openai image downloader|startpageprivateimageproxy|webzio-extended)\/?([\w\.]*)/i+            /((?:aihit|blex|diff|huggingface-|msn|pangu|replicate-|runpod-|timpi|together-|xai-|you|zum)bot|(?:audisto |brightedge |magpie-|velenpublicweb)crawler|(?:chatglm-|line|screaming frog seo |yisou)spider|cloudflare-autorag|cotoyogi|(?:firecrawl|twin)agent|freespoke|omgili(?:bot)?|openai image downloader|startpageprivateimageproxy|webzio-extended)\/?([\w\.]*)/i         ],         [NAME, VERSION, [TYPE, CRAWLER]],++        [+            // Headline - https://headline.com/legal/crawler+            /(ev-crawler)\/([\w\.]+)/i+        ],+        [[NAME, 'Headline'], VERSION, [TYPE, CRAWLER]], @@ -162,3 +169,3 @@             // Botify / Bytespider / DeepSeekBot / Qihoo 360Spider / SeekportBot / TikTokSpider-            /\b((ai2|aspiegel|atlassian-|dataforseo|deepseek|imagesift|petal|seekport|turnitin|v0)bot|360spider-?(image|video)?|baidu-ads|botify|(byte|tiktok)spider|cohere-training-data-crawler|elastic(?=\/s)|marginalia|siteimprove(?=bot|\.com)|teoma|webzio|yahoo! slurp)/i+            /\b((ai2|aspiegel|atlassian-|dataforseo|deepseek|imagesift|petal|seekport|turnitin|v0|yacy)bot|360spider-?(image|video)?|baidu-ads|botify|(byte|tiktok)spider|cohere-training-data-crawler|elastic(?=\/s)|marginalia|proximic|siteimprove(?=bot|\.com)|teoma|webzio|yahoo! slurp)/i         ], @@ -312,2 +319,3 @@             // DuckAssistBot - https://duckduckgo.com/duckassistbot/+            // Feedly - https://feedly.com/fetcher.html             // FlipboardProxy - https://about.flipboard.com/proxy-service/@@ -318,3 +326,3 @@             // Yandex Bots - https://yandex.com/bots-            /(asana|ahrefssiteaudit|(?:bing|microsoft)preview|blueno|(?:chatgpt|claude|mistralai|perplexity)-user|cohere-ai|flipboardproxy|hubspot page fetcher|mastodon|(?:bitly|bufferlinkpreview|discord|duckassist|linkedin|pinterest|reddit|roger|siteaudit|twitter|uptimero|zoom)bot|google-site-verification|iframely|kakaotalk-scrap|meta-externalfetcher|y!?j-dlc|yandex(?:calendar|direct(?:dyn)?|fordomain|pagechecker|searchshop)|yadirectfetcher|whatsapp)\/([\w\.]+)/i,+            /(asana|ahrefssiteaudit|(?:bing|microsoft)preview|blueno|(?:amzn|chatgpt|claude|mistralai|perplexity)-user|cohere-ai|flipboardproxy|hubspot page fetcher|mastodon|(?:bitly|bufferlinkpreview|discord|duckassist|linkedin|pinterest|reddit|roger|siteaudit|twitter|uptime(?:ro)?|zoom)bot|google-site-verification|iframely|kakaotalk-scrap|meta-externalfetcher|y!?j-dlc|yandex(?:calendar|direct(?:dyn)?|fordomain|pagechecker|searchshop)|yadirectfetcher|whatsapp)\/([\w\.]+)/i, @@ -322,2 +330,5 @@             /(bluesky) cardyb\/([\w\.]+)/i,++            // Feedly+            /(feedly)(?:bot)?\/([\w\.]+)/i, @@ -336,3 +347,3 @@             // Google Bots / Chrome-Lighthouse / Gemini-Deep-Research / KeybaseBot / Snapchat / Vercelbot / Yandex Bots-            /((?:better uptime |keybase|telegram|vercel)bot|lighthouse$|feedfetcher-google|gemini-deep-research|google(?:imageproxy|-read-aloud|-pagerenderer|producer)|snap url preview|vercel(flags|tracing|-(favicon|screenshot)-bot)|yandex(?:sitelinks|userproxy))/i+            /((?:better uptime |keybase|telegram|vercel)bot|lighthouse$|feedfetcher-google|gemini-deep-research|google(?:docs|imageproxy|-read-aloud|-pagerenderer|producer)|snap url preview|vercel(flags|tracing|-(favicon|screenshot)-bot)|virustotal(?=cloud)|yandex(?:sitelinks|userproxy))/i         ], @@ -446,3 +457,3 @@         ], [NAME, VERSION, [TYPE, LIBRARY]], [-            /(node-fetch|undici)/i+            /(node-fetch|phpcrawl|undici)/i         ], [NAME, [TYPE, LIBRARY]]
src/helpers/ua-parser-helpers.d.ts +1 lines
--- +++ @@ -1,2 +1,2 @@-// Type definitions for Helpers submodule of UAParser.js v2.0.9+// Type definitions for Helpers submodule of UAParser.js v2.0.10 // Project: https://github.com/faisalman/ua-parser-js
src/helpers/ua-parser-helpers.js +2 lines
--- +++ @@ -1,3 +1,3 @@ ///////////////////////////////////////////////-/*  Helpers for UAParser.js v2.0.9+/*  Helpers for UAParser.js v2.0.10     https://github.com/faisalman/ua-parser-js@@ -43,3 +43,3 @@  */-const isElectron = () => _isElectron;+const isElectron = _isElectron; 
src/helpers/ua-parser-helpers.mjs +2 lines
--- +++ @@ -5,3 +5,3 @@ ///////////////////////////////////////////////-/*  Helpers for UAParser.js v2.0.9+/*  Helpers for UAParser.js v2.0.10     https://github.com/faisalman/ua-parser-js@@ -47,3 +47,3 @@  */-const isElectron = () => _isElectron;+const isElectron = _isElectron; 
src/main/ua-parser.d.ts +11 lines
--- +++ @@ -1,2 +1,2 @@-// Type definitions for UAParser.js v2.0.9+// Type definitions for UAParser.js v2.0.10 // Project: https://github.com/faisalman/ua-parser-js@@ -7,2 +7,7 @@ declare namespace UAParser {++    type BrowserTypes = typeof BrowserType[keyof typeof BrowserType];+    type CPUArchs = typeof CPUArch[keyof typeof CPUArch];+    type DeviceTypes = typeof DeviceType[keyof typeof DeviceType];+    type EngineNames = typeof EngineName[keyof typeof EngineName];     @@ -19,3 +24,3 @@         major?: string;-        type?: typeof BrowserType[keyof typeof BrowserType];+        type?: BrowserTypes;     }@@ -23,3 +28,3 @@     interface ICPU extends IData<ICPU> {-        architecture?: typeof CPUArch[keyof typeof CPUArch];+        architecture?: CPUArchs;     }@@ -27,3 +32,3 @@     interface IDevice extends IData<IDevice> {-        type?: typeof DeviceType[keyof typeof DeviceType];+        type?: DeviceTypes;         vendor?: string;@@ -33,3 +38,3 @@     interface IEngine extends IData<IEngine> {-        name?: typeof EngineName[keyof typeof EngineName];+        name?: EngineNames;         version?: string;@@ -107,2 +112,3 @@         setUA(uastring: string): UAParser;+        useExtension(extensions: UAParserExt): UAParser;     }
pypi — by downloads
charset-normalizer pypi
3.4.9 5d ago ACTIVE ALERT
critical-tier YANK
latest 3.4.9 versions 63 maintainers 1 critical-tier (snapshotted)
3.3.1
3.3.2
3.4.0
3.4.1
3.4.2
3.4.3
3.4.4
3.4.5
3.4.6
3.4.7
3.4.8
3.4.9
YANK
3.4.8 marked yanked (still downloadable) · ACTIVE
high · registry-verified · 2026-07-06 · 6d ago
release diff 3.4.7 → 3.4.9
+0 added · -0 removed · ~17 modified
_mypyc_hook/backend.py +1 lines
--- +++ @@ -9,3 +9,3 @@ USE_MYPYC = os.getenv("CHARSET_NORMALIZER_USE_MYPYC", "0") == "1"-MYPYC_SPEC = "mypy>=1.4.1,<=1.20"+MYPYC_SPEC = "mypy>=1.4.1,<2.2" 
pyproject.toml +11 lines
--- +++ @@ -1,3 +1,3 @@ [build-system]-requires = ["setuptools>=68,<82.1"]+requires = ["setuptools>=68,<83.1"] build-backend = "backend"@@ -47,6 +47,7 @@   "nox==2024.4.15; python_version == '3.7'",-  "nox==2026.2.9; python_version >= '3.8'",+  "nox==2026.2.9; python_version == '3.8'",+  "nox>=2026.4.10; python_version >= '3.9'",   "build==1.1.1; python_version == '3.7'",   "build==1.2.2.post1; python_version == '3.8'",-  "build==1.4.0; python_version >= '3.9'"+  "build==1.4.3; python_version >= '3.9'" ]@@ -55,6 +56,8 @@   "pytest==8.3.5; python_version == '3.8'",-  "pytest==8.4.1; python_version >= '3.9'",+  "pytest==8.4.2; python_version == '3.9'",+  "pytest==9.0.3; python_version >= '3.10'",   "coverage==7.2.7; python_version == '3.7'",   "coverage==7.6.1; python_version == '3.8'",-  "coverage==7.10.4; python_version >= '3.9'",+  "coverage==7.10.7; python_version == '3.9'",+  "coverage>=7.13.5; python_version >= '3.10'" ]@@ -104 +107,4 @@ warn_unused_ignores = false++[tool.codespell]+ignore-words-list = "Tham,Vai,intoto"
src/charset_normalizer/api.py +214 lines
--- +++ @@ -3,2 +3,3 @@ import logging+from functools import lru_cache from os import PathLike@@ -41,15 +42,7 @@ # testing them first costs negligible time for non-CJK files.-_mb_supported: list[str] = []-_sb_supported: list[str] = []--for _supported_enc in IANA_SUPPORTED:-    try:-        if is_multi_byte_encoding(_supported_enc):-            _mb_supported.append(_supported_enc)-        else:-            _sb_supported.append(_supported_enc)-    except ImportError:-        _sb_supported.append(_supported_enc)--IANA_SUPPORTED_MB_FIRST: list[str] = _mb_supported + _sb_supported+# Stable sort on a boolean key: multibyte (False) first, IANA order kept+# within each group.+IANA_SUPPORTED_MB_FIRST: list[str] = sorted(+    IANA_SUPPORTED, key=lambda encoding: not is_multi_byte_encoding(encoding)+) @@ -186,2 +179,9 @@ +    # Avoid unoptimized RSS usage.+    # this cache is mostly interesting for+    # local usage. Garbage collected at the+    # end. Like it should.+    cached_mess_ratio = lru_cache(maxsize=None)(mess_ratio)+    cached_coherence_ratio = lru_cache(maxsize=None)(coherence_ratio)+     # When a definitive result (chaos=0.0 and good coherence) is found after testing@@ -348,4 +348,14 @@ +        # Single-byte candidates of regular size defer the expensive whole+        # payload decode until after chunk probing: single-byte codecs are+        # stateless (1 byte == 1 char) so decoding chunk slices is provably+        # identical to slicing the decoded payload, and candidates rejected+        # by chaos probing (the common case) never pay the full decode nor+        # the payload hash.+        deferred_decoding: bool = (+            not is_multi_byte_decoder and not is_too_large_sequence+        )+         try:-            if is_too_large_sequence and is_multi_byte_decoder is False:+            if is_too_large_sequence and not is_multi_byte_decoder:                 str(@@ -353,3 +363,3 @@                         sequences[: int(50e4)]-                        if strip_sig_or_bom is False+                        if not strip_sig_or_bom                         else sequences[len(sig_payload) : int(50e4)]@@ -358,3 +368,3 @@                 )-            else:+            elif not deferred_decoding:                 # UTF-7 BOM is encoded in modified Base64 whose byte boundary@@ -376,3 +386,3 @@                             sequences-                            if strip_sig_or_bom is False+                            if not strip_sig_or_bom                             else sequences[len(sig_payload) :]@@ -411,2 +421,175 @@             )++        max_chunk_gave_up: int = int(len(r_) / 4)++        max_chunk_gave_up = max(max_chunk_gave_up, 2)+        early_stop_count: int = 0+        lazy_str_hard_failure = False++        md_chunks: list[str] = []+        md_ratios = []++        try:+            for chunk in cut_sequence_chunks(+                sequences,+                encoding_iana,+                r_,+                chunk_size,+                bom_or_sig_available,+                strip_sig_or_bom,+                sig_payload,+                is_multi_byte_decoder,+                decoded_payload,+                deferred_decoding,+            ):+                md_chunks.append(chunk)++                md_ratios.append(+                    cached_mess_ratio(+                        chunk,+                        threshold,+                        explain and 1 <= len(cp_isolation) <= 2,+                    )+                )++                if md_ratios[-1] >= threshold:+                    early_stop_count += 1++                if (early_stop_count >= max_chunk_gave_up) or (+                    bom_or_sig_available and not strip_sig_or_bom+                ):+                    break+        except (+            UnicodeDecodeError,+            LookupError,+        ) as e:  # Lazy str loading may have missed something there+            if deferred_decoding:+                # Deferred single-byte validation failed on a chunk (or the+                # codec is unavailable on this interpreter build): identical+                # outcome and bookkeeping to the eager full-decode failure.+                logger.log(+                    TRACE,+                    "Code page %s does not fit given bytes sequence at ALL. %s",+                    encoding_iana,+                    str(e),+                )+                tested_but_hard_failure.append(encoding_iana)+                continue+            logger.log(+                TRACE,+                "LazyStr Loading: After MD chunk decode, code page %s does not fit given bytes sequence at ALL. %s",+                encoding_iana,+                str(e),+            )+            early_stop_count = max_chunk_gave_up+            lazy_str_hard_failure = True++        # We might want to check the sequence again with the whole content+        # Only if initial MD tests passes+        if (+            not lazy_str_hard_failure+            and is_too_large_sequence+            and not is_multi_byte_decoder+        ):+            try:+                sequences[int(50e3) :].decode(encoding_iana, errors="strict")+            except UnicodeDecodeError as e:+                logger.log(+                    TRACE,+                    "LazyStr Loading: After final lookup, code page %s does not fit given bytes sequence at ALL. %s",+                    encoding_iana,+                    str(e),+                )+                tested_but_hard_failure.append(encoding_iana)+                continue++        mean_mess_ratio: float = sum(md_ratios) / len(md_ratios) if md_ratios else 0.0+        if mean_mess_ratio >= threshold or early_stop_count >= max_chunk_gave_up:+            tested_but_soft_failure.append(encoding_iana)+            if encoding_iana in IANA_SUPPORTED_SIMILAR:+                soft_failure_skip.update(IANA_SUPPORTED_SIMILAR[encoding_iana])+            # Cache this soft-failure so identical decoding from other encodings+            # can be skipped immediately.+            if decoded_payload is not None and not is_multi_byte_decoder:+                payload_result_cache.setdefault(+                    hash(decoded_payload), (mean_mess_ratio, [], False)+                )+            logger.log(+                TRACE,+                "%s was excluded because of initial chaos probing. Gave up %i time(s). "+                "Computed mean chaos is %f %%.",+                encoding_iana,+                early_stop_count,+                round(mean_mess_ratio * 100, ndigits=3),+            )+            # Preparing those fallbacks in case we got nothing.+            if (+                enable_fallback+                and encoding_iana+                in ["ascii", "utf_8", specified_encoding, "utf_16", "utf_32"]+                and not lazy_str_hard_failure+            ):+                # Always fully decode payload before.+                # We've missed a UnicodeDecodeError proof+                # while issuing release 3.4.8+                # see https://github.com/jawah/charset_normalizer/issues/771+                if decoded_payload is None:+                    try:+                        decoded_payload = str(+                            (+                                sequences+                                if not strip_sig_or_bom+                                else sequences[len(sig_payload) :]+                            ),+                            encoding=encoding_iana,+                        )+                    except (UnicodeDecodeError, LookupError):+                        logger.log(+                            TRACE,+                            "%s does not decode the whole payload: fallback entry withheld.",+                            encoding_iana,+                        )+                        continue+                    if is_too_large_sequence:+                        # Don't retain huge payload in RAM.+                        decoded_payload = None++                fallback_entry = CharsetMatch(+                    sequences,+                    encoding_iana,+                    threshold,+                    bom_or_sig_available,+                    [],+                    decoded_payload,+                    preemptive_declaration=specified_encoding,+                )+                if encoding_iana == specified_encoding:+                    fallback_specified = fallback_entry+                elif encoding_iana == "ascii":+                    fallback_ascii = fallback_entry+                else:+                    fallback_u8 = fallback_entry+            continue++        if deferred_decoding:+            # The candidate passed chaos probing: perform the whole payload+            # decode (validation + payload reuse) that was deferred earlier.+            try:+                decoded_payload = str(+                    (+                        sequences+                        if not strip_sig_or_bom+                        else sequences[len(sig_payload) :]+                    ),+                    encoding=encoding_iana,+                )+            except (UnicodeDecodeError, LookupError) as e:+                logger.log(+                    TRACE,+                    "Code page %s does not fit given bytes sequence at ALL. %s",+                    encoding_iana,+                    str(e),+                )+                tested_but_hard_failure.append(encoding_iana)+                continue @@ -432,3 +615,3 @@                             if (-                                is_too_large_sequence is False+                                not is_too_large_sequence                                 or encoding_iana@@ -482,3 +665,6 @@
… 149 more lines (truncated)
src/charset_normalizer/cd.py +103 lines
--- +++ @@ -4,5 +4,3 @@ from codecs import IncrementalDecoder-from collections import Counter from functools import lru_cache-from typing import Counter as TypeCounter @@ -17,10 +15,7 @@ )-from .md import is_suspiciously_successive_range+from .md import _ASCII_CHAR_INFO, _char_info, is_suspiciously_successive_range from .models import CoherenceMatches from .utils import (-    is_accentuated,-    is_latin,     is_multi_byte_encoding,     is_unicode_range_secondary,-    unicode_range, )@@ -47,3 +42,8 @@         if chunk:-            character_range: str | None = unicode_range(chunk)+            chunk_codepoint = ord(chunk)+            character_range: str | None = (+                _ASCII_CHAR_INFO[chunk_codepoint].range+                if chunk_codepoint < 128+                else _char_info(chunk).range+            ) @@ -52,3 +52,3 @@ -            if is_unicode_range_secondary(character_range) is False:+            if not is_unicode_range_secondary(character_range):                 if character_range not in seen_ranges:@@ -75,3 +75,9 @@         for character in characters:-            if unicode_range(character) == primary_range:+            codepoint = ord(character)+            info = (+                _ASCII_CHAR_INFO[codepoint]+                if codepoint < 128+                else _char_info(character)+            )+            if info.range == primary_range:                 languages.append(language)@@ -88,3 +94,7 @@     """-    unicode_ranges: list[str] = encoding_unicode_range(iana_name)+    try:+        unicode_ranges: list[str] = encoding_unicode_range(iana_name)+    except ImportError:  # Defensive: encoding unavailable on this build.+        return []+     primary_range: str | None = None@@ -132,5 +142,7 @@     for character in FREQUENCIES[language]:-        if not target_have_accents and is_accentuated(character):+        codepoint = ord(character)+        info = _ASCII_CHAR_INFO[codepoint] if codepoint < 128 else _char_info(character)+        if not target_have_accents and info.accentuated:             target_have_accents = True-        if target_pure_latin and is_latin(character) is False:+        if target_pure_latin and not info.latin:             target_pure_latin = False@@ -149,3 +161,9 @@     characters_set: frozenset[str] = frozenset(characters)-    source_have_accents = any(is_accentuated(character) for character in characters)+    source_have_accents = False+    for character in characters:+        codepoint = ord(character)+        info = _ASCII_CHAR_INFO[codepoint] if codepoint < 128 else _char_info(character)+        if info.accentuated:+            source_have_accents = True+            break @@ -154,6 +172,6 @@ -        if ignore_non_latin and target_pure_latin is False:-            continue--        if target_have_accents is False and source_have_accents:+        if ignore_non_latin and not target_pure_latin:+            continue++        if not target_have_accents and source_have_accents:             continue@@ -186,3 +204,2 @@     character_approved_count: int = 0-    frequencies_language_set: frozenset[str] = _FREQUENCIES_SET[language]     lang_rank: dict[str, int] = _FREQUENCIES_RANK[language]@@ -193,2 +210,3 @@     large_alphabet: bool = target_language_characters_count > 26+    large_alphabet_threshold: float = target_language_characters_count / 3 @@ -198,27 +216,14 @@ -    # Pre-built rank dict for ordered_characters (avoids repeated list slicing).-    ordered_rank: dict[str, int] = {-        char: rank for rank, char in enumerate(ordered_characters)-    }--    # Pre-compute characters common to both orderings.-    # Avoids repeated `c in ordered_rank` dict lookups in the inner counts.-    common_chars: list[tuple[int, int]] = [-        (lr, ordered_rank[c]) for c, lr in lang_rank.items() if c in ordered_rank-    ]--    # Pre-extract lr and orr arrays for faster iteration in the inner loop.-    # Plain integer loops with local arrays are much faster under mypyc than-    # generator expression sums over a list of tuples.-    common_count: int = len(common_chars)-    common_lr: list[int] = [p[0] for p in common_chars]-    common_orr: list[int] = [p[1] for p in common_chars]--    for character, character_rank in zip(-        ordered_characters, range(0, ordered_characters_count)-    ):-        if character not in frequencies_language_set:-            continue--        character_rank_in_language: int = lang_rank[character]+    # Single pass: characters present in the language vocabulary, as+    # (language rank, popularity rank) pairs. The scoring below only ever+    # needs ranks, never the characters themselves.+    common_lr: list[int] = []+    common_orr: list[int] = []+    for popularity_rank, character in enumerate(ordered_characters):+        language_rank = lang_rank.get(character)+        if language_rank is not None:+            common_lr.append(language_rank)+            common_orr.append(popularity_rank)++    for character_rank_in_language, character_rank in zip(common_lr, common_orr):         character_rank_projection: int = int(character_rank * expected_projection_ratio)@@ -226,3 +231,3 @@         if (-            large_alphabet is False+            not large_alphabet             and abs(character_rank_projection - character_rank_in_language) > 4@@ -232,5 +237,5 @@         if (-            large_alphabet is True+            large_alphabet             and abs(character_rank_projection - character_rank_in_language)-            < target_language_characters_count / 3+            < large_alphabet_threshold         ):@@ -239,11 +244,23 @@ -        # Count how many characters appear "before" in both orderings,-        # and how many appear "at or after" in both orderings.-        # Single pass over pre-extracted arrays — much faster under mypyc-        # than two generator expression sums.+        if character_rank_in_language == 0:+            # before_match_count is structurally 0 here (no pair can have a+            # smaller language rank): the historic "before <= 4" acceptance+            # always holds. (The symmetric "after_len == 0" case is+            # impossible: language ranks are strictly below the language+            # character count, hence after_len >= 1.)+            character_approved_count += 1+            continue++        after_len: int = target_language_characters_count - character_rank_in_language++        # Count how many characters appear "before" in both orderings, and+        # how many appear "at or after" in both orderings. Both counts grow+        # monotonically and the approval thresholds+        # (before / rank >= 0.4 or after / after_len >= 0.4) are known+        # upfront, expressed below as exact integer comparisons: exit as+        # soon as one is crossed.         before_match_count: int = 0         after_match_count: int = 0-        for i in range(common_count):-            lr_i: int = common_lr[i]-            orr_i: int = common_orr[i]++        for lr_i, orr_i in zip(common_lr, common_orr):             if lr_i < character_rank_in_language:@@ -251,2 +268,5 @@                     before_match_count += 1+                    if 5 * before_match_count >= 2 * character_rank_in_language:+                        character_approved_count += 1+                        break             else:@@ -254,19 +274,5 @@                     after_match_count += 1--        after_len: int = target_language_characters_count - character_rank_in_language--        if character_rank_in_language == 0 and before_match_count <= 4:-            character_approved_count += 1-            continue--        if after_len == 0 and after_match_count <= 4:-            character_approved_count += 1-            continue--        if (-            character_rank_in_language > 0-            and before_match_count / character_rank_in_language >= 0.4-        ) or (after_len > 0 and after_match_count / after_len >= 0.4):-            character_approved_count += 1-            continue+                    if 5 * after_match_count >= 2 * after_len:+                        character_approved_count += 1+                        break @@ -293,12 +299,15 @@     for character in decoded_sequence:-        if character.isalpha() is False:-            continue--        # ASCII fast-path: a-z and A-Z are always "Basic Latin".-        # Avoids unicode_range() function call overhead for the most common case.-        character_ord: int = ord(character)-        if character_ord < 128:-            character_range: str | None = "Basic Latin"+        # Reuse the per-codepoint CharInfo cache: info.alpha and info.range+        # are computed with the very same str.isalpha() / unicode_range()+        # calls this loop historically made per character occurrence.+        codepoint: int = ord(character)+        if codepoint < 128:+            info = _ASCII_CHAR_INFO[codepoint]         else:-            character_range = unicode_range(character)+            info = _char_info(character)++        if not info.alpha:+            continue++        character_range: str | None = info.range @@ -317,5 +326,4 @@             for discovered_range in layers:-                if (-                    is_suspiciously_successive_range(discovered_range, character_range)-                    is False+                if not is_suspiciously_successive_range(+                    discovered_range, character_range                 ):@@ -324,6 +332,3 @@         elif single_layer_key is not None:-            if (-                is_suspiciously_successive_range(single_layer_key, character_range)-                is False-            ):+            if not is_suspiciously_successive_range(single_layer_key, character_range):                 layer_target_range = single_layer_key@@ -404,3 +409,2 @@
… 24 more lines (truncated)
src/charset_normalizer/cli/__main__.py +2 lines
--- +++ @@ -5,3 +5,2 @@ import typing-from json import dumps from os.path import abspath, basename, dirname, join, realpath@@ -338,2 +337,4 @@     if args.minimal is False:+        from json import dumps+         print(
src/charset_normalizer/constant.py +8 lines
--- +++ @@ -11,3 +11,2 @@     "utf_7": [-        b"\x2b\x2f\x76\x38\x2d",         b"\x2b\x2f\x76\x38",@@ -416,4 +415,3 @@     filter(-        lambda x: x.endswith("_codec") is False-        and x not in {"rot_13", "tactis", "mbcs"},+        lambda x: not x.endswith("_codec") and x not in {"rot_13", "tactis", "mbcs"},         list(set(aliases.values())) + IANA_NO_ALIASES,@@ -2050 +2048,8 @@ }++# prebuilt list of secondary range names.+_SECONDARY_RANGE_NAMES: frozenset[str] = frozenset(+    range_name+    for range_name in UNICODE_RANGES_COMBINED+    if any(keyword in range_name for keyword in UNICODE_SECONDARY_RANGE_KEYWORD)+)
src/charset_normalizer/legacy.py +2 lines
--- +++ @@ -61,3 +61,3 @@         }-        and r.bom is False  # type: ignore[union-attr]+        and not r.bom  # type: ignore[union-attr]         and len(byte_str) < TOO_SMALL_SEQUENCE@@ -71,3 +71,3 @@ -    if should_rename_legacy is False and encoding in CHARDET_CORRESPONDENCE:+    if not should_rename_legacy and encoding in CHARDET_CORRESPONDENCE:         encoding = CHARDET_CORRESPONDENCE[encoding]
src/charset_normalizer/md.py +121 lines
--- +++ @@ -48,10 +48,3 @@ class CharInfo:-    """Pre-computed character properties shared across all detectors.--    Instantiated once and reused via :meth:`update` on every character-    in the hot loop so that redundant calls to str methods-    (``isalpha``, ``isupper``, …) and cached utility functions-    (``_character_flags``, ``is_punctuation``, …) are avoided when-    several plugins need the same information.-    """+    """Pre-computed character properties shared across all detectors.""" @@ -75,25 +68,35 @@         "sym",+        "range",+        "sep",+        "emoticon",+        "safe",+        "common_cjk",     ) -    def __init__(self) -> None:-        self.character: str = ""-        self.printable: bool = False-        self.alpha: bool = False-        self.upper: bool = False-        self.lower: bool = False-        self.space: bool = False-        self.digit: bool = False-        self.is_ascii: bool = False-        self.case_variable: bool = False-        self.flags: int = 0-        self.accentuated: bool = False-        self.latin: bool = False-        self.is_cjk: bool = False-        self.is_arabic: bool = False-        self.is_glyph: bool = False-        self.punct: bool = False-        self.sym: bool = False--    def update(self, character: str) -> None:-        """Update all properties for *character* (called once per character)."""+    character: str+    printable: bool+    alpha: bool+    upper: bool+    lower: bool+    space: bool+    digit: bool+    is_ascii: bool+    case_variable: bool+    flags: int+    accentuated: bool+    latin: bool+    is_cjk: bool+    is_arabic: bool+    is_glyph: bool+    punct: bool+    sym: bool+    range: str | None+    sep: bool+    emoticon: bool+    safe: bool+    common_cjk: bool++    def __init__(self, character: str) -> None:+        """Compute all properties for *character* (built once per codepoint,+        every branch assigns every slot)."""         self.character = character@@ -204,2 +207,22 @@ +        self.range = unicode_range(character)+        self.sep = is_separator(character)+        self.emoticon = is_emoticon(character)+        self.safe = character in COMMON_SAFE_ASCII_CHARACTERS+        self.common_cjk = character in COMMON_CJK_CHARACTERS+++# Per-codepoint cache of CharInfo instances+# At most UTF-8 size allocated.+@lru_cache(maxsize=None)+def _char_info(character: str) -> CharInfo:+    """Build (once per codepoint) and cache the CharInfo for *character*."""+    return CharInfo(character)+++# ASCII table indexed by codepoint.+_ASCII_CHAR_INFO: list[CharInfo] = [+    CharInfo(chr(_codepoint)) for _codepoint in range(128)+]+ @@ -257,9 +280,6 @@ -        if (-            character != self._last_printable_char-            and character not in COMMON_SAFE_ASCII_CHARACTERS-        ):+        if character != self._last_printable_char and not info.safe:             if info.punct:                 self._punctuation_count += 1-            elif not info.digit and info.sym and not is_emoticon(character):+            elif not info.digit and info.sym and not info.emoticon:                 self._symbol_count += 2@@ -407,3 +427,3 @@ -        if info.space or info.punct or character in COMMON_SAFE_ASCII_CHARACTERS:+        if info.space or info.punct or info.safe:             self._last_printable_seen = None@@ -414,3 +434,3 @@             self._last_printable_seen = character-            self._last_printable_range = unicode_range(character)+            self._last_printable_range = info.range             return@@ -418,6 +438,8 @@         unicode_range_a: str | None = self._last_printable_range-        unicode_range_b: str | None = unicode_range(character)--        if is_suspiciously_successive_range(unicode_range_a, unicode_range_b):-            self._suspicious_successive_range_count += 1+        unicode_range_b: str | None = info.range++        # Identical non-None ranges can never be suspicious.+        if unicode_range_a != unicode_range_b or unicode_range_a is None:+            if is_suspiciously_successive_range(unicode_range_a, unicode_range_b):+                self._suspicious_successive_range_count += 1 @@ -460,2 +482,4 @@         "_buffer_upper_count",+        "_buffer_first_lower",+        "_buffer_has_non_ascii",     )@@ -479,2 +503,4 @@         self._buffer_upper_count: int = 0+        self._buffer_first_lower: bool = False+        self._buffer_has_non_ascii: bool = False @@ -483,2 +509,4 @@         if info.alpha:+            if self._buffer_length == 0:+                self._buffer_first_lower = info.lower             self._buffer_length += 1@@ -488,2 +516,4 @@                 self._buffer_upper_count += 1+            if not info.is_ascii:+                self._buffer_has_non_ascii = True @@ -504,3 +534,3 @@             return-        if info.space or info.punct or is_separator(character):+        if info.space or info.punct or info.sep:             self._word_count += 1@@ -523,2 +553,12 @@                     self._foreign_long_count += 1+                elif (+                    self._buffer_has_non_ascii+                    and self._buffer_first_lower+                    and self._buffer_upper_count == buffer_length - 1+                ):+                    # Inverse capitalization detector.+                    # No natural writing produces such words.+                    # see https://github.com/jawah/charset_normalizer/issues/731+                    self._foreign_long_count += 1+                    self._is_current_word_bad = True             if buffer_length >= 24 and self._foreign_long_watch:@@ -545,2 +585,4 @@             self._buffer_upper_count = 0+            self._buffer_first_lower = False+            self._buffer_has_non_ascii = False         elif (@@ -569,2 +611,4 @@         self._buffer_upper_count = 0+        self._buffer_first_lower = False+        self._buffer_has_non_ascii = False @@ -594,3 +638,3 @@ -        if character not in COMMON_CJK_CHARACTERS:+        if not info.common_cjk:             self._uncommon_count += 1@@ -809,3 +853,2 @@ -@lru_cache(maxsize=2048) def mess_ratio(@@ -825,2 +868,16 @@         step = 128++    # str.isascii() is O(1) (the flag lives in the str header). Six of the+    # nine detectors provably keep a 0.0 ratio on ASCII-only input and are+    # therefore not fed at all.+    is_pure_ascii: bool = decoded_sequence.isascii()++    # Cached per-codepoint character properties (see CharInfo). ASCII+    # characters resolve through the immutable import-time table; anything+    # else goes through the lru_cache-backed slow path.+    ascii_info = _ASCII_CHAR_INFO+    char_info = _char_info++    mean_mess_ratio: float+    info: CharInfo @@ -851,12 +908,13 @@ -    # Single reusable CharInfo object (avoids per-character allocation).-    info: CharInfo = CharInfo()-    info_update = info.update--    mean_mess_ratio: float-     for block_start in range(0, seq_len, step):         for character in decoded_sequence[block_start : block_start + step]:-            # Pre-compute all character properties once (shared across all plugins).-            info_update(character)+            # Character properties computed once per distinct codepoint+            # (shared across all plugins and all mess_ratio calls).+            # ord() doubles as the ASCII table index and, unlike+            # str.isascii(), lowers to a mypyc primitive.+            codepoint: int = ord(character)+            if codepoint < 128:+                info = ascii_info[codepoint]+            else:+                info = char_info(character) @@ -865,2 +923,9 @@             d_sw_feed(character, info)++            if is_pure_ascii:+                # The six remaining detectors provably stay at 0.0 (see above).+                if info.printable:+                    d_sp_feed(character, info)+                continue+             d_au_feed(character, info)@@ -901,6 +966,7 @@         # Flush last word buffer in SuperWeirdWordPlugin via trailing newline.-        info_update("\n")-        d_sw_feed("\n", info)-        d_au_feed("\n", info)-        d_up_feed("\n", info)+        nl_info = ascii_info[10]  # "\n"+        d_sw_feed("\n", nl_info)+        if not is_pure_ascii:+            d_au_feed("\n", nl_info)+        d_up_feed("\n", nl_info) 
src/charset_normalizer/models.py +2 lines
--- +++ @@ -3,3 +3,2 @@ from encodings.aliases import aliases-from json import dumps from re import sub@@ -368,2 +367,4 @@     def to_json(self) -> str:+        from json import dumps+         return dumps(self.__dict__, ensure_ascii=True, indent=4)
src/charset_normalizer/utils.py +59 lines
--- +++ @@ -12,6 +12,2 @@ -from _multibytecodec import (  # type: ignore[import-not-found,import]-    MultibyteIncrementalDecoder,-)- from .constant import (@@ -21,3 +17,3 @@     UNICODE_RANGES_COMBINED,-    UNICODE_SECONDARY_RANGE_KEYWORD,+    _SECONDARY_RANGE_NAMES,     UTF8_MAXIMAL_ALLOCATION,@@ -37,3 +33,2 @@ -@lru_cache(maxsize=UTF8_MAXIMAL_ALLOCATION) def _character_flags(character: str) -> int:@@ -72,3 +67,2 @@ -@lru_cache(maxsize=UTF8_MAXIMAL_ALLOCATION) def is_accentuated(character: str) -> bool:@@ -97,3 +91,2 @@ -@lru_cache(maxsize=UTF8_MAXIMAL_ALLOCATION) def unicode_range(character: str) -> str | None:@@ -114,3 +107,2 @@ -@lru_cache(maxsize=UTF8_MAXIMAL_ALLOCATION) def is_latin(character: str) -> bool:@@ -119,3 +111,2 @@ -@lru_cache(maxsize=UTF8_MAXIMAL_ALLOCATION) def is_punctuation(character: str) -> bool:@@ -134,3 +125,2 @@ -@lru_cache(maxsize=UTF8_MAXIMAL_ALLOCATION) def is_symbol(character: str) -> bool:@@ -149,3 +139,2 @@ -@lru_cache(maxsize=UTF8_MAXIMAL_ALLOCATION) def is_emoticon(character: str) -> bool:@@ -159,3 +148,2 @@ -@lru_cache(maxsize=UTF8_MAXIMAL_ALLOCATION) def is_separator(character: str) -> bool:@@ -214,5 +202,4 @@ -@lru_cache(maxsize=len(UNICODE_RANGES_COMBINED)) def is_unicode_range_secondary(range_name: str) -> bool:-    return any(keyword in range_name for keyword in UNICODE_SECONDARY_RANGE_KEYWORD)+    return range_name in _SECONDARY_RANGE_NAMES @@ -222,4 +209,4 @@     return (-        character.isspace() is False  # includes \n \t \r \v-        and character.isprintable() is False+        not character.isspace()  # includes \n \t \r \v+        and not character.isprintable()         and character != "\x1a"  # Why? Its the ASCII substitute character.@@ -241,5 +228,14 @@ +    decoded_zone: str = sequence[: min(seq_len, search_zone)].decode(+        "ascii", errors="ignore"+    )++    # Cheap literal pre-filter.+    lowered_zone: str = decoded_zone.lower()+    if "coding" not in lowered_zone and "charset" not in lowered_zone:+        return None+     results: list[str] = findall(         RE_POSSIBLE_ENCODING_INDICATION,-        sequence[: min(seq_len, search_zone)].decode("ascii", errors="ignore"),+        decoded_zone,     )@@ -269,3 +265,3 @@     """-    return name in {+    if name in {         "utf_8",@@ -279,6 +275,27 @@         "utf_7",-    } or issubclass(-        importlib.import_module(f"encodings.{name}").IncrementalDecoder,-        MultibyteIncrementalDecoder,-    )+    }:+        return True++    # Besides the Unicode family above, every multibyte codec shipped with+    # Python is implemented by _multibytecodec through exactly one of the six+    # cjkcodecs providers below. Probing those providers directly (getcodec)+    # classifies a name without importing its "encodings.<name>" module:+    # classifying the whole IANA_SUPPORTED list would otherwise import many+    # modules and dominate "import charset_normalizer" wall time.+    # see https://github.com/jawah/charset_normalizer/issues/742+    for provider in (+        "_codecs_cn",+        "_codecs_hk",+        "_codecs_iso2022",+        "_codecs_jp",+        "_codecs_kr",+        "_codecs_tw",+    ):+        try:+            importlib.import_module(provider).getcodec(name)  # type: ignore[attr-defined]+        except (ImportError, AttributeError, LookupError):  # Defensive: edge cases+            continue+        return True++    return False @@ -378,4 +395,5 @@     decoded_payload: str | None = None,+    deferred_decoding: bool = False, ) -> Generator[str, None, None]:-    if decoded_payload and is_multi_byte_decoder is False:+    if decoded_payload and not is_multi_byte_decoder:         for i in offsets:@@ -385,2 +403,17 @@             yield chunk+    elif deferred_decoding:+        # Deferred single-byte probing: the whole payload is not decoded+        # yet. Single-byte codecs are stateless (1 byte == 1 char), hence+        # decode(base)[i:j] == decode(base[i:j]): slicing the raw bytes+        # yields exactly the chunks the branch above would have produced,+        # short trailing chunks included, and raises UnicodeDecodeError on+        # invalid bytes just like the whole-payload decode would.+        base_bytes = (+            sequences if not strip_sig_or_bom else sequences[len(sig_payload) :]+        )+        for i in offsets:+            cut_sequence = base_bytes[i : i + chunk_size]+            if not cut_sequence:+                break+            yield str(cut_sequence, encoding_iana)     else:@@ -393,3 +426,3 @@ -            if bom_or_sig_available and strip_sig_or_bom is False:+            if bom_or_sig_available and not strip_sig_or_bom:                 cut_sequence = sig_payload + cut_sequence@@ -413,3 +446,3 @@ -                        if bom_or_sig_available and strip_sig_or_bom is False:+                        if bom_or_sig_available and not strip_sig_or_bom:                             cut_sequence = sig_payload + cut_sequence
src/charset_normalizer/version.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -__version__ = "3.4.7"+__version__ = "3.4.9" VERSION = __version__.split(".")
tests/test_edge_case.py +15 lines
--- +++ @@ -59 +59,16 @@     assert "Cyrillic" in best_guess.alphabets+++def test_regression_gh771_fallback_entry_on_undecodable_payload():+    chaos = b'=][;:!?*&^%$#@ (){}<>~|_+ "quoted" ' * 90+    gap_position = 512 + (len(chaos) // 5 - 512) // 2+    payload = chaos[:gap_position] + "\u00e9".encode() + chaos[gap_position:]++    results = from_bytes(payload)  # must not raise+    best_guess = results.best()++    assert best_guess is not None, "fallback machinery gave no result at all"+    assert best_guess.encoding == "utf_8", (+        f"expected the utf_8 fallback, got {best_guess.encoding}"+    )+    assert str(best_guess), "best match must decode without error"
grpcio-status pypi
1.82.1 4d ago ACTIVE ALERT
YANK ×10BURST ×6INSTALL-EXEC
latest 1.82.1 versions 199 maintainers 1
1.71.2
1.74.0
1.75.0
1.75.1
1.76.0
1.78.0
1.78.1
1.80.0
1.81.0
1.81.1
1.82.0
1.82.1
YANK
1.45.0 marked yanked (still downloadable)
high · registry-verified · 2022-03-23 · 4y ago
YANK
1.48.0 marked yanked (still downloadable)
high · registry-verified · 2022-07-28 · 3y ago
YANK
1.49.0 marked yanked (still downloadable)
high · registry-verified · 2022-09-15 · 3y ago
YANK
1.51.0 marked yanked (still downloadable)
high · registry-verified · 2022-11-21 · 3y ago
YANK
1.52.0 marked yanked (still downloadable)
high · registry-verified · 2023-02-06 · 3y ago
YANK
1.55.0 marked yanked (still downloadable)
high · registry-verified · 2023-05-22 · 3y ago
YANK
1.65.0 marked yanked (still downloadable)
high · registry-verified · 2024-07-11 · 2y ago
YANK
1.72.0 marked yanked (still downloadable)
high · registry-verified · 2025-04-25 · 1y ago
YANK
1.78.1 marked yanked (still downloadable)
high · registry-verified · 2026-02-20 · 4mo ago
YANK
1.82.0 marked yanked (still downloadable) · ACTIVE
high · registry-verified · 2026-07-06 · 6d ago
BURST
2 releases in 33m: 1.22.1, 1.23.0
info · registry-verified · 2019-08-15 · 6y ago
BURST
4 releases in 37m: 1.46.5, 1.47.2, 1.48.2, 1.49.1
info · registry-verified · 2022-09-22 · 3y ago
BURST
2 releases in 11m: 1.53.1, 1.54.2
info · registry-verified · 2023-05-12 · 3y ago
BURST
2 releases in 2m: 1.54.3, 1.53.2
info · registry-verified · 2023-08-02 · 2y ago
BURST
5 releases in 54m: 1.64.3, 1.63.2, 1.62.3, 1.61.3, 1.60.2
info · registry-verified · 2024-08-06 · 1y ago
BURST
2 releases in 9m: 1.59.5, 1.58.3
info · registry-verified · 2024-08-06 · 1y ago
INSTALL-EXEC
setup.py in sdist uses install-hook (runs at pip install)
warn · snapshot-derived
release diff 1.81.1 → 1.82.1
+0 added · -0 removed · ~5 modified
grpc_version.py +1 lines
--- +++ @@ -16,2 +16,2 @@ -VERSION = '1.81.1'+VERSION = '1.82.1'
setup.py +1 lines
--- +++ @@ -56,3 +56,3 @@ INSTALL_REQUIRES = (-    "protobuf>=6.33.5,<8.0.0",+    "protobuf>=7.35.1,<8.0.0",     "grpcio>={version}".format(version=grpc_version.VERSION),
anyio pypi
4.14.1 17d ago incident on record
YANKBURST ×2
latest 4.14.1 versions 69 maintainers 1
4.5.2
4.6.2
4.7.0
4.8.0
4.9.0
4.10.0
4.11.0
4.12.0
4.12.1
4.13.0
4.14.0
4.14.1
YANK
4.6.2 marked yanked (still downloadable)
high · registry-verified · 2024-10-13 · 1y ago
BURST
2 releases in 5m: 4.5.1, 4.6.1
info · registry-verified · 2024-10-13 · 1y ago
BURST
2 releases in 3m: 4.5.2, 4.6.2
info · registry-verified · 2024-10-13 · 1y ago
release diff 4.14.0 → 4.14.1
+2 added · -0 removed · ~13 modified
src/anyio.egg-info/scm_file_list.json +119 lines
--- +++ @@ -0,0 +1,119 @@+{+  "files": [+    ".pre-commit-config.yaml",+    "LICENSE",+    "pyproject.toml",+    "AGENTS.md",+    "README.rst",+    "CLAUDE.md",+    ".readthedocs.yml",+    ".gitignore",+    "docs/tempfile.rst",+    "docs/signals.rst",+    "docs/synchronization.rst",+    "docs/contextmanagers.rst",+    "docs/testing.rst",+    "docs/networking.rst",+    "docs/contributing.rst",+    "docs/index.rst",+    "docs/versionhistory.rst",+    "docs/threads.rst",+    "docs/api.rst",+    "docs/typedattrs.rst",+    "docs/basics.rst",+    "docs/fileio.rst",+    "docs/cancellation.rst",+    "docs/support.rst",+    "docs/streams.rst",+    "docs/why.rst",+    "docs/tasks.rst",+    "docs/migration.rst",+    "docs/conf.py",+    "docs/subprocesses.rst",+    "docs/faq.rst",+    "docs/subinterpreters.rst",+    "src/anyio/functools.py",+    "src/anyio/py.typed",+    "src/anyio/__init__.py",+    "src/anyio/pytest_plugin.py",+    "src/anyio/itertools.py",+    "src/anyio/to_interpreter.py",+    "src/anyio/from_thread.py",+    "src/anyio/to_process.py",+    "src/anyio/to_thread.py",+    "src/anyio/lowlevel.py",+    "src/anyio/_backends/_trio.py",+    "src/anyio/_backends/__init__.py",+    "src/anyio/_backends/_asyncio.py",+    "src/anyio/streams/memory.py",+    "src/anyio/streams/__init__.py",+    "src/anyio/streams/tls.py",+    "src/anyio/streams/file.py",+    "src/anyio/streams/text.py",+    "src/anyio/streams/stapled.py",+    "src/anyio/streams/buffered.py",+    "src/anyio/abc/_eventloop.py",+    "src/anyio/abc/__init__.py",+    "src/anyio/abc/_sockets.py",+    "src/anyio/abc/_tasks.py",+    "src/anyio/abc/_subprocesses.py",+    "src/anyio/abc/_resources.py",+    "src/anyio/abc/_streams.py",+    "src/anyio/abc/_testing.py",+    "src/anyio/_core/_typedattr.py",+    "src/anyio/_core/_eventloop.py",+    "src/anyio/_core/__init__.py",+    "src/anyio/_core/_tempfile.py",+    "src/anyio/_core/_sockets.py",+    "src/anyio/_core/_tasks.py",+    "src/anyio/_core/_fileio.py",+    "src/anyio/_core/_synchronization.py",+    "src/anyio/_core/_subprocesses.py",+    "src/anyio/_core/_resources.py",+    "src/anyio/_core/_contextmanagers.py",+    "src/anyio/_core/_exceptions.py",+    "src/anyio/_core/_streams.py",+    "src/anyio/_core/_signals.py",+    "src/anyio/_core/_asyncio_selector_thread.py",+    "src/anyio/_core/_testing.py",+    "tests/test_itertools.py",+    "tests/test_functools.py",+    "tests/test_eventloop.py",+    "tests/__init__.py",+    "tests/test_to_thread.py",+    "tests/test_from_thread.py",+    "tests/test_lowlevel.py",+    "tests/test_to_interpreter.py",+    "tests/test_sockets.py",+    "tests/test_typedattr.py",+    "tests/test_to_process.py",+    "tests/test_all_attributes.py",+    "tests/test_synchronization.py",+    "tests/test_debugging.py",+    "tests/test_contextmanagers.py",+    "tests/test_fileio.py",+    "tests/conftest.py",+    "tests/test_signals.py",+    "tests/test_deprecations.py",+    "tests/test_tempfile.py",+    "tests/test_taskgroups.py",+    "tests/test_pytest_plugin.py",+    "tests/test_subprocesses.py",+    "tests/streams/test_text.py",+    "tests/streams/test_memory.py",+    "tests/streams/__init__.py",+    "tests/streams/test_file.py",+    "tests/streams/test_stapled.py",+    "tests/streams/test_tls.py",+    "tests/streams/test_buffered.py",+    ".github/pull_request_template.md",+    ".github/dependabot.yml",+    ".github/FUNDING.yml",+    ".github/ISSUE_TEMPLATE/features_request.yaml",+    ".github/ISSUE_TEMPLATE/bug_report.yaml",+    ".github/ISSUE_TEMPLATE/config.yml",+    ".github/workflows/test.yml",+    ".github/workflows/test-downstream.yml",+    ".github/workflows/publish.yml"+  ]+}
src/anyio.egg-info/scm_version.json +8 lines
--- +++ @@ -0,0 +1,8 @@+{+  "tag": "4.14.1",+  "distance": 0,+  "node": "g149b9e907618fadf6840a4d3cebad533b0c7d033",+  "dirty": false,+  "branch": "HEAD",+  "node_date": "2026-06-24"+}
src/anyio/_backends/_asyncio.py +4 lines
--- +++ @@ -2375,2 +2375,4 @@     ) -> None:+        from _pytest.outcomes import OutcomeException+         try:@@ -2381,2 +2383,4 @@             self._exceptions.append(exc)+        except OutcomeException:+            raise         except BaseException:
src/anyio/_core/_synchronization.py +2 lines
--- +++ @@ -686,4 +686,4 @@             raise TypeError("total_tokens must be an int or math.inf")-        elif value < 1:-            raise ValueError("total_tokens must be >= 1")+        elif value < 0:+            raise ValueError("total_tokens must be >= 0") 
tests/test_pytest_plugin.py +32 lines
--- +++ @@ -510,2 +510,34 @@     result.stdout.fnmatch_lines(["*KeyboardInterrupt*"])+++def test_outcome_exception_does_not_discard_runner_task(testdir: Pytester) -> None:+    # Regression test for #1179+    testdir.makepyfile(+        """+        import anyio+        import pytest++        @pytest.fixture(scope="session")+        def anyio_backend():+            return "asyncio"++        @pytest.fixture(scope="session")+        async def background_resource():+            async with anyio.create_task_group() as tg:+                tg.start_soon(anyio.sleep_forever)+                yield "resource"+                tg.cancel_scope.cancel()++        @pytest.mark.anyio+        async def test_uses_the_resource(background_resource: str) -> None:+            assert background_resource == "resource"++        @pytest.mark.anyio+        async def test_that_skips() -> None:+            pytest.skip("anything that raises pytest's OutcomeException.")+        """+    )++    result = testdir.runpytest(*pytest_args)+    result.assert_outcomes(passed=1, skipped=1) 
tests/test_synchronization.py +8 lines
--- +++ @@ -922,2 +922,10 @@ +    def test_zero_tokens_outside_event_loop(self) -> None:+        # Regression test for the CapacityLimiterAdapter setter rejecting 0,+        # which contradicted the 4.12 behavior of allowing 0 total tokens+        limiter = CapacityLimiter(1)+        limiter.total_tokens = 0+        assert limiter.total_tokens == 0+        assert CapacityLimiter(0).total_tokens == 0+     async def test_total_tokens_as_kwarg(self) -> None:
attrs pypi
26.1.0 3mo ago incident on record
YANK
latest 26.1.0 versions 36 maintainers 1
22.1.0
22.2.0
23.1.0
23.2.0
24.1.0
24.2.0
24.3.0
25.1.0
25.2.0
25.3.0
25.4.0
26.1.0
YANK
21.1.0 marked yanked (still downloadable)
high · registry-verified · 2021-05-06 · 5y ago
release diff 25.4.0 → 26.1.0
+3 added · -2 removed · ~44 modified
bench/test_benchmarks.py +58 lines
--- +++ @@ -5,2 +5,5 @@ from __future__ import annotations++import functools+import time @@ -174 +177,56 @@         at(c)+++class TestCachedProperties:+    @attrs.define+    class Slotted:+        x: int = 0++        @functools.cached_property+        def cached(self):+            time.sleep(0.1)+            return 42++    @attrs.define(slots=False)+    class Unslotted:+        x: int = 0++        @functools.cached_property+        def cached(self):+            time.sleep(0.1)+            return 42++    def test_first_access(self):+        """+        Benchmark first access to a cached property (computation + storage).+        """+        for _ in range(ROUNDS):+            c = self.Slotted(42)+            _ = c.cached++    def test_repeated_access(self):+        """+        Benchmark repeated access to a cached property (should use stored+        value).+        """+        c = self.Slotted(42)+        _ = c.cached  # Prime the cache++        for _ in range(ROUNDS):+            _ = c.cached++    def test_create_cached_property_class(self):+        """+        Benchmark creating a class with a cached property+        """+        for _ in range(ROUNDS):++            @attrs.define+            class LocalC:+                x: int+                y: str+                z: dict[str, int]++                @functools.cached_property+                def cached(self):+                    return 42
pyproject.toml +10 lines
--- +++ @@ -131,2 +131,7 @@ [[tool.sponcon.sponsors]]+title = "Kraken Tech"+url = "https://kraken.tech/"+img = "Kraken.svg"++[[tool.sponcon.sponsors]] title = "Privacy Solutions"@@ -139,2 +144,7 @@ img = "FilePreviews.svg"++[[tool.sponcon.sponsors]]+title = "TestMu AI"+url = "https://www.testmuai.com/?utm_medium=sponsor&utm_source=structlog"+img = "TestMu-AI.svg" 
src/attr/_make.py +62 lines
--- +++ @@ -465,2 +465,11 @@ +    # Resolve default field alias before executing field_transformer, so that+    # the transformer receives fully populated Attribute objects with usable+    # alias values.+    for a in attrs:+        if not a.alias:+            # Evolve is very slow, so we hold our nose and do it dirty.+            _OBJ_SETATTR.__get__(a)("alias", _default_init_alias_for(a.name))+            _OBJ_SETATTR.__get__(a)("alias_is_default", True)+     if field_transformer is not None:@@ -482,9 +491,8 @@ -    # Resolve default field alias after executing field_transformer.-    # This allows field_transformer to differentiate between explicit vs-    # default aliases and supply their own defaults.+    # Resolve default field alias for any new attributes that the+    # field_transformer may have added without setting an alias.     for a in attrs:         if not a.alias:-            # Evolve is very slow, so we hold our nose and do it dirty.             _OBJ_SETATTR.__get__(a)("alias", _default_init_alias_for(a.name))+            _OBJ_SETATTR.__get__(a)("alias_is_default", True) @@ -571,3 +579,3 @@     """-    if isinstance(self, BaseException) and name in ("__notes__",):+    if isinstance(self, BaseException) and name == "__notes__":         BaseException.__delattr__(self, name)@@ -1098,5 +1106,3 @@     def add_replace(self):-        self._cls_dict["__replace__"] = self._add_method_dunders(-            lambda self, **changes: evolve(self, **changes)-        )+        self._cls_dict["__replace__"] = self._add_method_dunders(evolve)         return self@@ -1886,3 +1892,3 @@     """-    Return the tuple of *attrs* attributes for a class.+    Return the tuple of *attrs* attributes for a class or instance. @@ -1892,6 +1898,6 @@     Args:-        cls (type): Class to introspect.+        cls (type): Class or instance to introspect.      Raises:-        TypeError: If *cls* is not a class.+        TypeError: If *cls* is neither a class nor an *attrs* instance. @@ -1906,2 +1912,3 @@     .. versionchanged:: 23.1.0 Add support for generic classes.+    .. versionchanged:: 26.1.0 Add support for instances.     """@@ -1910,4 +1917,8 @@     if generic_base is None and not isinstance(cls, type):-        msg = "Passed object must be a class."-        raise TypeError(msg)+        type_ = type(cls)+        if getattr(type_, "__attrs_attrs__", None) is None:+            msg = "Passed object must be a class or attrs instance."+            raise TypeError(msg)++        return fields(type_) @@ -2018,3 +2029,3 @@         if a.on_setattr is not None:-            if frozen is True:+            if frozen is True and a.on_setattr is not setters.NO_OP:                 msg = "Frozen classes can't use on_setattr."@@ -2431,2 +2442,4 @@       any explicit overrides and default private-attribute-name handling.+    - ``alias_is_default`` (`bool`): Whether the ``alias`` was automatically+      generated (``True``) or explicitly provided by the user (``False``).     - ``inherited`` (`bool`): Whether or not that attribute has been inherited@@ -2456,2 +2469,3 @@     .. versionadded:: 22.2.0 *alias*+    .. versionadded:: 26.1.0 *alias_is_default* @@ -2480,2 +2494,3 @@         "alias",+        "alias_is_default",     )@@ -2502,2 +2517,3 @@         alias=None,+        alias_is_default=None,     ):@@ -2536,2 +2552,6 @@         bound_setattr("alias", alias)+        bound_setattr(+            "alias_is_default",+            alias is None if alias_is_default is None else alias_is_default,+        ) @@ -2571,2 +2591,3 @@             ca.alias,+            ca.alias is None,         )@@ -2588,2 +2609,16 @@         new._setattrs(changes.items())++        if "alias" in changes and "alias_is_default" not in changes:+            # Explicit alias provided -- no longer the default.+            _OBJ_SETATTR.__get__(new)("alias_is_default", False)+        elif (+            "name" in changes+            and "alias" not in changes+            # Don't auto-generate alias if the user picked picked the old one.+            and self.alias_is_default+        ):+            # Name changed, alias was auto-generated -- update it.+            _OBJ_SETATTR.__get__(new)(+                "alias", _default_init_alias_for(new.name)+            ) @@ -2605,2 +2640,13 @@         """+        if len(state) < len(self.__slots__):+            # Pre-26.1.0 pickle without alias_is_default -- infer it+            # heuristically.+            state_dict = dict(zip(self.__slots__, state))+            alias_is_default = state_dict.get(+                "alias"+            ) is None or state_dict.get("alias") == _default_init_alias_for(+                state_dict["name"]+            )+            state = (*state, alias_is_default)+         self._setattrs(zip(self.__slots__, state))@@ -2628,3 +2674,3 @@         validator=None,-        repr=True,+        repr=(name != "alias_is_default"),         cmp=None,@@ -3089,5 +3135,3 @@         else:-            self.__call__ = lambda value, instance, field: self.converter(-                value, instance, field-            )+            self.__call__ = self.converter 
src/attr/exceptions.py +4 lines
--- +++ @@ -3,4 +3,2 @@ from __future__ import annotations--from typing import ClassVar @@ -18,4 +16,6 @@ -    msg = "can't set attribute"-    args: ClassVar[tuple[str]] = [msg]+    def __init__(self):+        msg = "can't set attribute"+        super().__init__(msg)+        self.msg = msg 
src/attr/validators.py +4 lines
--- +++ @@ -81,3 +81,5 @@     .. versionadded:: 21.3.0-    """+    .. versionchanged:: 26.1.0 The contextmanager is nestable.+    """+    prev = get_run_validators()     set_run_validators(False)@@ -86,3 +88,3 @@     finally:-        set_run_validators(True)+        set_run_validators(prev) 
tests/test_functional.py +14 lines
--- +++ @@ -132,2 +132,3 @@                 inherited=False,+                alias_is_default=True,             ),@@ -145,2 +146,3 @@                 inherited=False,+                alias_is_default=True,             ),@@ -203,2 +205,3 @@                 inherited=False,+                alias_is_default=True,             ),@@ -216,2 +219,3 @@                 inherited=False,+                alias_is_default=True,             ),@@ -262,9 +266,16 @@ -        with pytest.raises(FrozenInstanceError) as e:+        with pytest.raises(+            FrozenInstanceError, match="can't set attribute"+        ) as e:             frozen.x = 2 -        with pytest.raises(FrozenInstanceError) as e:+        assert e.value.msg == e.value.args[0] == "can't set attribute"+        assert 1 == frozen.x++        with pytest.raises(+            FrozenInstanceError, match="can't set attribute"+        ) as e:             del frozen.x -        assert e.value.args[0] == "can't set attribute"+        assert e.value.msg == e.value.args[0] == "can't set attribute"         assert 1 == frozen.x
tests/test_hooks.py +145 lines
--- +++ @@ -180,3 +180,3 @@             "metadata=mappingproxy({'field_order': 1}), type='int', converter=None, "-            "kw_only=False, inherited=False, on_setattr=None, alias=None)",+            "kw_only=False, inherited=False, on_setattr=None, alias='x')",         ) == e.value.args@@ -234,2 +234,146 @@         assert ["x"] == [a.name for a in attr.fields(Base)]++    def test_hook_alias_available(self):+        """+        The field_transformer receives attributes with default aliases+        already resolved, not None.++        Regression test for #1479.+        """+        seen = []++        def hook(cls, attribs):+            seen[:] = [(a.name, a.alias, a.alias_is_default) for a in attribs]+            return attribs++        @attr.s(auto_attribs=True, field_transformer=hook)+        class C:+            _private: int+            _explicit: int = attr.ib(alias="_explicit")+            public: int++        assert [+            ("_private", "private", True),+            ("_explicit", "_explicit", False),+            ("public", "public", True),+        ] == seen++    def test_hook_evolve_name_updates_auto_alias(self):+        """+        When a field_transformer evolves a field's name, the alias is+        automatically updated if it was auto-generated.++        Regression test for #1479.+        """++        def hook(cls, attribs):+            return [a.evolve(name="renamed") for a in attribs]++        @attr.s(auto_attribs=True, field_transformer=hook)+        class C:+            _original: int++        f = attr.fields(C).renamed++        assert "renamed" == f.alias+        assert f.alias_is_default is True++    def test_hook_evolve_name_keeps_explicit_alias(self):+        """+        When a field_transformer evolves a field's name but the field had+        an explicit alias, the alias is preserved.++        Regression test for #1479.+        """++        def hook(cls, attribs):+            return [a.evolve(name="renamed") for a in attribs]++        @attr.s(auto_attribs=True, field_transformer=hook)+        class C:+            original: int = attr.ib(alias="my_alias")++        f = attr.fields(C).renamed++        assert "my_alias" == f.alias+        assert f.alias_is_default is False++    def test_hook_new_field_without_alias(self):+        """+        When a field_transformer adds a brand-new field without setting an+        alias, the post-transformer alias resolution fills it in.++        Regression test for #1479.+        """++        def hook(cls, attribs):+            return [+                *list(attribs),+                attr.Attribute(+                    name="_extra",+                    default=0,+                    validator=None,+                    repr=True,+                    cmp=None,+                    hash=None,+                    init=True,+                    metadata={},+                    type=int,+                    converter=None,+                    kw_only=False,+                    eq=True,+                    eq_key=None,+                    order=True,+                    order_key=None,+                    on_setattr=None,+                    alias=None,+                    inherited=False,+                ),+            ]++        @attr.s(auto_attribs=True, field_transformer=hook)+        class C:+            x: int++        f = attr.fields(C)._extra++        assert "extra" == f.alias+        assert f.alias_is_default is True++    def test_hook_explicit_alias_matching_default(self):+        """+        When a user explicitly sets an alias that happens to equal the+        auto-generated default, alias_is_default is still False.++        Regression test for #1479.+        """++        @attr.s(auto_attribs=True)+        class C:+            _private: int = attr.ib(alias="private")++        f = attr.fields(C)._private++        assert "private" == f.alias+        assert f.alias_is_default is False++    def test_hook_evolve_alias_sets_not_default(self):+        """+        When a field_transformer uses evolve() to set an explicit alias,+        alias_is_default becomes False.++        Regression test for #1479.+        """++        def hook(cls, attribs):+            return [a.evolve(alias="custom") for a in attribs]++        @attr.s(auto_attribs=True, field_transformer=hook)+        class C:+            x: int++        f = attr.fields(C).x++        assert "custom" == f.alias+        assert f.alias_is_default is False 
tests/test_make.py +113 lines
--- +++ @@ -11,3 +11,5 @@ import itertools+import pickle import sys+import types import unicodedata@@ -118,5 +120,3 @@ -    @pytest.mark.parametrize(-        "wrap", [lambda v: v, lambda v: [v], lambda v: and_(v)]-    )+    @pytest.mark.parametrize("wrap", [lambda v: v, lambda v: [v], and_])     def test_validator_decorator(self, wrap):@@ -247,3 +247,3 @@             "metadata=mappingproxy({}), type=None, converter=None, "-            "kw_only=False, inherited=False, on_setattr=None, alias=None)",+            "kw_only=False, inherited=False, on_setattr=None, alias='y')",         ) == e.value.args@@ -1552,8 +1552,15 @@         """-        Raises `TypeError` on non-classes.-        """-        with pytest.raises(TypeError) as e:-            fields(C())--        assert "Passed object must be a class." == e.value.args[0]+        Returns the class fields for *attrs* instances too.+        """+        assert fields(C()) is fields(C)++    def test_handler_non_attrs_instance(self):+        """+        Raises `TypeError` on non-*attrs* instances.+        """+        with pytest.raises(+            TypeError,+            match=r"Passed object must be a class or attrs instance\.",+        ):+            fields(object()) @@ -1777,5 +1784,3 @@         """-        C = make_class(-            "C", {"x": attr.ib(converter=lambda v: int(v))}, frozen=True-        )+        C = make_class("C", {"x": attr.ib(converter=int)}, frozen=True)         C("1")@@ -2391,2 +2396,97 @@ +    def test_alias_is_default(self):+        """+        alias_is_default is True for auto-generated aliases and False for+        explicitly provided ones -- even if the explicit value matches the+        auto-generated default.+        """++        @attrs.define+        class C:+            auto: int+            _private_auto: int+            explicit: int = attrs.field(alias="custom")+            _matches_default: int = attrs.field(alias="matches_default")++        fields = attr.fields_dict(C)++        assert fields["auto"].alias_is_default is True+        assert fields["_private_auto"].alias_is_default is True+        assert fields["explicit"].alias_is_default is False+        assert fields["_matches_default"].alias_is_default is False++    def test_alias_is_default_pickle_roundtrip(self):+        """+        alias_is_default survives pickle round-tripping.+        """++        @attrs.define+        class C:+            auto: int+            explicit: int = attrs.field(alias="custom")++        fields = attr.fields(C)++        for a in fields:+            restored = pickle.loads(pickle.dumps(a))++            assert a.alias == restored.alias+            assert a.alias_is_default == restored.alias_is_default++    X = (+        b"\x80\x05\x95_\x00\x00\x00\x00\x00\x00\x00\x8c\nattr._make\x94\x8c\tAttrib"+        b"ute\x94\x93\x94)\x81\x94(\x8c\x01x\x94h\x00\x8c\x08_Nothing\x94\x93"+        b"\x94K\x01\x85\x94R\x94N\x88\x88N\x88NN\x88}\x94\x8c\x08builtins\x94"+        b"\x8c\x03int\x94\x93\x94N\x89\x89Nh\x04t\x94b."+    )+    Y = (+        b"\x80\x05\x95b\x00\x00\x00\x00\x00\x00\x00\x8c\nattr._make\x94\x8c\tAttrib"+        b"ute\x94\x93\x94)\x81\x94(\x8c\x02_y\x94h\x00\x8c\x08_Nothing\x94"+        b"\x93\x94K\x01\x85\x94R\x94N\x88\x88N\x88NN\x88}\x94\x8c\x08builtins"+        b"\x94\x8c\x03int\x94\x93\x94N\x89\x89N\x8c\x01y\x94t\x94b."+    )+    Z = (+        b"\x80\x05\x95c\x00\x00\x00\x00\x00\x00\x00\x8c\nattr._make\x94\x8c\tAttrib"+        b"ute\x94\x93\x94)\x81\x94(\x8c\x01z\x94h\x00\x8c\x08_Nothing\x94\x93"+        b"\x94K\x01\x85\x94R\x94N\x88\x88N\x88NN\x88}\x94\x8c\x08builtins\x94"+        b"\x8c\x03int\x94\x93\x94N\x89\x89N\x8c\x03_z_\x94t\x94b."+    )++    @pytest.mark.parametrize(+        ("pickle_data", "name", "alias", "alias_is_default"),+        [+            (X, "x", "x", True),+            (Y, "_y", "y", True),+            (Z, "z", "_z_", False),+        ],+    )+    def test_can_unpickle_25_3_attributes(+        self, pickle_data, name, alias, alias_is_default+    ):+        """+        Can unpickle attributes created in 25.3.+        """++        assert Attribute(+            name=name,+            alias=alias,+            alias_is_default=alias_is_default,+            default=attrs.NOTHING,+            validator=None,+            repr=True,+            cmp=None,+            eq=True,+            eq_key=None,+            order=True,+            order_key=None,+            hash=None,+            init=True,+            metadata=types.MappingProxyType({}),+            type=int,+            converter=None,+            kw_only=False,+            inherited=False,+            on_setattr=None,+        ) == pickle.loads(pickle_data)+ 
tests/test_pyright.py +1 lines
--- +++ @@ -53,3 +53,3 @@             '"(self: DefineConverter, with_converter: str | Buffer | '-            'SupportsInt | SupportsIndex | SupportsTrunc) -> None"',+            'SupportsInt | SupportsIndex) -> None"',         ),
tests/test_setattr.py +10 lines
--- +++ @@ -223,2 +223,12 @@ +    @pytest.mark.parametrize("nop", [None, setters.NO_OP])+    def test_frozen_on_setattr_nops(self, nop):+        """+        on_setattr on frozen classes can be used for None and NO_OP.+        """++        @attr.s(frozen=True)+        class C:+            x = attr.ib(on_setattr=nop)+     def test_setattr_reset_if_no_custom_setattr(self, slots):
tests/test_validators.py +24 lines
--- +++ @@ -7,2 +7,3 @@ import re+import sys @@ -99,2 +100,18 @@ +    def test_disabled_ctx_nested(self):+        """+        Nested contextmanagers restore correct state.+        """+        assert _config._run_validators is True++        with validator_module.disabled():+            assert _config._run_validators is False++            with validator_module.disabled():+                assert _config._run_validators is False++            assert _config._run_validators is False++        assert _config._run_validators is True+ @@ -229,6 +246,9 @@ -        assert (-            "'func' must be one of None, fullmatch, match, search."-            == ei.value.args[0]-        )+        if sys.version_info >= (3, 15):+            errmsg = (+                "'func' must be one of None, fullmatch, prefixmatch, search."+            )+        else:+            errmsg = "'func' must be one of None, fullmatch, match, search."+        assert errmsg == ei.value.args[0] 
tests/utils.py +1 lines
--- +++ @@ -66,2 +66,3 @@         alias=_default_init_alias_for(name),+        alias_is_default=True,     )
typing-examples/baseline.py +9 lines
--- +++ @@ -94,2 +94,11 @@     num: int = attrs.field(validator=attrs.validators.ge(0))++[email protected]+class ValidatedOptionalOverTuple:+    num: int | None = attrs.field(+        validator=attrs.validators.optional(+            (attrs.validators.instance_of(int), attrs.validators.ge(0))  # ty:ignore [invalid-argument-type]+        )+    ) 
certifi pypi
2026.6.17 25d ago incident on record
critical-tier YANKBURST ×4
latest 2026.6.17 versions 75 maintainers 1 critical-tier (snapshotted)
2025.4.26
2025.6.15
2025.7.9
2025.7.14
2025.8.3
2025.10.5
2025.11.12
2026.1.4
2026.2.25
2026.4.22
2026.5.20
2026.6.17
YANK
2022.5.18 marked yanked (still downloadable)
high · registry-verified · 2022-05-18 · 4y ago
BURST
3 releases in 21m: 0.0.2, 0.0.3, 0.0.4
info · registry-verified · 2011-12-28 · 14y ago
BURST
2 releases in 2m: 0.0.5, 0.0.6
info · registry-verified · 2011-12-28 · 14y ago
BURST
2 releases in 39m: 2015.9.6, 2015.9.6.1
info · registry-verified · 2015-09-06 · 10y ago
BURST
2 releases in 4m: 2017.7.27, 2017.7.27.1
info · registry-verified · 2017-07-27 · 8y ago
release diff 2026.5.20 → 2026.6.17
+0 added · -0 removed · ~5 modified
certifi/__init__.py +1 lines
--- +++ @@ -3,2 +3,2 @@ __all__ = ["contents", "where"]-__version__ = "2026.05.20"+__version__ = "2026.06.17"
cffi pypi
2.1.0 5d ago incident on record
YANKBURST ×3INSTALL-EXEC
latest 2.1.0 versions 79 maintainers 1
1.14.2
1.14.3
1.14.4
1.14.5
1.14.6
1.15.0
1.15.1
1.16.0
1.17.0
1.17.1
2.0.0
2.1.0
YANK
1.0.2 marked yanked (still downloadable)
high · registry-verified · 2015-05-25 · 11y ago
BURST
2 releases in 20m: 0.8.4, 0.8.5
info · registry-verified · 2014-07-05 · 12y ago
BURST
2 releases in 41m: 1.4.0, 1.4.1
info · registry-verified · 2015-12-17 · 10y ago
BURST
2 releases in 21m: 1.9.0, 1.9.1
info · registry-verified · 2016-11-12 · 9y ago
INSTALL-EXEC
setup.py in sdist uses subprocess/exec (runs at pip install)
warn · snapshot-derived
release diff 2.0.0 → 2.1.0
+22 added · -0 removed · ~86 modified
new files touching dangerous APIs: src/cffi/_cffi_gen_src.py, testing/cffi1/test_cffi_gen_src.py, testing/cffi1/test_cffi_gen_src_meson.py
+44 more files not shown
src/cffi/_cffi_gen_src.py +216 lines · 1 flagged
--- +++ @@ -0,0 +1,216 @@+# Integrated from the cffi-buildtool project by Rose Davidson+# (https://github.com/inklesspen/cffi-buildtool), under the following+# license:+#+# MIT License+#+# Copyright (c) 2024, Rose Davidson+#+# Permission is hereby granted, free of charge, to any person obtaining a+# copy of this software and associated documentation files (the+# "Software"), to deal in the Software without restriction, including+# without limitation the rights to use, copy, modify, merge, publish,+# distribute, sublicense, and/or sell copies of the Software, and to+# permit persons to whom the Software is furnished to do so, subject to+# the following conditions:+#+# The above copyright notice and this permission notice (including the+# next paragraph) shall be included in all copies or substantial portions+# of the Software.+#+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.+"""Implementation of the ``cffi-gen-src`` command-line tool.++This module is private; the command line is the only supported+interface. Two subcommands:++``exec-python``+    Execute a Python script that constructs a :class:`cffi.FFI`+    (the same kind of script that the CFFI docs' "Main mode of usage"+    describes) and emit the generated C source.++``read-sources``+    Create the :class:`cffi.FFI` from a separate ``cdef`` file and C+    source prelude, then emit the generated C source.+"""++import argparse+import io+import os+import sys++from .api import FFI+++def _execfile(pysrc, filename, globs):+    compiled = compile(source=pysrc, filename=filename, mode='exec')+    exec(compiled, globs, globs)+++def find_ffi_in_python_script(pysrc, filename, ffivar):+    """Execute ``pysrc`` and return the :class:`FFI` object it defines.++    The script is executed with ``__name__`` set to ``"cffi.gen_src"``,+    so a trailing ``if __name__ == "__main__": ffibuilder.compile()``+    block in the script is skipped.++    ``ffivar`` is the name bound by the script to the :class:`FFI`+    object, or to a callable that returns one.++    Raises :class:`NameError` if the name is not bound by the script,+    or :class:`TypeError` if the name does not resolve to an+    :class:`FFI` instance.+    """+    filename = os.path.abspath(filename)+    globs = {'__name__': 'cffi.gen_src', '__file__': filename}+    old_path = sys.path[:]+    sys.path.insert(0, os.path.dirname(filename))+    try:+        _execfile(pysrc, filename, globs)+        if ffivar not in globs:+            raise NameError(+                "Expected to find the FFI object with the name %r, "+                "but it was not found." % (ffivar,)+            )+        ffi = globs[ffivar]+        if not isinstance(ffi, FFI) and callable(ffi):+            # Maybe it's a callable that returns a FFI+            ffi = ffi()+        if not isinstance(ffi, FFI):+            raise TypeError(+                "Found an object with the name %r but it was not an "+                "instance of cffi.api.FFI" % (ffivar,)+            )+        return ffi+    finally:+        sys.path[:] = old_path+++def make_ffi_from_sources(modulename, cdef, csrc):+    """Create an :class:`FFI` from ``cdef`` text and a C source prelude."""+    ffibuilder = FFI()+    ffibuilder.cdef(cdef)+    ffibuilder.set_source(modulename, csrc)+    return ffibuilder+++def generate_c_source(ffi):+    """Return the C source that :meth:`FFI.emit_c_code` would write."""+    output = io.StringIO()+    ffi.emit_c_code(output)+    return output.getvalue()+++def write_c_source(output, generated):+    if output == '-':+        sys.stdout.write(generated)+        return+    with open(output, 'w', encoding='utf-8') as f:+        f.write(generated)+++def same_input_file(file1, file2):+    if file1 is file2:+        return True+    try:+        return os.path.samefile(file1.name, file2.name)+    except OSError:+        return False+++def exec_python(*, output, pyfile, ffi_var):+    with pyfile:+        ffi = find_ffi_in_python_script(pyfile.read(), pyfile.name, ffi_var)+    generated = generate_c_source(ffi)+    write_c_source(output, generated)+++def read_sources(*, output, module_name, cdef_input, csrc_input):+    with csrc_input, cdef_input:+        csrc = csrc_input.read()+        cdef = cdef_input.read()+    ffi = make_ffi_from_sources(module_name, cdef, csrc)+    generated = generate_c_source(ffi)+    write_c_source(output, generated)+++def _prog():+    # The same parser serves both documented invocations; make --help+    # and usage messages show the one that was actually used.+    argv0 = os.path.basename(sys.argv[0]) if sys.argv else ''+    if argv0.startswith('cffi-gen-src'):+        return 'cffi-gen-src'+    return 'python -m cffi.gen_src'+++parser = argparse.ArgumentParser(+    prog=_prog(),+    description='Generate CFFI C source for extension modules.',+)+subparsers = parser.add_subparsers(dest='mode')++exec_python_parser = subparsers.add_parser(+    'exec-python',+    help='Execute a Python script that defines an FFI object',+)+exec_python_parser.add_argument(+    '--ffi-var',+    default='ffibuilder',+    help="Name of the FFI object in the Python script; defaults to 'ffibuilder'.",+)+exec_python_parser.add_argument(+    'pyfile',+    type=argparse.FileType('r', encoding='utf-8'),+    help='Path to the Python script',+)+exec_python_parser.add_argument(+    'output',+    help='Output path for the C source',+)++read_sources_parser = subparsers.add_parser(+    'read-sources',+    help='Read cdef and C source prelude files that define an FFI object',+)+read_sources_parser.add_argument(+    'module_name',+    help='Full name of the generated module, including packages',+)+read_sources_parser.add_argument(+    'cdef',+    type=argparse.FileType('r', encoding='utf-8'),+    help='File containing C definitions',+)+read_sources_parser.add_argument(+    'csrc',+    type=argparse.FileType('r', encoding='utf-8'),+    help='File containing C source prelude',+)+read_sources_parser.add_argument(+    'output',+    help='Output path for the C source',+)+++def run(args=None):+    args = parser.parse_args(args=args)+    if args.mode == 'exec-python':+        exec_python(output=args.output, pyfile=args.pyfile, ffi_var=args.ffi_var)+    elif args.mode == 'read-sources':+        if same_input_file(args.cdef, args.csrc):+            parser.error('cdef and csrc are the same file and should not be')+        read_sources(+            output=args.output,+            module_name=args.module_name,+            cdef_input=args.cdef,+            csrc_input=args.csrc,+        )+    else:+        parser.error('a subcommand is required: exec-python or read-sources')+    parser.exit(0)
testing/cffi1/test_cffi_gen_src.py +213 lines · 3 flagged
--- +++ @@ -0,0 +1,213 @@+"""Tests for the cffi-gen-src command-line tool.++The command line is the tool's only public interface, so these+tests drive it exclusively through subprocesses.+"""++import os+import shutil+import subprocess+import sys+import sysconfig++import pytest++pytestmark = [+    pytest.mark.thread_unsafe(reason="spawns subprocesses, slow"),+]+++SIMPLE_SCRIPT = """\+from cffi import FFI++ffibuilder = FFI()++ffibuilder.cdef("int square(int n);")++ffibuilder.set_source("squared._squared", '#include "square.h"')++something_else = 42++if __name__ == "__main__":+    ffibuilder.compile(verbose=True)+"""++CALLABLE_SCRIPT = """\+from cffi import FFI++def make_ffi():+    ffibuilder = FFI()+    ffibuilder.cdef("int square(int n);")+    ffibuilder.set_source("squared._squared", '#include "square.h"')+    return ffibuilder++def something_else():+    return 42+"""+++def _cffi_gen_src_path():+    """Locate the installed ``cffi-gen-src`` script, or return None."""+    exe = "cffi-gen-src" + (".exe" if sys.platform == "win32" else "")+    candidate = os.path.join(sysconfig.get_path("scripts"), exe)+    if os.path.exists(candidate):+        return candidate+    return shutil.which("cffi-gen-src")+++def _run(argv, *args):+    return subprocess.run(+        [*argv, *args],+        stdin=subprocess.DEVNULL,+        capture_output=True,+        text=True,+    )+++# `cffi-gen-src` can also be invoked via `python -m cffi.gen_src`.+# This fixture enables testing both invocations.[email protected](params=["module", "script"])+def run_cffi_gen_src(request):+    """Run the cffi-gen-src CLI in a subprocess, via both invocations."""+    if request.param == "script":+        script = _cffi_gen_src_path()+        if script is None:+            pytest.skip("the cffi-gen-src script is not installed")+        argv = [script]+    else:+        argv = [sys.executable, "-m", "cffi.gen_src"]++    def run(*args):+        return _run(argv, *args)++    return run+++def test_exec_python(tmp_path, run_cffi_gen_src):+    pyfile = tmp_path / "_squared_build.py"+    pyfile.write_text(SIMPLE_SCRIPT)+    output = tmp_path / "out.c"+    proc = run_cffi_gen_src("exec-python", str(pyfile), str(output))+    assert proc.returncode == 0, proc.stderr+    generated = output.read_text()+    assert "square" in generated+    # sanity check: the emitted C source is the thing meson-python will compile+    assert "PyInit" in generated or "_cffi_f_" in generated+++def test_exec_python_ffi_var(tmp_path, run_cffi_gen_src):+    pyfile = tmp_path / "_squared_build.py"+    pyfile.write_text(CALLABLE_SCRIPT)+    output = tmp_path / "out.c"+    proc = run_cffi_gen_src(+        "exec-python", "--ffi-var", "make_ffi", str(pyfile), str(output)+    )+    assert proc.returncode == 0, proc.stderr+    assert "square" in output.read_text()+++def test_exec_python_supports_file_and_script_imports(tmp_path, run_cffi_gen_src):+    helper = tmp_path / "helper.py"+    helper.write_text("HEADER = '#include \"square.h\"'\n")+    pyfile = tmp_path / "_squared_build.py"+    pyfile.write_text("""\+import os++from cffi import FFI++assert os.path.basename(__file__) == "_squared_build.py"++def make_ffi():+    from helper import HEADER++    ffibuilder = FFI()+    ffibuilder.cdef("int square(int n);")+    ffibuilder.set_source("squared._squared", HEADER)+    return ffibuilder+""")+    output = tmp_path / "out.c"+    proc = run_cffi_gen_src(+        "exec-python", "--ffi-var", "make_ffi", str(pyfile), str(output)+    )+    assert proc.returncode == 0, proc.stderr+    assert "square" in output.read_text()+++def test_exec_python_name_not_found(tmp_path, run_cffi_gen_src):+    pyfile = tmp_path / "_squared_build.py"+    pyfile.write_text(SIMPLE_SCRIPT)+    output = tmp_path / "out.c"+    proc = run_cffi_gen_src(+        "exec-python", "--ffi-var", "notfound", str(pyfile), str(output)+    )+    assert proc.returncode != 0+    assert "NameError" in proc.stderr+    assert "'notfound'" in proc.stderr++[email protected](+    "script", [SIMPLE_SCRIPT, CALLABLE_SCRIPT], ids=["simple", "callable"]+)+def test_exec_python_wrong_type(tmp_path, run_cffi_gen_src, script):+    pyfile = tmp_path / "_squared_build.py"+    pyfile.write_text(script)+    output = tmp_path / "out.c"+    proc = run_cffi_gen_src(+        "exec-python", "--ffi-var", "something_else", str(pyfile), str(output)+    )+    assert proc.returncode != 0+    assert "not an instance of cffi.api.FFI" in proc.stderr+++def test_read_sources(tmp_path, run_cffi_gen_src):+    cdef = tmp_path / "squared.cdef.txt"+    cdef.write_text("int square(int n);\n")+    csrc = tmp_path / "squared.csrc.c"+    csrc.write_text('#include "square.h"\n')+    output = tmp_path / "out.c"+    proc = run_cffi_gen_src(+        "read-sources", "squared._squared", str(cdef), str(csrc), str(output)+    )+    assert proc.returncode == 0, proc.stderr+    generated = output.read_text()+    assert "square" in generated+    assert "PyInit" in generated or "_cffi_f_" in generated+++def test_read_sources_same_input_fails(run_cffi_gen_src):+    proc = run_cffi_gen_src("read-sources", "_squared", "-", "-", "-")+    assert proc.returncode != 0+    assert "are the same file and should not be" in proc.stderr+++def test_no_subcommand(run_cffi_gen_src):+    proc = run_cffi_gen_src()+    assert proc.returncode != 0+    assert "a subcommand is required" in proc.stderr+++def test_module_help_names_module_invocation():+    proc = _run([sys.executable, "-m", "cffi.gen_src"], "--help")+    assert proc.returncode == 0, proc.stderr+    assert proc.stdout.startswith("usage: python -m cffi.gen_src")+++def test_script_help_names_script_invocation():+    script = _cffi_gen_src_path()+    if script is None:+        pytest.skip("the cffi-gen-src script is not installed")+    proc = _run([script], "--help")+    assert proc.returncode == 0, proc.stderr+    assert proc.stdout.startswith("usage: cffi-gen-src")+++def test_import_is_inert():+    # importing the entry-point module must not run the CLI+    proc = subprocess.run(+        [sys.executable, "-c", "import cffi.gen_src"],+        capture_output=True,+        text=True,+    )+    assert proc.returncode == 0, proc.stderr+    assert proc.stdout == ""+    assert proc.stderr == ""
testing/cffi1/test_cffi_gen_src_meson.py +88 lines · 5 flagged
--- +++ @@ -0,0 +1,88 @@+"""End-to-end test: build a self-contained CFFI extension with meson-python.++The test provisions a fresh nested venv under ``tmp_path`` using the+stdlib :mod:`venv` module, installs ``cffi`` (from the current source+tree) and ``meson-python`` into it, installs one of the small example+projects that live under ``testing/cffi1/cffi_gen_src_examples/``, and then+imports the built extension to confirm it works.++"""++import os+import re+import shutil+import subprocess+import sys+from pathlib import Path++import pytest++import cffi++pytestmark = [+    pytest.mark.thread_unsafe(reason="spawns subprocesses, slow"),+]++try:+    import mesonpy+except ImportError:+    pytest.skip("Test requires meson-python", allow_module_level=True)+++HERE = Path(__file__).resolve().parent+EXAMPLE_PROJECT = HERE / "cffi_gen_src_examples" / "exec_python_example"+EXAMPLE_PROJECT2 = HERE / "cffi_gen_src_examples" / "read_sources_example"+CFFI_DIR = HERE.parent.parent+++def _venv_python(venv_dir):+    if sys.platform == "win32":+        return venv_dir / "Scripts" / "python.exe"+    return venv_dir / "bin" / "python"++[email protected]("project", [EXAMPLE_PROJECT, EXAMPLE_PROJECT2])+def test_meson_python_build(tmp_path, project):+    venv_dir = tmp_path / "venv"+    subprocess.check_call([sys.executable, "-m", "venv", str(venv_dir)])+    venv_python = _venv_python(venv_dir)+    assert venv_python.exists(), venv_python++    # Upgrade pip so --no-build-isolation behaves consistently with recent+    # resolver behaviour on older base images.+    subprocess.check_call([+        str(venv_python), "-m", "pip", "install", "--upgrade", "pip",+    ])++    # Install build-time deps into the nested venv.+    subprocess.check_call([+        str(venv_python), "-m", "pip", "install", "meson-python", CFFI_DIR+    ])++    # Copy the example project so nothing is written back into the+    # source tree+    project_dir = tmp_path / "project"+    shutil.copytree(project, project_dir)++    # The example meson.build files locate the codegen tool with+    # find_program('cffi-gen-src'), which searches PATH. pip only puts+    # an environment's scripts directory on PATH for isolated builds,+    # so with --no-build-isolation the nested venv's script must be+    # made findable by hand.+    env = os.environ.copy()+    env["PATH"] = str(venv_python.parent) + os.pathsep + env.get("PATH", "")++    # --no-build-isolation to ensure the test runs against the CFFI build we want to test+    proc = subprocess.run([+        str(venv_python), "-m", "pip", "install", "-v",+        "--no-build-isolation", str(project_dir),+    ], env=env, capture_output=True, text=True)+    assert proc.returncode == 0, proc.stdout + proc.stderr++    # Confirm the built extension imports and behaves as expected.+    subprocess.check_call([+        str(venv_python), "-c",+        "from squared import squared; "+        "assert squared(7) == 49; "+        "assert squared(-3) == 9",+    ])
demo/_curses.py +2 lines
--- +++ @@ -221,3 +221,3 @@ -class Window(object):+class Window:     def __init__(self, window):@@ -331,3 +331,2 @@         lib.wbkgdset(self._win, _chtype(ch) | attr)-        return None @@ -337,3 +336,2 @@                     _chtype(tl), _chtype(tr), _chtype(bl), _chtype(br))-        return None @@ -341,3 +339,2 @@         lib.box(self._win, vertint, horint)-        return None @@ -515,5 +512,3 @@             raise error("is_linetouched: line number outside of boundaries")-        if code == lib.FALSE:-            return False-        return True+        return code != lib.FALSE @@ -652,3 +647,2 @@     lib.filter()-    return None @@ -915,3 +909,2 @@         lib.noqiflush()-    return None @@ -1018,3 +1011,2 @@     lib.setsyx(y, x)-    return None @@ -1026,3 +1018,2 @@     globals()["_initialised_color"] = True-    return None @@ -1072,3 +1063,2 @@     lib.use_env(flag)-    return None 
demo/api.py +1 lines
--- +++ @@ -37,3 +37,3 @@ -class _PyExport(object):+class _PyExport:     def __init__(self, tp, func):
demo/bsdopendirtype.py +1 lines
--- +++ @@ -35,3 +35,3 @@             name = ffi.string(dirent.d_name)-            if name == b'.' or name == b'..':+            if name in {b'.', b'..'}:                 continue
demo/btrfs-snap.py +1 lines
--- +++ @@ -5,4 +5,2 @@ """-from __future__ import print_function- import argparse@@ -49,3 +47,3 @@     fcntl.ioctl(target, lib.BTRFS_IOC_SNAP_CREATE_V2, args_buffer)-except IOError as e:+except OSError as e:     print(e)
demo/extern_python_varargs.py +0 lines
--- +++ @@ -1,2 +1 @@-from __future__ import print_function import cffi
demo/fastcsv.py +0 lines
--- +++ @@ -1,2 +1 @@-from __future__ import print_function import csv
demo/gmp.py +0 lines
--- +++ @@ -1,2 +1 @@-from __future__ import print_function import sys
demo/manual2.py +0 lines
--- +++ @@ -1,2 +1 @@-from __future__ import print_function import _cffi_backend
demo/pwuid.py +0 lines
--- +++ @@ -1,2 +1 @@-from __future__ import print_function import sys, os
demo/pyobj.py +1 lines
--- +++ @@ -1,3 +1 @@-from __future__ import print_function- referents = []     # list "object descriptor -> python object"@@ -26,3 +24,3 @@ -class Ref(object):+class Ref:     """For use in 'with Ref(x) as ob': open an object descriptor
demo/readdir.py +1 lines
--- +++ @@ -1,2 +1 @@-from __future__ import print_function # A Linux-only demo@@ -29,3 +28,3 @@         print('%3d %s' % (dirent.d_type, name))-        if dirent.d_type == 4 and name != '.' and name != '..':+        if dirent.d_type == 4 and name not in {'.', '..'}:             walk(dirfd, name)
demo/readdir2.py +1 lines
--- +++ @@ -1,2 +1 @@-from __future__ import print_function # A Linux-only demo, using set_source() instead of hard-coding the exact layouts@@ -29,3 +28,3 @@         print('%3d %s' % (dirent.d_type, name))-        if dirent.d_type == lib.DT_DIR and name != '.' and name != '..':+        if dirent.d_type == lib.DT_DIR and name not in {'.', '..'}:             walk(dirfd, name)
demo/readdir_ctypes.py +1 lines
--- +++ @@ -1,2 +1 @@-from __future__ import print_function # A Linux-only demo@@ -63,3 +62,3 @@         print('%3d %s' % (dirent.d_type, name))-        if dirent.d_type == 4 and name != '.' and name != '..':+        if dirent.d_type == 4 and name not in {'.', '..'}:             walk(dirfd, name)
demo/recopendirtype.py +1 lines
--- +++ @@ -37,3 +37,3 @@             name = ffi.string(dirent.d_name)-            if name == b'.' or name == b'..':+            if name in {b'.', b'..'}:                 continue
demo/winclipboard.py +0 lines
--- +++ @@ -1,2 +1 @@-from __future__ import print_function __author__ = "Israel Fruchter <[email protected]>"
doc/source/conf.py +6 lines
--- +++ @@ -1,3 +1 @@-# -*- coding: utf-8 -*--# # CFFI documentation build configuration file, created by@@ -39,4 +37,4 @@ # General information about the project.-project = u'CFFI'-copyright = u'2012-2025, Armin Rigo, Maciej Fijalkowski'+project = 'CFFI'+copyright = '2012-2025, Armin Rigo, Maciej Fijalkowski' @@ -47,5 +45,5 @@ # The short X.Y version.-version = '2.0'+version = '2.1' # The full version, including alpha/beta/rc tags.-release = '2.0.0'+release = '2.1.0' @@ -174,4 +172,4 @@ latex_documents = [-  ('index', 'CFFI.tex', u'CFFI Documentation',-   u'Armin Rigo, Maciej Fijalkowski', 'manual'),+  ('index', 'CFFI.tex', 'CFFI Documentation',+   'Armin Rigo, Maciej Fijalkowski', 'manual'), ]
pyproject.toml +12 lines
--- +++ @@ -2,5 +2,4 @@ requires = [-    # first version that supports Python 3.12; older versions may work-    # with previous Python versions, but are not tested-    "setuptools >= 66.1"+    # Required for PEP 639 support+    "setuptools >= 77.0.3" ]@@ -10,3 +9,3 @@ name = "cffi"-version = "2.0.0"+version = "2.1.0" dependencies = [@@ -14,7 +13,8 @@ ]-requires-python = ">=3.9"+requires-python = ">=3.10"  description = "Foreign Function Interface for Python calling C code."-readme = {file = "README.md", content-type = "text/markdown"}-license = "MIT"+readme = "README.md"+license = "MIT-0"+license-files = ["LICENSE"] classifiers = [@@ -22,3 +22,2 @@     "Programming Language :: Python :: 3",-    "Programming Language :: Python :: 3.9",     "Programming Language :: Python :: 3.10",@@ -28,2 +27,3 @@     "Programming Language :: Python :: 3.14",+    "Programming Language :: Python :: 3.15",     "Programming Language :: Python :: Free Threading :: 2 - Beta",@@ -38,3 +38,2 @@     {name = "Matt Clay"},-    {name = "Matti Picus"}, ]@@ -44,2 +43,5 @@ +[project.scripts]+cffi-gen-src = "cffi._cffi_gen_src:run"+ [project.urls]@@ -47,3 +49,3 @@ Changelog = "https://cffi.readthedocs.io/en/latest/whatsnew.html"-Downloads = "https://github.com/python-cffi/cffi/releases"+Download = "https://github.com/python-cffi/cffi/releases" Contact = "https://groups.google.com/forum/#!forum/python-cffi"
setup.py +1 lines
--- +++ @@ -156,3 +156,3 @@ -if 'darwin' in sys.platform:+if sysconfig.get_platform().startswith('macosx'):     # priority is given to `pkg_config`, but always fall back on SDK's libffi.
src/c/test_c.py +50 lines
--- +++ @@ -18,2 +18,5 @@         pass++is_ios = sys.platform == 'ios'+ @@ -65,3 +68,3 @@ import sys-assert __version__ == "2.0.0", ("This test_c.py file is for testing a version"+assert __version__ == "2.1.0", ("This test_c.py file is for testing a version"                                      " of cffi that differs from the one that we"@@ -74,3 +77,3 @@     bitem2bchr = lambda x: x-    class U(object):+    class U:         def __add__(self, other):@@ -459,3 +462,3 @@     assert p[0] == cast(BCharP, 0)-    assert p[0] != None+    assert p[0] is not None     assert repr(p[0]) == "<cdata 'int *' NULL>"@@ -494,4 +497,4 @@     x = cast(p, 42)-    assert (x == None) is False-    assert (x != None) is True+    assert (x is None) is False+    assert (x is not None) is True     assert (x == ["hello"]) is False@@ -499,3 +502,3 @@     y = cast(p, 0)-    assert (y == None) is False+    assert (y is None) is False @@ -1232,2 +1235,7 @@ [email protected](+    is_ios,+    reason="For an unknown reason f(1, cast(BInt, 42)) returns 36792864",+    raises=AssertionError,+) def test_call_function_9():@@ -1364,2 +1372,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") def test_callback():@@ -1380,2 +1389,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") @pytest.mark.thread_unsafe("mocks sys.unraiseablehook")@@ -1437,2 +1447,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") def test_callback_return_type():@@ -1457,2 +1468,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") def test_a_lot_of_callbacks():@@ -1472,2 +1484,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") def test_callback_receiving_tiny_struct():@@ -1487,2 +1500,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") def test_callback_returning_tiny_struct():@@ -1504,2 +1518,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") def test_callback_receiving_struct():@@ -1520,2 +1535,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") def test_callback_returning_struct():@@ -1539,2 +1555,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") def test_callback_receiving_big_struct():@@ -1563,2 +1580,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") def test_callback_returning_big_struct():@@ -1588,2 +1606,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") def test_callback_returning_void():@@ -1696,2 +1715,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") def test_callback_returning_enum():@@ -1712,2 +1732,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") def test_callback_returning_enum_unsigned():@@ -1729,2 +1750,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") def test_callback_returning_char():@@ -1743,2 +1765,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") def test_callback_returning_wchar_t():@@ -2312,2 +2335,4 @@     #+    if is_ios:+        return  # cannot allocate executable memory for the callback() below     def cb(p):@@ -2548,2 +2573,3 @@ [email protected](is_ios, reason="Cannot allocate executable memory on iOS") def test_errno_callback():@@ -2993,4 +3019,4 @@     try:-        import posix, io-        posix.fdopen = io.open+        import posix+        posix.fdopen = open     except ImportError:@@ -2998,2 +3024,7 @@ [email protected](+    is_ios,+    reason="For an unknown reason fscanf() doesn't read anything on 3.14"+           " and crashes on 3.13 (that's why it's not an xfail)",+) def test_FILE():@@ -3293,3 +3324,3 @@     BVoidP = new_pointer_type(new_void_type())-    class A(object):+    class A:         pass@@ -3337,11 +3368,10 @@             raise AssertionError("bad flag")+    elif flag & SF_MSVC_BITFIELDS:+        assert raw == b'A\x00\x00\x00\x00\x00\xC77\x9D\x00\x00\x00'+    elif flag & SF_GCC_LITTLE_ENDIAN:+        assert raw == b'A\xC77\x9D'+    elif flag & SF_GCC_BIG_ENDIAN:+        assert raw == b'A\x9B\xE3\x9D'     else:-        if flag & SF_MSVC_BITFIELDS:-            assert raw == b'A\x00\x00\x00\x00\x00\xC77\x9D\x00\x00\x00'-        elif flag & SF_GCC_LITTLE_ENDIAN:-            assert raw == b'A\xC77\x9D'-        elif flag & SF_GCC_BIG_ENDIAN:-            assert raw == b'A\x9B\xE3\x9D'-        else:-            raise AssertionError("bad flag")+        raise AssertionError("bad flag")     #@@ -3820,3 +3850,3 @@                 expected = expected_for_memoryview-        class X(object):+        class X:             pass@@ -4151,4 +4181,4 @@         BArray = new_array_type(new_pointer_type(BWChar), 10)   # wchar_t[10]-        p = newp(BArray, u"abc\x00def")-        assert unpack(p, 10) == u"abc\x00def\x00\x00\x00"+        p = newp(BArray, "abc\x00def")+        assert unpack(p, 10) == "abc\x00def\x00\x00\x00" 
src/cffi/__init__.py +2 lines
--- +++ @@ -7,4 +7,4 @@ -__version__ = "2.0.0"-__version_info__ = (2, 0, 0)+__version__ = "2.1.0"+__version_info__ = (2, 1, 0) 
src/cffi/api.py +3 lines
--- +++ @@ -4,9 +4,2 @@ from . import model--try:-    callable-except NameError:-    # Python 3.1-    from collections import Callable-    callable = lambda x: isinstance(x, Callable) @@ -22,3 +15,3 @@ -class FFI(object):+class FFI:     r'''@@ -416,3 +409,3 @@             replace_with = '(%s)' % replace_with-        elif replace_with and not replace_with[0] in '[(':+        elif replace_with and replace_with[0] not in '[(':             replace_with = ' ' + replace_with@@ -911,3 +904,3 @@     #-    class FFILibrary(object):+    class FFILibrary:         def __getattr__(self, name):
src/cffi/backend_ctypes.py +13 lines
--- +++ @@ -14,3 +14,3 @@ -class CTypesData(object):+class CTypesData:     __metaclass__ = CTypesType@@ -272,3 +272,3 @@ -class CTypesBackend(object):+class CTypesBackend: @@ -338,3 +338,2 @@                                     (type(novalue).__name__,))-                return None         CTypesVoid._fix_class()@@ -389,3 +388,3 @@ -            if kind == 'int' or kind == 'byte':+            if kind in {'int', 'byte'}:                 @classmethod@@ -437,3 +436,3 @@ -            if kind == 'int' or kind == 'byte' or kind == 'bool':+            if kind in {'int', 'byte', 'bool'}:                 @staticmethod@@ -560,3 +559,3 @@ -            if kind == 'charp' or kind == 'voidp':+            if kind in {'charp', 'voidp'}:                 @classmethod@@ -566,5 +565,5 @@                     else:-                        return super(CTypesPtr, cls)._arg_to_ctypes(*value)--            if kind == 'charp' or kind == 'bytep':+                        return super()._arg_to_ctypes(*value)++            if kind in {'charp', 'bytep'}:                 def _to_string(self, maxlen):@@ -583,3 +582,3 @@                         ctypes.sizeof(self._as_ctype_ptr.contents),)-                return super(CTypesPtr, self)._get_own_repr()+                return super()._get_own_repr()         #@@ -665,3 +664,3 @@ -            if kind == 'char' or kind == 'byte':+            if kind in {'char', 'byte'}:                 def _to_string(self, maxlen):@@ -679,3 +678,3 @@                     return 'owning %d bytes' % (ctypes.sizeof(self._blob),)-                return super(CTypesArray, self)._get_own_repr()+                return super()._get_own_repr() @@ -919,3 +918,3 @@                     return 'calling %r' % (self._own_callback,)-                return super(CTypesFunctionPtr, self)._get_own_repr()+                return super()._get_own_repr() @@ -1096,3 +1095,3 @@ -class CTypesLibrary(object):+class CTypesLibrary: 
click pypi
8.4.2 18d ago incident on record
YANKBURST
latest 8.4.2 versions 64 maintainers 1
8.1.7
8.1.8
8.2.0
8.2.1
8.2.2
8.3.0
8.3.1
8.3.2
8.3.3
8.4.0
8.4.1
8.4.2
YANK
8.2.2 marked yanked (still downloadable)
high · registry-verified · 2025-08-02 · 11mo ago
BURST
2 releases in 5m: 0.5, 0.5.1
info · registry-verified · 2014-05-06 · 12y ago
release diff 8.4.1 → 8.4.2
+0 added · -1 removed · ~30 modified
tests/test_utils.py +74 lines · 3 flagged
--- +++ @@ -18,3 +18,2 @@ import click.utils-from click._compat import MAC from click._compat import WIN@@ -288,2 +287,7 @@ def _test_gen_func_fails():+    raise RuntimeError("This is a test.")+    yield  # unreachable, keeps this a generator function+++def _test_gen_func_yields_then_fails():     yield "test"@@ -317,6 +321,2 @@ @pytest.mark.skipif(WIN, reason="Different behavior on windows.")[email protected](-    MAC and sys.version_info >= (3, 13) and not sys._is_gil_enabled(),-    reason="Generator exception tests are flaky in Python 3.14t on macOS.",-) @pytest.mark.parametrize(@@ -456,2 +456,71 @@     )++[email protected](WIN, reason="Different behavior on windows.")+def test_echo_via_pager_yields_before_exception(monkeypatch, tmp_path):+    """A generator that yields then raises: click writes the partial output to+    the pager stream before propagating the exception.++    The pager file content is intentionally NOT asserted: pipe-drain timing+    between click and the pager subprocess is outside click's control+    (#2899, #3470). Spying on ``MaybeStripAnsi.write`` records what click sent+    to the pager, which is deterministic regardless of scheduling.+    """+    monkeypatch.setitem(os.environ, "PAGER", "cat")+    monkeypatch.setattr(click._termui_impl, "isatty", lambda x: True)++    writes: list[str] = []+    real_write = click._termui_impl.MaybeStripAnsi.write++    def spy(self, text):+        writes.append(text)+        return real_write(self, text)++    monkeypatch.setattr(click._termui_impl.MaybeStripAnsi, "write", spy)++    pager_out_tmp = tmp_path / "pager_out.txt"+    with (+        pager_out_tmp.open("w") as f,+        patch.object(subprocess, "Popen", partial(subprocess.Popen, stdout=f)),+        pytest.raises(RuntimeError, match="This is a test."),+    ):+        click.echo_via_pager(_test_gen_func_yields_then_fails())++    assert "".join(writes) == "test", (+        f"click should have written the yielded chunk before exception, got {writes!r}"+    )++[email protected][email protected](WIN, reason="Different behavior on windows.")[email protected]("_", range(1000))+def test_stress_echo_via_pager_exception_cleanup(_, monkeypatch, tmp_path):+    """Repeated exceptions during ``echo_via_pager`` must not leak subprocesses.++    Regression coverage for the cleanup path in ``_pipepager``'s exception+    handler (issue #2899, PR #3470). Each iteration spawns a real pager+    subprocess, raises before any data is written and check there is no leak.+    """+    monkeypatch.setitem(os.environ, "PAGER", "cat")+    monkeypatch.setattr(click._termui_impl, "isatty", lambda x: True)++    spawned: list[subprocess.Popen] = []+    real_popen = subprocess.Popen++    def tracking_popen(*args, **kwargs):+        p = real_popen(*args, **kwargs)+        spawned.append(p)+        return p++    pager_out_tmp = tmp_path / "pager_out.txt"+    with (+        pager_out_tmp.open("w") as f,+        patch.object(subprocess, "Popen", partial(tracking_popen, stdout=f)),+        pytest.raises(RuntimeError),+    ):+        click.echo_via_pager(_test_gen_func_fails())++    assert spawned, "pager subprocess was never started"+    for p in spawned:+        assert p.returncode is not None, "pager subprocess not reaped" 
docs/conf.py +1 lines
--- +++ @@ -33,2 +33,3 @@ }+myst_enable_extensions = ["attrs_block"] myst_heading_anchors = 3
pyproject.toml +2 lines
--- +++ @@ -2,3 +2,3 @@ name = "click"-version = "8.4.1"+version = "8.4.2" description = "Composable command line interface toolkit"@@ -187,3 +187,3 @@ [tool.tox.env.stress]-description = "stress tests for stream lifecycle race conditions"+description = "high-iteration stress tests for race conditions" commands = [[@@ -192,3 +192,2 @@     "--override-ini=addopts=",-    "tests/test_stream_lifecycle.py",     {replace = "posargs", default = [], extend = true},
src/click/_compat.py +0 lines
--- +++ @@ -14,3 +14,2 @@ WIN = sys.platform.startswith("win")-MAC = sys.platform == "darwin" auto_wrap_for_ansi: t.Callable[[t.TextIO], t.TextIO] | None = None
src/click/_termui_impl.py +44 lines
--- +++ @@ -31,2 +31,3 @@ from .utils import echo+from .utils import KeepOpenFile @@ -432,4 +433,7 @@     """Context manager.+     Yields a writable file-like object which can be used as an output pager.-    .. versionadded:: 8.4++    .. versionadded:: 8.4.0+     :param color: controls if the pager supports ANSI colors or not.  The@@ -440,13 +444,24 @@         # BinaryIO annotations: buffered text streams can be unwrapped to bytes,-        # while text-only streams are yielded as-is.+        # while other streams are yielded as-is.+        wrapper: MaybeStripAnsi | None = None         if _has_binary_buffer(stream):             # Text stream backed by a binary buffer.-            stream = MaybeStripAnsi(stream.buffer, color=color, encoding=encoding)-        elif isinstance(stream, t.BinaryIO):-            # Binary stream-            stream = MaybeStripAnsi(stream, color=color, encoding=encoding)+            wrapper = MaybeStripAnsi(stream.buffer, color=color, encoding=encoding)+            stream = wrapper         try:-            yield stream+            # Narrow the BinaryIO | TextIO union that _pager_contextmanager+            # yields; the caller writes text to the pager.+            yield t.cast(t.TextIO, stream)         finally:-            stream.flush()+            try:+                stream.flush()+            finally:+                # Hand the binary buffer back to the pager that produced it+                # rather than letting this TextIOWrapper close it on garbage+                # collection. The pager owns the buffer's lifecycle: subprocess+                # pipes and temp files are closed by their own helpers, while a+                # borrowed stdout must stay open for the caller. detach() runs+                # even if flush() raised, so the buffer is never closed here.+                if wrapper is not None:+                    wrapper.detach() @@ -470,4 +485,7 @@     if not cmd_parts:+        # No usable pager: fall back to stdout through _nullpager so it gets the+        # same borrowed-stream handling and the caller's stream is not closed.         stdout = _default_text_stdout() or StringIO()-        yield stdout, "utf-8", False+        with _nullpager(stdout, color) as rv:+            yield rv         return@@ -481,4 +499,7 @@     if not cmd_filepath:+        # No usable pager: fall back to stdout through _nullpager so it gets the+        # same borrowed-stream handling and the caller's stream is not closed.         stdout = _default_text_stdout() or StringIO()-        yield stdout, "utf-8", False+        with _nullpager(stdout, color) as rv:+            yield rv         return@@ -570,4 +591,7 @@     if not cmd_parts:+        # No usable pager: fall back to stdout through _nullpager so it gets the+        # same borrowed-stream handling and the caller's stream is not closed.         stdout = _default_text_stdout() or StringIO()-        yield stdout, "utf-8", False+        with _nullpager(stdout, color) as rv:+            yield rv         return@@ -581,4 +605,7 @@     if not cmd_filepath:+        # No usable pager: fall back to stdout through _nullpager so it gets the+        # same borrowed-stream handling and the caller's stream is not closed.         stdout = _default_text_stdout() or StringIO()-        yield stdout, "utf-8", False+        with _nullpager(stdout, color) as rv:+            yield rv         return@@ -608,17 +635,2 @@ -class _SkipClose:-    def __init__(self, stream: t.IO[t.Any]) -> None:-        self.stream = stream--    def __getattr__(self, name: str) -> t.Any:-        return getattr(self.stream, name)--    @property-    def buffer(self) -> t.BinaryIO:-        return _SkipClose(self.stream.buffer)  # type: ignore[attr-defined, return-value]--    def close(self) -> None:-        pass-- @contextlib.contextmanager@@ -630,2 +642,6 @@     internal helpers.++    The stream is wrapped in :class:`~click.utils.KeepOpenFile` so that, as a+    borrowed stream, it is not closed by a ``with`` block. The wrapper that+    :func:`get_pager_file` builds around it is detached rather than closed.     """@@ -636,3 +652,3 @@ -    yield _SkipClose(stream), encoding, color  # type: ignore[misc]+    yield KeepOpenFile(stream), encoding, color  # type: ignore[misc] 
src/click/core.py +142 lines
--- +++ @@ -50,2 +50,4 @@ if t.TYPE_CHECKING:+    from typing_extensions import Self+     from .shell_completion import CompletionItem@@ -119,3 +121,3 @@     ctx: Context, param: Parameter | None = None-) -> cabc.Iterator[None]:+) -> cabc.Generator[None]:     """Context manager that attaches extra information to exceptions."""@@ -305,2 +307,30 @@ +    parent: Context | None+    command: Command+    info_name: str | None+    params: dict[str, t.Any]+    args: list[str]+    _protected_args: list[str]+    _opt_prefixes: set[str]+    obj: t.Any+    _meta: dict[str, t.Any]+    default_map: cabc.MutableMapping[str, t.Any] | None+    invoked_subcommand: str | None+    terminal_width: int | None+    max_content_width: int | None+    allow_extra_args: bool+    allow_interspersed_args: bool+    ignore_unknown_options: bool+    help_option_names: list[str]+    token_normalize_func: t.Callable[[str], str] | None+    resilient_parsing: bool+    auto_envvar_prefix: str | None+    color: bool | None+    show_default: bool | None+    _close_callbacks: list[t.Callable[[], t.Any]]+    _depth: int+    _parameter_source: dict[str, ParameterSource]+    _param_default_explicit: dict[str, bool]+    _exit_stack: ExitStack+     def __init__(@@ -332,5 +362,5 @@         #: with ``expose_value=False`` are not stored.-        self.params: dict[str, t.Any] = {}+        self.params = {}         #: the leftover arguments.-        self.args: list[str] = []+        self.args = []         #: protected arguments.  These are arguments that are prepended@@ -339,5 +369,5 @@         #: to implement nested parsing.-        self._protected_args: list[str] = []+        self._protected_args = []         #: the collected prefixes of the command's options.-        self._opt_prefixes: set[str] = set(parent._opt_prefixes) if parent else set()+        self._opt_prefixes = set(parent._opt_prefixes) if parent else set() @@ -347,4 +377,4 @@         #: the user object stored.-        self.obj: t.Any = obj-        self._meta: dict[str, t.Any] = getattr(parent, "meta", {})+        self.obj = obj+        self._meta = getattr(parent, "meta", {}) @@ -359,3 +389,3 @@ -        self.default_map: cabc.MutableMapping[str, t.Any] | None = default_map+        self.default_map = default_map @@ -371,3 +401,3 @@         #: should use a :func:`result_callback`.-        self.invoked_subcommand: str | None = None+        self.invoked_subcommand = None @@ -377,3 +407,3 @@         #: The width of the terminal (None is autodetection).-        self.terminal_width: int | None = terminal_width+        self.terminal_width = terminal_width @@ -384,3 +414,3 @@         #: default which is 80 for most things).-        self.max_content_width: int | None = max_content_width+        self.max_content_width = max_content_width @@ -402,3 +432,3 @@         #: .. versionadded:: 3.0-        self.allow_interspersed_args: bool = allow_interspersed_args+        self.allow_interspersed_args = allow_interspersed_args @@ -415,3 +445,3 @@         #: .. versionadded:: 4.0-        self.ignore_unknown_options: bool = ignore_unknown_options+        self.ignore_unknown_options = ignore_unknown_options @@ -424,3 +454,3 @@         #: The names for the help options.-        self.help_option_names: list[str] = help_option_names+        self.help_option_names = help_option_names @@ -431,3 +461,3 @@         #: options, choices, commands etc.-        self.token_normalize_func: t.Callable[[str], str] | None = token_normalize_func+        self.token_normalize_func = token_normalize_func @@ -436,3 +466,3 @@         #: will be ignored. Useful for completion.-        self.resilient_parsing: bool = resilient_parsing+        self.resilient_parsing = resilient_parsing @@ -456,3 +486,3 @@ -        self.auto_envvar_prefix: str | None = auto_envvar_prefix+        self.auto_envvar_prefix = auto_envvar_prefix @@ -462,3 +492,3 @@         #: Controls if styling output is wanted or not.-        self.color: bool | None = color+        self.color = color @@ -468,7 +498,7 @@         #: Show option default values when formatting help text.-        self.show_default: bool | None = show_default--        self._close_callbacks: list[t.Callable[[], t.Any]] = []+        self.show_default = show_default++        self._close_callbacks = []         self._depth = 0-        self._parameter_source: dict[str, ParameterSource] = {}+        self._parameter_source = {}         # Tracks whether the option that currently owns each parameter slot in@@ -478,3 +508,3 @@         # Refs: https://github.com/pallets/click/issues/3403-        self._param_default_explicit: dict[str, bool] = {}+        self._param_default_explicit = {}         self._exit_stack = ExitStack()@@ -514,3 +544,3 @@ -    def __enter__(self) -> Context:+    def __enter__(self) -> Self:         self._depth += 1@@ -534,3 +564,3 @@     @contextmanager-    def scope(self, cleanup: bool = True) -> cabc.Iterator[Context]:+    def scope(self, cleanup: bool = True) -> cabc.Generator[Context]:         """This helper method can be used with the context object to promote@@ -987,2 +1017,16 @@ +    name: str | None+    context_settings: cabc.MutableMapping[str, t.Any]+    callback: t.Callable[..., t.Any] | None+    params: list[Parameter]+    help: str | None+    epilog: str | None+    options_metavar: str | None+    short_help: str | None+    add_help_option: bool+    _help_option: Option | None+    no_args_is_help: bool+    hidden: bool+    deprecated: bool | str+     def __init__(@@ -1012,3 +1056,3 @@         #: an optional dictionary with defaults passed to the context.-        self.context_settings: cabc.MutableMapping[str, t.Any] = context_settings+        self.context_settings = context_settings @@ -1020,3 +1064,3 @@         #: will automatically be handled before non eager ones.-        self.params: list[Parameter] = params or []+        self.params = params or []         self.help = help@@ -1191,3 +1235,4 @@         if self.deprecated:-            text = f"{_(text)} {_format_deprecated_label(self.deprecated)}"+            label = _format_deprecated_label(self.deprecated)+            text = f"{_(text)} {label}" if text else label @@ -1594,2 +1639,8 @@ +    commands: cabc.MutableMapping[str, Command]+    invoke_without_command: bool+    subcommand_metavar: str+    chain: bool+    _result_callback: t.Callable[..., t.Any] | None+     def __init__(@@ -1615,3 +1666,3 @@         #: The registered subcommands by their exported names.-        self.commands: cabc.MutableMapping[str, Command] = commands+        self.commands = commands @@ -1624,4 +1675,11 @@         if subcommand_metavar is None:+            # When the group can run without a subcommand, the leading command+            # token is optional, so wrap it in brackets to reflect that.             if chain:-                subcommand_metavar = "COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]..."+                if invoke_without_command:+                    subcommand_metavar = "[COMMAND1] [ARGS]... [COMMAND2 [ARGS]...]..."+                else:+                    subcommand_metavar = "COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]..."+            elif invoke_without_command:+                subcommand_metavar = "[COMMAND] [ARGS]..."             else:@@ -2014,2 +2072,4 @@ +    sources: list[Group]+     def __init__(@@ -2022,3 +2082,3 @@         #: The list of registered groups.-        self.sources: list[Group] = sources or []+        self.sources = sources or [] @@ -2054,3 +2114,3 @@ -def _check_iter(value: t.Any) -> cabc.Iterator[t.Any]:+def _check_iter(value: cabc.Iterable[V]) -> cabc.Iterator[V]:     """Check if the value is iterable but not a string. Raises a type@@ -2157,2 +2217,21 @@ +    name: str+    opts: list[str]+    secondary_opts: list[str]+    # `Parameter.type` is annotated in `__init__` to avoid confusing mypy+    required: bool+    callback: t.Callable[[Context, Parameter, t.Any], t.Any] | None+    nargs: int+    multiple: bool+    expose_value: bool+    default: t.Any | t.Callable[[], t.Any] | None+    _default_explicit: bool+    is_eager: bool+    metavar: str | None+    envvar: str | cabc.Sequence[str] | None+    _custom_shell_complete: (+        t.Callable[[Context, Parameter, str], list[CompletionItem] | list[str]] | None+    )+    deprecated: bool | str+     def __init__(@@ -2186,5 +2265,2 @@     ) -> None:-        self.name: str-        self.opts: list[str]-        self.secondary_opts: list[str]
… 65 more lines (truncated)
src/click/decorators.py +30 lines
--- +++ @@ -436,4 +436,7 @@     If ``package_name`` is not provided, Click will try to detect it by-    inspecting the stack frames. This will be used to detect the-    version, so it must match the name of the installed package.+    inspecting the stack frames. If the detected (or given) name does+    not match an installed distribution, Click resolves it as an import+    (top-level module) name via+    :func:`importlib.metadata.packages_distributions`, so e.g. ``PIL``+    resolves to the ``Pillow`` distribution. @@ -462,2 +465,6 @@         package name, or be passed with ``package_name=``.++    .. versionchanged:: 8.4.2+        When ``package_name`` does not match an installed distribution,+        Click now resolves it as an import (top-level module).     """@@ -489,2 +496,3 @@         nonlocal version+        nonlocal package_name @@ -499,6 +507,22 @@             except importlib.metadata.PackageNotFoundError:-                raise RuntimeError(-                    f"{package_name!r} is not installed. Try passing"-                    " 'package_name' instead."-                ) from None+                # The given name didn't match an installed distribution.+                # Try resolving it as an import (top-level module) name,+                # e.g. ``PIL`` is provided by the ``Pillow`` distribution.+                distributions = importlib.metadata.packages_distributions().get(+                    package_name, []+                )+                if len(distributions) == 1:+                    package_name = distributions[0]+                    version = importlib.metadata.version(package_name)+                elif len(distributions) > 1:+                    raise RuntimeError(+                        f"{package_name!r} maps to multiple installed"+                        f" distributions ({', '.join(distributions)})."+                        " Pass 'package_name' to disambiguate."+                    ) from None+                else:+                    raise RuntimeError(+                        f"{package_name!r} is not installed. Try passing"+                        " 'package_name' instead."+                    ) from None 
src/click/exceptions.py +42 lines
--- +++ @@ -38,3 +38,6 @@     #: The exit code for this exception.-    exit_code = 1+    exit_code: t.ClassVar[int] = 1++    show_color: t.Final[bool | None]+    message: t.Final[str] @@ -44,3 +47,3 @@         # the color settings here to be used later on (in `show`)-        self.show_color: bool | None = resolve_color_default()+        self.show_color = resolve_color_default()         self.message = message@@ -73,3 +76,6 @@ -    exit_code = 2+    exit_code: t.ClassVar[int] = 2++    ctx: Context | None+    cmd: t.Final[Command | None] @@ -78,3 +84,3 @@         self.ctx = ctx-        self.cmd: Command | None = self.ctx.command if self.ctx else None+        self.cmd = self.ctx.command if self.ctx else None @@ -125,2 +131,5 @@ +    param: Parameter | None+    param_hint: cabc.Sequence[str] | str | None+     def __init__(@@ -160,2 +169,4 @@     """++    param_type: t.Final[str | None] @@ -226,2 +237,5 @@ +    option_name: t.Final[str]+    possibilities: t.Final[list[str] | None]+     def __init__(@@ -238,3 +252,3 @@         self.option_name = option_name-        self.possibilities: list[str] | None = None+         if possibilities:@@ -242,3 +256,6 @@ -            self.possibilities = get_close_matches(option_name, possibilities)+            possibilities_ = get_close_matches(option_name, possibilities)+        else:+            possibilities_ = None+        self.possibilities = possibilities_ @@ -255,2 +272,5 @@     """++    command_name: t.Final[str]+    possibilities: t.Final[list[str] | None] @@ -268,3 +288,3 @@         self.command_name = command_name-        self.possibilities: list[str] | None = None+         if possibilities:@@ -272,3 +292,6 @@ -            self.possibilities = get_close_matches(command_name, possibilities)+            possibilities_ = get_close_matches(command_name, possibilities)+        else:+            possibilities_ = None+        self.possibilities = possibilities_ @@ -290,2 +313,4 @@ +    option_name: t.Final[str]+     def __init__(@@ -307,4 +332,5 @@ class NoArgsIsHelpError(UsageError):+    ctx: Context+     def __init__(self, ctx: Context) -> None:-        self.ctx: Context         super().__init__(ctx.get_help(), ctx=ctx)@@ -317,2 +343,5 @@     """Raised if a file cannot be opened."""++    ui_filename: t.Final[str]+    filename: t.Final[str] @@ -323,3 +352,3 @@         super().__init__(hint)-        self.ui_filename: str = format_filename(filename)+        self.ui_filename = format_filename(filename)         self.filename = filename@@ -345,3 +374,5 @@ +    exit_code: t.Final[int]+     def __init__(self, code: int = 0) -> None:-        self.exit_code: int = code+        self.exit_code = code
src/click/formatting.py +11 lines
--- +++ @@ -121,2 +121,7 @@ +    indent_increment: int+    width: int+    current_indent: int+    buffer: list[str]+     def __init__(@@ -137,4 +142,4 @@         self.width = width-        self.current_indent: int = 0-        self.buffer: list[str] = []+        self.current_indent = 0+        self.buffer = [] @@ -225,3 +230,3 @@         self,-        rows: cabc.Sequence[tuple[str, str]],+        rows: cabc.Iterable[tuple[str, str]],         col_max: int = 30,@@ -268,3 +273,3 @@     @contextmanager-    def section(self, name: str) -> cabc.Iterator[None]:+    def section(self, name: str) -> cabc.Generator[None]:         """Helpful context manager that writes a paragraph, a heading,@@ -283,3 +288,3 @@     @contextmanager-    def indentation(self) -> cabc.Iterator[None]:+    def indentation(self) -> cabc.Generator[None]:         """A context manager that increases the indentation."""@@ -296,3 +301,3 @@ -def join_options(options: cabc.Sequence[str]) -> tuple[str, bool]:+def join_options(options: cabc.Iterable[str]) -> tuple[str, bool]:     """Given a list of option strings this joins them in the most appropriate
src/click/shell_completion.py +69 lines
--- +++ @@ -24,3 +24,3 @@     instruction: str,-) -> int:+) -> t.Literal[0, 1]:     """Perform shell completion for the given CLI program.@@ -57,3 +57,12 @@ -class CompletionItem:+if t.TYPE_CHECKING:+    from typing_extensions import TypeVar++    # `Any` is used as default for backwards compatibility (instead of e.g. `str`)+    _ValueT_co = TypeVar("_ValueT_co", covariant=True, default=t.Any)+else:+    _ValueT_co = t.TypeVar("_ValueT_co", covariant=True)+++class CompletionItem(t.Generic[_ValueT_co]):     """Represents a completion value and metadata about the value. The@@ -80,3 +89,3 @@         self,-        value: t.Any,+        value: _ValueT_co,         type: str = "plain",@@ -85,3 +94,3 @@     ) -> None:-        self.value: t.Any = value+        self.value: _ValueT_co = value         self.type: str = type@@ -183,3 +192,3 @@     for completion in $response;-        set -l metadata (string split \n $completion);+        set -l metadata (string split "," $completion); @@ -190,7 +199,3 @@         else if test $metadata[1] = "plain";-            if test $metadata[3] != "_";-                echo $metadata[2]\t$metadata[3];-            else;-                echo $metadata[2];-            end;+            echo $metadata[2];         end;@@ -202,2 +207,8 @@ """+++class _SourceVarsDict(t.TypedDict):+    complete_func: str+    complete_var: str+    prog_name: str @@ -227,2 +238,7 @@     """++    cli: Command+    ctx_args: cabc.MutableMapping[str, t.Any]+    prog_name: str+    complete_var: str @@ -248,3 +264,3 @@ -    def source_vars(self) -> dict[str, t.Any]:+    def source_vars(self) -> _SourceVarsDict:         """Vars for formatting :attr:`source_template`.@@ -275,3 +291,5 @@ -    def get_completions(self, args: list[str], incomplete: str) -> list[CompletionItem]:+    def get_completions(+        self, args: list[str], incomplete: str+    ) -> list[CompletionItem[str]]:         """Determine the context and last complete command or parameter@@ -287,3 +305,3 @@ -    def format_completion(self, item: CompletionItem) -> str:+    def format_completion(self, item: CompletionItem[str]) -> str:         """Format a completion item into the form recognized by the@@ -311,4 +329,4 @@ -    name = "bash"-    source_template = _SOURCE_BASH+    name: t.ClassVar[str] = "bash"+    source_template: t.ClassVar[str] = _SOURCE_BASH @@ -363,3 +381,3 @@ -    def format_completion(self, item: CompletionItem) -> str:+    def format_completion(self, item: CompletionItem[t.Any]) -> str:         return f"{item.type},{item.value}"@@ -370,4 +388,4 @@ -    name = "zsh"-    source_template = _SOURCE_ZSH+    name: t.ClassVar[str] = "zsh"+    source_template: t.ClassVar[str] = _SOURCE_ZSH @@ -385,3 +403,3 @@ -    def format_completion(self, item: CompletionItem) -> str:+    def format_completion(self, item: CompletionItem[str]) -> str:         help_ = item.help or "_"@@ -406,4 +424,4 @@ -    name = "fish"-    source_template = _SOURCE_FISH+    name: t.ClassVar[str] = "fish"+    source_template: t.ClassVar[str] = _SOURCE_FISH @@ -423,23 +441,20 @@ -    def format_completion(self, item: CompletionItem) -> str:-        """-        .. versionchanged:: 8.4.0-            Escape newlines in value and help to fix completion errors with-            multi-line help strings.-        """-        # The fish completion script splits each response line on literal-        # newlines, so any newline in the value or help would corrupt the-        # frame. Replace them with the two-character escape "\n" so the text-        # round-trips through fish without breaking the format. The "_"-        # sentinel for missing help mirrors :class:`ZshComplete`.-        help_ = item.help or "_"-        value = item.value.replace("\n", r"\n")-        help_escaped = help_.replace("\n", r"\n")-        return f"{item.type}\n{value}\n{help_escaped}"---ShellCompleteType = t.TypeVar("ShellCompleteType", bound="type[ShellComplete]")---_available_shells: dict[str, type[ShellComplete]] = {+    def format_completion(self, item: CompletionItem[str]) -> str:+        """+        .. versionchanged:: 8.4.2+            Escape newlines and replace tabs with spaces in the help text to+            fix completion errors with multi-line help strings.+        """+        # According to https://fishshell.com/docs/current/cmds/complete.html+        # Command substitutions found in ARGUMENTS should return a newline-+        # separated list of arguments, and each argument may optionally have a tab+        # character followed by the argument description.+        if item.help:+            help_ = item.help.replace("\n", "\\n").replace("\t", " ")+            return f"{item.type},{item.value}\t{help_}"++        return f"{item.type},{item.value}"+++_available_shells: t.Final[dict[str, type[ShellComplete]]] = {     "bash": BashComplete,@@ -449,6 +464,8 @@ +_ShellCompleteT = t.TypeVar("_ShellCompleteT", bound="ShellComplete")+  def add_completion_class(-    cls: ShellCompleteType, name: str | None = None-) -> ShellCompleteType:+    cls: type[_ShellCompleteT], name: str | None = None+) -> type[_ShellCompleteT]:     """Register a :class:`ShellComplete` subclass under the given name.@@ -470,2 +487,10 @@ [email protected]+def get_completion_class(shell: t.Literal["bash"]) -> type[BashComplete]: ...[email protected]+def get_completion_class(shell: t.Literal["fish"]) -> type[FishComplete]: ...[email protected]+def get_completion_class(shell: t.Literal["zsh"]) -> type[ZshComplete]: ...[email protected]+def get_completion_class(shell: str) -> type[ShellComplete] | None: ... def get_completion_class(shell: str) -> type[ShellComplete] | None:
src/click/termui.py +4 lines
--- +++ @@ -348,2 +348,6 @@             pager.write(text)+            # Flush after each write so a slow generator streams to the pager+            # incrementally rather than staying invisible until the pipe buffer+            # fills (~8 KB).+            pager.flush() 
src/click/testing.py +51 lines
--- +++ @@ -24,3 +24,7 @@ -CaptureMode = t.Literal["sys", "fd"]+if sys.platform == "win32":+    CaptureMode: t.TypeAlias = t.Literal["sys"]  # pyright: ignore[reportRedeclaration]+else:+    CaptureMode: t.TypeAlias = t.Literal["sys", "fd"]  # pyright: ignore[reportRedeclaration]+ExceptionInfo: t.TypeAlias = tuple[type[BaseException], BaseException, TracebackType] @@ -28,2 +32,6 @@ class EchoingStdin:+    _input: t.BinaryIO+    _output: t.BinaryIO+    _paused: bool+     def __init__(self, input: t.BinaryIO, output: t.BinaryIO) -> None:@@ -62,3 +70,3 @@ @contextlib.contextmanager-def _pause_echo(stream: EchoingStdin | None) -> cabc.Iterator[None]:+def _pause_echo(stream: EchoingStdin | None) -> cabc.Generator[None]:     if stream is None:@@ -82,6 +90,10 @@ +    _targetfd: int+    saved_fd: int+    _tmpfile: t.BinaryIO | None+     def __init__(self, targetfd: int) -> None:         self._targetfd = targetfd-        self.saved_fd: int = -1-        self._tmpfile: t.BinaryIO | None = None+        self.saved_fd = -1+        self._tmpfile = None @@ -110,2 +122,4 @@ +    copy_to: io.BytesIO+     def __init__(self, copy_to: io.BytesIO) -> None:@@ -131,6 +145,10 @@ +    output: io.BytesIO+    stdout: BytesIOCopy+    stderr: BytesIOCopy+     def __init__(self) -> None:-        self.output: io.BytesIO = io.BytesIO()-        self.stdout: io.BytesIO = BytesIOCopy(copy_to=self.output)-        self.stderr: io.BytesIO = BytesIOCopy(copy_to=self.output)+        self.output = io.BytesIO()+        self.stdout = BytesIOCopy(copy_to=self.output)+        self.stderr = BytesIOCopy(copy_to=self.output) @@ -148,2 +166,6 @@     """++    _name: str+    _mode: str+    _original_fd: int @@ -159,3 +181,3 @@         self._mode = mode-        self._original_fd: int = -1+        self._original_fd = -1 @@ -230,2 +252,11 @@ +    runner: CliRunner+    stdout_bytes: bytes+    stderr_bytes: bytes+    output_bytes: bytes+    return_value: t.Any+    exit_code: int+    exception: BaseException | None+    exc_info: ExceptionInfo | None+     def __init__(@@ -239,5 +270,4 @@         exception: BaseException | None,-        exc_info: tuple[type[BaseException], BaseException, TracebackType]-        | None = None,-    ):+        exc_info: ExceptionInfo | None = None,+    ) -> None:         self.runner = runner@@ -322,2 +352,8 @@     """++    charset: str+    env: cabc.Mapping[str, str | None]+    echo_stdin: bool+    catch_exceptions: bool+    capture: CaptureMode @@ -340,6 +376,6 @@         self.charset = charset-        self.env: cabc.Mapping[str, str | None] = env or {}+        self.env = env or {}         self.echo_stdin = echo_stdin         self.catch_exceptions = catch_exceptions-        self.capture: CaptureMode = capture+        self.capture = capture @@ -367,3 +403,3 @@         color: bool = False,-    ) -> cabc.Iterator[tuple[io.BytesIO, io.BytesIO, io.BytesIO]]:+    ) -> cabc.Generator[tuple[io.BytesIO, io.BytesIO, io.BytesIO]]:         """A context manager that sets up the isolation for invoking of a@@ -707,3 +743,3 @@         self, temp_dir: str | os.PathLike[str] | None = None-    ) -> cabc.Iterator[str]:+    ) -> cabc.Generator[str]:         """A context manager that creates a temporary directory and
src/click/types.py +152 lines
--- +++ @@ -28,3 +28,8 @@ -ParamTypeValue = t.TypeVar("ParamTypeValue")+_ValueT = t.TypeVar("_ValueT")+_ValueT_contra = t.TypeVar("_ValueT_contra", contravariant=True)+_ValueT_co = t.TypeVar("_ValueT_co", covariant=True)++_FloatValueT = t.TypeVar("_FloatValueT", bound=float)+_FloatValueT_co = t.TypeVar("_FloatValueT_co", bound=float, covariant=True) @@ -36,3 +41,3 @@ -class ParamType(t.Generic[ParamTypeValue], abc.ABC):+class ParamType(t.Generic[_ValueT_co], abc.ABC):     """Represents the type of a parameter. Validates and converts values@@ -61,3 +66,3 @@     is_composite: t.ClassVar[bool] = False-    arity: t.ClassVar[int] = 1+    arity: int = 1  # read-only @@ -100,3 +105,3 @@         ctx: Context | None = None,-    ) -> ParamTypeValue | None:+    ) -> _ValueT_co | None:         if value is not None:@@ -117,3 +122,3 @@         self, value: t.Any, param: Parameter | None, ctx: Context | None-    ) -> ParamTypeValue:+    ) -> _ValueT_co:         """Convert the value to the correct type. This is not called if@@ -139,3 +144,3 @@         # metadata are not forced to redeclare ``convert``.-        return t.cast("ParamTypeValue", value)+        return t.cast("_ValueT_co", value) @@ -178,4 +183,4 @@ -class CompositeParamType(ParamType[ParamTypeValue]):-    is_composite = True+class CompositeParamType(ParamType[_ValueT_co]):+    is_composite: t.ClassVar[bool] = True @@ -186,12 +191,25 @@ -class FuncParamTypeInfoDict(ParamTypeInfoDict):-    func: t.Callable[[t.Any], t.Any]---class FuncParamType(ParamType[ParamTypeValue]):-    def __init__(self, func: t.Callable[[t.Any], ParamTypeValue]) -> None:-        self.name: str = func.__name__+if t.TYPE_CHECKING:+    # on Python 3.10 this will raise a TypeError++    class FuncParamTypeInfoDict(+        ParamTypeInfoDict,+        t.Generic[_ValueT_contra, _ValueT_co],+    ):+        func: t.Callable[[_ValueT_contra], _ValueT_co]+else:++    class FuncParamTypeInfoDict(ParamTypeInfoDict):+        func: t.Callable[[t.Any], t.Any]+++class FuncParamType(ParamType[_ValueT_co], t.Generic[_ValueT_contra, _ValueT_co]):+    name: str+    func: t.Callable[[_ValueT_contra], _ValueT_co]++    def __init__(self, func: t.Callable[[_ValueT_contra], _ValueT_co]) -> None:+        self.name = func.__name__         self.func = func -    def to_info_dict(self) -> FuncParamTypeInfoDict:+    def to_info_dict(self) -> FuncParamTypeInfoDict[_ValueT_contra, _ValueT_co]:         return {"func": self.func, **super().to_info_dict()}@@ -199,4 +217,4 @@     def convert(-        self, value: t.Any, param: Parameter | None, ctx: Context | None-    ) -> ParamTypeValue:+        self, value: _ValueT_contra, param: Parameter | None, ctx: Context | None+    ) -> _ValueT_co:         try:@@ -210,3 +228,3 @@                 except UnicodeError:-                    message = value.decode("utf-8", "replace")+                    message = t.cast("bytes", value).decode("utf-8", "replace") @@ -219,4 +237,4 @@     def convert(-        self, value: t.Any, param: Parameter | None, ctx: Context | None-    ) -> t.Any:+        self, value: _ValueT, param: Parameter | None, ctx: Context | None+    ) -> _ValueT:         return value@@ -236,3 +254,3 @@             try:-                value = value.decode(enc)+                return value.decode(enc)             except UnicodeError:@@ -241,8 +259,7 @@                     try:-                        value = value.decode(fs_enc)+                        return value.decode(fs_enc)                     except UnicodeError:-                        value = value.decode("utf-8", "replace")+                        return value.decode("utf-8", "replace")                 else:-                    value = value.decode("utf-8", "replace")-            return value  # type: ignore[no-any-return]+                    return value.decode("utf-8", "replace")         return str(value)@@ -253,8 +270,16 @@ -class ChoiceInfoDict(ParamTypeInfoDict):-    choices: cabc.Sequence[t.Any]-    case_sensitive: bool---class Choice(ParamType[ParamTypeValue], t.Generic[ParamTypeValue]):+if t.TYPE_CHECKING:+    # on Python 3.10 this will raise a TypeError++    class ChoiceInfoDict(ParamTypeInfoDict, t.Generic[_ValueT_co]):+        choices: tuple[_ValueT_co, ...]+        case_sensitive: bool+else:++    class ChoiceInfoDict(ParamTypeInfoDict):+        choices: tuple[t.Any, ...]+        case_sensitive: bool+++class Choice(ParamType[_ValueT_co], t.Generic[_ValueT_co]):     """The choice type allows a value to be checked against a fixed set@@ -286,11 +311,14 @@ -    name = "choice"+    name: str = "choice"++    choices: tuple[_ValueT_co, ...]+    case_sensitive: bool      def __init__(-        self, choices: cabc.Iterable[ParamTypeValue], case_sensitive: bool = True+        self, choices: cabc.Iterable[_ValueT_co], case_sensitive: bool = True     ) -> None:-        self.choices: cabc.Sequence[ParamTypeValue] = tuple(choices)+        self.choices = tuple(choices)         self.case_sensitive = case_sensitive -    def to_info_dict(self) -> ChoiceInfoDict:+    def to_info_dict(self) -> ChoiceInfoDict[_ValueT_co]:         return {@@ -303,3 +331,3 @@         self, ctx: Context | None = None-    ) -> cabc.Mapping[ParamTypeValue, str]:+    ) -> cabc.Mapping[_ValueT_co, str]:         """@@ -319,3 +347,3 @@ -    def normalize_choice(self, choice: ParamTypeValue, ctx: Context | None) -> str:+    def normalize_choice(self, choice: object, ctx: Context | None) -> str:         """@@ -340,3 +368,3 @@     def get_metavar(self, param: Parameter, ctx: Context) -> str | None:-        if param.param_type_name == "option" and not param.show_choices:  # type: ignore+        if param.param_type_name == "option" and not param.show_choices:  # type: ignore[attr-defined]             choice_metavars = [@@ -369,3 +397,3 @@         self, value: t.Any, param: Parameter | None, ctx: Context | None-    ) -> ParamTypeValue:+    ) -> _ValueT_co:         """@@ -458,4 +486,6 @@ +    formats: cabc.Sequence[str]+     def __init__(self, formats: cabc.Sequence[str] | None = None):-        self.formats: cabc.Sequence[str] = formats or [+        self.formats = formats or [             "%Y-%m-%d",@@ -468,3 +498,3 @@ -    def get_metavar(self, param: Parameter, ctx: Context) -> str | None:+    def get_metavar(self, param: Parameter, ctx: Context) -> str:         return f"[{'|'.join(self.formats)}]"@@ -504,8 +534,10 @@ -class _NumberParamTypeBase(ParamType[ParamTypeValue]):-    _number_class: t.Callable[[t.Any], ParamTypeValue]+class _NumberParamTypeBase(+    ParamType[_ValueT_co], t.Generic[_ValueT_contra, _ValueT_co]+):+    _number_class: t.Callable[[_ValueT_contra], _ValueT_co]      def convert(-        self, value: t.Any, param: Parameter | None, ctx: Context | None-    ) -> ParamTypeValue:+        self, value: _ValueT_contra, param: Parameter | None, ctx: Context | None+    ) -> _ValueT_co:         try:@@ -522,5 +554,27 @@ -class NumberRangeInfoDict(ParamTypeInfoDict):-    min: float | None-    max: float | None+if t.TYPE_CHECKING:+    # on Python 3.10 this will raise a TypeError++    class NumberRangeInfoDict(ParamTypeInfoDict, t.Generic[_FloatValueT_co]):+        min: _FloatValueT_co | None+        max: _FloatValueT_co | None+        min_open: bool+        max_open: bool+        clamp: bool+else:++    class NumberRangeInfoDict(ParamTypeInfoDict):+        min: t.Any | None+        max: t.Any | None+        min_open: bool+        max_open: bool+        clamp: bool+++class _NumberRangeBase(+    _NumberParamTypeBase[_ValueT_contra, _FloatValueT_co],+    t.Generic[_ValueT_contra, _FloatValueT_co],+):+    min: _FloatValueT_co | None+    max: _FloatValueT_co | None     min_open: bool@@ -529,8 +583,6 @@ --class _NumberRangeBase(_NumberParamTypeBase[ParamTypeValue]):     def __init__(         self,-        min: float | None = None,-        max: float | None = None,+        min: _FloatValueT_co | None = None,+        max: _FloatValueT_co | None = None,         min_open: bool = False,@@ -545,3 +597,3 @@ -    def to_info_dict(self) -> NumberRangeInfoDict:+    def to_info_dict(self) -> NumberRangeInfoDict[_FloatValueT_co]:
… 158 more lines (truncated)
src/click/utils.py +12 lines
--- +++ @@ -207,2 +207,14 @@ class KeepOpenFile:+    """Proxy a file object but keep it open across a ``with`` block.++    Wraps a borrowed file (such as ``sys.stdin`` or ``sys.stdout``) so that+    leaving a ``with`` block does not close it, as used by :func:`open_file`+    for the ``-`` filename. The caller stays responsible for the file: an+    explicit :meth:`close` still passes through to the wrapped object.++    Dunder methods are proxied explicitly: implicit special-method lookups+    bypass :meth:`__getattr__`, because Python resolves them on the type rather+    than the instance.+    """+     _file: t.IO[t.Any]
tests/test_arguments.py +26 lines
--- +++ @@ -308,2 +308,28 @@ [email protected](+    ("kwargs", "expected"),+    [+        ({}, "FOO"),+        ({"required": True}, "FOO"),+        ({"required": False}, "[FOO]"),+        ({"default": "x"}, "[FOO]"),+        ({"nargs": -1}, "[FOO]..."),+        ({"nargs": -1, "required": True}, "FOO..."),+        ({"nargs": 2}, "FOO..."),+        ({"nargs": 2, "required": False}, "[FOO]..."),+    ],+)+def test_argument_metavar_marks_optional(runner, kwargs, expected):+    """An argument is bracketed in the usage line only when it is optional."""++    @click.command()+    @click.argument("foo", **kwargs)+    def cli(foo):+        pass++    result = runner.invoke(cli, ["--help"])+    assert result.exit_code == 0+    assert result.output.splitlines()[0] == f"Usage: cli [OPTIONS] {expected}"++ @pytest.mark.parametrize("deprecated", [True, "USE B INSTEAD"])
tests/test_basic.py +119 lines
--- +++ @@ -571,2 +571,42 @@ +def test_choice_argument_optional_metavar(runner):+    """Optional Choice arguments reuse the type's brackets instead of doubling.++    Without this the usage line for a ``Choice`` argument with ``nargs=-1`` or+    ``required=False`` rendered as ``[[a|b|c]]``: one pair from ``Choice`` to+    enumerate values, a second pair from ``Argument`` to mark it optional.+    """++    @click.command()+    @click.argument("method", type=click.Choice(["foo", "bar", "baz"]), nargs=-1)+    def cli_variadic(method):+        pass++    @click.command()+    @click.argument("method", type=click.Choice(["foo", "bar", "baz"]), required=False)+    def cli_optional(method):+        pass++    variadic = runner.invoke(cli_variadic, ["--help"]).output+    assert "Usage: cli-variadic [OPTIONS] [foo|bar|baz]...\n" in variadic+    assert "[[foo|bar|baz]]" not in variadic++    optional = runner.invoke(cli_optional, ["--help"]).output+    assert "Usage: cli-optional [OPTIONS] [foo|bar|baz]\n" in optional+    assert "[[foo|bar|baz]]" not in optional+++def test_datetime_argument_optional_metavar(runner):+    """``DateTime`` arguments behave the same way as ``Choice``."""++    @click.command()+    @click.argument("when", type=click.DateTime(formats=["%Y-%m-%d"]), required=False)+    def cli(when):+        pass++    result = runner.invoke(cli, ["--help"])+    assert "Usage: cli [OPTIONS] [%Y-%m-%d]\n" in result.output+    assert "[[%Y-%m-%d]]" not in result.output++ def test_datetime_option_default(runner):@@ -741 +781,80 @@     assert "default: not found" in result.output+++def test_version_option_resolves_import_name_to_distribution(runner, monkeypatch):+    """When ``package_name`` (detected or passed) is an import name that+    differs from its installed distribution name (``PIL`` vs ``Pillow``),+    ``version_option`` resolves it via ``packages_distributions()`` instead+    of raising ``RuntimeError``.+    """+    import importlib.metadata++    def fake_version(name):+        if name == "pillow":+            return "10.4.0"+        raise importlib.metadata.PackageNotFoundError(name)++    monkeypatch.setattr(importlib.metadata, "version", fake_version)+    monkeypatch.setattr(+        importlib.metadata,+        "packages_distributions",+        lambda: {"PIL": ["pillow"]},+    )++    @click.command()+    @click.version_option(package_name="PIL")+    def cli():+        pass++    result = runner.invoke(cli, ["--version"], prog_name="imageapp")+    assert result.exit_code == 0+    assert "10.4.0" in result.output+++def test_version_option_ambiguous_import_name_errors(runner, monkeypatch):+    """When an import name maps to multiple installed distributions, the+    user must disambiguate. The error names the candidates.+    """+    import importlib.metadata++    def fake_version(name):+        raise importlib.metadata.PackageNotFoundError(name)++    monkeypatch.setattr(importlib.metadata, "version", fake_version)+    monkeypatch.setattr(+        importlib.metadata,+        "packages_distributions",+        lambda: {"plug": ["foo-plug", "bar-plug"]},+    )++    @click.command()+    @click.version_option(package_name="plug")+    def cli():+        pass++    result = runner.invoke(cli, ["--version"])+    assert result.exit_code != 0+    msg = str(result.exception)+    assert "multiple installed distributions" in msg+    assert "foo-plug" in msg+    assert "bar-plug" in msg+++def test_version_option_unknown_package_errors(runner, monkeypatch):+    """When the name resolves to no distribution, keep the existing error."""+    import importlib.metadata++    def fake_version(name):+        raise importlib.metadata.PackageNotFoundError(name)++    monkeypatch.setattr(importlib.metadata, "version", fake_version)+    monkeypatch.setattr(importlib.metadata, "packages_distributions", lambda: {})++    @click.command()+    @click.version_option(package_name="nonexistent")+    def cli():+        pass++    result = runner.invoke(cli, ["--version"])+    assert result.exit_code != 0+    assert "not installed" in str(result.exception)
tests/test_commands.py +43 lines
--- +++ @@ -299,2 +299,29 @@     assert result.output == "no subcommand, use default\nin subcommand\n"++[email protected](+    ("chain", "invoke_without_command", "metavar"),+    [+        (False, False, "COMMAND [ARGS]..."),+        (False, True, "[COMMAND] [ARGS]..."),+        (True, False, "COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]..."),+        (True, True, "[COMMAND1] [ARGS]... [COMMAND2 [ARGS]...]..."),+    ],+)+def test_subcommand_metavar_marks_optional(+    runner, chain, invoke_without_command, metavar+):+    """The leading subcommand token is bracketed only when it is optional."""++    @click.group(chain=chain, invoke_without_command=invoke_without_command)+    def cli():+        pass++    @cli.command()+    def sub():+        pass++    result = runner.invoke(cli, ["--help"])+    assert result.exit_code == 0+    assert result.output.splitlines()[0] == f"Usage: cli [OPTIONS] {metavar}" @@ -494,2 +521,18 @@ @pytest.mark.parametrize("deprecated", [True, "USE OTHER COMMAND INSTEAD"])[email protected]("doc", ["", None])+def test_deprecated_empty_help_no_leading_space(runner, doc, deprecated):+    """A command with empty or missing help text must render the deprecation+    label at the normal indentation, without a stray leading space.+    """++    @click.command(deprecated=deprecated, help=doc)+    def cli():+        pass++    out = runner.invoke(cli, ["--help"]).output+    assert "\n  (DEPRECATED" in out+    assert "\n   (DEPRECATED" not in out++[email protected]("deprecated", [True, "USE OTHER COMMAND INSTEAD"]) def test_deprecated_in_invocation(runner, deprecated):
tests/test_options.py +16 lines
--- +++ @@ -58,2 +58,16 @@         assert deprecated in result.output++[email protected](+    ("deprecated", "expected"),+    [(True, "(DEPRECATED)"), ("USE B INSTEAD", "(DEPRECATED: USE B INSTEAD)")],+)[email protected]("help_text", ["", None])+def test_deprecated_empty_help_no_leading_space(help_text, deprecated, expected):+    """An option with empty or missing help text must not gain a stray leading+    space before the deprecation label.+    """+    opt = click.Option(["--foo"], help=help_text, deprecated=deprecated)+    ctx = click.Context(click.Command("cli"))+    assert opt.get_help_record(ctx)[1] == expected @@ -3308,6 +3322,4 @@ -    result = runner.invoke(cli, [])-    assert result.exit_code == 1-    assert isinstance(result.exception, UserWarning)-    assert "used more than once" in str(result.exception)+    with pytest.warns(UserWarning, match="used more than once"):+        runner.invoke(cli, []) 
tests/test_shell_completion.py +10 lines
--- +++ @@ -14,2 +14,3 @@ from click.shell_completion import CompletionItem+from click.shell_completion import FishComplete from click.shell_completion import shell_complete@@ -361,5 +362,5 @@         ("zsh", {"COMP_WORDS": "a b", "COMP_CWORD": "1"}, "plain\nb\nbee\n"),-        ("fish", {"COMP_WORDS": "", "COMP_CWORD": ""}, "plain\na\n_\nplain\nb\nbee\n"),-        ("fish", {"COMP_WORDS": "a b", "COMP_CWORD": "b"}, "plain\nb\nbee\n"),-        ("fish", {"COMP_WORDS": 'a "b', "COMP_CWORD": '"b'}, "plain\nb\nbee\n"),+        ("fish", {"COMP_WORDS": "", "COMP_CWORD": ""}, "plain,a\nplain,b\tbee\n"),+        ("fish", {"COMP_WORDS": "a b", "COMP_CWORD": "b"}, "plain,b\tbee\n"),+        ("fish", {"COMP_WORDS": 'a "b', "COMP_CWORD": '"b'}, "plain,b\tbee\n"),     ],@@ -580,46 +581,7 @@ [email protected]("_patch_for_completion")-def test_fish_multiline_help_complete(runner):-    """Test Fish completion with multi-line help text doesn't cause errors."""-    cli = Command(-        "cli",-        params=[-            Option(-                ["--at", "--attachment-type"],-                type=(str, str),-                multiple=True,-                help=(-                    "\b\nAttachment with explicit mimetype,\n--at image.jpg image/jpeg"-                ),-            ),-            Option(["--other"], help="Normal help"),-        ],-    )--    result = runner.invoke(-        cli,-        env={-            "COMP_WORDS": "cli --",-            "COMP_CWORD": "--",-            "_CLI_COMPLETE": "fish_complete",-        },-    )--    # Should not fail-    assert result.exit_code == 0--    # Output should contain escaped newlines, not literal newlines-    # Fish expects: plain\n--at\n{help_with_\\n}-    lines = result.output.split("\n")--    # Find the --at completion block (3 lines: type, value, help)-    for i in range(0, len(lines) - 2, 3):-        if lines[i] == "plain" and lines[i + 1] in ("--at", "--attachment-type"):-            help_line = lines[i + 2]-            # Help should have escaped newlines (\\n), not actual newlines-            assert "\\n" in help_line-            # Should contain the example text-            assert "image.jpg" in help_line.replace("\\n", " ")-            break-    else:-        pytest.fail("--at completion not found in output")+def test_fish_format_completion_escapes_help():+    fc = FishComplete(Command("x"), {}, "x", "_X_COMPLETE")+    item = CompletionItem("--at", help="first\nsecond\tthird")+    # The newline is escaped to the literal characters backslash-n and the tab+    # becomes a space, so each completion stays on one line for fish.+    assert fc.format_completion(item) == "plain,--at\tfirst\\nsecond third"
tests/test_stream_lifecycle.py +3 lines
--- +++ @@ -486,3 +486,5 @@ # These are marked with ``pytest.mark.stress`` so they can be included or-# excluded independently. The CI workflow runs them in a separate job.+# excluded independently. The ``tox -e stress`` env collects every+# ``pytest.mark.stress`` test across the suite (not just this file), so+# stress regressions for other components live alongside their unit tests. # ---------------------------------------------------------------------------
tests/test_termui.py +94 lines
--- +++ @@ -1,2 +1,3 @@ import contextlib+import gc import io@@ -728,2 +729,40 @@ +def test_echo_via_pager_streams_each_write(monkeypatch):+    """Each write is flushed so a slow generator streams to the pager+    incrementally instead of buffering until the end (issues #3242, #2542).+    """+    calls = []++    class RecordingStream(io.StringIO):+        def __init__(self):+            super().__init__()+            self.color = None++        def write(self, s):+            calls.append("write")+            return super().write(s)++        def flush(self):+            calls.append("flush")++    stream = RecordingStream()+    monkeypatch.setattr(click._termui_impl, "isatty", lambda _: False)+    monkeypatch.setattr(click._termui_impl, "_default_text_stdout", lambda: stream)++    def generate():+        yield "a\n"+        yield "b\n"+        yield "c\n"++    click.echo_via_pager(generate())++    # No two writes are adjacent: every chunk is flushed before the next one,+    # so the pager sees output as it is produced.+    assert not any(+        calls[i] == "write" and calls[i + 1] == "write" for i in range(len(calls) - 1)+    )+    assert calls.count("write") == 4  # three chunks plus the trailing newline+    assert stream.getvalue() == "a\nb\nc\n\n"++ def test_get_pager_file_pager_missing_binary_falls_back(monkeypatch, tmp_path):@@ -768,2 +807,57 @@     assert pager_out.read_text(encoding="utf-8") == "hello\n"+++def test_get_pager_file_missing_pager_keeps_borrowed_stream_open(monkeypatch):+    """A missing ``PAGER`` must not close the borrowed stdout (issue #3449).++    The ``8.4.0`` regression was only fixed for the no-tty ``_nullpager`` path;+    the ``_pipepager``/``_tempfilepager`` fallbacks (reached in a tty when+    ``PAGER`` resolves to nothing) used to close the borrowed stream too.+    """+    buffer = io.BytesIO()+    stream = io.TextIOWrapper(buffer, encoding="utf-8")++    monkeypatch.setitem(+        click._termui_impl.os.environ,+        "PAGER",+        "click-tests-nonexistent-pager-9b3f2",+    )+    monkeypatch.setattr(click._termui_impl, "isatty", lambda _: True)+    monkeypatch.setattr(click._termui_impl, "_default_text_stdout", lambda: stream)++    with click.get_pager_file() as pager:+        pager.write("hello\n")++    # Drop the wrapper reference and force finalization: the old bug closed the+    # borrowed buffer when the TextIOWrapper built by get_pager_file was+    # garbage-collected.+    del pager+    gc.collect()++    assert not buffer.closed+    assert not stream.closed+    assert buffer.getvalue().replace(b"\r\n", b"\n") == b"hello\n"+++def test_echo_via_pager_tty_pager_missing(runner, monkeypatch):+    """``echo_via_pager`` through the tty fallback keeps ``CliRunner`` working.++    Regression for issue #3449 via the pager fallback: a tty with ``PAGER``+    pointing at a missing binary used to close the runner's stdout, breaking+    ``CliRunner.invoke``.+    """+    monkeypatch.setattr(click._termui_impl, "isatty", lambda _: True)+    monkeypatch.setitem(+        click._termui_impl.os.environ,+        "PAGER",+        "click-tests-nonexistent-pager-9b3f2",+    )++    @click.command()+    def cli():+        click.echo_via_pager("Hello, Click!")++    result = runner.invoke(cli)+    assert not result.exception+    assert result.output == "Hello, Click!\n" 
tests/test_types.py +15 lines
--- +++ @@ -245,9 +245,18 @@ def test_file_surrogates(type, tmp_path):+    """Ensures that the error handling in ``click.File`` is robust.++    ``EILSEQ`` shows up with rootless Podman (FUSE-backed paths) and on filesystems+    that reject non-UTF-8 names, like ZFS with ``utf8only=on``.++    See: https://github.com/pallets/click/issues/2634+    """     path = tmp_path / "\udcff"--    # - common case: �': No such file or directory-    # - special case: Illegal byte sequence-    # The special case is seen with rootless Podman. The root cause is most-    # likely that the path is handled by a user-space program (FUSE).-    match = r"(�': No such file or directory|Illegal byte sequence)"+    match = (+        # Common case: �': No such file or directory.+        r"(�': No such file or directory"+        # BSD/macOS libc special case (EILSEQ).+        r"|Illegal byte sequence"+        # glibc special case (EILSEQ).+        r"|Invalid or incomplete multibyte or wide character)"+    )     with pytest.raises(click.BadParameter, match=match):
cryptography pypi
49.0.0 29d ago incident on record
critical-tier YANK ×3BURST ×2
latest 49.0.0 versions 157 maintainers 1 critical-tier (snapshotted)
46.0.0
46.0.1
46.0.2
46.0.3
46.0.4
46.0.5
46.0.6
46.0.7
47.0.0
48.0.0
48.0.1
49.0.0
YANK
37.0.3 marked yanked (still downloadable)
high · registry-verified · 2022-06-21 · 4y ago
YANK
38.0.2 marked yanked (still downloadable)
high · registry-verified · 2022-10-11 · 3y ago
YANK
45.0.0 marked yanked (still downloadable)
high · registry-verified · 2025-05-17 · 1y ago
BURST
2 releases in 46m: 2.4, 2.4.1
info · registry-verified · 2018-11-12 · 7y ago
BURST
2 releases in 53m: 45.0.0, 45.0.1
info · registry-verified · 2025-05-17 · 1y ago
release diff 48.0.1 → 49.0.0
+117 added · -479 removed · ~0 modified
new files touching dangerous APIs: cryptography/hazmat/primitives/twofactor/hotp.py
+54 more files not shown
cryptography/hazmat/primitives/twofactor/hotp.py +101 lines · 1 flagged
--- +++ @@ -0,0 +1,101 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++import base64+import typing+from urllib.parse import quote, urlencode++from cryptography.hazmat.primitives import constant_time, hmac+from cryptography.hazmat.primitives.hashes import SHA1, SHA256, SHA512+from cryptography.hazmat.primitives.twofactor import InvalidToken+from cryptography.utils import Buffer++HOTPHashTypes = typing.Union[SHA1, SHA256, SHA512]+++def _generate_uri(+    hotp: HOTP,+    type_name: str,+    account_name: str,+    issuer: str | None,+    extra_parameters: list[tuple[str, int]],+) -> str:+    parameters = [+        ("digits", hotp._length),+        ("secret", base64.b32encode(hotp._key)),+        ("algorithm", hotp._algorithm.name.upper()),+    ]++    if issuer is not None:+        parameters.append(("issuer", issuer))++    parameters.extend(extra_parameters)++    label = (+        f"{quote(issuer)}:{quote(account_name)}"+        if issuer+        else quote(account_name)+    )+    return f"otpauth://{type_name}/{label}?{urlencode(parameters)}"+++class HOTP:+    def __init__(+        self,+        key: Buffer,+        length: int,+        algorithm: HOTPHashTypes,+        backend: typing.Any = None,+        enforce_key_length: bool = True,+    ) -> None:+        if len(key) < 16 and enforce_key_length is True:+            raise ValueError("Key length has to be at least 128 bits.")++        if not isinstance(length, int):+            raise TypeError("Length parameter must be an integer type.")++        if length < 6 or length > 8:+            raise ValueError("Length of HOTP has to be between 6 and 8.")++        if not isinstance(algorithm, (SHA1, SHA256, SHA512)):+            raise TypeError("Algorithm must be SHA1, SHA256 or SHA512.")++        self._key = key+        self._length = length+        self._algorithm = algorithm++    def generate(self, counter: int) -> bytes:+        if not isinstance(counter, int):+            raise TypeError("Counter parameter must be an integer type.")++        truncated_value = self._dynamic_truncate(counter)+        hotp = truncated_value % (10**self._length)+        return "{0:0{1}}".format(hotp, self._length).encode()++    def verify(self, hotp: bytes, counter: int) -> None:+        if not constant_time.bytes_eq(self.generate(counter), hotp):+            raise InvalidToken("Supplied HOTP value does not match.")++    def _dynamic_truncate(self, counter: int) -> int:+        ctx = hmac.HMAC(self._key, self._algorithm)++        try:+            ctx.update(counter.to_bytes(length=8, byteorder="big"))+        except OverflowError:+            raise ValueError(f"Counter must be between 0 and {2**64 - 1}.")++        hmac_value = ctx.finalize()++        offset = hmac_value[len(hmac_value) - 1] & 0b1111+        p = hmac_value[offset : offset + 4]+        return int.from_bytes(p, byteorder="big") & 0x7FFFFFFF++    def get_provisioning_uri(+        self, account_name: str, counter: int, issuer: str | None+    ) -> str:+        return _generate_uri(+            self, "hotp", account_name, issuer, [("counter", int(counter))]+        )
cryptography-49.0.0.dist-info/sboms/cryptography-rust.cyclonedx.json +1365 lines
--- +++ @@ -0,0 +1,1365 @@+{+  "bomFormat": "CycloneDX",+  "specVersion": "1.5",+  "version": 1,+  "serialNumber": "urn:uuid:1084bdfc-45ca-417b-b741-2d95f25688a3",+  "metadata": {+    "timestamp": "2026-06-12T19:53:29.923247312Z",+    "tools": [+      {+        "vendor": "CycloneDX",+        "name": "cargo-cyclonedx",+        "version": "0.5.9"+      }+    ],+    "authors": [+      {+        "name": "The cryptography developers",+        "email": "[email protected]"+      }+    ],+    "component": {+      "type": "library",+      "bom-ref": "path+file:///__w/cryptography/cryptography/tmpwheelhouse/.tmpG3FeY2/cryptography-49.0.0/src/rust#[email protected]",+      "author": "The cryptography developers <[email protected]>",+      "name": "cryptography-rust",+      "version": "0.49.0",+      "scope": "required",+      "licenses": [+        {+          "expression": "Apache-2.0 OR BSD-3-Clause"+        }+      ],+      "purl": "pkg:cargo/[email protected]?download_url=file://.",+      "components": [+        {+          "type": "library",+          "bom-ref": "path+file:///__w/cryptography/cryptography/tmpwheelhouse/.tmpG3FeY2/cryptography-49.0.0/src/rust#[email protected] bin-target-0",+          "name": "cryptography_rust",+          "version": "0.49.0",+          "purl": "pkg:cargo/[email protected]?download_url=file://.#src/lib.rs"+        }+      ]+    },+    "properties": [+      {+        "name": "cdx:rustc:sbom:target:all_targets",+        "value": "true"+      }+    ]+  },+  "components": [+    {+      "type": "library",+      "bom-ref": "path+file:///__w/cryptography/cryptography/tmpwheelhouse/.tmpG3FeY2/cryptography-49.0.0/src/rust/cryptography-cffi#0.49.0",+      "author": "The cryptography developers <[email protected]>",+      "name": "cryptography-cffi",+      "version": "0.49.0",+      "scope": "required",+      "licenses": [+        {+          "expression": "Apache-2.0 OR BSD-3-Clause"+        }+      ],+      "purl": "pkg:cargo/[email protected]?download_url=file://cryptography-cffi"+    },+    {+      "type": "library",+      "bom-ref": "path+file:///__w/cryptography/cryptography/tmpwheelhouse/.tmpG3FeY2/cryptography-49.0.0/src/rust/cryptography-crypto#0.49.0",+      "author": "The cryptography developers <[email protected]>",+      "name": "cryptography-crypto",+      "version": "0.49.0",+      "scope": "required",+      "licenses": [+        {+          "expression": "Apache-2.0 OR BSD-3-Clause"+        }+      ],+      "purl": "pkg:cargo/[email protected]?download_url=file://cryptography-crypto"+    },+    {+      "type": "library",+      "bom-ref": "path+file:///__w/cryptography/cryptography/tmpwheelhouse/.tmpG3FeY2/cryptography-49.0.0/src/rust/cryptography-keepalive#0.49.0",+      "author": "The cryptography developers <[email protected]>",+      "name": "cryptography-keepalive",+      "version": "0.49.0",+      "scope": "required",+      "licenses": [+        {+          "expression": "Apache-2.0 OR BSD-3-Clause"+        }+      ],+      "purl": "pkg:cargo/[email protected]?download_url=file://cryptography-keepalive"+    },+    {+      "type": "library",+      "bom-ref": "path+file:///__w/cryptography/cryptography/tmpwheelhouse/.tmpG3FeY2/cryptography-49.0.0/src/rust/cryptography-key-parsing#0.49.0",+      "author": "The cryptography developers <[email protected]>",+      "name": "cryptography-key-parsing",+      "version": "0.49.0",+      "scope": "required",+      "licenses": [+        {+          "expression": "Apache-2.0 OR BSD-3-Clause"+        }+      ],+      "purl": "pkg:cargo/[email protected]?download_url=file://cryptography-key-parsing"+    },+    {+      "type": "library",+      "bom-ref": "path+file:///__w/cryptography/cryptography/tmpwheelhouse/.tmpG3FeY2/cryptography-49.0.0/src/rust/cryptography-openssl#0.49.0",+      "author": "The cryptography developers <[email protected]>",+      "name": "cryptography-openssl",+      "version": "0.49.0",+      "scope": "required",+      "licenses": [+        {+          "expression": "Apache-2.0 OR BSD-3-Clause"+        }+      ],+      "purl": "pkg:cargo/[email protected]?download_url=file://cryptography-openssl"+    },+    {+      "type": "library",+      "bom-ref": "path+file:///__w/cryptography/cryptography/tmpwheelhouse/.tmpG3FeY2/cryptography-49.0.0/src/rust/cryptography-x509#0.49.0",+      "author": "The cryptography developers <[email protected]>",+      "name": "cryptography-x509",+      "version": "0.49.0",+      "scope": "required",+      "licenses": [+        {+          "expression": "Apache-2.0 OR BSD-3-Clause"+        }+      ],+      "purl": "pkg:cargo/[email protected]?download_url=file://cryptography-x509"+    },+    {+      "type": "library",+      "bom-ref": "path+file:///__w/cryptography/cryptography/tmpwheelhouse/.tmpG3FeY2/cryptography-49.0.0/src/rust/cryptography-x509-verification#0.49.0",+      "author": "The cryptography developers <[email protected]>",+      "name": "cryptography-x509-verification",+      "version": "0.49.0",+      "scope": "required",+      "licenses": [+        {+          "expression": "Apache-2.0 OR BSD-3-Clause"+        }+      ],+      "purl": "pkg:cargo/[email protected]?download_url=file://cryptography-x509-verification"+    },+    {+      "type": "library",+      "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#[email protected]",+      "author": "Alex Gaynor <[email protected]>",+      "name": "asn1",+      "version": "0.24.1",+      "description": "ASN.1 (DER) parser and writer for Rust.",+      "scope": "required",+      "hashes": [+        {+          "alg": "SHA-256",+          "content": "c9795210620c0cb3f9a7ce4f882808c38e1ef7b347c90591dceae0886e031fb1"+        }+      ],+      "licenses": [+        {+          "expression": "BSD-3-Clause"+        }+      ],+      "purl": "pkg:cargo/[email protected]",+      "externalReferences": [+        {+          "type": "vcs",+          "url": "https://github.com/alex/rust-asn1"+        }+      ]+    },+    {+      "type": "library",+      "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#[email protected]",+      "author": "Alex Gaynor <[email protected]>",+      "name": "asn1_derive",+      "version": "0.24.1",+      "description": "#[derive] support for asn1",+      "scope": "required",+      "hashes": [+        {+          "alg": "SHA-256",+          "content": "909e307f1cc32bb8bccbd98f446e6d1bf03fa30f7b53a4337da7181ad30fa11a"+        }+      ],+      "licenses": [+        {+          "expression": "BSD-3-Clause"+        }+      ],+      "purl": "pkg:cargo/[email protected]",+      "externalReferences": [+        {+          "type": "vcs",+          "url": "https://github.com/alex/rust-asn1"+        }+      ]+    },+    {+      "type": "library",+      "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#[email protected]",+      "author": "Marshall Pierce <[email protected]>",+      "name": "base64",+      "version": "0.22.1",+      "description": "encodes and decodes base64 as bytes or utf8",+      "scope": "required",+      "hashes": [+        {+          "alg": "SHA-256",+          "content": "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"+        }+      ],+      "licenses": [+        {+          "expression": "MIT OR Apache-2.0"+        }+      ],+      "purl": "pkg:cargo/[email protected]",+      "externalReferences": [+        {+          "type": "documentation",+          "url": "https://docs.rs/base64"+        },+        {+          "type": "vcs",+          "url": "https://github.com/marshallpierce/rust-base64"+        }+      ]+    },+    {+      "type": "library",+      "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#[email protected]",+      "author": "The Rust Project Developers",+      "name": "bitflags",+      "version": "2.13.0",+      "description": "A macro to generate structures which behave like bitflags. ",+      "scope": "required",+      "hashes": [+        {+          "alg": "SHA-256",+          "content": "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8"+        }
… 1118 more lines (truncated)
cryptography-49.0.0.dist-info/sboms/sbom.json +43 lines
--- +++ @@ -0,0 +1,43 @@+{+  "bomFormat": "CycloneDX",+  "specVersion": "1.5",+  "version": 1,+  "serialNumber": "urn:uuid:3bcd4c72-b01c-4990-8c3d-538bd45ca378",+  "metadata": {+    "timestamp": "2026-06-12T00:57:49Z"+  },+  "components": [+    {+      "type": "library",+      "name": "openssl",+      "version": "4.0.1",+      "purl": "pkg:generic/[email protected]?download_url=https://github.com/openssl/openssl/releases/download/openssl-4.0.1/openssl-4.0.1.tar.gz",+      "hashes": [+        {+          "alg": "SHA-256",+          "content": "2db3f3a0d6ea4b59e1f094ace2c8cd536dffb87cdc39084c5afa1e6f7f37dd09"+        }+      ],+      "externalReferences": [+        {+          "type": "distribution",+          "url": "https://github.com/openssl/openssl/releases/download/openssl-4.0.1/openssl-4.0.1.tar.gz"+        }+      ],+      "properties": [+        {+          "name": "build:operating-system",+          "value": "linux"+        },+        {+          "name": "build:architecture",+          "value": "aarch64"+        },+        {+          "name": "build:flags",+          "value": "no-zlib no-shared no-module no-comp no-apps no-docs no-sm2-precomp no-atexit enable-ec_nistp_64_gcc_128"+        }+      ]+    }+  ]+}
cryptography/__about__.py +17 lines
--- +++ @@ -0,0 +1,17 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++__all__ = [+    "__author__",+    "__copyright__",+    "__version__",+]++__version__ = "49.0.0"+++__author__ = "The Python Cryptographic Authority and individual contributors"+__copyright__ = f"Copyright 2013-2026 {__author__}"
cryptography/__init__.py +13 lines
--- +++ @@ -0,0 +1,13 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++from cryptography.__about__ import __author__, __copyright__, __version__++__all__ = [+    "__author__",+    "__copyright__",+    "__version__",+]
cryptography/exceptions.py +52 lines
--- +++ @@ -0,0 +1,52 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++import typing++from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions++if typing.TYPE_CHECKING:+    from cryptography.hazmat.bindings._rust import openssl as rust_openssl++_Reasons = rust_exceptions._Reasons+++class UnsupportedAlgorithm(Exception):+    def __init__(self, message: str, reason: _Reasons | None = None) -> None:+        super().__init__(message)+        self._reason = reason+++class AlreadyFinalized(Exception):+    pass+++class AlreadyUpdated(Exception):+    pass+++class NotYetFinalized(Exception):+    pass+++class InvalidTag(Exception):+    pass+++class InvalidSignature(Exception):+    pass+++class InternalError(Exception):+    def __init__(+        self, msg: str, err_code: list[rust_openssl.OpenSSLError]+    ) -> None:+        super().__init__(msg)+        self.err_code = err_code+++class InvalidKey(Exception):+    pass
cryptography/fernet.py +224 lines
--- +++ @@ -0,0 +1,224 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++import base64+import binascii+import os+import time+import typing+from collections.abc import Iterable++from cryptography import utils+from cryptography.exceptions import InvalidSignature+from cryptography.hazmat.primitives import hashes, padding+from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes+from cryptography.hazmat.primitives.hmac import HMAC+++class InvalidToken(Exception):+    pass+++_MAX_CLOCK_SKEW = 60+++class Fernet:+    def __init__(+        self,+        key: bytes | str,+        backend: typing.Any = None,+    ) -> None:+        try:+            key = base64.urlsafe_b64decode(key)+        except binascii.Error as exc:+            raise ValueError(+                "Fernet key must be 32 url-safe base64-encoded bytes."+            ) from exc+        if len(key) != 32:+            raise ValueError(+                "Fernet key must be 32 url-safe base64-encoded bytes."+            )++        self._signing_key = key[:16]+        self._encryption_key = key[16:]++    @classmethod+    def generate_key(cls) -> bytes:+        return base64.urlsafe_b64encode(os.urandom(32))++    def encrypt(self, data: bytes) -> bytes:+        return self.encrypt_at_time(data, int(time.time()))++    def encrypt_at_time(self, data: bytes, current_time: int) -> bytes:+        iv = os.urandom(16)+        return self._encrypt_from_parts(data, current_time, iv)++    def _encrypt_from_parts(+        self, data: bytes, current_time: int, iv: bytes+    ) -> bytes:+        utils._check_bytes("data", data)++        padder = padding.PKCS7(algorithms.AES.block_size).padder()+        padded_data = padder.update(data) + padder.finalize()+        encryptor = Cipher(+            algorithms.AES(self._encryption_key),+            modes.CBC(iv),+        ).encryptor()+        ciphertext = encryptor.update(padded_data) + encryptor.finalize()++        basic_parts = (+            b"\x80"+            + current_time.to_bytes(length=8, byteorder="big")+            + iv+            + ciphertext+        )++        h = HMAC(self._signing_key, hashes.SHA256())+        h.update(basic_parts)+        hmac = h.finalize()+        return base64.urlsafe_b64encode(basic_parts + hmac)++    def decrypt(self, token: bytes | str, ttl: int | None = None) -> bytes:+        timestamp, data = Fernet._get_unverified_token_data(token)+        if ttl is None:+            time_info = None+        else:+            time_info = (ttl, int(time.time()))+        return self._decrypt_data(data, timestamp, time_info)++    def decrypt_at_time(+        self, token: bytes | str, ttl: int, current_time: int+    ) -> bytes:+        if ttl is None:+            raise ValueError(+                "decrypt_at_time() can only be used with a non-None ttl"+            )+        timestamp, data = Fernet._get_unverified_token_data(token)+        return self._decrypt_data(data, timestamp, (ttl, current_time))++    def extract_timestamp(self, token: bytes | str) -> int:+        timestamp, data = Fernet._get_unverified_token_data(token)+        # Verify the token was not tampered with.+        self._verify_signature(data)+        return timestamp++    @staticmethod+    def _get_unverified_token_data(token: bytes | str) -> tuple[int, bytes]:+        if not isinstance(token, (str, bytes)):+            raise TypeError("token must be bytes or str")++        try:+            data = base64.urlsafe_b64decode(token)+        except (TypeError, binascii.Error):+            raise InvalidToken++        if not data or data[0] != 0x80:+            raise InvalidToken++        if len(data) < 9:+            raise InvalidToken++        timestamp = int.from_bytes(data[1:9], byteorder="big")+        return timestamp, data++    def _verify_signature(self, data: bytes) -> None:+        h = HMAC(self._signing_key, hashes.SHA256())+        h.update(data[:-32])+        try:+            h.verify(data[-32:])+        except InvalidSignature:+            raise InvalidToken++    def _decrypt_data(+        self,+        data: bytes,+        timestamp: int,+        time_info: tuple[int, int] | None,+    ) -> bytes:+        if time_info is not None:+            ttl, current_time = time_info+            if timestamp + ttl < current_time:+                raise InvalidToken++            if current_time + _MAX_CLOCK_SKEW < timestamp:+                raise InvalidToken++        self._verify_signature(data)++        iv = data[9:25]+        ciphertext = data[25:-32]+        decryptor = Cipher(+            algorithms.AES(self._encryption_key), modes.CBC(iv)+        ).decryptor()+        plaintext_padded = decryptor.update(ciphertext)+        try:+            plaintext_padded += decryptor.finalize()+        except ValueError:+            raise InvalidToken+        unpadder = padding.PKCS7(algorithms.AES.block_size).unpadder()++        unpadded = unpadder.update(plaintext_padded)+        try:+            unpadded += unpadder.finalize()+        except ValueError:+            raise InvalidToken+        return unpadded+++class MultiFernet:+    def __init__(self, fernets: Iterable[Fernet]):+        fernets = list(fernets)+        if not fernets:+            raise ValueError(+                "MultiFernet requires at least one Fernet instance"+            )+        self._fernets = fernets++    def encrypt(self, msg: bytes) -> bytes:+        return self.encrypt_at_time(msg, int(time.time()))++    def encrypt_at_time(self, msg: bytes, current_time: int) -> bytes:+        return self._fernets[0].encrypt_at_time(msg, current_time)++    def rotate(self, msg: bytes | str) -> bytes:+        timestamp, data = Fernet._get_unverified_token_data(msg)+        for f in self._fernets:+            try:+                p = f._decrypt_data(data, timestamp, None)+                break+            except InvalidToken:+                pass+        else:+            raise InvalidToken++        iv = os.urandom(16)+        return self._fernets[0]._encrypt_from_parts(p, timestamp, iv)++    def decrypt(self, msg: bytes | str, ttl: int | None = None) -> bytes:+        for f in self._fernets:+            try:+                return f.decrypt(msg, ttl)+            except InvalidToken:+                pass+        raise InvalidToken++    def decrypt_at_time(+        self, msg: bytes | str, ttl: int, current_time: int+    ) -> bytes:+        for f in self._fernets:+            try:+                return f.decrypt_at_time(msg, ttl, current_time)+            except InvalidToken:+                pass+        raise InvalidToken++    def extract_timestamp(self, msg: bytes | str) -> int:+        for f in self._fernets:+            try:+                return f.extract_timestamp(msg)+            except InvalidToken:+                pass+        raise InvalidToken
cryptography/hazmat/__init__.py +13 lines
--- +++ @@ -0,0 +1,13 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++"""+Hazardous Materials++This is a "Hazardous Materials" module. You should ONLY use it if you're+100% absolutely sure that you know what you're doing because this module+is full of land mines, dragons, and dinosaurs with laser guns.+"""
cryptography/hazmat/_oid.py +368 lines
--- +++ @@ -0,0 +1,368 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++from cryptography.hazmat.bindings._rust import (+    ObjectIdentifier as ObjectIdentifier,+)+from cryptography.hazmat.primitives import hashes+++class ExtensionOID:+    SUBJECT_DIRECTORY_ATTRIBUTES = ObjectIdentifier("2.5.29.9")+    SUBJECT_KEY_IDENTIFIER = ObjectIdentifier("2.5.29.14")+    KEY_USAGE = ObjectIdentifier("2.5.29.15")+    PRIVATE_KEY_USAGE_PERIOD = ObjectIdentifier("2.5.29.16")+    SUBJECT_ALTERNATIVE_NAME = ObjectIdentifier("2.5.29.17")+    ISSUER_ALTERNATIVE_NAME = ObjectIdentifier("2.5.29.18")+    BASIC_CONSTRAINTS = ObjectIdentifier("2.5.29.19")+    NAME_CONSTRAINTS = ObjectIdentifier("2.5.29.30")+    CRL_DISTRIBUTION_POINTS = ObjectIdentifier("2.5.29.31")+    CERTIFICATE_POLICIES = ObjectIdentifier("2.5.29.32")+    POLICY_MAPPINGS = ObjectIdentifier("2.5.29.33")+    AUTHORITY_KEY_IDENTIFIER = ObjectIdentifier("2.5.29.35")+    POLICY_CONSTRAINTS = ObjectIdentifier("2.5.29.36")+    EXTENDED_KEY_USAGE = ObjectIdentifier("2.5.29.37")+    FRESHEST_CRL = ObjectIdentifier("2.5.29.46")+    INHIBIT_ANY_POLICY = ObjectIdentifier("2.5.29.54")+    ISSUING_DISTRIBUTION_POINT = ObjectIdentifier("2.5.29.28")+    AUTHORITY_INFORMATION_ACCESS = ObjectIdentifier("1.3.6.1.5.5.7.1.1")+    SUBJECT_INFORMATION_ACCESS = ObjectIdentifier("1.3.6.1.5.5.7.1.11")+    OCSP_NO_CHECK = ObjectIdentifier("1.3.6.1.5.5.7.48.1.5")+    TLS_FEATURE = ObjectIdentifier("1.3.6.1.5.5.7.1.24")+    CRL_NUMBER = ObjectIdentifier("2.5.29.20")+    DELTA_CRL_INDICATOR = ObjectIdentifier("2.5.29.27")+    PRECERT_SIGNED_CERTIFICATE_TIMESTAMPS = ObjectIdentifier(+        "1.3.6.1.4.1.11129.2.4.2"+    )+    PRECERT_POISON = ObjectIdentifier("1.3.6.1.4.1.11129.2.4.3")+    SIGNED_CERTIFICATE_TIMESTAMPS = ObjectIdentifier("1.3.6.1.4.1.11129.2.4.5")+    MS_CERTIFICATE_TEMPLATE = ObjectIdentifier("1.3.6.1.4.1.311.21.7")+    ADMISSIONS = ObjectIdentifier("1.3.36.8.3.3")+++class OCSPExtensionOID:+    NONCE = ObjectIdentifier("1.3.6.1.5.5.7.48.1.2")+    ACCEPTABLE_RESPONSES = ObjectIdentifier("1.3.6.1.5.5.7.48.1.4")+++class CRLEntryExtensionOID:+    CERTIFICATE_ISSUER = ObjectIdentifier("2.5.29.29")+    CRL_REASON = ObjectIdentifier("2.5.29.21")+    INVALIDITY_DATE = ObjectIdentifier("2.5.29.24")+++class NameOID:+    COMMON_NAME = ObjectIdentifier("2.5.4.3")+    COUNTRY_NAME = ObjectIdentifier("2.5.4.6")+    LOCALITY_NAME = ObjectIdentifier("2.5.4.7")+    STATE_OR_PROVINCE_NAME = ObjectIdentifier("2.5.4.8")+    STREET_ADDRESS = ObjectIdentifier("2.5.4.9")+    ORGANIZATION_IDENTIFIER = ObjectIdentifier("2.5.4.97")+    ORGANIZATION_NAME = ObjectIdentifier("2.5.4.10")+    ORGANIZATIONAL_UNIT_NAME = ObjectIdentifier("2.5.4.11")+    SERIAL_NUMBER = ObjectIdentifier("2.5.4.5")+    SURNAME = ObjectIdentifier("2.5.4.4")+    GIVEN_NAME = ObjectIdentifier("2.5.4.42")+    TITLE = ObjectIdentifier("2.5.4.12")+    INITIALS = ObjectIdentifier("2.5.4.43")+    GENERATION_QUALIFIER = ObjectIdentifier("2.5.4.44")+    X500_UNIQUE_IDENTIFIER = ObjectIdentifier("2.5.4.45")+    DN_QUALIFIER = ObjectIdentifier("2.5.4.46")+    PSEUDONYM = ObjectIdentifier("2.5.4.65")+    USER_ID = ObjectIdentifier("0.9.2342.19200300.100.1.1")+    DOMAIN_COMPONENT = ObjectIdentifier("0.9.2342.19200300.100.1.25")+    EMAIL_ADDRESS = ObjectIdentifier("1.2.840.113549.1.9.1")+    JURISDICTION_COUNTRY_NAME = ObjectIdentifier("1.3.6.1.4.1.311.60.2.1.3")+    JURISDICTION_LOCALITY_NAME = ObjectIdentifier("1.3.6.1.4.1.311.60.2.1.1")+    JURISDICTION_STATE_OR_PROVINCE_NAME = ObjectIdentifier(+        "1.3.6.1.4.1.311.60.2.1.2"+    )+    BUSINESS_CATEGORY = ObjectIdentifier("2.5.4.15")+    POSTAL_ADDRESS = ObjectIdentifier("2.5.4.16")+    POSTAL_CODE = ObjectIdentifier("2.5.4.17")+    INN = ObjectIdentifier("1.2.643.3.131.1.1")+    OGRN = ObjectIdentifier("1.2.643.100.1")+    SNILS = ObjectIdentifier("1.2.643.100.3")+    UNSTRUCTURED_NAME = ObjectIdentifier("1.2.840.113549.1.9.2")+++class SignatureAlgorithmOID:+    RSA_WITH_MD5 = ObjectIdentifier("1.2.840.113549.1.1.4")+    RSA_WITH_SHA1 = ObjectIdentifier("1.2.840.113549.1.1.5")+    # This is an alternate OID for RSA with SHA1 that is occasionally seen+    _RSA_WITH_SHA1 = ObjectIdentifier("1.3.14.3.2.29")+    RSA_WITH_SHA224 = ObjectIdentifier("1.2.840.113549.1.1.14")+    RSA_WITH_SHA256 = ObjectIdentifier("1.2.840.113549.1.1.11")+    RSA_WITH_SHA384 = ObjectIdentifier("1.2.840.113549.1.1.12")+    RSA_WITH_SHA512 = ObjectIdentifier("1.2.840.113549.1.1.13")+    RSA_WITH_SHA3_224 = ObjectIdentifier("2.16.840.1.101.3.4.3.13")+    RSA_WITH_SHA3_256 = ObjectIdentifier("2.16.840.1.101.3.4.3.14")+    RSA_WITH_SHA3_384 = ObjectIdentifier("2.16.840.1.101.3.4.3.15")+    RSA_WITH_SHA3_512 = ObjectIdentifier("2.16.840.1.101.3.4.3.16")+    RSASSA_PSS = ObjectIdentifier("1.2.840.113549.1.1.10")+    ECDSA_WITH_SHA1 = ObjectIdentifier("1.2.840.10045.4.1")+    ECDSA_WITH_SHA224 = ObjectIdentifier("1.2.840.10045.4.3.1")+    ECDSA_WITH_SHA256 = ObjectIdentifier("1.2.840.10045.4.3.2")+    ECDSA_WITH_SHA384 = ObjectIdentifier("1.2.840.10045.4.3.3")+    ECDSA_WITH_SHA512 = ObjectIdentifier("1.2.840.10045.4.3.4")+    ECDSA_WITH_SHA3_224 = ObjectIdentifier("2.16.840.1.101.3.4.3.9")+    ECDSA_WITH_SHA3_256 = ObjectIdentifier("2.16.840.1.101.3.4.3.10")+    ECDSA_WITH_SHA3_384 = ObjectIdentifier("2.16.840.1.101.3.4.3.11")+    ECDSA_WITH_SHA3_512 = ObjectIdentifier("2.16.840.1.101.3.4.3.12")+    DSA_WITH_SHA1 = ObjectIdentifier("1.2.840.10040.4.3")+    DSA_WITH_SHA224 = ObjectIdentifier("2.16.840.1.101.3.4.3.1")+    DSA_WITH_SHA256 = ObjectIdentifier("2.16.840.1.101.3.4.3.2")+    DSA_WITH_SHA384 = ObjectIdentifier("2.16.840.1.101.3.4.3.3")+    DSA_WITH_SHA512 = ObjectIdentifier("2.16.840.1.101.3.4.3.4")+    ED25519 = ObjectIdentifier("1.3.101.112")+    ED448 = ObjectIdentifier("1.3.101.113")+    ML_DSA_44 = ObjectIdentifier("2.16.840.1.101.3.4.3.17")+    ML_DSA_65 = ObjectIdentifier("2.16.840.1.101.3.4.3.18")+    ML_DSA_87 = ObjectIdentifier("2.16.840.1.101.3.4.3.19")+    GOSTR3411_94_WITH_3410_2001 = ObjectIdentifier("1.2.643.2.2.3")+    GOSTR3410_2012_WITH_3411_2012_256 = ObjectIdentifier("1.2.643.7.1.1.3.2")+    GOSTR3410_2012_WITH_3411_2012_512 = ObjectIdentifier("1.2.643.7.1.1.3.3")+++_SIG_OIDS_TO_HASH: dict[ObjectIdentifier, hashes.HashAlgorithm | None] = {+    SignatureAlgorithmOID.RSA_WITH_MD5: hashes.MD5(),+    SignatureAlgorithmOID.RSA_WITH_SHA1: hashes.SHA1(),+    SignatureAlgorithmOID._RSA_WITH_SHA1: hashes.SHA1(),+    SignatureAlgorithmOID.RSA_WITH_SHA224: hashes.SHA224(),+    SignatureAlgorithmOID.RSA_WITH_SHA256: hashes.SHA256(),+    SignatureAlgorithmOID.RSA_WITH_SHA384: hashes.SHA384(),+    SignatureAlgorithmOID.RSA_WITH_SHA512: hashes.SHA512(),+    SignatureAlgorithmOID.RSA_WITH_SHA3_224: hashes.SHA3_224(),+    SignatureAlgorithmOID.RSA_WITH_SHA3_256: hashes.SHA3_256(),+    SignatureAlgorithmOID.RSA_WITH_SHA3_384: hashes.SHA3_384(),+    SignatureAlgorithmOID.RSA_WITH_SHA3_512: hashes.SHA3_512(),+    SignatureAlgorithmOID.ECDSA_WITH_SHA1: hashes.SHA1(),+    SignatureAlgorithmOID.ECDSA_WITH_SHA224: hashes.SHA224(),+    SignatureAlgorithmOID.ECDSA_WITH_SHA256: hashes.SHA256(),+    SignatureAlgorithmOID.ECDSA_WITH_SHA384: hashes.SHA384(),+    SignatureAlgorithmOID.ECDSA_WITH_SHA512: hashes.SHA512(),+    SignatureAlgorithmOID.ECDSA_WITH_SHA3_224: hashes.SHA3_224(),+    SignatureAlgorithmOID.ECDSA_WITH_SHA3_256: hashes.SHA3_256(),+    SignatureAlgorithmOID.ECDSA_WITH_SHA3_384: hashes.SHA3_384(),+    SignatureAlgorithmOID.ECDSA_WITH_SHA3_512: hashes.SHA3_512(),+    SignatureAlgorithmOID.DSA_WITH_SHA1: hashes.SHA1(),+    SignatureAlgorithmOID.DSA_WITH_SHA224: hashes.SHA224(),+    SignatureAlgorithmOID.DSA_WITH_SHA256: hashes.SHA256(),+    SignatureAlgorithmOID.ED25519: None,+    SignatureAlgorithmOID.ED448: None,+    SignatureAlgorithmOID.ML_DSA_44: None,+    SignatureAlgorithmOID.ML_DSA_65: None,+    SignatureAlgorithmOID.ML_DSA_87: None,+    SignatureAlgorithmOID.GOSTR3411_94_WITH_3410_2001: None,+    SignatureAlgorithmOID.GOSTR3410_2012_WITH_3411_2012_256: None,+    SignatureAlgorithmOID.GOSTR3410_2012_WITH_3411_2012_512: None,+}+++class HashAlgorithmOID:+    SHA1 = ObjectIdentifier("1.3.14.3.2.26")+    SHA224 = ObjectIdentifier("2.16.840.1.101.3.4.2.4")+    SHA256 = ObjectIdentifier("2.16.840.1.101.3.4.2.1")+    SHA384 = ObjectIdentifier("2.16.840.1.101.3.4.2.2")+    SHA512 = ObjectIdentifier("2.16.840.1.101.3.4.2.3")+    SHA3_224 = ObjectIdentifier("1.3.6.1.4.1.37476.3.2.1.99.7.224")+    SHA3_256 = ObjectIdentifier("1.3.6.1.4.1.37476.3.2.1.99.7.256")+    SHA3_384 = ObjectIdentifier("1.3.6.1.4.1.37476.3.2.1.99.7.384")+    SHA3_512 = ObjectIdentifier("1.3.6.1.4.1.37476.3.2.1.99.7.512")+    SHA3_224_NIST = ObjectIdentifier("2.16.840.1.101.3.4.2.7")+    SHA3_256_NIST = ObjectIdentifier("2.16.840.1.101.3.4.2.8")+    SHA3_384_NIST = ObjectIdentifier("2.16.840.1.101.3.4.2.9")+    SHA3_512_NIST = ObjectIdentifier("2.16.840.1.101.3.4.2.10")+++class PublicKeyAlgorithmOID:+    DSA = ObjectIdentifier("1.2.840.10040.4.1")+    EC_PUBLIC_KEY = ObjectIdentifier("1.2.840.10045.2.1")+    RSAES_PKCS1_v1_5 = ObjectIdentifier("1.2.840.113549.1.1.1")+    RSASSA_PSS = ObjectIdentifier("1.2.840.113549.1.1.10")+    X25519 = ObjectIdentifier("1.3.101.110")+    X448 = ObjectIdentifier("1.3.101.111")+    ED25519 = ObjectIdentifier("1.3.101.112")+    ED448 = ObjectIdentifier("1.3.101.113")+    ML_DSA_44 = ObjectIdentifier("2.16.840.1.101.3.4.3.17")+    ML_DSA_65 = ObjectIdentifier("2.16.840.1.101.3.4.3.18")+    ML_DSA_87 = ObjectIdentifier("2.16.840.1.101.3.4.3.19")+++class ExtendedKeyUsageOID:+    SERVER_AUTH = ObjectIdentifier("1.3.6.1.5.5.7.3.1")+    CLIENT_AUTH = ObjectIdentifier("1.3.6.1.5.5.7.3.2")+    CODE_SIGNING = ObjectIdentifier("1.3.6.1.5.5.7.3.3")+    EMAIL_PROTECTION = ObjectIdentifier("1.3.6.1.5.5.7.3.4")+    TIME_STAMPING = ObjectIdentifier("1.3.6.1.5.5.7.3.8")+    OCSP_SIGNING = ObjectIdentifier("1.3.6.1.5.5.7.3.9")+    ANY_EXTENDED_KEY_USAGE = ObjectIdentifier("2.5.29.37.0")+    SMARTCARD_LOGON = ObjectIdentifier("1.3.6.1.4.1.311.20.2.2")+    KERBEROS_PKINIT_KDC = ObjectIdentifier("1.3.6.1.5.2.3.5")+    IPSEC_IKE = ObjectIdentifier("1.3.6.1.5.5.7.3.17")+    BUNDLE_SECURITY = ObjectIdentifier("1.3.6.1.5.5.7.3.35")+    CERTIFICATE_TRANSPARENCY = ObjectIdentifier("1.3.6.1.4.1.11129.2.4.4")+++class OtherNameFormOID:+    PERMANENT_IDENTIFIER = ObjectIdentifier("1.3.6.1.5.5.7.8.3")+    HW_MODULE_NAME = ObjectIdentifier("1.3.6.1.5.5.7.8.4")+    DNS_SRV = ObjectIdentifier("1.3.6.1.5.5.7.8.7")+    NAI_REALM = ObjectIdentifier("1.3.6.1.5.5.7.8.8")+    SMTP_UTF8_MAILBOX = ObjectIdentifier("1.3.6.1.5.5.7.8.9")+    ACP_NODE_NAME = ObjectIdentifier("1.3.6.1.5.5.7.8.10")+    BUNDLE_EID = ObjectIdentifier("1.3.6.1.5.5.7.8.11")+++class AuthorityInformationAccessOID:+    CA_ISSUERS = ObjectIdentifier("1.3.6.1.5.5.7.48.2")+    OCSP = ObjectIdentifier("1.3.6.1.5.5.7.48.1")+++class SubjectInformationAccessOID:+    CA_REPOSITORY = ObjectIdentifier("1.3.6.1.5.5.7.48.5")+++class CertificatePoliciesOID:+    CPS_QUALIFIER = ObjectIdentifier("1.3.6.1.5.5.7.2.1")+    CPS_USER_NOTICE = ObjectIdentifier("1.3.6.1.5.5.7.2.2")+    ANY_POLICY = ObjectIdentifier("2.5.29.32.0")+++class AttributeOID:+    CHALLENGE_PASSWORD = ObjectIdentifier("1.2.840.113549.1.9.7")+    UNSTRUCTURED_NAME = ObjectIdentifier("1.2.840.113549.1.9.2")+++_OID_NAMES = {+    NameOID.COMMON_NAME: "commonName",+    NameOID.COUNTRY_NAME: "countryName",+    NameOID.LOCALITY_NAME: "localityName",+    NameOID.STATE_OR_PROVINCE_NAME: "stateOrProvinceName",+    NameOID.STREET_ADDRESS: "streetAddress",+    NameOID.ORGANIZATION_NAME: "organizationName",+    NameOID.ORGANIZATIONAL_UNIT_NAME: "organizationalUnitName",
… 121 more lines (truncated)
cryptography/hazmat/asn1/__init__.py +45 lines
--- +++ @@ -0,0 +1,45 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from cryptography.hazmat.asn1.asn1 import (+    TLV,+    BitString,+    Default,+    Explicit,+    GeneralizedTime,+    IA5String,+    Implicit,+    Null,+    PrintableString,+    SetOf,+    Size,+    UTCTime,+    Variant,+    decode_der,+    encode_der,+    sequence,+    set,+    value_set,+)++__all__ = [+    "TLV",+    "BitString",+    "Default",+    "Explicit",+    "GeneralizedTime",+    "IA5String",+    "Implicit",+    "Null",+    "PrintableString",+    "SetOf",+    "Size",+    "UTCTime",+    "Variant",+    "decode_der",+    "encode_der",+    "sequence",+    "set",+    "value_set",+]
cryptography/hazmat/asn1/asn1.py +533 lines
--- +++ @@ -0,0 +1,533 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++import builtins+import dataclasses+import enum+import sys+import types+import typing++if sys.version_info < (3, 11):+    import typing_extensions++    LiteralString = typing_extensions.LiteralString+else:+    LiteralString = typing.LiteralString++from cryptography.hazmat.bindings._rust import declarative_asn1+from cryptography.hazmat.bindings._rust import x509 as rust_x509++if sys.version_info < (3, 10):+    NoneType = type(None)+else:+    NoneType = types.NoneType  # type: ignore[nonetype-type]++T = typing.TypeVar("T", covariant=True)+U = typing.TypeVar("U")+Tag = typing.TypeVar("Tag", bound=LiteralString)++[email protected](frozen=True)+class Variant(typing.Generic[U, Tag]):+    """+    A tagged variant for CHOICE fields with the same underlying type.++    Use this when you have multiple CHOICE alternatives with the same type+    and need to distinguish between them:++        foo: (+            Annotated[Variant[int, typing.Literal["IntA"]], Implicit(0)]+            | Annotated[Variant[int, typing.Literal["IntB"]], Implicit(1)]+        )++    Usage:+        example = Example(foo=Variant(5, "IntA"))+        decoded.foo.value  # The int value+        decoded.foo.tag    # "IntA" or "IntB"+    """++    value: U+    tag: str+++decode_der = declarative_asn1.decode_der+encode_der = declarative_asn1.encode_der+++_X509_TYPES = (+    rust_x509.Certificate,+    rust_x509.CertificateSigningRequest,+    rust_x509.CertificateRevocationList,+)+++def _check_x509_field_annotations(+    field_type: typing.Any,+    annotation: declarative_asn1.Annotation,+    field_name: str,+) -> None:+    if field_type in _X509_TYPES and isinstance(annotation.encoding, Implicit):+        raise TypeError(+            f"field '{field_name}' has an IMPLICIT annotation, but "+            "IMPLICIT annotations are not supported for X.509 types."+        )+++def _is_union(field_type: type) -> bool:+    # NOTE: types.UnionType for `T | U`, typing.Union for `Union[T, U]`.+    # TODO: Drop the `hasattr()` once the minimum supported Python version+    # is >= 3.10.+    union_types = (+        (types.UnionType, typing.Union)+        if hasattr(types, "UnionType")+        else (typing.Union,)+    )+    return typing.get_origin(field_type) in union_types+++def _resolve_type_aliases(field_type: typing.Any) -> typing.Any:+    # Recursively resolve PEP 695 (`type X = ...`) type aliases (Python+    # 3.12+) to their underlying value, so that the rest of the+    # normalization logic never encounters an alias. Aliases can refer+    # to other aliases and can appear at any level of nesting (e.g.+    # inside `Annotated[...]`, unions, or `list[...]`).+    if sys.version_info < (3, 12):+        return field_type++    while isinstance(field_type, typing.TypeAliasType):+        field_type = field_type.__value__++    args = typing.get_args(field_type)+    resolved_args = tuple(_resolve_type_aliases(arg) for arg in args)+    if resolved_args == args:+        # No aliases anywhere inside: return the type unchanged.+        return field_type++    if _is_union(field_type):+        # `X | Y` unions can't be rebuilt through their origin like+        # other generics below: `typing.get_origin` returns+        # `types.UnionType` for them, which is only subscriptable on+        # Python 3.14+. Rebuilding through `typing.Union` also+        # flattens any nested union introduced by an alias of a union+        # (e.g. `Time | int` where `type Time = UTCTime |+        # GeneralizedTime`), just like `typing.Union` would have done+        # if the alias had been written inline.+        return typing.Union[resolved_args]++    # An alias appeared inside a generic (e.g. `Annotated[Time, ...]`,+    # `list[MyInt]`, or `SetOf[MyInt]`): re-parameterize the generic+    # with the resolved arguments. Subscripting with a tuple is+    # equivalent to subscripting with multiple arguments.+    return typing.get_origin(field_type)[resolved_args]+++def _extract_annotation(+    metadata: tuple, field_name: str+) -> declarative_asn1.Annotation:+    default = None+    encoding = None+    size = None+    for raw_annotation in metadata:+        if isinstance(raw_annotation, Default):+            if default is not None:+                raise TypeError(+                    f"multiple DEFAULT annotations found in field "+                    f"'{field_name}'"+                )+            default = raw_annotation.value+        elif isinstance(raw_annotation, declarative_asn1.Encoding):+            if encoding is not None:+                raise TypeError(+                    f"multiple IMPLICIT/EXPLICIT annotations found in field "+                    f"'{field_name}'"+                )+            encoding = raw_annotation+        elif isinstance(raw_annotation, declarative_asn1.Size):+            if size is not None:+                raise TypeError(+                    f"multiple SIZE annotations found in field '{field_name}'"+                )+            size = raw_annotation+        else:+            raise TypeError(f"unsupported annotation: {raw_annotation}")++    return declarative_asn1.Annotation(+        default=default, encoding=encoding, size=size+    )+++def _normalize_field_type(+    field_type: typing.Any, field_name: str+) -> declarative_asn1.AnnotatedType:+    field_type = _resolve_type_aliases(field_type)++    # Strip the `Annotated[...]` off, and populate the annotation+    # from it if it exists.+    if typing.get_origin(field_type) is typing.Annotated:+        annotation = _extract_annotation(field_type.__metadata__, field_name)+        field_type, *_ = typing.get_args(field_type)+    else:+        annotation = declarative_asn1.Annotation()++    if annotation.size is not None and (+        typing.get_origin(field_type) not in (builtins.list, SetOf)+        and field_type+        not in (+            builtins.bytes,+            builtins.str,+            BitString,+            IA5String,+            PrintableString,+        )+    ):+        raise TypeError(+            f"field '{field_name}' has a SIZE annotation, but SIZE "+            "annotations are only supported for fields of types: "+            "[SEQUENCE OF, SET OF, BIT STRING, OCTET STRING, UTF8String, "+            "PrintableString, IA5String]"+        )++    if field_type is TLV:+        if isinstance(annotation.encoding, Implicit):+            raise TypeError(+                f"field '{field_name}' has an IMPLICIT annotation, but "+                "IMPLICIT annotations are not supported for TLV types."+            )+        elif annotation.default is not None:+            raise TypeError(+                f"field '{field_name}' has a DEFAULT annotation, but "+                "DEFAULT annotations are not supported for TLV types."+            )++    _check_x509_field_annotations(field_type, annotation, field_name)++    if hasattr(field_type, "__asn1_root__"):+        root_type = field_type.__asn1_root__+        if not isinstance(+            root_type,+            (+                declarative_asn1.Type.Sequence,+                declarative_asn1.Type.Set,+                declarative_asn1.Type.ValueSet,+            ),+        ):+            raise TypeError(f"unsupported root type: {root_type}")+        return declarative_asn1.AnnotatedType(+            typing.cast(declarative_asn1.Type, root_type), annotation+        )+    elif _is_union(field_type):+        union_args = typing.get_args(field_type)+        if len(union_args) == 2 and NoneType in union_args:+            # A Union between a type and None is an OPTIONAL+            optional_type = (+                union_args[0] if union_args[1] is type(None) else union_args[1]+            )+            if optional_type is TLV:+                raise TypeError(+                    "optional TLV types (`TLV | None`) are not "+                    "currently supported"+                )+            # For optional types, the annotation is associated with the+            # union, so we check it against the inner type here.+            _check_x509_field_annotations(+                optional_type, annotation, field_name+            )+            annotated_type = _normalize_field_type(optional_type, field_name)++            if not annotated_type.annotation.is_empty():+                raise TypeError(+                    "optional (`X | None`) types cannot have `X` "+                    "annotated: annotations must apply to the union "+                    "(i.e: `Annotated[X | None, annotation]`)"+                )+
… 286 more lines (truncated)
cryptography/hazmat/backends/__init__.py +13 lines
--- +++ @@ -0,0 +1,13 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++from typing import Any+++def default_backend() -> Any:+    from cryptography.hazmat.backends.openssl.backend import backend++    return backend
cryptography/hazmat/backends/openssl/__init__.py +9 lines
--- +++ @@ -0,0 +1,9 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++from cryptography.hazmat.backends.openssl.backend import backend++__all__ = ["backend"]
cryptography/hazmat/backends/openssl/backend.py +314 lines
--- +++ @@ -0,0 +1,314 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++from cryptography.hazmat.bindings._rust import openssl as rust_openssl+from cryptography.hazmat.bindings.openssl import binding+from cryptography.hazmat.primitives import hashes+from cryptography.hazmat.primitives._asymmetric import AsymmetricPadding+from cryptography.hazmat.primitives.asymmetric import ec+from cryptography.hazmat.primitives.asymmetric import utils as asym_utils+from cryptography.hazmat.primitives.asymmetric.padding import (+    MGF1,+    OAEP,+    PSS,+    PKCS1v15,+)+from cryptography.hazmat.primitives.ciphers import (+    CipherAlgorithm,+)+from cryptography.hazmat.primitives.ciphers.algorithms import (+    AES,+)+from cryptography.hazmat.primitives.ciphers.modes import (+    CBC,+    Mode,+)+++class Backend:+    """+    OpenSSL API binding interfaces.+    """++    name = "openssl"++    # TripleDES encryption is disallowed/deprecated throughout 2023 in+    # FIPS 140-3. To keep it simple we denylist any use of TripleDES (TDEA).+    _fips_ciphers = (AES,)+    # Sometimes SHA1 is still permissible. That logic is contained+    # within the various *_supported methods.+    _fips_hashes = (+        hashes.SHA224,+        hashes.SHA256,+        hashes.SHA384,+        hashes.SHA512,+        hashes.SHA512_224,+        hashes.SHA512_256,+        hashes.SHA3_224,+        hashes.SHA3_256,+        hashes.SHA3_384,+        hashes.SHA3_512,+        hashes.SHAKE128,+        hashes.SHAKE256,+    )+    _fips_ecdh_curves = (+        ec.SECP224R1,+        ec.SECP256R1,+        ec.SECP384R1,+        ec.SECP521R1,+    )+    _fips_rsa_min_key_size = 2048+    _fips_rsa_min_public_exponent = 65537+    _fips_dsa_min_modulus = 1 << 2048+    _fips_dh_min_key_size = 2048+    _fips_dh_min_modulus = 1 << _fips_dh_min_key_size++    def __init__(self) -> None:+        self._binding = binding.Binding()+        self._ffi = self._binding.ffi+        self._lib = self._binding.lib+        self._fips_enabled = rust_openssl.is_fips_enabled()++    def __repr__(self) -> str:+        return (+            f"<OpenSSLBackend(version: {self.openssl_version_text()}, "+            f"FIPS: {self._fips_enabled}, "+            f"Legacy: {rust_openssl._legacy_provider_loaded})>"+        )++    def openssl_assert(self, ok: bool) -> None:+        return binding._openssl_assert(ok)++    def _enable_fips(self) -> None:+        # This function enables FIPS mode for OpenSSL 3.0.0 on installs that+        # have the FIPS provider installed properly.+        rust_openssl.enable_fips(rust_openssl._providers)+        assert rust_openssl.is_fips_enabled()+        self._fips_enabled = rust_openssl.is_fips_enabled()++    def openssl_version_text(self) -> str:+        """+        Friendly string name of the loaded OpenSSL library. This is not+        necessarily the same version as it was compiled against.++        Example: OpenSSL 3.2.1 30 Jan 2024+        """+        return rust_openssl.openssl_version_text()++    def openssl_version_number(self) -> int:+        return rust_openssl.openssl_version()++    def hash_supported(self, algorithm: hashes.HashAlgorithm) -> bool:+        if self._fips_enabled and not isinstance(algorithm, self._fips_hashes):+            return False++        return rust_openssl.hashes.hash_supported(algorithm)++    def signature_hash_supported(+        self, algorithm: hashes.HashAlgorithm+    ) -> bool:+        # Dedicated check for hashing algorithm use in message digest for+        # signatures, e.g. RSA PKCS#1 v1.5 SHA1 (sha1WithRSAEncryption).+        if self._fips_enabled and isinstance(algorithm, hashes.SHA1):+            return False+        return self.hash_supported(algorithm)++    def scrypt_supported(self) -> bool:+        if self._fips_enabled:+            return False+        else:+            return hasattr(rust_openssl.kdf.Scrypt, "derive")++    def argon2_supported(self) -> bool:+        if self._fips_enabled:+            return False+        else:+            return hasattr(rust_openssl.kdf.Argon2id, "derive")++    def hmac_supported(self, algorithm: hashes.HashAlgorithm) -> bool:+        # FIPS mode still allows SHA1 for HMAC+        if self._fips_enabled and isinstance(algorithm, hashes.SHA1):+            return True+        if rust_openssl.CRYPTOGRAPHY_IS_AWSLC:+            return isinstance(+                algorithm,+                (+                    hashes.MD5,+                    hashes.SHA1,+                    hashes.SHA224,+                    hashes.SHA256,+                    hashes.SHA384,+                    hashes.SHA512,+                    hashes.SHA512_224,+                    hashes.SHA512_256,+                ),+            )+        return self.hash_supported(algorithm)++    def cipher_supported(self, cipher: CipherAlgorithm, mode: Mode) -> bool:+        if self._fips_enabled:+            # FIPS mode requires AES. TripleDES is disallowed/deprecated in+            # FIPS 140-3.+            if not isinstance(cipher, self._fips_ciphers):+                return False++        return rust_openssl.ciphers.cipher_supported(cipher, mode)++    def pbkdf2_hmac_supported(self, algorithm: hashes.HashAlgorithm) -> bool:+        return self.hmac_supported(algorithm)++    def _consume_errors(self) -> list[rust_openssl.OpenSSLError]:+        return rust_openssl.capture_error_stack()++    def _oaep_hash_supported(self, algorithm: hashes.HashAlgorithm) -> bool:+        if self._fips_enabled and isinstance(algorithm, hashes.SHA1):+            return False++        return isinstance(+            algorithm,+            (+                hashes.SHA1,+                hashes.SHA224,+                hashes.SHA256,+                hashes.SHA384,+                hashes.SHA512,+            ),+        )++    def rsa_padding_supported(self, padding: AsymmetricPadding) -> bool:+        if isinstance(padding, PKCS1v15):+            return True+        elif isinstance(padding, PSS) and isinstance(padding._mgf, MGF1):+            # FIPS 186-4 only allows salt length == digest length for PSS+            # It is technically acceptable to set an explicit salt length+            # equal to the digest length and this will incorrectly fail, but+            # since we don't do that in the tests and this method is+            # private, we'll ignore that until we need to do otherwise.+            if (+                self._fips_enabled+                and padding._salt_length != PSS.DIGEST_LENGTH+            ):+                return False+            return self.hash_supported(padding._mgf._algorithm)+        elif isinstance(padding, OAEP) and isinstance(padding._mgf, MGF1):+            return self._oaep_hash_supported(+                padding._mgf._algorithm+            ) and self._oaep_hash_supported(padding._algorithm)+        else:+            return False++    def rsa_encryption_supported(self, padding: AsymmetricPadding) -> bool:+        if self._fips_enabled and isinstance(padding, PKCS1v15):+            return False+        else:+            return self.rsa_padding_supported(padding)++    def dsa_supported(self) -> bool:+        return (+            not rust_openssl.CRYPTOGRAPHY_IS_BORINGSSL+            and not self._fips_enabled+        )++    def dsa_hash_supported(self, algorithm: hashes.HashAlgorithm) -> bool:+        if not self.dsa_supported():+            return False+        return self.signature_hash_supported(algorithm)++    def cmac_algorithm_supported(self, algorithm) -> bool:+        return self.cipher_supported(+            algorithm, CBC(b"\x00" * algorithm.block_size)+        )++    def elliptic_curve_supported(self, curve: ec.EllipticCurve) -> bool:+        if self._fips_enabled and not isinstance(+            curve, self._fips_ecdh_curves+        ):+            return False++        return rust_openssl.ec.curve_supported(curve)++    def elliptic_curve_signature_algorithm_supported(+        self,+        signature_algorithm: ec.EllipticCurveSignatureAlgorithm,+        curve: ec.EllipticCurve,+    ) -> bool:+        # We only support ECDSA right now.+        if not isinstance(signature_algorithm, ec.ECDSA):+            return False++        return self.elliptic_curve_supported(curve) and (+            isinstance(signature_algorithm.algorithm, asym_utils.Prehashed)+            or self.hash_supported(signature_algorithm.algorithm)+        )++    def elliptic_curve_exchange_algorithm_supported(
… 67 more lines (truncated)
cryptography/hazmat/bindings/__init__.py +3 lines
--- +++ @@ -0,0 +1,3 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.
cryptography/hazmat/bindings/openssl/__init__.py +3 lines
--- +++ @@ -0,0 +1,3 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.
cryptography/hazmat/bindings/openssl/_conditional.py +199 lines
--- +++ @@ -0,0 +1,199 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations+++def cryptography_has_set_cert_cb() -> list[str]:+    return [+        "SSL_CTX_set_cert_cb",+        "SSL_set_cert_cb",+    ]+++def cryptography_has_ssl_st() -> list[str]:+    return [+        "SSL_ST_BEFORE",+        "SSL_ST_OK",+        "SSL_ST_INIT",+        "SSL_ST_RENEGOTIATE",+    ]+++def cryptography_has_tls_st() -> list[str]:+    return [+        "TLS_ST_BEFORE",+        "TLS_ST_OK",+    ]+++def cryptography_has_ssl_sigalgs() -> list[str]:+    return [+        "SSL_CTX_set1_sigalgs_list",+    ]+++def cryptography_has_psk() -> list[str]:+    return [+        "SSL_CTX_use_psk_identity_hint",+        "SSL_CTX_set_psk_server_callback",+        "SSL_CTX_set_psk_client_callback",+    ]+++def cryptography_has_psk_tlsv13() -> list[str]:+    return [+        "SSL_CTX_set_psk_find_session_callback",+        "SSL_CTX_set_psk_use_session_callback",+        "Cryptography_SSL_SESSION_new",+        "SSL_CIPHER_find",+        "SSL_SESSION_set1_master_key",+        "SSL_SESSION_set_cipher",+        "SSL_SESSION_set_protocol_version",+    ]+++def cryptography_has_custom_ext() -> list[str]:+    return [+        "SSL_CTX_add_client_custom_ext",+        "SSL_CTX_add_server_custom_ext",+        "SSL_extension_supported",+    ]+++def cryptography_has_tlsv13_functions() -> list[str]:+    return [+        "SSL_CTX_set_ciphersuites",+    ]+++def cryptography_has_tlsv13_hs_functions() -> list[str]:+    return [+        "SSL_VERIFY_POST_HANDSHAKE",+        "SSL_verify_client_post_handshake",+        "SSL_CTX_set_post_handshake_auth",+        "SSL_set_post_handshake_auth",+        "SSL_SESSION_get_max_early_data",+        "SSL_write_early_data",+        "SSL_read_early_data",+        "SSL_CTX_set_max_early_data",+    ]+++def cryptography_has_ssl_verify_client_post_handshake() -> list[str]:+    return [+        "SSL_verify_client_post_handshake",+    ]+++def cryptography_has_engine() -> list[str]:+    return [+        "ENGINE_by_id",+        "ENGINE_init",+        "ENGINE_finish",+        "ENGINE_get_default_RAND",+        "ENGINE_set_default_RAND",+        "ENGINE_unregister_RAND",+        "ENGINE_ctrl_cmd",+        "ENGINE_free",+        "ENGINE_get_name",+        "ENGINE_ctrl_cmd_string",+        "ENGINE_load_builtin_engines",+        "ENGINE_load_private_key",+        "ENGINE_load_public_key",+        "SSL_CTX_set_client_cert_engine",+    ]+++def cryptography_has_verified_chain() -> list[str]:+    return [+        "SSL_get0_verified_chain",+    ]+++def cryptography_has_srtp() -> list[str]:+    return [+        "SSL_CTX_set_tlsext_use_srtp",+        "SSL_set_tlsext_use_srtp",+        "SSL_get_selected_srtp_profile",+    ]+++def cryptography_has_dtls_get_data_mtu() -> list[str]:+    return [+        "DTLS_get_data_mtu",+    ]+++def cryptography_has_ssl_cookie() -> list[str]:+    return [+        "SSL_OP_COOKIE_EXCHANGE",+        "DTLS1_COOKIE_LENGTH",+        "DTLSv1_listen",+        "SSL_CTX_set_cookie_generate_cb",+        "SSL_CTX_set_cookie_verify_cb",+    ]+++def cryptography_has_prime_checks() -> list[str]:+    return [+        "BN_prime_checks_for_size",+    ]+++def cryptography_has_unexpected_eof_while_reading() -> list[str]:+    return ["SSL_R_UNEXPECTED_EOF_WHILE_READING"]+++def cryptography_has_ssl_op_ignore_unexpected_eof() -> list[str]:+    return [+        "SSL_OP_IGNORE_UNEXPECTED_EOF",+    ]+++def cryptography_has_get_extms_support() -> list[str]:+    return ["SSL_get_extms_support"]+++def cryptography_has_ssl_get0_group_name() -> list[str]:+    return ["SSL_get0_group_name"]+++# This is a mapping of+# {condition: function-returning-names-dependent-on-that-condition} so we can+# loop over them and delete unsupported names at runtime. It will be removed+# when cffi supports #if in cdef. We use functions instead of just a dict of+# lists so we can use coverage to measure which are used.+CONDITIONAL_NAMES = {+    "Cryptography_HAS_SET_CERT_CB": cryptography_has_set_cert_cb,+    "Cryptography_HAS_SSL_ST": cryptography_has_ssl_st,+    "Cryptography_HAS_TLS_ST": cryptography_has_tls_st,+    "Cryptography_HAS_SIGALGS": cryptography_has_ssl_sigalgs,+    "Cryptography_HAS_PSK": cryptography_has_psk,+    "Cryptography_HAS_PSK_TLSv1_3": cryptography_has_psk_tlsv13,+    "Cryptography_HAS_CUSTOM_EXT": cryptography_has_custom_ext,+    "Cryptography_HAS_TLSv1_3_FUNCTIONS": cryptography_has_tlsv13_functions,+    "Cryptography_HAS_TLSv1_3_HS_FUNCTIONS": (+        cryptography_has_tlsv13_hs_functions+    ),+    "Cryptography_HAS_SSL_VERIFY_CLIENT_POST_HANDSHAKE": (+        cryptography_has_ssl_verify_client_post_handshake+    ),+    "Cryptography_HAS_ENGINE": cryptography_has_engine,+    "Cryptography_HAS_VERIFIED_CHAIN": cryptography_has_verified_chain,+    "Cryptography_HAS_SRTP": cryptography_has_srtp,+    "Cryptography_HAS_DTLS_GET_DATA_MTU": cryptography_has_dtls_get_data_mtu,+    "Cryptography_HAS_SSL_COOKIE": cryptography_has_ssl_cookie,+    "Cryptography_HAS_PRIME_CHECKS": cryptography_has_prime_checks,+    "Cryptography_HAS_UNEXPECTED_EOF_WHILE_READING": (+        cryptography_has_unexpected_eof_while_reading+    ),+    "Cryptography_HAS_SSL_OP_IGNORE_UNEXPECTED_EOF": (+        cryptography_has_ssl_op_ignore_unexpected_eof+    ),+    "Cryptography_HAS_GET_EXTMS_SUPPORT": cryptography_has_get_extms_support,+    "Cryptography_HAS_SSL_GET0_GROUP_NAME": (+        cryptography_has_ssl_get0_group_name+    ),+}
cryptography/hazmat/bindings/openssl/binding.py +107 lines
--- +++ @@ -0,0 +1,107 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++import threading+import types+import typing+from collections.abc import Callable, Mapping++import cryptography+from cryptography.exceptions import InternalError+from cryptography.hazmat.bindings._rust import _openssl, openssl+from cryptography.hazmat.bindings.openssl._conditional import CONDITIONAL_NAMES+++def _openssl_assert(ok: bool) -> None:+    if not ok:+        errors = openssl.capture_error_stack()++        raise InternalError(+            "Unknown OpenSSL error. This error is commonly encountered when "+            "another library is not cleaning up the OpenSSL error stack. If "+            "you are using cryptography with another library that uses "+            "OpenSSL try disabling it before reporting a bug. Otherwise "+            "please file an issue at https://github.com/pyca/cryptography/"+            "issues with information on how to reproduce "+            f"this. ({errors!r})",+            errors,+        )+++def build_conditional_library(+    lib: typing.Any,+    conditional_names: Mapping[str, Callable[[], list[str]]],+) -> typing.Any:+    conditional_lib = types.ModuleType("lib")+    conditional_lib._original_lib = lib  # type: ignore[attr-defined]+    excluded_names = set()+    for condition, names_cb in conditional_names.items():+        if not getattr(lib, condition):+            excluded_names.update(names_cb())++    for attr in dir(lib):+        if attr not in excluded_names:+            setattr(conditional_lib, attr, getattr(lib, attr))++    return conditional_lib+++class Binding:+    """+    OpenSSL API wrapper.+    """++    lib: typing.ClassVar[typing.Any] = None+    ffi: typing.Any = _openssl.ffi+    _lib_loaded = False+    _init_lock = threading.Lock()++    def __init__(self) -> None:+        self._ensure_ffi_initialized()++    @classmethod+    def _ensure_ffi_initialized(cls) -> None:+        with cls._init_lock:+            if not cls._lib_loaded:+                cls.lib = build_conditional_library(+                    _openssl.lib, CONDITIONAL_NAMES+                )+                cls._lib_loaded = True++    @classmethod+    def init_static_locks(cls) -> None:+        cls._ensure_ffi_initialized()+++def _verify_package_version(version: str) -> None:+    # Occasionally we run into situations where the version of the Python+    # package does not match the version of the shared object that is loaded.+    # This may occur in environments where multiple versions of cryptography+    # are installed and available in the python path. To avoid errors cropping+    # up later this code checks that the currently imported package and the+    # shared object that were loaded have the same version and raise an+    # ImportError if they do not+    so_package_version = _openssl.ffi.string(+        _openssl.lib.CRYPTOGRAPHY_PACKAGE_VERSION+    )+    if version.encode("ascii") != so_package_version:+        raise ImportError(+            "The version of cryptography does not match the loaded "+            "shared object. This can happen if you have multiple copies of "+            "cryptography installed in your Python path. Please try creating "+            "a new virtual environment to resolve this issue. "+            f"Loaded python version: {version}, "+            f"shared object version: {so_package_version}"+        )++    _openssl_assert(+        _openssl.lib.OpenSSL_version_num() == openssl.openssl_version(),+    )+++_verify_package_version(cryptography.__version__)++Binding.init_static_locks()
cryptography/hazmat/decrepit/__init__.py +5 lines
--- +++ @@ -0,0 +1,5 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations
cryptography/hazmat/decrepit/ciphers/__init__.py +5 lines
--- +++ @@ -0,0 +1,5 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations
cryptography/hazmat/decrepit/ciphers/algorithms.py +142 lines
--- +++ @@ -0,0 +1,142 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++import warnings++from cryptography import utils+from cryptography.hazmat.primitives._cipheralgorithm import (+    BlockCipherAlgorithm,+    CipherAlgorithm,+    _verify_key_size,+)+++class ARC4(CipherAlgorithm):+    name = "RC4"+    key_sizes = frozenset([40, 56, 64, 80, 128, 160, 192, 256])++    def __init__(self, key: bytes):+        self.key = _verify_key_size(self, key)++    @property+    def key_size(self) -> int:+        return len(self.key) * 8+++class TripleDES(BlockCipherAlgorithm):+    name = "3DES"+    block_size = 64+    key_sizes = frozenset([64, 128, 192])++    def __init__(self, key: bytes):+        if len(key) == 8:+            warnings.warn(+                "Single-key TripleDES (8-byte keys) is deprecated and "+                "support will be removed in a future release. Use 24-byte "+                "keys instead (e.g., key + key + key).",+                utils.DeprecatedIn47,+                stacklevel=2,+            )+            key = key + key + key+        elif len(key) == 16:+            warnings.warn(+                "Two-key TripleDES (16-byte keys) is deprecated and "+                "support will be removed in a future release. Use 24-byte "+                "keys instead (e.g., key + key[:8]).",+                utils.DeprecatedIn47,+                stacklevel=2,+            )+            key = key + key[:8]+        self.key = _verify_key_size(self, key)++    @property+    def key_size(self) -> int:+        return len(self.key) * 8+++# Not actually supported, marker for tests+class _DES:+    key_size = 64+++class Blowfish(BlockCipherAlgorithm):+    name = "Blowfish"+    block_size = 64+    key_sizes = frozenset(range(32, 449, 8))++    def __init__(self, key: bytes):+        self.key = _verify_key_size(self, key)++    @property+    def key_size(self) -> int:+        return len(self.key) * 8+++class CAST5(BlockCipherAlgorithm):+    name = "CAST5"+    block_size = 64+    key_sizes = frozenset(range(40, 129, 8))++    def __init__(self, key: bytes):+        self.key = _verify_key_size(self, key)++    @property+    def key_size(self) -> int:+        return len(self.key) * 8+++class SEED(BlockCipherAlgorithm):+    name = "SEED"+    block_size = 128+    key_sizes = frozenset([128])++    def __init__(self, key: bytes):+        self.key = _verify_key_size(self, key)++    @property+    def key_size(self) -> int:+        return len(self.key) * 8+++class IDEA(BlockCipherAlgorithm):+    name = "IDEA"+    block_size = 64+    key_sizes = frozenset([128])++    def __init__(self, key: bytes):+        self.key = _verify_key_size(self, key)++    @property+    def key_size(self) -> int:+        return len(self.key) * 8+++class Camellia(BlockCipherAlgorithm):+    name = "camellia"+    block_size = 128+    key_sizes = frozenset([128, 192, 256])++    def __init__(self, key: bytes):+        self.key = _verify_key_size(self, key)++    @property+    def key_size(self) -> int:+        return len(self.key) * 8+++# This class only allows RC2 with a 128-bit key. No support for+# effective key bits or other key sizes is provided.+class RC2(BlockCipherAlgorithm):+    name = "RC2"+    block_size = 64+    key_sizes = frozenset([128])++    def __init__(self, key: bytes):+        self.key = _verify_key_size(self, key)++    @property+    def key_size(self) -> int:+        return len(self.key) * 8
cryptography/hazmat/decrepit/ciphers/modes.py +53 lines
--- +++ @@ -0,0 +1,53 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++from cryptography import utils+from cryptography.hazmat.primitives._modes import (+    ModeWithInitializationVector,+    _check_iv_and_key_length,+)+++class OFB(ModeWithInitializationVector):+    name = "OFB"++    def __init__(self, initialization_vector: utils.Buffer):+        utils._check_byteslike("initialization_vector", initialization_vector)+        self._initialization_vector = initialization_vector++    @property+    def initialization_vector(self) -> utils.Buffer:+        return self._initialization_vector++    validate_for_algorithm = _check_iv_and_key_length+++class CFB(ModeWithInitializationVector):+    name = "CFB"++    def __init__(self, initialization_vector: utils.Buffer):+        utils._check_byteslike("initialization_vector", initialization_vector)+        self._initialization_vector = initialization_vector++    @property+    def initialization_vector(self) -> utils.Buffer:+        return self._initialization_vector++    validate_for_algorithm = _check_iv_and_key_length+++class CFB8(ModeWithInitializationVector):+    name = "CFB8"++    def __init__(self, initialization_vector: utils.Buffer):+        utils._check_byteslike("initialization_vector", initialization_vector)+        self._initialization_vector = initialization_vector++    @property+    def initialization_vector(self) -> utils.Buffer:+        return self._initialization_vector++    validate_for_algorithm = _check_iv_and_key_length
cryptography/hazmat/primitives/__init__.py +3 lines
--- +++ @@ -0,0 +1,3 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.
cryptography/hazmat/primitives/_asymmetric.py +19 lines
--- +++ @@ -0,0 +1,19 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++import abc++# This exists to break an import cycle. It is normally accessible from the+# asymmetric padding module.+++class AsymmetricPadding(metaclass=abc.ABCMeta):+    @property+    @abc.abstractmethod+    def name(self) -> str:+        """+        A string naming this padding (e.g. "PSS", "PKCS1").+        """
cryptography/hazmat/primitives/_cipheralgorithm.py +60 lines
--- +++ @@ -0,0 +1,60 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++from __future__ import annotations++import abc++from cryptography import utils++# This exists to break an import cycle. It is normally accessible from the+# ciphers module.+++class CipherAlgorithm(metaclass=abc.ABCMeta):+    @property+    @abc.abstractmethod+    def name(self) -> str:+        """+        A string naming this mode (e.g. "AES", "Camellia").+        """++    @property+    @abc.abstractmethod+    def key_sizes(self) -> frozenset[int]:+        """+        Valid key sizes for this algorithm in bits+        """++    @property+    @abc.abstractmethod+    def key_size(self) -> int:+        """+        The size of the key being used as an integer in bits (e.g. 128, 256).+        """+++class BlockCipherAlgorithm(CipherAlgorithm):+    key: utils.Buffer++    @property+    @abc.abstractmethod+    def block_size(self) -> int:+        """+        The size of a block as an integer in bits (e.g. 64, 128).+        """+++def _verify_key_size(+    algorithm: CipherAlgorithm, key: utils.Buffer+) -> utils.Buffer:+    # Verify that the key is instance of bytes+    utils._check_byteslike("key", key)++    # Verify that the key size matches the expected key size+    if len(key) * 8 not in algorithm.key_sizes:+        raise ValueError(+            f"Invalid key size ({len(key) * 8}) for {algorithm.name}."+        )+    return key
numpy pypi
2.5.1 8d ago incident on record
YANKBURST ×2
latest 2.5.1 versions 149 maintainers 1
2.3.3
2.3.4
2.3.5
2.4.0
2.4.1
2.4.2
2.4.3
2.4.4
2.4.5
2.4.6
2.5.0
2.5.1
YANK
2.4.0 marked yanked (still downloadable)
high · registry-verified · 2025-12-20 · 6mo ago
BURST
3 releases in 22m: 1.10.4, 1.9.3, 1.8.2
info · registry-verified · 2016-04-20 · 10y ago
BURST
15 releases in 40m: 1.7.2, 1.6.2, 1.10.3, 1.10.2, 1.10.1, 1.10.0, 1.9.2, 1.9.1, 1.9.0, 1.8.1, 1.8.0, 1.7.1, 1.7.0, 1.6.1, 1.6.0
info · registry-verified · 2016-04-20 · 10y ago
release diff 2.5.0 → 2.5.1
artifact too large or unavailable
packaging pypi
26.2 2mo ago incident on record
critical-tier YANKBURST ×3
latest 26.2 versions 53 maintainers 1 critical-tier (snapshotted)
21.3
22.0
23.0
23.1
23.2
24.0
24.1
24.2
25.0
26.0
26.1
26.2
YANK
20.6 marked yanked (still downloadable)
high · registry-verified · 2020-11-28 · 5y ago
BURST
2 releases in 9m: 20.2, 20.3
info · registry-verified · 2020-03-05 · 6y ago
BURST
2 releases in 3m: 20.6, 20.7
info · registry-verified · 2020-11-28 · 5y ago
BURST
2 releases in 5m: 21.1, 21.2
info · registry-verified · 2021-10-29 · 4y ago
release diff 26.1 → 26.2
+2 added · -0 removed · ~23 modified
pyproject.toml +3 lines
--- +++ @@ -160,4 +160,5 @@ "tests/test_*.py" = ["PYI024", "PLR", "SIM201", "T20", "S301"]-"tasks/check.py" = ["UP032", "T20"]-"tasks/check_frozen_revs.py" = ["T20", "ANN401"]+"tasks/*.py" = ["T20"]+"tasks/check.py" = ["UP032"]+"tasks/check_frozen_revs.py" = ["ANN401"] "tests/test_requirements.py" = ["UP032"]
src/packaging/__init__.py +1 lines
--- +++ @@ -8,3 +8,3 @@ -__version__ = "26.1"+__version__ = "26.2" 
src/packaging/_parser.py +28 lines
--- +++ @@ -28,2 +28,30 @@         raise NotImplementedError++    def __getstate__(self) -> str:+        # Return just the value string for compactness and stability.+        return self.value++    def _restore_value(self, value: object) -> None:+        if not isinstance(value, str):+            raise TypeError(+                f"Cannot restore {self.__class__.__name__} value from {value!r}"+            )+        self.value = value++    def __setstate__(self, state: object) -> None:+        if isinstance(state, str):+            # New format (26.2+): just the value string.+            self._restore_value(state)+            return+        if isinstance(state, tuple) and len(state) == 2:+            # Old format (packaging <= 26.0, __slots__): (None, {slot: value}).+            _, slot_dict = state+            if isinstance(slot_dict, dict) and "value" in slot_dict:+                self._restore_value(slot_dict["value"])+                return+        if isinstance(state, dict) and "value" in state:+            # Old format (packaging <= 25.0, no __slots__): plain __dict__.+            self._restore_value(state["value"])+            return+        raise TypeError(f"Cannot restore {self.__class__.__name__} from {state!r}") 
src/packaging/_structures.py +33 lines
--- +++ @@ -0,0 +1,33 @@+# This file is dual licensed under the terms of the Apache License, Version+# 2.0, and the BSD License. See the LICENSE file in the root of this repository+# for complete details.++"""Backward-compatibility shim for unpickling Version objects serialized before+packaging 26.1.++Old pickles reference ``packaging._structures.InfinityType`` and+``packaging._structures.NegativeInfinityType``.  This module provides minimal+stand-in classes so that ``pickle.loads()`` can resolve those references.+The deserialized objects are not used for comparisons — ``Version.__setstate__``+discards the stale ``_key`` cache and recomputes it from the core version fields.+"""++from __future__ import annotations+++class InfinityType:+    """Stand-in for the removed ``InfinityType`` used in old comparison keys."""++    def __repr__(self) -> str:+        return "Infinity"+++class NegativeInfinityType:+    """Stand-in for the removed ``NegativeInfinityType`` used in old comparison keys."""++    def __repr__(self) -> str:+        return "-Infinity"+++Infinity = InfinityType()+NegativeInfinity = NegativeInfinityType()
src/packaging/markers.py +39 lines
--- +++ @@ -324,2 +324,12 @@     :raises InvalidMarker: If ``marker`` cannot be parsed.++    Instances are safe to serialize with :mod:`pickle`. They use a stable+    format so the same pickle can be loaded in future packaging releases.++    .. versionchanged:: 26.2++        Added a stable pickle format. Pickles created with packaging 26.2+ can+        be unpickled with future releases.  Backward compatibility with pickles+        from packaging < 26.2 is supported but may be removed in a future+        release.     """@@ -383,2 +393,31 @@ +    def __getstate__(self) -> str:+        # Return the marker expression string for compactness and stability.+        # Internal Node objects are excluded; the string is re-parsed on load.+        return str(self)++    def __setstate__(self, state: object) -> None:+        if isinstance(state, str):+            # New format (26.2+): just the marker expression string.+            try:+                self._markers = _normalize_extra_values(_parse_marker(state))+            except ParserSyntaxError as exc:+                raise TypeError(f"Cannot restore Marker from {state!r}") from exc+            return+        if isinstance(state, dict) and "_markers" in state:+            # Old format (packaging <= 26.1, no __slots__): plain __dict__.+            markers = state["_markers"]+            if isinstance(markers, list):+                self._markers = markers+                return+        if isinstance(state, tuple) and len(state) == 2:+            # Old format (packaging <= 26.1, __slots__): (None, {slot: value}).+            _, slot_dict = state+            if isinstance(slot_dict, dict) and "_markers" in slot_dict:+                markers = slot_dict["_markers"]+                if isinstance(markers, list):+                    self._markers = markers+                    return+        raise TypeError(f"Cannot restore Marker from {state!r}")+     def __and__(self, other: Marker) -> Marker:
src/packaging/metadata.py +1 lines
--- +++ @@ -29,2 +29,3 @@ __all__ = [+    "ExceptionGroup",  # Keep this for a bit (makes mypy happy w/ 26.0 compat)     "InvalidMetadata",
src/packaging/requirements.py +34 lines
--- +++ @@ -35,2 +35,12 @@     string.++    Instances are safe to serialize with :mod:`pickle`. They use a stable+    format so the same pickle can be loaded in future packaging releases.++    .. versionchanged:: 26.2++        Added a stable pickle format. Pickles created with packaging 26.2+ can+        be unpickled with future releases.  Backward compatibility with pickles+        from packaging < 26.2 is supported but may be removed in a future+        release.     """@@ -75,2 +85,26 @@ +    def __getstate__(self) -> str:+        # Return the requirement string for compactness and stability.+        # Re-parsed on load to reconstruct all fields.+        return str(self)++    def __setstate__(self, state: object) -> None:+        if isinstance(state, str):+            # New format (26.2+): just the requirement string.+            try:+                tmp = Requirement(state)+            except InvalidRequirement as exc:+                raise TypeError(f"Cannot restore Requirement from {state!r}") from exc+            self.name = tmp.name+            self.url = tmp.url+            self.extras = tmp.extras+            self.specifier = tmp.specifier+            self.marker = tmp.marker+            return+        if isinstance(state, dict):+            # Old format (packaging <= 26.1, no __slots__): plain __dict__.+            self.__dict__.update(state)+            return+        raise TypeError(f"Cannot restore Requirement from {state!r}")+     def __str__(self) -> str:
src/packaging/specifiers.py +155 lines
--- +++ @@ -17,4 +17,15 @@ import re+import sys import typing-from typing import Any, Callable, Final, Iterable, Iterator, Sequence, TypeVar, Union+from typing import (+    TYPE_CHECKING,+    Any,+    Callable,+    Final,+    Iterable,+    Iterator,+    Sequence,+    TypeVar,+    Union,+) @@ -22,2 +33,7 @@ from .version import InvalidVersion, Version++if sys.version_info >= (3, 10):+    from typing import TypeGuard  # pragma: no cover+elif TYPE_CHECKING:+    from typing_extensions import TypeGuard @@ -33,2 +49,15 @@     return __all__+++def _validate_spec(spec: object, /) -> TypeGuard[tuple[str, str]]:+    return (+        isinstance(spec, tuple)+        and len(spec) == 2+        and isinstance(spec[0], str)+        and isinstance(spec[1], str)+    )+++def _validate_pre(pre: object, /) -> TypeGuard[bool | None]:+    return pre is None or isinstance(pre, bool) @@ -416,2 +445,12 @@         comma-separated version specifiers (which is what package metadata contains).++    Instances are safe to serialize with :mod:`pickle`. They use a stable+    format so the same pickle can be loaded in future packaging releases.++    .. versionchanged:: 26.2++        Added a stable pickle format. Pickles created with packaging 26.2+ can+        be unpickled with future releases.  Backward compatibility with pickles+        from packaging < 26.2 is supported but may be removed in a future+        release.     """@@ -724,2 +763,42 @@ +    def __getstate__(self) -> tuple[tuple[str, str], bool | None]:+        # Return state as a 2-item tuple for compactness:+        #   ((operator, version), prereleases)+        # Cache members are excluded and will be recomputed on demand.+        return (self._spec, self._prereleases)++    def __setstate__(self, state: object) -> None:+        # Always discard cached values - they will be recomputed on demand.+        self._spec_version = None+        self._wildcard_split = None+        self._ranges = None++        if isinstance(state, tuple):+            if len(state) == 2:+                # New format (26.2+): ((operator, version), prereleases)+                spec, prereleases = state+                if _validate_spec(spec) and _validate_pre(prereleases):+                    self._spec = spec+                    self._prereleases = prereleases+                    return+            if len(state) == 2 and isinstance(state[1], dict):+                # Format (packaging 26.0-26.1): (None, {slot: value}).+                _, slot_dict = state+                spec = slot_dict.get("_spec")+                prereleases = slot_dict.get("_prereleases", "invalid")+                if _validate_spec(spec) and _validate_pre(prereleases):+                    self._spec = spec+                    self._prereleases = prereleases+                    return+        if isinstance(state, dict):+            # Old format (packaging <= 25.x, no __slots__): state is a plain dict.+            spec = state.get("_spec")+            prereleases = state.get("_prereleases", "invalid")+            if _validate_spec(spec) and _validate_pre(prereleases):+                self._spec = spec+                self._prereleases = prereleases+                return++        raise TypeError(f"Cannot restore Specifier from {state!r}")+     @property@@ -1259,2 +1338,14 @@     specifiers (``>=3.0,!=3.1``), or no specifier at all.++    Instances are safe to serialize with :mod:`pickle`. They use a stable+    format so the same pickle can be loaded in future packaging+    releases.++    .. versionchanged:: 26.2++        Added a stable pickle format. Pickles created with+        packaging 26.2+ can be unpickled with future releases.+        Backward compatibility with pickles from+        packaging < 26.2 is supported but may be removed in a future+        release.     """@@ -1348,2 +1439,65 @@         self._is_unsatisfiable = None++    def __getstate__(self) -> tuple[tuple[Specifier, ...], bool | None]:+        # Return state as a 2-item tuple for compactness:+        #   (specs, prereleases)+        # Cache members are excluded and will be recomputed on demand.+        return (self._specs, self._prereleases)++    def __setstate__(self, state: object) -> None:+        # Always discard cached values - they will be recomputed on demand.+        self._resolved_ops = None+        self._is_unsatisfiable = None++        if isinstance(state, tuple):+            if len(state) == 2:+                # New format (26.2+): (specs, prereleases)+                specs, prereleases = state+                if (+                    isinstance(specs, tuple)+                    and all(isinstance(s, Specifier) for s in specs)+                    and _validate_pre(prereleases)+                ):+                    self._specs = specs+                    self._prereleases = prereleases+                    self._canonicalized = len(specs) <= 1+                    self._has_arbitrary = any("===" in str(s) for s in specs)+                    return+            if len(state) == 2 and isinstance(state[1], dict):+                # Format (packaging 26.0-26.1): (None, {slot: value}).+                _, slot_dict = state+                specs = slot_dict.get("_specs", ())+                prereleases = slot_dict.get("_prereleases")+                # Convert frozenset to tuple (26.0 stored as frozenset)+                if isinstance(specs, frozenset):+                    specs = tuple(sorted(specs, key=str))+                if (+                    isinstance(specs, tuple)+                    and all(isinstance(s, Specifier) for s in specs)+                    and _validate_pre(prereleases)+                ):+                    self._specs = specs+                    self._prereleases = prereleases+                    self._canonicalized = len(self._specs) <= 1+                    self._has_arbitrary = any("===" in str(s) for s in self._specs)+                    return+        if isinstance(state, dict):+            # Old format (packaging <= 25.x, no __slots__): state is a plain dict.+            specs = state.get("_specs", ())+            prereleases = state.get("_prereleases")+            # Convert frozenset to tuple (26.0 stored as frozenset)+            if isinstance(specs, frozenset):+                specs = tuple(sorted(specs, key=str))+            if (+                isinstance(specs, tuple)+                and all(isinstance(s, Specifier) for s in specs)+                and _validate_pre(prereleases)+            ):+                self._specs = specs+                self._prereleases = prereleases+                self._canonicalized = len(self._specs) <= 1+                self._has_arbitrary = any("===" in str(s) for s in self._specs)+                return++        raise TypeError(f"Cannot restore SpecifierSet from {state!r}") 
src/packaging/tags.py +46 lines
--- +++ @@ -17,3 +17,2 @@     TYPE_CHECKING,-    Any,     Iterable,@@ -94,2 +93,12 @@     is also supported.++    Instances are safe to serialize with :mod:`pickle`. They use a stable+    format so the same pickle can be loaded in future packaging releases.++    .. versionchanged:: 26.2++        Added a stable pickle format. Pickles created with packaging 26.2+ can+        be unpickled with future releases.  Backward compatibility with pickles+        from packaging < 26.2 is supported but may be removed in a future+        release.     """@@ -160,8 +169,33 @@ -    def __setstate__(self, state: tuple[None, dict[str, Any]]) -> None:-        # The cached _hash is wrong when unpickling.-        _, slots = state-        for k, v in slots.items():-            setattr(self, k, v)-        self._hash = hash((self._interpreter, self._abi, self._platform))+    def __getstate__(self) -> tuple[str, str, str]:+        # Return state as a 3-item tuple: (interpreter, abi, platform).+        # Cache member _hash is excluded and will be recomputed.+        return (self._interpreter, self._abi, self._platform)++    def __setstate__(self, state: object) -> None:+        if isinstance(state, tuple):+            if len(state) == 3 and all(isinstance(s, str) for s in state):+                # New format (26.2+): (interpreter, abi, platform)+                self._interpreter, self._abi, self._platform = state+                self._hash = hash((self._interpreter, self._abi, self._platform))+                return+            if len(state) == 2 and isinstance(state[1], dict):+                # Old format (packaging <= 26.1, __slots__): (None, {slot: value}).+                _, slots = state+                try:+                    interpreter = slots["_interpreter"]+                    abi = slots["_abi"]+                    platform = slots["_platform"]+                except KeyError:+                    raise TypeError(f"Cannot restore Tag from {state!r}") from None+                if not all(+                    isinstance(value, str) for value in (interpreter, abi, platform)+                ):+                    raise TypeError(f"Cannot restore Tag from {state!r}")+                self._interpreter = interpreter.lower()+                self._abi = abi.lower()+                self._platform = platform.lower()+                self._hash = hash((self._interpreter, self._abi, self._platform))+                return+        raise TypeError(f"Cannot restore Tag from {state!r}") @@ -751,5 +785,7 @@ def _emscripten_platforms() -> Iterator[str]:-    pyemscripten_abi_version = sysconfig.get_config_var("PYEMSCRIPTEN_ABI_VERSION")-    if pyemscripten_abi_version:-        yield f"pyemscripten_{pyemscripten_abi_version}_wasm32"+    pyemscripten_platform_version = sysconfig.get_config_var(+        "PYEMSCRIPTEN_PLATFORM_VERSION"+    )+    if pyemscripten_platform_version:+        yield f"pyemscripten_{pyemscripten_platform_version}_wasm32"     yield from _generic_platforms()
src/packaging/version.py +77 lines
--- +++ @@ -360,2 +360,12 @@     part of a version.++    Instances are safe to serialize with :mod:`pickle`. They use a stable+    format so the same pickle can be loaded in future packaging releases.++    .. versionchanged:: 26.2++        Added a stable pickle format. Pickles created with packaging 26.2+ can+        be unpickled with future releases.  Backward compatibility with pickles+        from packaging < 26.2 is supported but may be removed in a future+        release.     """@@ -743,2 +753,69 @@ +    def __getstate__(+        self,+    ) -> tuple[+        int,+        tuple[int, ...],+        tuple[str, int] | None,+        tuple[str, int] | None,+        tuple[str, int] | None,+        LocalType | None,+    ]:+        # Return state as a 6-item tuple for compactness:+        #   (epoch, release, pre, post, dev, local)+        # Cache members are excluded and will be recomputed on demand+        return (+            self._epoch,+            self._release,+            self._pre,+            self._post,+            self._dev,+            self._local,+        )++    def __setstate__(self, state: object) -> None:+        # Always discard cached values — they may contain stale references+        # (e.g. packaging._structures.InfinityType from pre-26.1 pickles)+        # and will be recomputed on demand from the core fields above.+        self._key_cache = None+        self._hash_cache = None++        if isinstance(state, tuple):+            if len(state) == 6:+                # New format (26.2+): (epoch, release, pre, post, dev, local)+                (+                    self._epoch,+                    self._release,+                    self._pre,+                    self._post,+                    self._dev,+                    self._local,+                ) = state+                return+            if len(state) == 2:+                # Format (packaging 26.0-26.1): (None, {slot: value}).+                _, slot_dict = state+                if isinstance(slot_dict, dict):+                    self._epoch = slot_dict["_epoch"]+                    self._release = slot_dict["_release"]+                    self._pre = slot_dict.get("_pre")+                    self._post = slot_dict.get("_post")+                    self._dev = slot_dict.get("_dev")+                    self._local = slot_dict.get("_local")+                    return+        if isinstance(state, dict):+            # Old format (packaging <= 25.x, no __slots__): state is a plain+            # dict with "_version" (_Version NamedTuple) and "_key" entries.+            version_nt = state.get("_version")+            if version_nt is not None:+                self._epoch = version_nt.epoch+                self._release = version_nt.release+                self._pre = version_nt.pre+                self._post = version_nt.post+                self._dev = version_nt.dev+                self._local = version_nt.local+                return++        raise TypeError(f"Cannot restore Version from {state!r}")+     @property
tests/test_markers.py +156 lines
--- +++ @@ -8,2 +8,3 @@ import os+import pickle import platform@@ -15,3 +16,3 @@ -from packaging._parser import Node+from packaging._parser import Node, Op, Value, Variable from packaging.markers import (@@ -566 +567,155 @@     assert m.evaluate(env) is True++[email protected](+    "marker_str",+    [+        'python_version >= "3.8"',+        'python_version >= "3.8" and os_name == "posix"',+        'python_version >= "3.8" or platform_system == "Windows"',+        'extra == "security"',+    ],+)+def test_pickle_marker_roundtrip(marker_str: str) -> None:+    # Make sure equality and str() work between a pickle/unpickle round trip.+    m = Marker(marker_str)+    loaded = pickle.loads(pickle.dumps(m))+    assert loaded == m+    assert str(loaded) == str(m)+++def test_pickle_marker_setstate_rejects_invalid_state() -> None:+    # Cover the TypeError branches in __setstate__ for invalid input.+    m = Marker.__new__(Marker)+    with pytest.raises(TypeError, match="Cannot restore Marker"):+        m.__setstate__(12345)+    with pytest.raises(TypeError, match="Cannot restore Marker"):+        m.__setstate__((1, 2, 3))  # Wrong tuple length+++# Pickle bytes generated with packaging==26.1, Python 3.13.1, pickle protocol 2.+# Format: __slots__ (no __getstate__), state is (None, {slot: value}).+_PACKAGING_26_1_PICKLE_MARKER_PYTHON_VERSION_GE_3_8 = (+    b"\x80\x02cpackaging.markers\nMarker\nq\x00)\x81q\x01N}q\x02X\x08\x00"+    b"\x00\x00_markersq\x03]q\x04cpackaging._parser\nVariable\nq\x05)\x81"+    b"q\x06N}q\x07X\x05\x00\x00\x00valueq\x08X\x0e\x00\x00\x00python_vers"+    b"ionq\ts\x86q\nbcpackaging._parser\nOp\nq\x0b)\x81q\x0cN}q\rh\x08X\x02"+    b"\x00\x00\x00>=q\x0es\x86q\x0fbcpackaging._parser\nValue\nq\x10)\x81q"+    b"\x11N}q\x12h\x08X\x03\x00\x00\x003.8q\x13s\x86q\x14b\x87q\x15as\x86"+    b"q\x16b."+)+++# Pickle bytes generated with packaging==26.0, Python 3.13.1, pickle protocol 2.+# Format: __slots__ (no __getstate__), state is plain __dict__.+_PACKAGING_26_0_PICKLE_MARKER_PYTHON_VERSION_GE_3_8 = (+    b"\x80\x02cpackaging.markers\nMarker\nq\x00)\x81q\x01}q\x02X\x08\x00\x00"+    b"\x00_markersq\x03]q\x04cpackaging._parser\nVariable\nq\x05)\x81q\x06N}"+    b"q\x07X\x05\x00\x00\x00valueq\x08X\x0e\x00\x00\x00python_versionq\ts\x86"+    b"q\nbcpackaging._parser\nOp\nq\x0b)\x81q\x0cN}q\rh\x08X\x02\x00\x00"+    b"\x00>=q\x0es\x86q\x0fbcpackaging._parser\nValue\nq\x10)\x81q\x11N}q\x12"+    b"h\x08X\x03\x00\x00\x003.8q\x13s\x86q\x14b\x87q\x15asb."+)++# Format: __slots__ with Node objects using __dict__ format (packaging <= 25.0).+# Now loadable because Node classes have __getstate__/__setstate__.+_PACKAGING_25_0_PICKLE_MARKER_PYTHON_VERSION_GE_3_8 = (+    b"\x80\x02cpackaging.markers\nMarker\nq\x00)\x81q\x01}q\x02X\x08\x00\x00"+    b"\x00_markersq\x03]q\x04cpackaging._parser\nVariable\nq\x05)\x81q\x06}q\x07"+    b"X\x05\x00\x00\x00valueq\x08X\x0e\x00\x00\x00python_versionq\tsbcpackaging"+    b"._parser\nOp\nq\n)\x81q\x0b}q\x0ch\x08X\x02\x00\x00\x00>=q\rsbcpackaging"+    b"._parser\nValue\nq\x0e)\x81q\x0f}q\x10h\x08X\x03\x00\x00\x003.8q\x11sb\x87"+    b"q\x12asb."+)+++def test_pickle_marker_old_format_loads() -> None:+    # Verify that Marker pickles created with packaging <= 26.1 (__slots__,+    # no __getstate__) can be loaded and produce correct Marker objects.+    m = pickle.loads(_PACKAGING_26_1_PICKLE_MARKER_PYTHON_VERSION_GE_3_8)+    assert isinstance(m, Marker)+    assert str(m) == 'python_version >= "3.8"'+    assert m == Marker('python_version >= "3.8"')+++def test_pickle_marker_26_0_format_loads() -> None:+    # Verify that Marker pickles created with packaging 26.0 (plain __dict__)+    # can be loaded and produce correct Marker objects.+    m = pickle.loads(_PACKAGING_26_0_PICKLE_MARKER_PYTHON_VERSION_GE_3_8)+    assert isinstance(m, Marker)+    assert str(m) == 'python_version >= "3.8"'+    assert m == Marker('python_version >= "3.8"')+++def test_pickle_marker_25_0_format_loads() -> None:+    # Verify that Marker pickles created with packaging 25.0 (with Node __dict__)+    # can now be loaded thanks to __getstate__/__setstate__ in Node classes.+    m = pickle.loads(_PACKAGING_25_0_PICKLE_MARKER_PYTHON_VERSION_GE_3_8)+    assert isinstance(m, Marker)+    assert str(m) == 'python_version >= "3.8"'+    assert m == Marker('python_version >= "3.8"')+++def test_pickle_node_roundtrip() -> None:+    # Cover Node.__getstate__ and Node.__setstate__ with the new string format.+    for node in (Variable("python_version"), Value("3.8"), Op(">=")):+        loaded = pickle.loads(pickle.dumps(node))+        assert loaded.value == node.value+        assert str(loaded) == str(node)+++def test_pickle_node_setstate_rejects_invalid_state() -> None:+    # Cover the TypeError branch in Node.__setstate__ for invalid input.+    node = Variable.__new__(Variable)+    with pytest.raises(TypeError, match="Cannot restore Variable"):+        node.__setstate__(12345)++    node2 = Variable.__new__(Variable)+    with pytest.raises(TypeError, match="Cannot restore Variable"):+        node2.__setstate__((1, 2, 3))  # Wrong tuple length++    # Cover the legacy tuple branch where slot_dict doesn't have "value".+    node3 = Variable.__new__(Variable)+    with pytest.raises(TypeError, match="Cannot restore Variable"):+        node3.__setstate__((None, {"wrong_key": "foo"}))++    # Cover the legacy tuple branch where slot_dict has "value" but it's not a str.+    node4 = Variable.__new__(Variable)+    with pytest.raises(TypeError, match="Cannot restore Variable value from 123"):+        node4.__setstate__((None, {"value": 123}))++    # Cover the legacy dict branch where "value" exists but it's not a str.+    node5 = Value.__new__(Value)+    with pytest.raises(TypeError, match="Cannot restore Value value from 456"):+        node5.__setstate__({"value": 456})++    # Cover the legacy dict branch on Op (different subclass to ensure coverage).+    node6 = Op.__new__(Op)+    with pytest.raises(TypeError, match="Cannot restore Op value from 789"):+        node6.__setstate__({"value": 789})+++def test_pickle_marker_setstate_legacy_slot_dict_without_markers_key() -> None:+    # Cover Marker.__setstate__ legacy tuple branch where slot_dict has no "_markers".+    m = Marker.__new__(Marker)+    with pytest.raises(TypeError, match="Cannot restore Marker"):+        m.__setstate__((None, {"other_key": "value"}))+++def test_pickle_marker_setstate_rejects_invalid_markers_type() -> None:+    # Cover the dict branch where "_markers" exists but is not a list.+    m1 = Marker.__new__(Marker)+    with pytest.raises(TypeError, match="Cannot restore Marker"):+        m1.__setstate__({"_markers": "not a list"})++    # Cover the tuple branch where "_markers" exists but is not a list.+    m2 = Marker.__new__(Marker)+    with pytest.raises(TypeError, match="Cannot restore Marker"):+        m2.__setstate__((None, {"_markers": "not a list"}))+++def test_pickle_marker_setstate_rejects_invalid_marker_string() -> None:+    # Cover the string branch where parsing raises ParserSyntaxError.+    m = Marker.__new__(Marker)+    with pytest.raises(TypeError, match="Cannot restore Marker"):+        m.__setstate__("this is not a valid marker")
tests/test_requirements.py +134 lines
--- +++ @@ -5,2 +5,4 @@ from __future__ import annotations++import pickle @@ -707 +709,133 @@         assert Requirement("packaging>=21.3") != "packaging>=21.3"++[email protected](+    "req_str",+    [+        "requests",+        "requests>=2.0",+        "requests>=2.0,<3.0",+        'requests>=2.0; python_version >= "3.8"',+        "requests[security,socks]>=2.0",+        "my-pkg @ https://example.com",+        'Django>=1.4.2,!=1.5.0,!=1.5.1; python_version < "3"',+    ],+)+def test_pickle_requirement_roundtrip(req_str: str) -> None:+    # Make sure equality and str() work between a pickle/unpickle round trip.+    r = Requirement(req_str)+    loaded = pickle.loads(pickle.dumps(r))+    assert loaded == r+    assert str(loaded) == str(r)+++def test_pickle_requirement_setstate_rejects_invalid_state() -> None:+    # Cover the TypeError branches in __setstate__ for invalid input.+    r = Requirement.__new__(Requirement)+    with pytest.raises(TypeError, match="Cannot restore Requirement"):+        r.__setstate__(12345)+    with pytest.raises(TypeError, match="Cannot restore Requirement"):+        r.__setstate__((1, 2, 3))+++def test_pickle_requirement_setstate_rejects_invalid_string() -> None:+    # Cover the string branch where Requirement() raises InvalidRequirement.+    r = Requirement.__new__(Requirement)+    with pytest.raises(TypeError, match="Cannot restore Requirement"):+        r.__setstate__("this is not a valid requirement")+++# Pickle bytes generated with packaging==26.1, Python 3.13.1, pickle protocol 2.+# Format: plain __dict__ (no __getstate__). Contains nested SpecifierSet and+# Marker objects also pickled in their old format.+_PACKAGING_26_1_PICKLE_REQUESTS_GE_2_0_WITH_MARKER = (+    b"\x80\x02cpackaging.requirements\nRequirement\nq\x00)\x81q\x01}q\x02("+    b"X\x04\x00\x00\x00nameq\x03X\x08\x00\x00\x00requestsq\x04X\x03\x00"+    b"\x00\x00urlq\x05NX\x06\x00\x00\x00extrasq\x06c__builtin__\nset\nq\x07"+    b"]q\x08\x85q\tRq\nX\t\x00\x00\x00specifierq\x0bcpackaging.specifiers\n"+    b"SpecifierSet\nq\x0c)\x81q\rcpackaging.specifiers\nSpecifier\nq\x0e)\x81"+    b"q\x0fX\x02\x00\x00\x00>=q\x10X\x03\x00\x00\x002.0q\x11\x86q\x12N\x86"+    b"q\x13b\x85q\x14N\x86q\x15bX\x06\x00\x00\x00markerq\x16cpackaging."+    b"markers\nMarker\nq\x17)\x81q\x18N}q\x19X\x08\x00\x00\x00_markersq\x1a"+    b"]q\x1bcpackaging._parser\nVariable\nq\x1c)\x81q\x1dN}q\x1eX\x05\x00"+    b"\x00\x00valueq\x1fX\x0e\x00\x00\x00python_versionq s\x86q!b"+    b'cpackaging._parser\nOp\nq")\x81q#N}q$h\x1fX\x02\x00\x00\x00>=q%s'+    b"\x86q&bcpackaging._parser\nValue\nq')\x81q(N}q)h\x1fX\x03\x00\x00"+    b"\x003.8q*s\x86q+b\x87q,as\x86q-bub."+)+++# Pickle bytes generated with packaging==26.0, Python 3.13.1, pickle protocol 2.+# Format: plain __dict__ (no __getstate__).+_PACKAGING_26_0_PICKLE_REQUESTS_GE_2_0 = (+    b"\x80\x02cpackaging.requirements\nRequirement\nq\x00)\x81q\x01}q\x02("+    b"X\x04\x00\x00\x00nameq\x03X\x08\x00\x00\x00requestsq\x04X\x03\x00"+    b"\x00\x00urlq\x05NX\x06\x00\x00\x00extrasq\x06c__builtin__\nset\nq\x07"+    b"]q\x08\x85q\tRq\nX\t\x00\x00\x00specifierq\x0bcpackaging.specifiers\n"+    b"SpecifierSet\nq\x0c)\x81q\rN}q\x0e(X\x0c\x00\x00\x00_prereleasesq\x0f"+    b"NX\x06\x00\x00\x00_specsq\x10c__builtin__\nfrozenset\nq\x11]q\x12cpackag"+    b"ing.specifiers\nSpecifier\nq\x13)\x81q\x14N}q\x15(h\x0fNX\x05\x00\x00"+    b"\x00_specq\x16X\x02\x00\x00\x00>=q\x17X\x03\x00\x00\x002.0q\x18\x86q"+    b"\x19X\r\x00\x00\x00_spec_versionq\x1ah\x18cpackaging.version\nVersion\n"+    b"q\x1b)\x81q\x1cN}q\x1d(X\x04\x00\x00\x00_devq\x1eNX\x06\x00\x00\x00_epo"+    b"chq\x1fK\x00X\n\x00\x00\x00_key_cacheq NX\x06\x00\x00\x00_localq!NX\x05"+    b'\x00\x00\x00_postq"NX\x04\x00\x00\x00_preq#NX\x08\x00\x00\x00_releaseq$'+    b"K\x02K\x00\x86q%u\x86q&b\x86q'u\x86q(b"+    b"a\x85q)Rq*u\x86q+bX\x06\x00\x00"+    b"\x00markerq,Nub."+)+++# Pickle bytes generated with packaging==25.0, Python 3.13.1, pickle protocol 2.+# Format: plain __dict__ (no __getstate__).+_PACKAGING_25_0_PICKLE_REQUESTS_GE_2_0 = (+    b"\x80\x02cpackaging.requirements\nRequirement\nq\x00)\x81q\x01}q\x02("+    b"X\x04\x00\x00\x00nameq\x03X\x08\x00\x00\x00requestsq\x04X\x03\x00"+    b"\x00\x00urlq\x05NX\x06\x00\x00\x00extrasq\x06c__builtin__\nset\nq\x07"+    b"]q\x08\x85q\tRq\nX\t\x00\x00\x00specifierq\x0bcpackaging.specifiers\n"+    b"SpecifierSet\nq\x0c)\x81q\r}q\x0e(X\x06\x00\x00\x00_specsq\x0fc__bui"+    b"ltin__\nfrozenset\nq\x10]q\x11cpackaging.specifiers\nSpecifier\nq\x12)\x81"+    b"q\x13}q\x14(X\x05\x00\x00\x00_specq\x15X\x02\x00\x00\x00>=q\x16X\x03\x00"+    b"\x00\x002.0q\x17\x86q\x18X\x0c\x00\x00\x00_prereleasesq\x19Nuba\x85q\x1a"+    b"Rq\x1bh\x19NubX\x06\x00\x00\x00markerq\x1cNub."+)+++def test_pickle_requirement_old_format_loads() -> None:+    # Verify that Requirement pickles created with packaging <= 26.1 (plain+    # __dict__, no __getstate__) can be loaded and produce correct objects.+    r = pickle.loads(_PACKAGING_26_1_PICKLE_REQUESTS_GE_2_0_WITH_MARKER)+    assert isinstance(r, Requirement)+    assert r.name == "requests"+    assert r.url is None+    assert r.extras == set()+    assert str(r.specifier) == ">=2.0"+    assert r.marker is not None+    assert str(r.marker) == 'python_version >= "3.8"'+    assert r == Requirement('requests>=2.0; python_version >= "3.8"')+++def test_pickle_requirement_26_0_format_loads() -> None:+    # Verify that Requirement pickles created with packaging 26.0 (plain __dict__)+    # can be loaded and produce correct objects.+    r = pickle.loads(_PACKAGING_26_0_PICKLE_REQUESTS_GE_2_0)+    assert isinstance(r, Requirement)+    assert r.name == "requests"+    assert r.url is None+    assert r.extras == set()+    assert str(r.specifier) == ">=2.0"+    assert r.marker is None+    assert r == Requirement("requests>=2.0")+++def test_pickle_requirement_25_0_format_loads() -> None:+    # Verify that Requirement pickles created with packaging 25.0 (plain __dict__)+    # can be loaded and produce correct objects.+    r = pickle.loads(_PACKAGING_25_0_PICKLE_REQUESTS_GE_2_0)+    assert isinstance(r, Requirement)+    assert r.name == "requests"+    assert r.url is None+    assert r.extras == set()+    assert str(r.specifier) == ">=2.0"+    assert r.marker is None+    assert r == Requirement("requests>=2.0")
tests/test_specifiers.py +340 lines
--- +++ @@ -8,2 +8,3 @@ import operator+import pickle import re@@ -2847 +2848,340 @@         assert repr(upper2) == "<_UpperBound None)>"++[email protected](+    ("specifier", "spec_prereleases"),+    [+        (">=1.0", None),+        ("==2.1.*", None),+        ("!=2.2.*", None),+        ("~=2.0", None),+        (">=1.0.dev1", None),+        ("<1.0.post1", None),+        (">2.0.post1", None),+        ("<=5", None),+        (">=7.9a1", None),+        ("<1.0.dev1", None),+        ("===foobar", None),+        # With prereleases override+        (">=1.0", True),+        (">=1.0", False),+    ],+)+def test_pickle_specifier_roundtrip(+    specifier: str, spec_prereleases: bool | None+) -> None:+    # Make sure equality and str() work between a pickle/unpickle round trip.+    s = Specifier(specifier, prereleases=spec_prereleases)+    # Warm up caches before pickling to ensure they are excluded from state.+    _ = s.prereleases+    _ = s._to_ranges()+    loaded = pickle.loads(pickle.dumps(s))+    assert loaded == s+    assert str(loaded) == str(s)+    assert loaded.prereleases == s.prereleases++[email protected](+    ("specifiers", "ss_prereleases"),+    [+        (">=1.0,<2.0", None),+        ("~=1.0,!=1.1", None),+        (">=1.0.dev1,<2.0", None),+        ("", None),  # Empty+        (">=1.0,<2.0,!=1.5", None),+        # With prereleases override+        (">=1.0,<2.0", True),+        (">=1.0,<2.0", False),+    ],+)+def test_pickle_specifierset_roundtrip(+    specifiers: str, ss_prereleases: bool | None+) -> None:+    # Make sure equality and str() work between a pickle/unpickle round trip.+    ss = SpecifierSet(specifiers, prereleases=ss_prereleases)+    # Warm up caches before pickling to ensure they are excluded from state.+    _ = ss.prereleases+    _ = ss.is_unsatisfiable()+    list(ss.filter(["1.5"]))+    loaded = pickle.loads(pickle.dumps(ss))+    assert loaded == ss+    assert str(loaded) == str(ss)+    assert loaded.prereleases == ss.prereleases+++def test_pickle_setstate_rejects_invalid_state() -> None:+    # Cover the TypeError branches in __setstate__ for invalid input.+    s = Specifier.__new__(Specifier)+    with pytest.raises(TypeError, match="Cannot restore Specifier"):+        s.__setstate__((1, 2, 3))  # Wrong tuple length+    with pytest.raises(TypeError, match="Cannot restore Specifier"):+        s.__setstate__(12345)  # Not a tuple or dict++    ss = SpecifierSet.__new__(SpecifierSet)+    with pytest.raises(TypeError, match="Cannot restore SpecifierSet"):+        ss.__setstate__((1, 2, 3))  # Wrong tuple length+    with pytest.raises(TypeError, match="Cannot restore SpecifierSet"):+        ss.__setstate__(12345)  # Not a tuple or dict+++def test_pickle_specifier_setstate_rejects_malformed_legacy_state() -> None:+    # Verify validation catches malformed legacy slot-dict and dict formats.+    s = Specifier.__new__(Specifier)+    # Missing _spec key (legacy slot-dict format).+    with pytest.raises(TypeError, match="Cannot restore Specifier"):+        s.__setstate__((None, {"_prereleases": None}))+    # Missing _spec key (legacy dict format).+    with pytest.raises(TypeError, match="Cannot restore Specifier"):+        s.__setstate__({"_prereleases": None})+    # _spec is not a 2-tuple of strings.+    with pytest.raises(TypeError, match="Cannot restore Specifier"):+        s.__setstate__((("bad",), None))+    with pytest.raises(TypeError, match="Cannot restore Specifier"):+        s.__setstate__((None, {"_spec": 123}))+    # _prereleases is not bool|None.+    with pytest.raises(TypeError, match="Cannot restore Specifier"):+        s.__setstate__((("==", "1.0"), "yes"))+++def test_pickle_specifierset_setstate_rejects_malformed_legacy_state() -> None:+    # Verify validation catches malformed legacy slot-dict and dict formats.+    ss = SpecifierSet.__new__(SpecifierSet)+    # _specs contains non-Specifier items (legacy slot-dict format).+    with pytest.raises(TypeError, match="Cannot restore SpecifierSet"):+        ss.__setstate__((None, {"_specs": {1, 2}, "_prereleases": None}))+    # _specs contains non-Specifier items (legacy dict format).+    with pytest.raises(TypeError, match="Cannot restore SpecifierSet"):+        ss.__setstate__({"_specs": {1, 2}, "_prereleases": None})+++def test_pickle_specifierset_setstate_on_initialized_instance() -> None:+    # Cover the branch where hasattr(self, "_specs") is True in __setstate__.+    # This happens when __setstate__ is called on an already-initialized instance.+    ss = SpecifierSet(">=1.0")+    ss.__setstate__(((Specifier(">=2.0"),), None))+    assert ss == SpecifierSet(">=2.0")+++def test_pickle_specifier_setstate_clears_cache() -> None:+    # Verify that __setstate__ resets all three cached slots to None,+    # regardless of what was cached before the call.+    s = Specifier("==1.*")+    # Warm up every cache slot.+    _ = s.prereleases  # populates _spec_version+    _ = s._get_wildcard_split("1.*")  # populates _wildcard_split+    _ = s._to_ranges()  # populates _ranges+    assert s._spec_version is not None+    assert s._wildcard_split is not None+    assert s._ranges is not None++    s.__setstate__((("==", "1.*"), None))++    assert s._spec_version is None+    assert s._wildcard_split is None+    assert s._ranges is None+++def test_pickle_specifierset_setstate_clears_cache() -> None:+    # Verify that __setstate__ resets all cached slots to None,+    # regardless of what was cached before the call.+    ss = SpecifierSet(">=1.0,<2.0")+    # Warm up every cache slot.+    ss.is_unsatisfiable()  # populates _is_unsatisfiable+    list(ss.filter(["1.5"]))  # populates _resolved_ops+    assert ss._is_unsatisfiable is not None+    assert ss._resolved_ops is not None++    ss.__setstate__(((Specifier(">=3.0"), Specifier("<4.0")), None))++    assert ss._is_unsatisfiable is None+    assert ss._resolved_ops is None+++# Pickle bytes generated with packaging==25.0, Python 3.13.13, pickle protocol 2.+# Format: plain __dict__ (no __slots__). _spec is stored as a (operator, version) tuple+# and _prereleases as a separate key.+_PACKAGING_25_0_PICKLE_GE_3_10 = (+    b"\x80\x02cpackaging.specifiers\nSpecifier\nq\x00)\x81q\x01}q\x02"+    b"(X\x05\x00\x00\x00_specq\x03X\x02\x00\x00\x00>=q\x04X\x04\x00\x00"+    b"\x003.10q\x05\x86q\x06X\x0c\x00\x00\x00_prereleasesq\x07Nub."+)++_PACKAGING_25_0_PICKLE_SS_GE_3_10_LT_4_0 = (+    b"\x80\x02cpackaging.specifiers\nSpecifierSet\nq\x00)\x81q\x01}q\x02"+    b"(X\x06\x00\x00\x00_specsq\x03c__builtin__\nfrozenset\nq\x04]q\x05"+    b"(cpackaging.specifiers\nSpecifier\nq\x06)\x81q\x07}q\x08(X\x05\x00"+    b"\x00\x00_specq\tX\x02\x00\x00\x00>=q\nX\x04\x00\x00\x003.10q\x0b"+    b"\x86q\x0cX\x0c\x00\x00\x00_prereleasesq\rNubh\x06)\x81q\x0e}q\x0f"+    b"(h\tX\x01\x00\x00\x00<q\x10X\x03\x00\x00\x004.0q\x11\x86q\x12h\r"+    b"Nube\x85q\x13Rq\x14h\rNub."+)+++def test_pickle_specifier_25_0_format_loads() -> None:+    # Verify that Specifier pickles created with packaging <= 25.x (plain __dict__)+    # can be loaded and produce correct Specifier objects.+    s = pickle.loads(_PACKAGING_25_0_PICKLE_GE_3_10)+    assert isinstance(s, Specifier)+    assert str(s) == ">=3.10"+    assert s == Specifier(">=3.10")+    assert s.operator == ">="+    assert s.version == "3.10"+    assert s.prereleases == Specifier(">=3.10").prereleases+++def test_pickle_specifierset_25_0_format_loads() -> None:+    # Verify that SpecifierSet pickles created with packaging <= 25.x (plain __dict__,+    # _specs stored as a frozenset) can be loaded and produce correct objects.+    ss = pickle.loads(_PACKAGING_25_0_PICKLE_SS_GE_3_10_LT_4_0)+    assert isinstance(ss, SpecifierSet)+    assert ss == SpecifierSet(">=3.10,<4.0")+    assert "3.10" in ss+    assert "3.12" in ss+    assert "4.0" not in ss+    assert ss.prereleases is None+++# Pickle bytes generated with packaging==26.0, Python 3.13.13, pickle protocol 2.+# Format: __slots__ (no __dict__), state is (None, {slot: value}). Includes+# _spec_version slot (a cached Version object, may be present or None).+_PACKAGING_26_0_PICKLE_GE_3_10 = (+    b"\x80\x02cpackaging.specifiers\nSpecifier\nq\x00)\x81q\x01N}q\x02"+    b"(X\x0c\x00\x00\x00_prereleasesq\x03NX\x05\x00\x00\x00_specq\x04"+    b"X\x02\x00\x00\x00>=q\x05X\x04\x00\x00\x003.10q\x06\x86q\x07X\r"+    b"\x00\x00\x00_spec_versionq\x08Nu\x86q\tb."+)++_PACKAGING_26_0_PICKLE_SS_GE_3_10_LT_4_0 = (+    b"\x80\x02cpackaging.specifiers\nSpecifierSet\nq\x00)\x81q\x01N}q\x02"+    b"(X\x0c\x00\x00\x00_prereleasesq\x03NX\x06\x00\x00\x00_specsq\x04"+    b"c__builtin__\nfrozenset\nq\x05]q\x06(cpackaging.specifiers\nSpecifier"+    b"\nq\x07)\x81q\x08N}q\t(h\x03NX\x05\x00\x00\x00_specq\nX\x02\x00"+    b"\x00\x00>=q\x0bX\x04\x00\x00\x003.10q\x0c\x86q\rX\r\x00\x00\x00"+    b"_spec_versionq\x0eh\x0ccpackaging.version\nVersion\nq\x0f)\x81q\x10"+    b"N}q\x11(X\x04\x00\x00\x00_devq\x12NX\x06\x00\x00\x00_epochq\x13K"+    b"\x00X\n\x00\x00\x00_key_cacheq\x14NX\x06\x00\x00\x00_localq\x15N"+    b"X\x05\x00\x00\x00_postq\x16NX\x04\x00\x00\x00_preq\x17NX\x08\x00"+    b"\x00\x00_releaseq\x18K\x03K\n\x86q\x19u\x86q\x1ab\x86q\x1bu\x86"+    b"q\x1cbh\x07)\x81q\x1dN}q\x1e(h\x03Nh\nX\x01\x00\x00\x00<q\x1fX"+    b'\x03\x00\x00\x004.0q \x86q!h\x0eh h\x0f)\x81q"N}q#(h\x12Nh\x13'+    b"K\x00h\x14Nh\x15Nh\x16Nh\x17Nh\x18K\x04K\x00\x86q$u\x86q%b\x86"+    b"q&u\x86q'be\x85q(Rq)u\x86q*b."+)+++def test_pickle_specifier_26_0_slots_format_loads() -> None:+    # Verify that Specifier pickles created with packaging 26.0 (__slots__,+    # state is (None, {slot_dict})) can be loaded and produce correct objects.+    s = pickle.loads(_PACKAGING_26_0_PICKLE_GE_3_10)+    assert isinstance(s, Specifier)+    assert str(s) == ">=3.10"+    assert s == Specifier(">=3.10")+    assert s.operator == ">="+    assert s.version == "3.10"+    assert s.prereleases == Specifier(">=3.10").prereleases+++def test_pickle_specifierset_26_0_slots_format_loads() -> None:+    # Verify that SpecifierSet pickles created with packaging 26.0 (__slots__,+    # state is (None, {slot_dict}), _specs stored as frozenset) can be loaded.+    ss = pickle.loads(_PACKAGING_26_0_PICKLE_SS_GE_3_10_LT_4_0)+    assert isinstance(ss, SpecifierSet)+    assert ss == SpecifierSet(">=3.10,<4.0")+    assert "3.10" in ss
… 97 more lines (truncated)
tests/test_tags.py +105 lines
--- +++ @@ -1813,3 +1813,3 @@         config = {-            "PYEMSCRIPTEN_ABI_VERSION": "2026_0",+            "PYEMSCRIPTEN_PLATFORM_VERSION": "2026_0",         }@@ -1870,2 +1870,106 @@ @pytest.mark.parametrize(+    ("interpreter", "abi", "platform"),+    [+        ("py3", "none", "any"),+        ("cp39", "cp39", "linux_x86_64"),+        ("cp312", "cp312", "win_amd64"),+        ("pp310", "pypy310_pp73", "manylinux_2_17_x86_64"),+    ],+)+def test_pickle_tag_roundtrip(interpreter: str, abi: str, platform: str) -> None:+    # Make sure equality, str(), and hash() work between a pickle/unpickle round trip.+    t = tags.Tag(interpreter, abi, platform)+    loaded = pickle.loads(pickle.dumps(t))+    assert loaded == t+    assert str(loaded) == str(t)+    assert hash(loaded) == hash(t)+++def test_pickle_tag_setstate_rejects_invalid_state() -> None:+    # Cover the TypeError branches in __setstate__ for invalid input.+    t = tags.Tag.__new__(tags.Tag)+    with pytest.raises(TypeError, match="Cannot restore Tag"):+        t.__setstate__(12345)+    with pytest.raises(TypeError, match="Cannot restore Tag"):+        t.__setstate__((1, 2, 3))  # Wrong types, not all strings+    with pytest.raises(TypeError, match="Cannot restore Tag"):+        t.__setstate__((None, {"_interpreter": "cp39", "_abi": "cp39"}))+    with pytest.raises(TypeError, match="Cannot restore Tag"):+        t.__setstate__(+            (None, {"_interpreter": 123, "_abi": "cp39", "_platform": "linux_x86_64"})+        )+    with pytest.raises(TypeError, match="Cannot restore Tag"):+        t.__setstate__((1, 2))  # len==2 but second element not a dict+    with pytest.raises(TypeError, match="Cannot restore Tag"):+        t.__setstate__((1, 2, 3, 4))  # tuple length not 2 or 3+++# Pickle bytes generated with packaging==26.1, Python 3.13.1, pickle protocol 2.+# Format: __slots__ (no __getstate__), state is (None, {slot: value}). The+# _hash slot contains a pre-computed integer that must be discarded on load.+_PACKAGING_26_1_PICKLE_TAG_CP39 = (+    b"\x80\x02cpackaging.tags\nTag\nq\x00)\x81q\x01N}q\x02(X\x04\x00\x00"+    b"\x00_abiq\x03X\x04\x00\x00\x00cp39q\x04X\x05\x00\x00\x00_hashq\x05"+    b"\x8a\x08)\xb1\xe8\x9d\x90\xf8tFX\x0c\x00\x00\x00_interpreterq\x06X"+    b"\x04\x00\x00\x00cp39q\x07X\t\x00\x00\x00_platformq\x08X\x0c\x00\x00"+    b"\x00linux_x86_64q\tu\x86q\nb."+)+++# Pickle bytes generated with packaging==26.0, Python 3.13.1, pickle protocol 2.+# Format: __slots__ (no __getstate__), state is (None, {slot: value}).+_PACKAGING_26_0_PICKLE_TAG_CP39 = (+    b"\x80\x02cpackaging.tags\nTag\nq\x00)\x81q\x01N}q\x02(X\x04\x00\x00"+    b"\x00_abiq\x03X\x04\x00\x00\x00cp39q\x04X\x05\x00\x00\x00_hashq\x05"+    b"\x8a\x08\xc1\xdb\xa0\xe5]7z\x87X\x0c\x00\x00\x00_interpreterq\x06X"+    b"\x04\x00\x00\x00cp39q\x07X\t\x00\x00\x00_platformq\x08X\x0c\x00\x00"+    b"\x00linux_x86_64q\tu\x86q\nb."+)+++# Pickle bytes generated with packaging==25.0, Python 3.13.1, pickle protocol 2.+# Format: plain __dict__ (no __slots__).+_PACKAGING_25_0_PICKLE_TAG_CP39 = (+    b"\x80\x02cpackaging.tags\nTag\nq\x00)\x81q\x01N}q\x02(X\x04\x00\x00\x00"+    b"_abiq\x03X\x04\x00\x00\x00cp39q\x04X\x05\x00\x00\x00_hashq\x05\x8a\x08"+    b"\xea\xa5X\x92\xa5\xc9\x11\x0cX\x0c\x00\x00\x00_interpreterq\x06X\x04"+    b"\x00\x00\x00cp39q\x07X\t\x00\x00\x00_platformq\x08X\x0c\x00\x00\x00"+    b"linux_x86_64q\tu\x86q\nb."+)+++def test_pickle_tag_old_format_loads() -> None:+    # Verify that Tag pickles created with packaging <= 26.1 (__slots__,+    # no __getstate__) can be loaded and produce correct Tag objects.+    t = pickle.loads(_PACKAGING_26_1_PICKLE_TAG_CP39)+    assert isinstance(t, tags.Tag)+    assert str(t) == "cp39-cp39-linux_x86_64"+    assert t == tags.Tag("cp39", "cp39", "linux_x86_64")+    assert t.interpreter == "cp39"+    assert t.abi == "cp39"+    assert t.platform == "linux_x86_64"+    assert t._hash == hash(("cp39", "cp39", "linux_x86_64"))+++def test_pickle_tag_26_0_format_loads() -> None:+    # Verify that Tag pickles created with packaging 26.0 (__slots__,+    # no __getstate__) can be loaded and produce correct Tag objects.+    t = pickle.loads(_PACKAGING_26_0_PICKLE_TAG_CP39)+    assert isinstance(t, tags.Tag)+    assert str(t) == "cp39-cp39-linux_x86_64"+    assert t == tags.Tag("cp39", "cp39", "linux_x86_64")+    assert t._hash == hash(("cp39", "cp39", "linux_x86_64"))+++def test_pickle_tag_25_0_format_loads() -> None:+    # Verify that Tag pickles created with packaging 25.0 (plain __dict__)+    # can be loaded and produce correct Tag objects.+    t = pickle.loads(_PACKAGING_25_0_PICKLE_TAG_CP39)+    assert isinstance(t, tags.Tag)+    assert str(t) == "cp39-cp39-linux_x86_64"+    assert t == tags.Tag("cp39", "cp39", "linux_x86_64")+    assert t._hash == hash(("cp39", "cp39", "linux_x86_64"))++[email protected](     ("supported", "things", "expected"),
tests/test_version.py +148 lines
--- +++ @@ -8,2 +8,3 @@ import operator+import pickle import sys@@ -14,2 +15,3 @@ +from packaging._structures import Infinity, NegativeInfinity from packaging.version import (@@ -1259 +1261,147 @@     assert v == Version(string)++[email protected](+    "version",+    [+        "1.2.3",+        "0.1.0",+        "2.0a1",+        "1.0b2",+        "3.0rc1",+        "1.0.post1",+        "1.0.dev3",+        "1!2.3.4a5.post6.dev7+zzz",+    ],+)+def test_pickle_roundtrip(version: str) -> None:+    # Make sure equality and str() work between a pickle/unpickle round trip.+    v = Version(version)+    loaded = pickle.loads(pickle.dumps(v))+    assert loaded == v+    assert str(loaded) == str(v)+++# Pickle bytes generated with packaging==25.0, Python 3.13.1, pickle protocol 2.+# These contain references to packaging._structures.InfinityType and+# NegativeInfinityType in the _key cache, which were removed in packaging 26.1.+_PACKAGING_25_0_PICKLE_V1_2_3 = (+    b"\x80\x02cpackaging.version\nVersion\nq\x00)\x81q\x01}q\x02"+    b"(X\x08\x00\x00\x00_versionq\x03cpackaging.version\n_Version\n"+    b"q\x04(K\x00K\x01K\x02K\x03\x87q\x05NNNNtq\x06\x81q\x07X\x04"+    b"\x00\x00\x00_keyq\x08(K\x00K\x01K\x02K\x03\x87q\tcpackaging._structures\n"+    b"InfinityType\nq\n)\x81q\x0bcpackaging._structures\nNegativeInfinityType\n"+    b"q\x0c)\x81q\rh\x0bh\rtq\x0eub."+)++_PACKAGING_25_0_PICKLE_V2_0A1 = (+    b"\x80\x02cpackaging.version\nVersion\nq\x00)\x81q\x01}q\x02"+    b"(X\x08\x00\x00\x00_versionq\x03cpackaging.version\n_Version\n"+    b"q\x04(K\x00K\x02K\x00\x86q\x05NX\x01\x00\x00\x00aq\x06K\x01"+    b"\x86q\x07NNtq\x08\x81q\tX\x04\x00\x00\x00_keyq\n(K\x00K\x02"+    b"\x85q\x0bh\x07cpackaging._structures\nNegativeInfinityType\n"+    b"q\x0c)\x81q\rcpackaging._structures\nInfinityType\nq\x0e)\x81"+    b"q\x0fh\rtq\x10ub."+)+++def test_pickle_old_format_loads() -> None:+    # Verify that pickles created with packaging <= 25.x can be loaded+    # and produce correct Version objects.+    v = pickle.loads(_PACKAGING_25_0_PICKLE_V1_2_3)+    assert isinstance(v, Version)+    assert str(v) == "1.2.3"+    assert v == Version("1.2.3")+    assert v < Version("2.0")+    assert v > Version("1.2.2")++    v2 = pickle.loads(_PACKAGING_25_0_PICKLE_V2_0A1)+    assert isinstance(v2, Version)+    assert str(v2) == "2.0a1"+    assert v2 == Version("2.0a1")+    assert v2 < Version("2.0")+++def test_pickle_old_format_re_pickled_is_clean() -> None:+    # Verify that loading an old pickle and re-pickling it produces+    # a clean payload that no longer references packaging._structures.+    v = pickle.loads(_PACKAGING_25_0_PICKLE_V1_2_3)+    new_data = pickle.dumps(v)+    assert b"_structures" not in new_data+    # And the re-pickled version still works.+    v2 = pickle.loads(new_data)+    assert v2 == Version("1.2.3")+    assert str(v2) == "1.2.3"+++# Pickle bytes generated with packaging==26.0, Python 3.13.1, pickle protocol 2.+# 26.0 used __slots__ (no __dict__), so the pickle state is (None, {slot: value}).+# The _key_cache slot still contains packaging._structures.InfinityType references.+_PACKAGING_26_0_PICKLE_V1_2_3 = (+    b"\x80\x02cpackaging.version\nVersion\nq\x00)\x81q\x01N}q\x02"+    b"(X\x04\x00\x00\x00_devq\x03NX\x06\x00\x00\x00_epochq\x04K\x00"+    b"X\n\x00\x00\x00_key_cacheq\x05(K\x00K\x01K\x02K\x03\x87q\x06"+    b"cpackaging._structures\nInfinityType\nq\x07)\x81q\x08cpackaging._structures\n"+    b"NegativeInfinityType\nq\t)\x81q\nh\x08h\ntq\x0bX\x06\x00\x00\x00"+    b"_localq\x0cNX\x05\x00\x00\x00_postq\rNX\x04\x00\x00\x00_preq\x0e"+    b"NX\x08\x00\x00\x00_releaseq\x0fh\x06u\x86q\x10b."+)+++def test_pickle_26_0_slots_format_loads() -> None:+    # Verify that pickles created with packaging 26.0 (__slots__, no __reduce__)+    # can be loaded and produce correct Version objects.+    v = pickle.loads(_PACKAGING_26_0_PICKLE_V1_2_3)+    assert isinstance(v, Version)+    assert str(v) == "1.2.3"+    assert v == Version("1.2.3")+    assert v < Version("2.0")+    assert v > Version("1.2.2")+++# Pickle bytes generated with packaging 26.2+ (6-tuple __getstate__ format),+# Python 3.13.1, pickle protocol 2.+_PACKAGING_26_2_TUPLE_PICKLE_V1E2_3_4A5_POST6_DEV7_ZZZ = (+    b"\x80\x02cpackaging.version\nVersion\nq\x00)\x81q\x01(K\x01K\x02K\x03"+    b"K\x04\x87q\x02X\x01\x00\x00\x00aq\x03K\x05\x86q\x04X\x04\x00\x00"+    b"\x00postq\x05K\x06\x86q\x06X\x03\x00\x00\x00devq\x07K\x07\x86q\x08"+    b"X\x03\x00\x00\x00zzzq\t\x85q\ntq\x0bb."+)+++def test_pickle_26_2_tuple_getstate_loads() -> None:+    # Verify that pickles created with packaging 26.2+ (6-tuple __getstate__)+    # can be loaded and produce correct Version objects.+    v = pickle.loads(_PACKAGING_26_2_TUPLE_PICKLE_V1E2_3_4A5_POST6_DEV7_ZZZ)+    assert isinstance(v, Version)+    assert str(v) == "1!2.3.4a5.post6.dev7+zzz"+    assert v == Version("1!2.3.4a5.post6.dev7+zzz")+    assert v.epoch == 1+    assert v.release == (2, 3, 4)+    assert v.pre == ("a", 5)+    assert v.post == 6+    assert v.dev == 7+    assert v.local == "zzz"+++def test_pickle_setstate_rejects_invalid_state() -> None:+    # Cover the TypeError branches in __setstate__ for invalid input.+    v = Version.__new__(Version)+    # dict without "_version" key+    with pytest.raises(TypeError, match="Cannot restore Version"):+        v.__setstate__({"bad_key": 123})+    # tuple with non-dict second element+    with pytest.raises(TypeError, match="Cannot restore Version"):+        v.__setstate__((None, "not_a_dict"))+    # tuple with unexpected length (not 2 or 6)+    with pytest.raises(TypeError, match="Cannot restore Version"):+        v.__setstate__((1, 2, 3))+    # completely wrong type+    with pytest.raises(TypeError, match="Cannot restore Version"):+        v.__setstate__(12345)+++def test_structures_shim_repr() -> None:+    # Cover the __repr__ methods on the backward-compatibility shim classes.+    assert repr(Infinity) == "Infinity"+    assert repr(NegativeInfinity) == "-Infinity"
pluggy pypi
1.6.0 1y ago incident on record
YANKBURST
latest 1.6.0 versions 24 maintainers 1
0.10.0
0.11.0
0.12.0
0.13.0
0.13.1
1.0.0
1.1.0
1.2.0
1.3.0
1.4.0
1.5.0
1.6.0
YANK
1.1.0 marked yanked (still downloadable)
high · registry-verified · 2023-06-19 · 3y ago
BURST
2 releases in 0m: 0.5.1, 0.5.2
info · registry-verified · 2018-04-15 · 8y ago
release diff 1.5.0 → 1.6.0
+2 added · -1 removed · ~30 modified
pyproject.toml +50 lines
--- +++ @@ -3,4 +3,4 @@   # sync with setup.py until we discard non-pep-517/518-  "setuptools>=45.0",-  "setuptools-scm[toml]>=6.2.3",+  "setuptools>=65.0",+  "setuptools-scm[toml]>=8.0", ]@@ -8,7 +8,52 @@ +[project]+name = "pluggy"+license = {text = "MIT"}+authors = [{name = "Holger Krekel", email = "[email protected]"}]+classifiers = [+  "Development Status :: 6 - Mature",+  "Intended Audience :: Developers",+  "License :: OSI Approved :: MIT License",+  "Operating System :: POSIX",+  "Operating System :: Microsoft :: Windows",+  "Operating System :: MacOS :: MacOS X",+  "Topic :: Software Development :: Testing",+  "Topic :: Software Development :: Libraries",+  "Topic :: Utilities",+  "Programming Language :: Python :: Implementation :: CPython",+  "Programming Language :: Python :: Implementation :: PyPy",+  "Programming Language :: Python :: 3",+  "Programming Language :: Python :: 3 :: Only",+  "Programming Language :: Python :: 3.9",+  "Programming Language :: Python :: 3.10",+  "Programming Language :: Python :: 3.11",+  "Programming Language :: Python :: 3.12",+  "Programming Language :: Python :: 3.13",+]+description = "plugin and hook calling mechanisms for python"+readme = {file = "README.rst", content-type = "text/x-rst"}+requires-python = ">=3.9"++dynamic = ["version"]+[project.optional-dependencies]+dev = ["pre-commit", "tox"]+testing = ["pytest", "pytest-benchmark", "coverage"]++[tool.setuptools]+packages = ["pluggy"]+package-dir =  {""="src"}+package-data = {"pluggy" = ["py.typed"]}+  [tool.ruff.lint]-select = [-    "I",  # isort+extend-select = [+  "I",  # isort+  "F","E", "W",+  "UP", "ANN", ]+extend-ignore = ["ANN401"]++[tool.ruff.lint.extend-per-file-ignores]+"testing/*.py" = ["ANN001", "ANN002", "ANN003",  "ANN201", "ANN202","ANN204" ,]+"docs/*.py" = ["ANN001", "ANN002", "ANN003",  "ANN201", "ANN202","ANN204" ,] @@ -23,3 +68,3 @@ [tool.setuptools_scm]-write_to = "src/pluggy/_version.py"+version_file = "src/pluggy/_version.py" 
scripts/release.py +6 lines
--- +++ @@ -14,3 +14,3 @@ -def create_branch(version):+def create_branch(version: str) -> Repo:     """Create a fresh branch from upstream/main"""@@ -38,3 +38,3 @@ -def pre_release(version):+def pre_release(version: str) -> None:     """Generates new docs, release announcements and creates a local tag."""@@ -49,3 +49,3 @@ -def changelog(version, write_out=False):+def changelog(version: str, write_out: bool = False) -> None:     if write_out:@@ -58,3 +58,3 @@ -def main():+def main() -> int:     init(autoreset=True)@@ -68,2 +68,4 @@         return 1+    else:+        return 0 
scripts/towncrier-draft-to-file.py +1 lines
--- +++ @@ -4,3 +4,3 @@ -def main():+def main() -> int:     """
setup.cfg +0 lines
--- +++ @@ -1,53 +1 @@-[metadata]-name = pluggy-description = plugin and hook calling mechanisms for python-long_description = file: README.rst-long_description_content_type = text/x-rst-license = MIT-platforms = unix, linux, osx, win32-author = Holger Krekel-author_email = [email protected]-url = https://github.com/pytest-dev/pluggy-classifiers = -	Development Status :: 6 - Mature-	Intended Audience :: Developers-	License :: OSI Approved :: MIT License-	Operating System :: POSIX-	Operating System :: Microsoft :: Windows-	Operating System :: MacOS :: MacOS X-	Topic :: Software Development :: Testing-	Topic :: Software Development :: Libraries-	Topic :: Utilities-	Programming Language :: Python :: Implementation :: CPython-	Programming Language :: Python :: Implementation :: PyPy-	Programming Language :: Python :: 3-	Programming Language :: Python :: 3 :: Only-	Programming Language :: Python :: 3.8-	Programming Language :: Python :: 3.9-	Programming Language :: Python :: 3.10-	Programming Language :: Python :: 3.11--[options]-packages = -	pluggy-python_requires = >=3.8-package_dir = -	=src-setup_requires = -	setuptools-scm--[options.extras_require]-dev = -	pre-commit-	tox-testing = -	pytest-	pytest-benchmark--[options.package_data]-pluggy = py.typed--[devpi:upload]-formats = sdist.tgz,bdist_wheel- [egg_info]
src/pluggy/__init__.py +1 lines
--- +++ @@ -1,8 +1 @@-try:-    from ._version import version as __version__-except ImportError:-    # broken installation, we don't even try-    # unknown only works because we do poor mans version compare-    __version__ = "unknown"- __all__ = [@@ -23,3 +16,2 @@ ]- from ._hooks import HookCaller@@ -35,2 +27,3 @@ from ._result import Result+from ._version import version as __version__ from ._warnings import PluggyTeardownRaisedWarning
src/pluggy/_callers.py +87 lines
--- +++ @@ -6,9 +6,7 @@ +from collections.abc import Generator+from collections.abc import Mapping+from collections.abc import Sequence from typing import cast-from typing import Generator-from typing import Mapping from typing import NoReturn-from typing import Sequence-from typing import Tuple-from typing import Union import warnings@@ -23,6 +21,34 @@ # Wrapping with a tuple is the fastest type-safe way I found to do it.-Teardown = Union[-    Tuple[Generator[None, Result[object], None], HookImpl],-    Generator[None, object, object],-]+Teardown = Generator[None, object, object]+++def run_old_style_hookwrapper(+    hook_impl: HookImpl, hook_name: str, args: Sequence[object]+) -> Teardown:+    """+    backward compatibility wrapper to run a old style hookwrapper as a wrapper+    """++    teardown: Teardown = cast(Teardown, hook_impl.function(*args))+    try:+        next(teardown)+    except StopIteration:+        _raise_wrapfail(teardown, "did not yield")+    try:+        res = yield+        result = Result(res, None)+    except BaseException as exc:+        result = Result(None, exc)+    try:+        teardown.send(result)+    except StopIteration:+        pass+    except BaseException as e:+        _warn_teardown_exception(hook_name, hook_impl, e)+        raise+    else:+        _raise_wrapfail(teardown, "has second yield")+    finally:+        teardown.close()+    return result.get_result() @@ -30,11 +56,8 @@ def _raise_wrapfail(-    wrap_controller: (-        Generator[None, Result[object], None] | Generator[None, object, object]-    ),+    wrap_controller: Generator[None, object, object],     msg: str, ) -> NoReturn:-    co = wrap_controller.gi_code+    co = wrap_controller.gi_code  # type: ignore[attr-defined]     raise RuntimeError(-        "wrap_controller at %r %s:%d %s"-        % (co.co_name, co.co_filename, co.co_firstlineno, msg)+        f"wrap_controller at {co.co_name!r} {co.co_filename}:{co.co_firstlineno} {msg}"     )@@ -49,3 +72,3 @@     msg += "For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning"  # noqa: E501-    warnings.warn(PluggyTeardownRaisedWarning(msg), stacklevel=5)+    warnings.warn(PluggyTeardownRaisedWarning(msg), stacklevel=6) @@ -66,3 +89,2 @@     exception = None-    only_new_style_wrappers = True     try:  # run impl and wrapper setup functions in a loop@@ -73,4 +95,5 @@                     args = [caller_kwargs[argname] for argname in hook_impl.argnames]-                except KeyError:-                    for argname in hook_impl.argnames:+                except KeyError as e:+                    # coverage bug - this is tested+                    for argname in hook_impl.argnames:  # pragma: no cover                         if argname not in caller_kwargs:@@ -78,15 +101,10 @@                                 f"hook call must provide argument {argname!r}"-                            )+                            ) from e                  if hook_impl.hookwrapper:-                    only_new_style_wrappers = False-                    try:-                        # If this cast is not valid, a type error is raised below,-                        # which is the desired response.-                        res = hook_impl.function(*args)-                        wrapper_gen = cast(Generator[None, Result[object], None], res)-                        next(wrapper_gen)  # first yield-                        teardowns.append((wrapper_gen, hook_impl))-                    except StopIteration:-                        _raise_wrapfail(wrapper_gen, "did not yield")+                    function_gen = run_old_style_hookwrapper(hook_impl, hook_name, args)++                    next(function_gen)  # first yield+                    teardowns.append(function_gen)+                 elif hook_impl.wrapper:@@ -110,73 +128,42 @@     finally:-        # Fast path - only new-style wrappers, no Result.-        if only_new_style_wrappers:-            if firstresult:  # first result hooks return a single value-                result = results[0] if results else None-            else:-                result = results+        if firstresult:  # first result hooks return a single value+            result = results[0] if results else None+        else:+            result = results -            # run all wrapper post-yield blocks-            for teardown in reversed(teardowns):-                try:-                    if exception is not None:-                        teardown.throw(exception)  # type: ignore[union-attr]-                    else:-                        teardown.send(result)  # type: ignore[union-attr]-                    # Following is unreachable for a well behaved hook wrapper.-                    # Try to force finalizers otherwise postponed till GC action.-                    # Note: close() may raise if generator handles GeneratorExit.-                    teardown.close()  # type: ignore[union-attr]-                except StopIteration as si:-                    result = si.value-                    exception = None-                    continue-                except BaseException as e:-                    exception = e-                    continue-                _raise_wrapfail(teardown, "has second yield")  # type: ignore[arg-type]+        # run all wrapper post-yield blocks+        for teardown in reversed(teardowns):+            try:+                if exception is not None:+                    try:+                        teardown.throw(exception)+                    except RuntimeError as re:+                        # StopIteration from generator causes RuntimeError+                        # even for coroutine usage - see #544+                        if (+                            isinstance(exception, StopIteration)+                            and re.__cause__ is exception+                        ):+                            teardown.close()+                            continue+                        else:+                            raise+                else:+                    teardown.send(result)+                # Following is unreachable for a well behaved hook wrapper.+                # Try to force finalizers otherwise postponed till GC action.+                # Note: close() may raise if generator handles GeneratorExit.+                teardown.close()+            except StopIteration as si:+                result = si.value+                exception = None+                continue+            except BaseException as e:+                exception = e+                continue+            _raise_wrapfail(teardown, "has second yield") -            if exception is not None:-                raise exception.with_traceback(exception.__traceback__)-            else:-                return result--        # Slow path - need to support old-style wrappers.-        else:-            if firstresult:  # first result hooks return a single value-                outcome: Result[object | list[object]] = Result(-                    results[0] if results else None, exception-                )-            else:-                outcome = Result(results, exception)--            # run all wrapper post-yield blocks-            for teardown in reversed(teardowns):-                if isinstance(teardown, tuple):-                    try:-                        teardown[0].send(outcome)-                    except StopIteration:-                        pass-                    except BaseException as e:-                        _warn_teardown_exception(hook_name, teardown[1], e)-                        raise-                    else:-                        _raise_wrapfail(teardown[0], "has second yield")-                else:-                    try:-                        if outcome._exception is not None:-                            teardown.throw(outcome._exception)-                        else:-                            teardown.send(outcome._result)-                        # Following is unreachable for a well behaved hook wrapper.-                        # Try to force finalizers otherwise postponed till GC action.-                        # Note: close() may raise if generator handles GeneratorExit.-                        teardown.close()-                    except StopIteration as si:-                        outcome.force_result(si.value)-                        continue-                    except BaseException as e:-                        outcome.force_exception(e)-                        continue-                    _raise_wrapfail(teardown, "has second yield")--            return outcome.get_result()+    if exception is not None:+        raise exception+    else:+        return result
src/pluggy/_hooks.py +21 lines
--- +++ @@ -6,2 +6,6 @@ +from collections.abc import Generator+from collections.abc import Mapping+from collections.abc import Sequence+from collections.abc import Set import inspect@@ -9,3 +13,2 @@ from types import ModuleType-from typing import AbstractSet from typing import Any@@ -14,9 +17,4 @@ from typing import final-from typing import Generator-from typing import List-from typing import Mapping from typing import Optional from typing import overload-from typing import Sequence-from typing import Tuple from typing import TYPE_CHECKING@@ -36,3 +34,3 @@     [str, Sequence["HookImpl"], Mapping[str, object], bool],-    Union[object, List[object]],+    Union[object, list[object]], ]@@ -304,3 +302,3 @@             func = func.__init__-        except AttributeError:+        except AttributeError:  # pragma: no cover - pypy special case             return (), ()@@ -309,3 +307,3 @@             func = getattr(func, "__call__", func)-        except Exception:+        except Exception:  # pragma: no cover - pypy special case             return (), ()@@ -317,3 +315,3 @@         )-    except TypeError:+    except TypeError:  # pragma: no cover         return (), ()@@ -349,3 +347,3 @@         implicit_names: tuple[str, ...] = ("self",)-    else:+    else:  # pragma: no cover         implicit_names = ("self", "obj")@@ -378,3 +376,3 @@ -_CallHistory = List[Tuple[Mapping[str, object], Optional[Callable[[Any], None]]]]+_CallHistory = list[tuple[Mapping[str, object], Optional[Callable[[Any], None]]]] @@ -487,3 +485,4 @@                         for argname in self.spec.argnames-                        # Avoid self.spec.argnames - kwargs.keys() - doesn't preserve order.+                        # Avoid self.spec.argnames - kwargs.keys()+                        # it doesn't preserve order.                         if argname not in kwargs.keys()@@ -491,4 +490,4 @@                     warnings.warn(-                        "Argument(s) {} which are declared in the hookspec "-                        "cannot be found in this hook call".format(notincall),+                        f"Argument(s) {notincall} which are declared in the hookspec "+                        "cannot be found in this hook call",                         stacklevel=2,@@ -506,5 +505,5 @@         """-        assert (-            not self.is_historic()-        ), "Cannot directly call a historic hook - use call_historic instead."+        assert not self.is_historic(), (+            "Cannot directly call a historic hook - use call_historic instead."+        )         self._verify_all_args_are_provided(kwargs)@@ -547,5 +546,5 @@         :ref:`call_extra`."""-        assert (-            not self.is_historic()-        ), "Cannot directly call a historic hook - use call_historic instead."+        assert not self.is_historic(), (+            "Cannot directly call a historic hook - use call_historic instead."+        )         self._verify_all_args_are_provided(kwargs)@@ -610,3 +609,3 @@ -    def __init__(self, orig: HookCaller, remove_plugins: AbstractSet[_Plugin]) -> None:+    def __init__(self, orig: HookCaller, remove_plugins: Set[_Plugin]) -> None:         self._orig = orig
src/pluggy/_manager.py +33 lines
--- +++ @@ -2,2 +2,5 @@ +from collections.abc import Iterable+from collections.abc import Mapping+from collections.abc import Sequence import inspect@@ -8,5 +11,2 @@ from typing import Final-from typing import Iterable-from typing import Mapping-from typing import Sequence from typing import TYPE_CHECKING@@ -72,3 +72,3 @@ -    def __getattr__(self, attr: str, default=None):+    def __getattr__(self, attr: str, default: Any | None = None) -> Any:         return getattr(self._dist, attr, default)@@ -140,4 +140,4 @@             raise ValueError(-                "Plugin name already registered: %s=%s\n%s"-                % (plugin_name, plugin, self._name2plugin)+                "Plugin name already registered: "+                f"{plugin_name}={plugin}\n{self._name2plugin}"             )@@ -146,4 +146,4 @@             raise ValueError(-                "Plugin already registered under a different name: %s=%s\n%s"-                % (plugin_name, plugin, self._name2plugin)+                "Plugin already registered under a different name: "+                f"{plugin_name}={plugin}\n{self._name2plugin}"             )@@ -190,7 +190,7 @@             )-        except Exception:-            res = {}  # type: ignore[assignment]+        except Exception:  # pragma: no cover+            res = {}  # type: ignore[assignment] #pragma: no cover         if res is not None and not isinstance(res, dict):             # false positive-            res = None  # type:ignore[unreachable]+            res = None  # type:ignore[unreachable] #pragma: no cover         return res@@ -331,4 +331,4 @@                 hookimpl.plugin,-                "Plugin %r\nhook %r\nhistoric incompatible with yield/wrapper/hookwrapper"-                % (hookimpl.plugin_name, hook.name),+                f"Plugin {hookimpl.plugin_name!r}\nhook {hook.name!r}\n"+                "historic incompatible with yield/wrapper/hookwrapper",             )@@ -344,11 +344,6 @@                 hookimpl.plugin,-                "Plugin %r for hook %r\nhookimpl definition: %s\n"-                "Argument(s) %s are declared in the hookimpl but "-                "can not be found in the hookspec"-                % (-                    hookimpl.plugin_name,-                    hook.name,-                    _formatdef(hookimpl.function),-                    notinspec,-                ),+                f"Plugin {hookimpl.plugin_name!r} for hook {hook.name!r}\n"+                f"hookimpl definition: {_formatdef(hookimpl.function)}\n"+                f"Argument(s) {notinspec} are declared in the hookimpl but "+                "can not be found in the hookspec",             )@@ -366,6 +361,6 @@                 hookimpl.plugin,-                "Plugin %r for hook %r\nhookimpl definition: %s\n"+                f"Plugin {hookimpl.plugin_name!r} for hook {hook.name!r}\n"+                f"hookimpl definition: {_formatdef(hookimpl.function)}\n"                 "Declared as wrapper=True or hookwrapper=True "-                "but function is not a generator function"-                % (hookimpl.plugin_name, hook.name, _formatdef(hookimpl.function)),+                "but function is not a generator function",             )@@ -375,5 +370,5 @@                 hookimpl.plugin,-                "Plugin %r for hook %r\nhookimpl definition: %s\n"-                "The wrapper=True and hookwrapper=True options are mutually exclusive"-                % (hookimpl.plugin_name, hook.name, _formatdef(hookimpl.function)),+                f"Plugin {hookimpl.plugin_name!r} for hook {hook.name!r}\n"+                f"hookimpl definition: {_formatdef(hookimpl.function)}\n"+                "The wrapper=True and hookwrapper=True options are mutually exclusive",             )@@ -385,12 +380,12 @@         for name in self.hook.__dict__:-            if name[0] != "_":-                hook: HookCaller = getattr(self.hook, name)-                if not hook.has_spec():-                    for hookimpl in hook.get_hookimpls():-                        if not hookimpl.optionalhook:-                            raise PluginValidationError(-                                hookimpl.plugin,-                                "unknown hook %r in plugin %r"-                                % (name, hookimpl.plugin),-                            )+            if name[0] == "_":+                continue+            hook: HookCaller = getattr(self.hook, name)+            if not hook.has_spec():+                for hookimpl in hook.get_hookimpls():+                    if not hookimpl.optionalhook:+                        raise PluginValidationError(+                            hookimpl.plugin,+                            f"unknown hook {name!r} in plugin {hookimpl.plugin!r}",+                        ) 
src/pluggy/_result.py +9 lines
--- +++ @@ -12,4 +12,2 @@ from typing import Optional-from typing import Tuple-from typing import Type from typing import TypeVar@@ -17,3 +15,3 @@ -_ExcInfo = Tuple[Type[BaseException], BaseException, Optional[TracebackType]]+_ExcInfo = tuple[type[BaseException], BaseException, Optional[TracebackType]] ResultType = TypeVar("ResultType")@@ -30,3 +28,3 @@ -    __slots__ = ("_result", "_exception")+    __slots__ = ("_result", "_exception", "_traceback") @@ -40,2 +38,4 @@         self._exception = exception+        # Exception __traceback__ is mutable, this keeps the original.+        self._traceback = exception.__traceback__ if exception is not None else None @@ -48,3 +48,3 @@         else:-            return (type(exc), exc, exc.__traceback__)+            return (type(exc), exc, self._traceback) @@ -77,2 +77,3 @@         self._exception = None+        self._traceback = None @@ -87,2 +88,3 @@         self._exception = exception+        self._traceback = exception.__traceback__ if exception is not None else None @@ -96,2 +98,3 @@         exc = self._exception+        tb = self._traceback         if exc is None:@@ -99,3 +102,3 @@         else:-            raise exc.with_traceback(exc.__traceback__)+            raise exc.with_traceback(tb) 
src/pluggy/_tracing.py +2 lines
--- +++ @@ -6,6 +6,5 @@ +from collections.abc import Sequence from typing import Any from typing import Callable-from typing import Sequence-from typing import Tuple @@ -13,3 +12,3 @@ _Writer = Callable[[str], object]-_Processor = Callable[[Tuple[str, ...], Tuple[Any, ...]], object]+_Processor = Callable[[tuple[str, ...], tuple[Any, ...]], object] 
src/pluggy/_version.py +9 lines
--- +++ @@ -1,6 +1,11 @@-# file generated by setuptools_scm+# file generated by setuptools-scm # don't change, don't track in version control++__all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]+ TYPE_CHECKING = False if TYPE_CHECKING:-    from typing import Tuple, Union+    from typing import Tuple+    from typing import Union+     VERSION_TUPLE = Tuple[Union[int, str], ...]@@ -14,3 +19,3 @@ -__version__ = version = '1.5.0'-__version_tuple__ = version_tuple = (1, 5, 0)+__version__ = version = '1.6.0'+__version_tuple__ = version_tuple = (1, 6, 0)
testing/benchmark.py +6 lines
--- +++ @@ -3,2 +3,4 @@ """++from typing import Any @@ -28,3 +30,3 @@ @pytest.fixture(params=[10, 100], ids="hooks={}".format)-def hooks(request):+def hooks(request: Any) -> list[object]:     return [hook for i in range(request.param)]@@ -33,3 +35,3 @@ @pytest.fixture(params=[10, 100], ids="wrappers={}".format)-def wrappers(request):+def wrappers(request: Any) -> list[object]:     return [wrapper for i in range(request.param)]@@ -37,3 +39,3 @@ -def test_hook_and_wrappers_speed(benchmark, hooks, wrappers):+def test_hook_and_wrappers_speed(benchmark, hooks, wrappers) -> None:     def setup():@@ -67,3 +69,3 @@ )-def test_call_hook(benchmark, plugins, wrappers, nesting):+def test_call_hook(benchmark, plugins, wrappers, nesting) -> None:     pm = PluginManager("example")
testing/conftest.py +1 lines
--- +++ @@ -16,3 +16,3 @@         def he_method1(self, arg: int) -> int:-            return arg + 1+            return arg + 1  # pragma: no cover 
testing/test_details.py +65 lines
--- +++ @@ -1,3 +1,6 @@+from importlib.metadata import distribution+ import pytest +import pluggy from pluggy import HookimplMarker@@ -22,3 +25,3 @@         def x1meth(self):-            pass+            pass  # pragma: no cover @@ -35,3 +38,3 @@         def x1meth(self):-            pass+            pass  # pragma: no cover @@ -39,3 +42,3 @@         def x1meth2(self):-            pass+            pass  # pragma: no cover @@ -43,3 +46,3 @@         def x1meth3(self):-            pass+            pass  # pragma: no cover @@ -77,3 +80,3 @@         def foo(self):-            pass+            pass  # pragma: no cover @@ -82,3 +85,3 @@         def foo(self):-            pass+            pass  # pragma: no cover @@ -138,6 +141,8 @@     class Module:-        pass+        x: DontTouchMe      module = Module()-    module.x = DontTouchMe()  # type: ignore[attr-defined]+    module.x = DontTouchMe()+    with pytest.raises(Exception, match="touch me"):+        module.x.broken @@ -156,3 +161,3 @@         def hello(self, arg1, arg2):-            pass+            pass  # pragma: no cover @@ -160,3 +165,3 @@         def herstory(self, arg1, arg2):-            pass+            pass  # pragma: no cover @@ -191 +196,51 @@     )+++def test_dist_facade_list_attributes() -> None:+    from pluggy._manager import DistFacade++    fc = DistFacade(distribution("pluggy"))+    res = dir(fc)+    assert res == sorted(res)+    assert set(res) - set(dir(fc._dist)) == {"_dist", "project_name"}+++def test_hookimpl_disallow_invalid_combination() -> None:+    decorator = hookspec(historic=True, firstresult=True)+    with pytest.raises(ValueError, match="cannot have a historic firstresult hook"):+        decorator(any)+++def test_hook_nonspec_call(pm: PluginManager) -> None:+    class Plugin:+        @hookimpl+        def a_hook(self, passed: str, missing: int) -> None:+            pass++    pm.register(Plugin())+    with pytest.raises(+        pluggy.HookCallError, match="hook call must provide argument 'missing'"+    ):+        pm.hook.a_hook(passed="a")+    pm.hook.a_hook(passed="a", missing="ok")+++def test_wrapper_runtimeerror_passtrough(pm: PluginManager) -> None:+    """+    ensure runtime-error passes trough a wrapper in case of exceptions+    """++    class Fail:+        @hookimpl+        def fail_late(self):+            raise RuntimeError("this is personal")++    class Plugin:+        @hookimpl(wrapper=True)+        def fail_late(self):+            yield++    pm.register(Plugin())+    pm.register(Fail())+    with pytest.raises(RuntimeError, match="this is personal"):+        pm.hook.fail_late()
testing/test_helpers.py +4 lines
--- +++ @@ -12,3 +12,3 @@     def f(x) -> None:-        i = 3  # noqa+        i = 3  # noqa #pragma: no cover @@ -16,3 +16,3 @@         def f(self, y) -> None:-            pass+            pass  # pragma: no cover @@ -20,3 +20,3 @@         def __call__(self, z) -> None:-            pass+            pass  # pragma: no cover @@ -98,3 +98,3 @@         def wrapper(*args, **kwargs):-            return func(*args, **kwargs)+            return func(*args, **kwargs)  # pragma: no cover 
testing/test_hookcaller.py +17 lines
--- +++ @@ -1,5 +1,4 @@+from collections.abc import Generator+from collections.abc import Sequence from typing import Callable-from typing import Generator-from typing import List-from typing import Sequence from typing import TypeVar@@ -65,3 +64,3 @@ -def funcs(hookmethods: Sequence[HookImpl]) -> List[Callable[..., object]]:+def funcs(hookmethods: Sequence[HookImpl]) -> list[Callable[..., object]]:     return [hookmethod.function for hookmethod in hookmethods]@@ -161,3 +160,3 @@     def he_method1():-        yield+        yield  # pragma: no cover @@ -165,3 +164,3 @@     def he_method1_fun():-        yield+        yield  # pragma: no cover @@ -169,3 +168,3 @@     def he_method1_middle():-        return+        return  # pragma: no cover @@ -173,3 +172,3 @@     def he_method3_fun():-        yield+        yield  # pragma: no cover @@ -177,3 +176,3 @@     def he_method3():-        yield+        yield  # pragma: no cover @@ -191,3 +190,3 @@     def he_method1():-        yield+        yield  # pragma: no cover @@ -195,3 +194,3 @@     def he_method2():-        yield+        yield  # pragma: no cover @@ -199,3 +198,3 @@     def he_method3():-        yield+        yield  # pragma: no cover @@ -209,3 +208,3 @@     def m1():-        yield+        yield  # pragma: no cover @@ -230,3 +229,3 @@     def m5():-        yield+        yield  # pragma: no cover @@ -246,3 +245,3 @@     def m8():-        yield+        yield  # pragma: no cover @@ -267,3 +266,3 @@     def m12():-        yield+        yield  # pragma: no cover @@ -408,3 +407,3 @@         def foo(self, arg: int, too, many, args) -> int:-            return arg + 1+            return arg + 1  # pragma: no cover @@ -418,3 +417,3 @@         def hello(self, arg: int) -> int:-            return arg + 1+            return arg + 1  # pragma: no cover 
testing/test_invocations.py +43 lines
--- +++ @@ -1,2 +1,3 @@-from typing import Iterator+from collections.abc import Iterator+from typing import Any @@ -135,3 +136,3 @@         def hello(self, arg):-            return arg + 1+            return arg + 1  # pragma: no cover @@ -328 +329,41 @@     assert [y for x in res for y in x] == [2, 3, 1]++[email protected](+    "kind",+    [+        pytest.param(hookimpl(wrapper=True), id="wrapper"),+        pytest.param(hookimpl(hookwrapper=True), id="legacy-wrapper"),+    ],+)+def test_wrappers_yield_twice_fails(pm: PluginManager, kind: Any) -> None:+    class Plugin:+        @kind+        def wrap(self):+            yield+            yield++    pm.register(Plugin())+    with pytest.raises(+        RuntimeError, match="wrap_controller at 'wrap'.* has second yield"+    ):+        pm.hook.wrap()++[email protected](+    "kind",+    [+        pytest.param(hookimpl(wrapper=True), id="wrapper"),+        pytest.param(hookimpl(hookwrapper=True), id="legacy-wrapper"),+    ],+)+def test_wrappers_yield_never_fails(pm: PluginManager, kind: Any) -> None:+    class Plugin:+        @kind+        def wrap(self):+            if False:+                yield  # type: ignore[unreachable]++    pm.register(Plugin())+    with pytest.raises(RuntimeError, match="wrap_controller at 'wrap'.* did not yield"):+        pm.hook.wrap()
testing/test_multicall.py +40 lines
--- +++ @@ -1,6 +1,4 @@+from collections.abc import Mapping+from collections.abc import Sequence from typing import Callable-from typing import List-from typing import Mapping-from typing import Sequence-from typing import Type from typing import Union@@ -24,3 +22,3 @@     firstresult: bool = False,-) -> Union[object, List[object]]:+) -> Union[object, list[object]]:     caller = _multicall@@ -59,3 +57,3 @@     def f(x):-        return x+        return x  # pragma: no cover @@ -252,3 +250,3 @@ @pytest.mark.parametrize("exc", [ValueError, SystemExit])-def test_hookwrapper_exception(exc: "Type[BaseException]") -> None:+def test_hookwrapper_exception(exc: type[BaseException]) -> None:     out = []@@ -322,3 +320,3 @@ @pytest.mark.parametrize("exc", [ValueError, SystemExit])-def test_wrapper_exception(exc: "Type[BaseException]") -> None:+def test_wrapper_exception(exc: type[BaseException]) -> None:     out = []@@ -335,3 +333,3 @@             out.append("m1 finish")-        return result+        return result  # pragma: no cover @@ -362,3 +360,3 @@         yield-        return 10+        return 10  # pragma: no cover @@ -388,3 +386,3 @@             yield-            out.append("m1 unreachable")+            out.append("m1 unreachable")  # pragma: no cover         except BaseException:@@ -418,2 +416,32 @@ [email protected]("has_hookwrapper", [True, False])+def test_wrapper_stopiteration_passtrough(has_hookwrapper: bool) -> None:+    out = []++    @hookimpl(wrapper=True)+    def wrap():+        out.append("wrap")+        try:+            yield+        finally:+            out.append("wrap done")++    @hookimpl(wrapper=not has_hookwrapper, hookwrapper=has_hookwrapper)+    def wrap_path2():+        yield++    @hookimpl+    def stop():+        out.append("stop")+        raise StopIteration++    with pytest.raises(StopIteration):+        try:+            MC([stop, wrap, wrap_path2], {})+        finally:+            out.append("finally")++    assert out == ["wrap", "stop", "wrap done", "finally"]++ def test_suppress_inner_wrapper_teardown_exc() -> None:@@ -433,3 +461,3 @@             yield-            out.append("m2 unreachable")+            out.append("m2 unreachable")  # pragma: no cover         except ValueError:
testing/test_pluginmanager.py +72 lines
--- +++ @@ -6,3 +6,2 @@ from typing import Any-from typing import List @@ -68,5 +67,7 @@                 return 42-            raise AttributeError()+            raise AttributeError(name)      a = A()+    a.test+     he_pm.register(a)@@ -129,3 +130,3 @@         def he_method_notexists(self):-            pass+            pass  # pragma: no cover @@ -143,3 +144,3 @@         def he_method1(self, qlwkje):-            pass+            pass  # pragma: no cover @@ -183,3 +184,3 @@         @hookimpl-        def he_method1(self): ...+        def he_method1(self): ...  # pragma: no cover @@ -202,2 +203,14 @@ +def test_unregister_blocked(pm: PluginManager) -> None:+    class Plugin:+        pass++    p = Plugin()+    pm.set_blocked("error")+    pm.register(p, "error")+    # bloked plugins can be unregistred many times atm+    pm.unregister(p, "error")+    pm.unregister(p, "error")++ def test_register_unknown_hooks(pm: PluginManager) -> None:@@ -213,4 +226,3 @@         @hookspec-        def he_method1(self, arg):-            pass+        def he_method1(self, arg): ... @@ -227,4 +239,3 @@         @hookspec(historic=True)-        def he_method1(self, arg):-            pass+        def he_method1(self, arg): ... @@ -376,3 +387,3 @@         def he_method1(self, arg):-            out.append(arg)+            out.append(arg)  # pragma: no cover @@ -393,3 +404,3 @@         def he_method1(self, arg):-            yield+            yield  # pragma: no cover @@ -428,2 +439,5 @@     pm.register(Plugin1())+    with pytest.raises(ZeroDivisionError):+        pm.hook.he_method1(arg="works")+     with pytest.raises(HookCallError):@@ -608,3 +622,3 @@ def test_add_tracefuncs(he_pm: PluginManager) -> None:-    out: List[Any] = []+    out: list[Any] = [] @@ -661,3 +675,3 @@     he_pm.register(api1())-    out: List[Any] = []+    out: list[Any] = []     he_pm.trace.root.setwriter(out.append)@@ -757 +771,46 @@         assert result == [4, 5, 3, 2, 1, 6]+++def test_check_pending_skips_underscore(pm: PluginManager) -> None:+    # todo: determine what we want to do with the namespace+    class Plugin:+        @hookimpl+        def _problem(self):+            pass++    pm.register(Plugin())+    pm.hook._problem()+    pm.check_pending()+++def test_check_pending_optionalhook(+    pm: PluginManager,+) -> None:+    class Plugin:+        @hookimpl(optionalhook=True)+        def a_hook(self, param):+            pass++    pm.register(Plugin())+    pm.hook.a_hook(param=1)+    pm.check_pending()+++def test_check_pending_nonspec_hook(+    pm: PluginManager,+) -> None:+    hookimpl = HookimplMarker("example")++    class Plugin:+        @hookimpl+        def a_hook(self, param):+            pass++    pm.register(Plugin())+    with pytest.raises(HookCallError, match="hook call must provide argument 'param'"):+        pm.hook.a_hook()++    with pytest.raises(+        PluginValidationError, match="unknown hook 'a_hook' in plugin .*"+    ):+        pm.check_pending()
testing/test_result.py +27 lines
--- +++ @@ -0,0 +1,27 @@+import traceback++from pluggy import Result+++def test_exceptions_traceback_doesnt_get_longer_and_longer() -> None:+    def bad() -> None:+        1 / 0++    result = Result.from_call(bad)++    try:+        result.get_result()+    except Exception as exc:+        tb1 = traceback.extract_tb(exc.__traceback__)++    try:+        result.get_result()+    except Exception as exc:+        tb2 = traceback.extract_tb(exc.__traceback__)++    try:+        result.get_result()+    except Exception as exc:+        tb3 = traceback.extract_tb(exc.__traceback__)++    assert len(tb1) == len(tb2) == len(tb3)
testing/test_tracer.py +1 lines
--- +++ @@ -1,3 +1 @@-from typing import List- import pytest@@ -15,3 +13,3 @@     log("hello")-    out: List[str] = []+    out: list[str] = []     rootlogger.setwriter(out.append)
protobuf pypi
7.35.1 1mo ago incident on record
YANK ×3BURST ×3INSTALL-EXEC
latest 7.35.1 versions 218 maintainers 1
6.33.2
6.33.3
6.33.4
6.33.5
5.29.6
7.34.0
6.33.6
7.34.1
4.25.9
7.35.0
7.34.2
7.35.1
YANK
3.18.0 marked yanked (still downloadable)
high · registry-verified · 2021-09-15 · 4y ago
YANK
4.21.0 marked yanked (still downloadable)
high · registry-verified · 2022-05-26 · 4y ago
YANK
5.29.0 marked yanked (still downloadable)
high · registry-verified · 2024-11-27 · 1y ago
BURST
3 releases in 59m: 3.18.3, 3.19.5, 3.20.2
info · registry-verified · 2022-09-14 · 3y ago
BURST
2 releases in 53m: 3.19.6, 3.20.3
info · registry-verified · 2022-09-29 · 3y ago
BURST
2 releases in 56m: 5.28.2, 4.25.5
info · registry-verified · 2024-09-18 · 1y ago
INSTALL-EXEC
setup.py in sdist uses subprocess/exec (runs at pip install)
warn · snapshot-derived
release diff 7.34.2 → 7.35.1
+1 added · -0 removed · ~76 modified
google/protobuf/__init__.py +1 lines
--- +++ @@ -9,2 +9,2 @@ -__version__ = '7.34.2'+__version__ = '7.35.1'
google/protobuf/any_pb2.py +3 lines
--- +++ @@ -4,3 +4,3 @@ # source: google/protobuf/any.proto-# Protobuf Python Version: 7.34.2+# Protobuf Python Version: 7.35.1 """Generated protocol buffer code."""@@ -14,4 +14,4 @@     7,-    34,-    2,+    35,+    1,     '',
google/protobuf/api_pb2.py +3 lines
--- +++ @@ -4,3 +4,3 @@ # source: google/protobuf/api.proto-# Protobuf Python Version: 7.34.2+# Protobuf Python Version: 7.35.1 """Generated protocol buffer code."""@@ -14,4 +14,4 @@     7,-    34,-    2,+    35,+    1,     '',
google/protobuf/compiler/plugin_pb2.py +3 lines
--- +++ @@ -4,3 +4,3 @@ # source: google/protobuf/compiler/plugin.proto-# Protobuf Python Version: 7.34.2+# Protobuf Python Version: 7.35.1 """Generated protocol buffer code."""@@ -14,4 +14,4 @@     7,-    34,-    2,+    35,+    1,     '',
google/protobuf/descriptor_database.py +23 lines
--- +++ @@ -11,2 +11,3 @@ +from typing import Dict, Iterator, Optional import warnings@@ -25,7 +26,11 @@ -  def __init__(self):-    self._file_desc_protos_by_file = {}-    self._file_desc_protos_by_symbol = {}+  def __init__(self) -> None:+    self._file_desc_protos_by_file: Dict[+        str, 'descriptor_pb2.FileDescriptorProto'+    ] = {}+    self._file_desc_protos_by_symbol: Dict[+        str, 'descriptor_pb2.FileDescriptorProto'+    ] = {} -  def Add(self, file_desc_proto):+  def Add(self, file_desc_proto: 'descriptor_pb2.FileDescriptorProto') -> None:     """Adds the FileDescriptorProto and its types to this database.@@ -73,3 +78,3 @@ -  def FindFileByName(self, name):+  def FindFileByName(self, name: str) -> 'descriptor_pb2.FileDescriptorProto':     """Finds the file descriptor proto by file name.@@ -92,3 +97,5 @@ -  def FindFileContainingSymbol(self, symbol):+  def FindFileContainingSymbol(+      self, symbol: str+  ) -> 'descriptor_pb2.FileDescriptorProto':     """Finds the file descriptor proto containing the specified symbol.@@ -137,3 +144,5 @@ -  def FindFileContainingExtension(self, extendee_name, extension_number):+  def FindFileContainingExtension(+      self, extendee_name: str, extension_number: int  # pylint: disable=unused-argument+  ) -> Optional['descriptor_pb2.FileDescriptorProto']:     # TODO: implement this API.@@ -141,3 +150,3 @@ -  def FindAllExtensionNumbers(self, extendee_name):+  def FindAllExtensionNumbers(self, extendee_name: str) -> list[int]:  # pylint: disable=unused-argument     # TODO: implement this API.@@ -145,3 +154,5 @@ -  def _AddSymbol(self, name, file_desc_proto):+  def _AddSymbol(+      self, name: str, file_desc_proto: 'descriptor_pb2.FileDescriptorProto'+  ) -> None:     if name in self._file_desc_protos_by_symbol:@@ -155,3 +166,5 @@ -def _ExtractSymbols(desc_proto, package):+def _ExtractSymbols(+    desc_proto: 'descriptor_pb2.DescriptorProto', package: str+) -> Iterator[str]:   """Pulls out all the symbols from a descriptor proto.
google/protobuf/descriptor_pb2.py +152 lines
--- +++ @@ -4,3 +4,3 @@ # source: google/protobuf/descriptor.proto-# Protobuf Python Version: 7.34.2+# Protobuf Python Version: 7.35.1 """Generated protocol buffer code."""@@ -14,4 +14,4 @@     7,-    34,-    2,+    35,+    1,     '',@@ -34,6 +34,6 @@     create_key=_descriptor._internal_create_key,-    serialized_pb=b'\n google/protobuf/descriptor.proto\x12\x0fgoogle.protobuf\"[\n\x11\x46ileDescriptorSet\x12\x38\n\x04\x66ile\x18\x01 \x03(\x0b\x32$.google.protobuf.FileDescriptorProtoR\x04\x66ile*\x0c\x08\x80\xec\xca\xff\x01\x10\x81\xec\xca\xff\x01\"\xc5\x05\n\x13\x46ileDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n\x07package\x18\x02 \x01(\tR\x07package\x12\x1e\n\ndependency\x18\x03 \x03(\tR\ndependency\x12+\n\x11public_dependency\x18\n \x03(\x05R\x10publicDependency\x12\'\n\x0fweak_dependency\x18\x0b \x03(\x05R\x0eweakDependency\x12+\n\x11option_dependency\x18\x0f \x03(\tR\x10optionDependency\x12\x43\n\x0cmessage_type\x18\x04 \x03(\x0b\x32 .google.protobuf.DescriptorProtoR\x0bmessageType\x12\x41\n\tenum_type\x18\x05 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProtoR\x08\x65numType\x12\x41\n\x07service\x18\x06 \x03(\x0b\x32\'.google.protobuf.ServiceDescriptorProtoR\x07service\x12\x43\n\textension\x18\x07 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProtoR\textension\x12\x36\n\x07options\x18\x08 \x01(\x0b\x32\x1c.google.protobuf.FileOptionsR\x07options\x12I\n\x10source_code_info\x18\t \x01(\x0b\x32\x1f.google.protobuf.SourceCodeInfoR\x0esourceCodeInfo\x12\x16\n\x06syntax\x18\x0c \x01(\tR\x06syntax\x12\x32\n\x07\x65\x64ition\x18\x0e \x01(\x0e\x32\x18.google.protobuf.EditionR\x07\x65\x64ition\"\xfc\x06\n\x0f\x44\x65scriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12;\n\x05\x66ield\x18\x02 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProtoR\x05\x66ield\x12\x43\n\textension\x18\x06 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProtoR\textension\x12\x41\n\x0bnested_type\x18\x03 \x03(\x0b\x32 .google.protobuf.DescriptorProtoR\nnestedType\x12\x41\n\tenum_type\x18\x04 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProtoR\x08\x65numType\x12X\n\x0f\x65xtension_range\x18\x05 \x03(\x0b\x32/.google.protobuf.DescriptorProto.ExtensionRangeR\x0e\x65xtensionRange\x12\x44\n\noneof_decl\x18\x08 \x03(\x0b\x32%.google.protobuf.OneofDescriptorProtoR\toneofDecl\x12\x39\n\x07options\x18\x07 \x01(\x0b\x32\x1f.google.protobuf.MessageOptionsR\x07options\x12U\n\x0ereserved_range\x18\t \x03(\x0b\x32..google.protobuf.DescriptorProto.ReservedRangeR\rreservedRange\x12#\n\rreserved_name\x18\n \x03(\tR\x0creservedName\x12\x41\n\nvisibility\x18\x0b \x01(\x0e\x32!.google.protobuf.SymbolVisibilityR\nvisibility\x1az\n\x0e\x45xtensionRange\x12\x14\n\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n\x03\x65nd\x18\x02 \x01(\x05R\x03\x65nd\x12@\n\x07options\x18\x03 \x01(\x0b\x32&.google.protobuf.ExtensionRangeOptionsR\x07options\x1a\x37\n\rReservedRange\x12\x14\n\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n\x03\x65nd\x18\x02 \x01(\x05R\x03\x65nd\"\xcc\x04\n\x15\x45xtensionRangeOptions\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x12Y\n\x0b\x64\x65\x63laration\x18\x02 \x03(\x0b\x32\x32.google.protobuf.ExtensionRangeOptions.DeclarationB\x03\x88\x01\x02R\x0b\x64\x65\x63laration\x12\x37\n\x08\x66\x65\x61tures\x18\x32 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12m\n\x0cverification\x18\x03 \x01(\x0e\x32\x38.google.protobuf.ExtensionRangeOptions.VerificationState:\nUNVERIFIEDB\x03\x88\x01\x02R\x0cverification\x1a\x94\x01\n\x0b\x44\x65\x63laration\x12\x16\n\x06number\x18\x01 \x01(\x05R\x06number\x12\x1b\n\tfull_name\x18\x02 \x01(\tR\x08\x66ullName\x12\x12\n\x04type\x18\x03 \x01(\tR\x04type\x12\x1a\n\x08reserved\x18\x05 \x01(\x08R\x08reserved\x12\x1a\n\x08repeated\x18\x06 \x01(\x08R\x08repeatedJ\x04\x08\x04\x10\x05\"4\n\x11VerificationState\x12\x0f\n\x0b\x44\x45\x43LARATION\x10\x00\x12\x0e\n\nUNVERIFIED\x10\x01*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xc1\x06\n\x14\x46ieldDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n\x06number\x18\x03 \x01(\x05R\x06number\x12\x41\n\x05label\x18\x04 \x01(\x0e\x32+.google.protobuf.FieldDescriptorProto.LabelR\x05label\x12>\n\x04type\x18\x05 \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.TypeR\x04type\x12\x1b\n\ttype_name\x18\x06 \x01(\tR\x08typeName\x12\x1a\n\x08\x65xtendee\x18\x02 \x01(\tR\x08\x65xtendee\x12#\n\rdefault_value\x18\x07 \x01(\tR\x0c\x64\x65\x66\x61ultValue\x12\x1f\n\x0boneof_index\x18\t \x01(\x05R\noneofIndex\x12\x1b\n\tjson_name\x18\n \x01(\tR\x08jsonName\x12\x37\n\x07options\x18\x08 \x01(\x0b\x32\x1d.google.protobuf.FieldOptionsR\x07options\x12\'\n\x0fproto3_optional\x18\x11 \x01(\x08R\x0eproto3Optional\"\xb6\x02\n\x04Type\x12\x0f\n\x0bTYPE_DOUBLE\x10\x01\x12\x0e\n\nTYPE_FLOAT\x10\x02\x12\x0e\n\nTYPE_INT64\x10\x03\x12\x0f\n\x0bTYPE_UINT64\x10\x04\x12\x0e\n\nTYPE_INT32\x10\x05\x12\x10\n\x0cTYPE_FIXED64\x10\x06\x12\x10\n\x0cTYPE_FIXED32\x10\x07\x12\r\n\tTYPE_BOOL\x10\x08\x12\x0f\n\x0bTYPE_STRING\x10\t\x12\x0e\n\nTYPE_GROUP\x10\n\x12\x10\n\x0cTYPE_MESSAGE\x10\x0b\x12\x0e\n\nTYPE_BYTES\x10\x0c\x12\x0f\n\x0bTYPE_UINT32\x10\r\x12\r\n\tTYPE_ENUM\x10\x0e\x12\x11\n\rTYPE_SFIXED32\x10\x0f\x12\x11\n\rTYPE_SFIXED64\x10\x10\x12\x0f\n\x0bTYPE_SINT32\x10\x11\x12\x0f\n\x0bTYPE_SINT64\x10\x12\"C\n\x05Label\x12\x12\n\x0eLABEL_OPTIONAL\x10\x01\x12\x12\n\x0eLABEL_REPEATED\x10\x03\x12\x12\n\x0eLABEL_REQUIRED\x10\x02\"c\n\x14OneofDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x37\n\x07options\x18\x02 \x01(\x0b\x32\x1d.google.protobuf.OneofOptionsR\x07options\"\xa6\x03\n\x13\x45numDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12?\n\x05value\x18\x02 \x03(\x0b\x32).google.protobuf.EnumValueDescriptorProtoR\x05value\x12\x36\n\x07options\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.EnumOptionsR\x07options\x12]\n\x0ereserved_range\x18\x04 \x03(\x0b\x32\x36.google.protobuf.EnumDescriptorProto.EnumReservedRangeR\rreservedRange\x12#\n\rreserved_name\x18\x05 \x03(\tR\x0creservedName\x12\x41\n\nvisibility\x18\x06 \x01(\x0e\x32!.google.protobuf.SymbolVisibilityR\nvisibility\x1a;\n\x11\x45numReservedRange\x12\x14\n\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n\x03\x65nd\x18\x02 \x01(\x05R\x03\x65nd\"\x83\x01\n\x18\x45numValueDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n\x06number\x18\x02 \x01(\x05R\x06number\x12;\n\x07options\x18\x03 \x01(\x0b\x32!.google.protobuf.EnumValueOptionsR\x07options\"\xb5\x01\n\x16ServiceDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12>\n\x06method\x18\x02 \x03(\x0b\x32&.google.protobuf.MethodDescriptorProtoR\x06method\x12\x39\n\x07options\x18\x03 \x01(\x0b\x32\x1f.google.protobuf.ServiceOptionsR\x07optionsJ\x04\x08\x04\x10\x05R\x06stream\"\x89\x02\n\x15MethodDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x1d\n\ninput_type\x18\x02 \x01(\tR\tinputType\x12\x1f\n\x0boutput_type\x18\x03 \x01(\tR\noutputType\x12\x38\n\x07options\x18\x04 \x01(\x0b\x32\x1e.google.protobuf.MethodOptionsR\x07options\x12\x30\n\x10\x63lient_streaming\x18\x05 \x01(\x08:\x05\x66\x61lseR\x0f\x63lientStreaming\x12\x30\n\x10server_streaming\x18\x06 \x01(\x08:\x05\x66\x61lseR\x0fserverStreaming\"\xf2\n\n\x0b\x46ileOptions\x12!\n\x0cjava_package\x18\x01 \x01(\tR\x0bjavaPackage\x12\x30\n\x14java_outer_classname\x18\x08 \x01(\tR\x12javaOuterClassname\x12\xf9\x01\n\x13java_multiple_files\x18\n \x01(\x08:\x05\x66\x61lseB\xc1\x01\xb2\x01\xbd\x01\x08\xe6\x07 \xe9\x07*\xb4\x01This behavior is enabled by default in editions 2024 and above. To disable it, you can set `features.(pb.java).nest_in_file_class = YES` on individual messages, enums, or services.R\x11javaMultipleFiles\x12\x44\n\x1djava_generate_equals_and_hash\x18\x14 \x01(\x08\x42\x02\x18\x01R\x19javaGenerateEqualsAndHash\x12:\n\x16java_string_check_utf8\x18\x1b \x01(\x08:\x05\x66\x61lseR\x13javaStringCheckUtf8\x12S\n\x0coptimize_for\x18\t \x01(\x0e\x32).google.protobuf.FileOptions.OptimizeMode:\x05SPEEDR\x0boptimizeFor\x12\x1d\n\ngo_package\x18\x0b \x01(\tR\tgoPackage\x12\x35\n\x13\x63\x63_generic_services\x18\x10 \x01(\x08:\x05\x66\x61lseR\x11\x63\x63GenericServices\x12\x39\n\x15java_generic_services\x18\x11 \x01(\x08:\x05\x66\x61lseR\x13javaGenericServices\x12\x35\n\x13py_generic_services\x18\x12 \x01(\x08:\x05\x66\x61lseR\x11pyGenericServices\x12%\n\ndeprecated\x18\x17 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12.\n\x10\x63\x63_enable_arenas\x18\x1f \x01(\x08:\x04trueR\x0e\x63\x63\x45nableArenas\x12*\n\x11objc_class_prefix\x18$ \x01(\tR\x0fobjcClassPrefix\x12)\n\x10\x63sharp_namespace\x18% \x01(\tR\x0f\x63sharpNamespace\x12!\n\x0cswift_prefix\x18\' \x01(\tR\x0bswiftPrefix\x12(\n\x10php_class_prefix\x18( \x01(\tR\x0ephpClassPrefix\x12#\n\rphp_namespace\x18) \x01(\tR\x0cphpNamespace\x12\x34\n\x16php_metadata_namespace\x18, \x01(\tR\x14phpMetadataNamespace\x12!\n\x0cruby_package\x18- \x01(\tR\x0brubyPackage\x12\x37\n\x08\x66\x65\x61tures\x18\x32 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\":\n\x0cOptimizeMode\x12\t\n\x05SPEED\x10\x01\x12\r\n\tCODE_SIZE\x10\x02\x12\x10\n\x0cLITE_RUNTIME\x10\x03*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08*\x10+J\x04\x08&\x10\'R\x14php_generic_services\"\xf4\x03\n\x0eMessageOptions\x12<\n\x17message_set_wire_format\x18\x01 \x01(\x08:\x05\x66\x61lseR\x14messageSetWireFormat\x12L\n\x1fno_standard_descriptor_accessor\x18\x02 \x01(\x08:\x05\x66\x61lseR\x1cnoStandardDescriptorAccessor\x12%\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12\x1b\n\tmap_entry\x18\x07 \x01(\x08R\x08mapEntry\x12V\n&deprecated_legacy_json_field_conflicts\x18\x0b \x01(\x08\x42\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x12\x37\n\x08\x66\x65\x61tures\x18\x0c \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07J\x04\x08\x08\x10\tJ\x04\x08\t\x10\n\"\xc6\r\n\x0c\x46ieldOptions\x12\x41\n\x05\x63type\x18\x01 \x01(\x0e\x32#.google.protobuf.FieldOptions.CType:\x06STRINGR\x05\x63type\x12\x16\n\x06packed\x18\x02 \x01(\x08R\x06packed\x12G\n\x06jstype\x18\x06 \x01(\x0e\x32$.google.protobuf.FieldOptions.JSType:\tJS_NORMALR\x06jstype\x12\x19\n\x04lazy\x18\x05 \x01(\x08:\x05\x66\x61lseR\x04lazy\x12.\n\x0funverified_lazy\x18\x0f \x01(\x08:\x05\x66\x61lseR\x0eunverifiedLazy\x12%\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12\x1d\n\x04weak\x18\n \x01(\x08:\x05\x66\x61lseB\x02\x18\x01R\x04weak\x12(\n\x0c\x64\x65\x62ug_redact\x18\x10 \x01(\x08:\x05\x66\x61lseR\x0b\x64\x65\x62ugRedact\x12K\n\tretention\x18\x11 \x01(\x0e\x32-.google.protobuf.FieldOptions.OptionRetentionR\tretention\x12H\n\x07targets\x18\x13 \x03(\x0e\x32..google.protobuf.FieldOptions.OptionTargetTypeR\x07targets\x12W\n\x10\x65\x64ition_defaults\x18\x14 \x03(\x0b\x32,.google.protobuf.FieldOptions.EditionDefaultR\x0f\x65\x64itionDefaults\x12\x37\n\x08\x66\x65\x61tures\x18\x15 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12U\n\x0f\x66\x65\x61ture_support\x18\x16 \x01(\x0b\x32,.google.protobuf.FieldOptions.FeatureSupportR\x0e\x66\x65\x61tureSupport\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x1aZ\n\x0e\x45\x64itionDefault\x12\x32\n\x07\x65\x64ition\x18\x03 \x01(\x0e\x32\x18.google.protobuf.EditionR\x07\x65\x64ition\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\x1a\xbb\x02\n\x0e\x46\x65\x61tureSupport\x12G\n\x12\x65\x64ition_introduced\x18\x01 \x01(\x0e\x32\x18.google.protobuf.EditionR\x11\x65\x64itionIntroduced\x12G\n\x12\x65\x64ition_deprecated\x18\x02 \x01(\x0e\x32\x18.google.protobuf.EditionR\x11\x65\x64itionDeprecated\x12/\n\x13\x64\x65precation_warning\x18\x03 \x01(\tR\x12\x64\x65precationWarning\x12\x41\n\x0f\x65\x64ition_removed\x18\x04 \x01(\x0e\x32\x18.google.protobuf.EditionR\x0e\x65\x64itionRemoved\x12#\n\rremoval_error\x18\x05 \x01(\tR\x0cremovalError\"/\n\x05\x43Type\x12\n\n\x06STRING\x10\x00\x12\x08\n\x04\x43ORD\x10\x01\x12\x10\n\x0cSTRING_PIECE\x10\x02\"5\n\x06JSType\x12\r\n\tJS_NORMAL\x10\x00\x12\r\n\tJS_STRING\x10\x01\x12\r\n\tJS_NUMBER\x10\x02\"U\n\x0fOptionRetention\x12\x15\n\x11RETENTION_UNKNOWN\x10\x00\x12\x15\n\x11RETENTION_RUNTIME\x10\x01\x12\x14\n\x10RETENTION_SOURCE\x10\x02\"\x8c\x02\n\x10OptionTargetType\x12\x17\n\x13TARGET_TYPE_UNKNOWN\x10\x00\x12\x14\n\x10TARGET_TYPE_FILE\x10\x01\x12\x1f\n\x1bTARGET_TYPE_EXTENSION_RANGE\x10\x02\x12\x17\n\x13TARGET_TYPE_MESSAGE\x10\x03\x12\x15\n\x11TARGET_TYPE_FIELD\x10\x04\x12\x15\n\x11TARGET_TYPE_ONEOF\x10\x05\x12\x14\n\x10TARGET_TYPE_ENUM\x10\x06\x12\x1a\n\x16TARGET_TYPE_ENUM_ENTRY\x10\x07\x12\x17\n\x13TARGET_TYPE_SERVICE\x10\x08\x12\x16\n\x12TARGET_TYPE_METHOD\x10\t*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05J\x04\x08\x12\x10\x13\"\xac\x01\n\x0cOneofOptions\x12\x37\n\x08\x66\x65\x61tures\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xd1\x02\n\x0b\x45numOptions\x12\x1f\n\x0b\x61llow_alias\x18\x02 \x01(\x08R\nallowAlias\x12%\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12V\n&deprecated_legacy_json_field_conflicts\x18\x06 \x01(\x08\x42\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x12\x37\n\x08\x66\x65\x61tures\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x05\x10\x06\"\xd8\x02\n\x10\x45numValueOptions\x12%\n\ndeprecated\x18\x01 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12\x37\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12(\n\x0c\x64\x65\x62ug_redact\x18\x03 \x01(\x08:\x05\x66\x61lseR\x0b\x64\x65\x62ugRedact\x12U\n\x0f\x66\x65\x61ture_support\x18\x04 \x01(\x0b\x32,.google.protobuf.FieldOptions.FeatureSupportR\x0e\x66\x65\x61tureSupport\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xd5\x01\n\x0eServiceOptions\x12\x37\n\x08\x66\x65\x61tures\x18\" \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12%\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x99\x03\n\rMethodOptions\x12%\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12q\n\x11idempotency_level\x18\" \x01(\x0e\x32/.google.protobuf.MethodOptions.IdempotencyLevel:\x13IDEMPOTENCY_UNKNOWNR\x10idempotencyLevel\x12\x37\n\x08\x66\x65\x61tures\x18# \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\"P\n\x10IdempotencyLevel\x12\x17\n\x13IDEMPOTENCY_UNKNOWN\x10\x00\x12\x13\n\x0fNO_SIDE_EFFECTS\x10\x01\x12\x0e\n\nIDEMPOTENT\x10\x02*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x9a\x03\n\x13UninterpretedOption\x12\x41\n\x04name\x18\x02 \x03(\x0b\x32-.google.protobuf.UninterpretedOption.NamePartR\x04name\x12)\n\x10identifier_value\x18\x03 \x01(\tR\x0fidentifierValue\x12,\n\x12positive_int_value\x18\x04 \x01(\x04R\x10positiveIntValue\x12,\n\x12negative_int_value\x18\x05 \x01(\x03R\x10negativeIntValue\x12!\n\x0c\x64ouble_value\x18\x06 \x01(\x01R\x0b\x64oubleValue\x12!\n\x0cstring_value\x18\x07 \x01(\x0cR\x0bstringValue\x12\'\n\x0f\x61ggregate_value\x18\x08 \x01(\tR\x0e\x61ggregateValue\x1aJ\n\x08NamePart\x12\x1b\n\tname_part\x18\x01 \x02(\tR\x08namePart\x12!\n\x0cis_extension\x18\x02 \x02(\x08R\x0bisExtension\"\x8e\x0f\n\nFeatureSet\x12\x91\x01\n\x0e\x66ield_presence\x18\x01 \x01(\x0e\x32).google.protobuf.FeatureSet.FieldPresenceB?\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\r\x12\x08\x45XPLICIT\x18\x84\x07\xa2\x01\r\x12\x08IMPLICIT\x18\xe7\x07\xa2\x01\r\x12\x08\x45XPLICIT\x18\xe8\x07\xb2\x01\x03\x08\xe8\x07R\rfieldPresence\x12l\n\tenum_type\x18\x02 \x01(\x0e\x32$.google.protobuf.FeatureSet.EnumTypeB)\x88\x01\x01\x98\x01\x06\x98\x01\x01\xa2\x01\x0b\x12\x06\x43LOSED\x18\x84\x07\xa2\x01\t\x12\x04OPEN\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\x08\x65numType\x12\x98\x01\n\x17repeated_field_encoding\x18\x03 \x01(\x0e\x32\x31.google.protobuf.FeatureSet.RepeatedFieldEncodingB-\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\r\x12\x08\x45XPANDED\x18\x84\x07\xa2\x01\x0b\x12\x06PACKED\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\x15repeatedFieldEncoding\x12~\n\x0futf8_validation\x18\x04 \x01(\x0e\x32*.google.protobuf.FeatureSet.Utf8ValidationB)\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\t\x12\x04NONE\x18\x84\x07\xa2\x01\x0b\x12\x06VERIFY\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\x0eutf8Validation\x12~\n\x10message_encoding\x18\x05 \x01(\x0e\x32+.google.protobuf.FeatureSet.MessageEncodingB&\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\x14\x12\x0fLENGTH_PREFIXED\x18\x84\x07\xb2\x01\x03\x08\xe8\x07R\x0fmessageEncoding\x12\x82\x01\n\x0bjson_format\x18\x06 \x01(\x0e\x32&.google.protobuf.FeatureSet.JsonFormatB9\x88\x01\x01\x98\x01\x03\x98\x01\x06\x98\x01\x01\xa2\x01\x17\x12\x12LEGACY_BEST_EFFORT\x18\x84\x07\xa2\x01\n\x12\x05\x41LLOW\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\njsonFormat\x12\xab\x01\n\x14\x65nforce_naming_style\x18\x07 \x01(\x0e\x32..google.protobuf.FeatureSet.EnforceNamingStyleBI\x88\x01\x02\x98\x01\x01\x98\x01\x02\x98\x01\x03\x98\x01\x04\x98\x01\x05\x98\x01\x06\x98\x01\x07\x98\x01\x08\x98\x01\t\xa2\x01\x11\x12\x0cSTYLE_LEGACY\x18\x84\x07\xa2\x01\x0e\x12\tSTYLE2024\x18\xe9\x07\xb2\x01\x03\x08\xe9\x07R\x12\x65nforceNamingStyle\x12\xb9\x01\n\x19\x64\x65\x66\x61ult_symbol_visibility\x18\x08 \x01(\x0e\x32\x45.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibilityB6\x88\x01\x02\x98\x01\x01\xa2\x01\x0f\x12\nEXPORT_ALL\x18\x84\x07\xa2\x01\x15\x12\x10\x45XPORT_TOP_LEVEL\x18\xe9\x07\xb2\x01\x03\x08\xe9\x07R\x17\x64\x65\x66\x61ultSymbolVisibility\x1a\xa1\x01\n\x11VisibilityFeature\"\x81\x01\n\x17\x44\x65\x66\x61ultSymbolVisibility\x12%\n!DEFAULT_SYMBOL_VISIBILITY_UNKNOWN\x10\x00\x12\x0e\n\nEXPORT_ALL\x10\x01\x12\x14\n\x10\x45XPORT_TOP_LEVEL\x10\x02\x12\r\n\tLOCAL_ALL\x10\x03\x12\n\n\x06STRICT\x10\x04J\x08\x08\x01\x10\x80\x80\x80\x80\x02\"\\\n\rFieldPresence\x12\x1a\n\x16\x46IELD_PRESENCE_UNKNOWN\x10\x00\x12\x0c\n\x08\x45XPLICIT\x10\x01\x12\x0c\n\x08IMPLICIT\x10\x02\x12\x13\n\x0fLEGACY_REQUIRED\x10\x03\"7\n\x08\x45numType\x12\x15\n\x11\x45NUM_TYPE_UNKNOWN\x10\x00\x12\x08\n\x04OPEN\x10\x01\x12\n\n\x06\x43LOSED\x10\x02\"V\n\x15RepeatedFieldEncoding\x12#\n\x1fREPEATED_FIELD_ENCODING_UNKNOWN\x10\x00\x12\n\n\x06PACKED\x10\x01\x12\x0c\n\x08\x45XPANDED\x10\x02\"I\n\x0eUtf8Validation\x12\x1b\n\x17UTF8_VALIDATION_UNKNOWN\x10\x00\x12\n\n\x06VERIFY\x10\x02\x12\x08\n\x04NONE\x10\x03\"\x04\x08\x01\x10\x01\"S\n\x0fMessageEncoding\x12\x1c\n\x18MESSAGE_ENCODING_UNKNOWN\x10\x00\x12\x13\n\x0fLENGTH_PREFIXED\x10\x01\x12\r\n\tDELIMITED\x10\x02\"H\n\nJsonFormat\x12\x17\n\x13JSON_FORMAT_UNKNOWN\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x12\x16\n\x12LEGACY_BEST_EFFORT\x10\x02\"W\n\x12\x45nforceNamingStyle\x12 \n\x1c\x45NFORCE_NAMING_STYLE_UNKNOWN\x10\x00\x12\r\n\tSTYLE2024\x10\x01\x12\x10\n\x0cSTYLE_LEGACY\x10\x02*\x06\x08\xe8\x07\x10\x8bN*\x06\x08\x8bN\x10\x90N*\x06\x08\x90N\x10\x91NJ\x06\x08\xe7\x07\x10\xe8\x07\"\xef\x03\n\x12\x46\x65\x61tureSetDefaults\x12X\n\x08\x64\x65\x66\x61ults\x18\x01 \x03(\x0b\x32<.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefaultR\x08\x64\x65\x66\x61ults\x12\x41\n\x0fminimum_edition\x18\x04 \x01(\x0e\x32\x18.google.protobuf.EditionR\x0eminimumEdition\x12\x41\n\x0fmaximum_edition\x18\x05 \x01(\x0e\x32\x18.google.protobuf.EditionR\x0emaximumEdition\x1a\xf8\x01\n\x18\x46\x65\x61tureSetEditionDefault\x12\x32\n\x07\x65\x64ition\x18\x03 \x01(\x0e\x32\x18.google.protobuf.EditionR\x07\x65\x64ition\x12N\n\x14overridable_features\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x13overridableFeatures\x12\x42\n\x0e\x66ixed_features\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\rfixedFeaturesJ\x04\x08\x01\x10\x02J\x04\x08\x02\x10\x03R\x08\x66\x65\x61tures\"\xb5\x02\n\x0eSourceCodeInfo\x12\x44\n\x08location\x18\x01 \x03(\x0b\x32(.google.protobuf.SourceCodeInfo.LocationR\x08location\x1a\xce\x01\n\x08Location\x12\x16\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01R\x04path\x12\x16\n\x04span\x18\x02 \x03(\x05\x42\x02\x10\x01R\x04span\x12)\n\x10leading_comments\x18\x03 \x01(\tR\x0fleadingComments\x12+\n\x11trailing_comments\x18\x04 \x01(\tR\x10trailingComments\x12:\n\x19leading_detached_comments\x18\x06 \x03(\tR\x17leadingDetachedComments*\x0c\x08\x80\xec\xca\xff\x01\x10\x81\xec\xca\xff\x01\"\xd0\x02\n\x11GeneratedCodeInfo\x12M\n\nannotation\x18\x01 \x03(\x0b\x32-.google.protobuf.GeneratedCodeInfo.AnnotationR\nannotation\x1a\xeb\x01\n\nAnnotation\x12\x16\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01R\x04path\x12\x1f\n\x0bsource_file\x18\x02 \x01(\tR\nsourceFile\x12\x14\n\x05\x62\x65gin\x18\x03 \x01(\x05R\x05\x62\x65gin\x12\x10\n\x03\x65nd\x18\x04 \x01(\x05R\x03\x65nd\x12R\n\x08semantic\x18\x05 \x01(\x0e\x32\x36.google.protobuf.GeneratedCodeInfo.Annotation.SemanticR\x08semantic\"(\n\x08Semantic\x12\x08\n\x04NONE\x10\x00\x12\x07\n\x03SET\x10\x01\x12\t\n\x05\x41LIAS\x10\x02*\xbe\x02\n\x07\x45\x64ition\x12\x13\n\x0f\x45\x44ITION_UNKNOWN\x10\x00\x12\x13\n\x0e\x45\x44ITION_LEGACY\x10\x84\x07\x12\x13\n\x0e\x45\x44ITION_PROTO2\x10\xe6\x07\x12\x13\n\x0e\x45\x44ITION_PROTO3\x10\xe7\x07\x12\x11\n\x0c\x45\x44ITION_2023\x10\xe8\x07\x12\x11\n\x0c\x45\x44ITION_2024\x10\xe9\x07\x12\x15\n\x10\x45\x44ITION_UNSTABLE\x10\x8fN\x12\x17\n\x13\x45\x44ITION_1_TEST_ONLY\x10\x01\x12\x17\n\x13\x45\x44ITION_2_TEST_ONLY\x10\x02\x12\x1d\n\x17\x45\x44ITION_99997_TEST_ONLY\x10\x9d\x8d\x06\x12\x1d\n\x17\x45\x44ITION_99998_TEST_ONLY\x10\x9e\x8d\x06\x12\x1d\n\x17\x45\x44ITION_99999_TEST_ONLY\x10\x9f\x8d\x06\x12\x13\n\x0b\x45\x44ITION_MAX\x10\xff\xff\xff\xff\x07*U\n\x10SymbolVisibility\x12\x14\n\x10VISIBILITY_UNSET\x10\x00\x12\x14\n\x10VISIBILITY_LOCAL\x10\x01\x12\x15\n\x11VISIBILITY_EXPORT\x10\x02\x42~\n\x13\x63om.google.protobufB\x10\x44\x65scriptorProtosH\x01Z-google.golang.org/protobuf/types/descriptorpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1aGoogle.Protobuf.Reflection'+    serialized_pb=b'\n google/protobuf/descriptor.proto\x12\x0fgoogle.protobuf\"[\n\x11\x46ileDescriptorSet\x12\x38\n\x04\x66ile\x18\x01 \x03(\x0b\x32$.google.protobuf.FileDescriptorProtoR\x04\x66ile*\x0c\x08\x80\xec\xca\xff\x01\x10\x81\xec\xca\xff\x01\"\xc5\x05\n\x13\x46ileDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n\x07package\x18\x02 \x01(\tR\x07package\x12\x1e\n\ndependency\x18\x03 \x03(\tR\ndependency\x12+\n\x11public_dependency\x18\n \x03(\x05R\x10publicDependency\x12\'\n\x0fweak_dependency\x18\x0b \x03(\x05R\x0eweakDependency\x12+\n\x11option_dependency\x18\x0f \x03(\tR\x10optionDependency\x12\x43\n\x0cmessage_type\x18\x04 \x03(\x0b\x32 .google.protobuf.DescriptorProtoR\x0bmessageType\x12\x41\n\tenum_type\x18\x05 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProtoR\x08\x65numType\x12\x41\n\x07service\x18\x06 \x03(\x0b\x32\'.google.protobuf.ServiceDescriptorProtoR\x07service\x12\x43\n\textension\x18\x07 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProtoR\textension\x12\x36\n\x07options\x18\x08 \x01(\x0b\x32\x1c.google.protobuf.FileOptionsR\x07options\x12I\n\x10source_code_info\x18\t \x01(\x0b\x32\x1f.google.protobuf.SourceCodeInfoR\x0esourceCodeInfo\x12\x16\n\x06syntax\x18\x0c \x01(\tR\x06syntax\x12\x32\n\x07\x65\x64ition\x18\x0e \x01(\x0e\x32\x18.google.protobuf.EditionR\x07\x65\x64ition\"\xfc\x06\n\x0f\x44\x65scriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12;\n\x05\x66ield\x18\x02 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProtoR\x05\x66ield\x12\x43\n\textension\x18\x06 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProtoR\textension\x12\x41\n\x0bnested_type\x18\x03 \x03(\x0b\x32 .google.protobuf.DescriptorProtoR\nnestedType\x12\x41\n\tenum_type\x18\x04 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProtoR\x08\x65numType\x12X\n\x0f\x65xtension_range\x18\x05 \x03(\x0b\x32/.google.protobuf.DescriptorProto.ExtensionRangeR\x0e\x65xtensionRange\x12\x44\n\noneof_decl\x18\x08 \x03(\x0b\x32%.google.protobuf.OneofDescriptorProtoR\toneofDecl\x12\x39\n\x07options\x18\x07 \x01(\x0b\x32\x1f.google.protobuf.MessageOptionsR\x07options\x12U\n\x0ereserved_range\x18\t \x03(\x0b\x32..google.protobuf.DescriptorProto.ReservedRangeR\rreservedRange\x12#\n\rreserved_name\x18\n \x03(\tR\x0creservedName\x12\x41\n\nvisibility\x18\x0b \x01(\x0e\x32!.google.protobuf.SymbolVisibilityR\nvisibility\x1az\n\x0e\x45xtensionRange\x12\x14\n\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n\x03\x65nd\x18\x02 \x01(\x05R\x03\x65nd\x12@\n\x07options\x18\x03 \x01(\x0b\x32&.google.protobuf.ExtensionRangeOptionsR\x07options\x1a\x37\n\rReservedRange\x12\x14\n\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n\x03\x65nd\x18\x02 \x01(\x05R\x03\x65nd\"\xd4\x04\n\x15\x45xtensionRangeOptions\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x12Y\n\x0b\x64\x65\x63laration\x18\x02 \x03(\x0b\x32\x32.google.protobuf.ExtensionRangeOptions.DeclarationB\x03\x88\x01\x02R\x0b\x64\x65\x63laration\x12\x37\n\x08\x66\x65\x61tures\x18\x32 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12m\n\x0cverification\x18\x03 \x01(\x0e\x32\x38.google.protobuf.ExtensionRangeOptions.VerificationState:\nUNVERIFIEDB\x03\x88\x01\x02R\x0cverification\x1a\x94\x01\n\x0b\x44\x65\x63laration\x12\x16\n\x06number\x18\x01 \x01(\x05R\x06number\x12\x1b\n\tfull_name\x18\x02 \x01(\tR\x08\x66ullName\x12\x12\n\x04type\x18\x03 \x01(\tR\x04type\x12\x1a\n\x08reserved\x18\x05 \x01(\x08R\x08reserved\x12\x1a\n\x08repeated\x18\x06 \x01(\x08R\x08repeatedJ\x04\x08\x04\x10\x05\"4\n\x11VerificationState\x12\x0f\n\x0b\x44\x45\x43LARATION\x10\x00\x12\x0e\n\nUNVERIFIED\x10\x01*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xc1\x06\n\x14\x46ieldDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n\x06number\x18\x03 \x01(\x05R\x06number\x12\x41\n\x05label\x18\x04 \x01(\x0e\x32+.google.protobuf.FieldDescriptorProto.LabelR\x05label\x12>\n\x04type\x18\x05 \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.TypeR\x04type\x12\x1b\n\ttype_name\x18\x06 \x01(\tR\x08typeName\x12\x1a\n\x08\x65xtendee\x18\x02 \x01(\tR\x08\x65xtendee\x12#\n\rdefault_value\x18\x07 \x01(\tR\x0c\x64\x65\x66\x61ultValue\x12\x1f\n\x0boneof_index\x18\t \x01(\x05R\noneofIndex\x12\x1b\n\tjson_name\x18\n \x01(\tR\x08jsonName\x12\x37\n\x07options\x18\x08 \x01(\x0b\x32\x1d.google.protobuf.FieldOptionsR\x07options\x12\'\n\x0fproto3_optional\x18\x11 \x01(\x08R\x0eproto3Optional\"\xb6\x02\n\x04Type\x12\x0f\n\x0bTYPE_DOUBLE\x10\x01\x12\x0e\n\nTYPE_FLOAT\x10\x02\x12\x0e\n\nTYPE_INT64\x10\x03\x12\x0f\n\x0bTYPE_UINT64\x10\x04\x12\x0e\n\nTYPE_INT32\x10\x05\x12\x10\n\x0cTYPE_FIXED64\x10\x06\x12\x10\n\x0cTYPE_FIXED32\x10\x07\x12\r\n\tTYPE_BOOL\x10\x08\x12\x0f\n\x0bTYPE_STRING\x10\t\x12\x0e\n\nTYPE_GROUP\x10\n\x12\x10\n\x0cTYPE_MESSAGE\x10\x0b\x12\x0e\n\nTYPE_BYTES\x10\x0c\x12\x0f\n\x0bTYPE_UINT32\x10\r\x12\r\n\tTYPE_ENUM\x10\x0e\x12\x11\n\rTYPE_SFIXED32\x10\x0f\x12\x11\n\rTYPE_SFIXED64\x10\x10\x12\x0f\n\x0bTYPE_SINT32\x10\x11\x12\x0f\n\x0bTYPE_SINT64\x10\x12\"C\n\x05Label\x12\x12\n\x0eLABEL_OPTIONAL\x10\x01\x12\x12\n\x0eLABEL_REPEATED\x10\x03\x12\x12\n\x0eLABEL_REQUIRED\x10\x02\"c\n\x14OneofDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x37\n\x07options\x18\x02 \x01(\x0b\x32\x1d.google.protobuf.OneofOptionsR\x07options\"\xa6\x03\n\x13\x45numDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12?\n\x05value\x18\x02 \x03(\x0b\x32).google.protobuf.EnumValueDescriptorProtoR\x05value\x12\x36\n\x07options\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.EnumOptionsR\x07options\x12]\n\x0ereserved_range\x18\x04 \x03(\x0b\x32\x36.google.protobuf.EnumDescriptorProto.EnumReservedRangeR\rreservedRange\x12#\n\rreserved_name\x18\x05 \x03(\tR\x0creservedName\x12\x41\n\nvisibility\x18\x06 \x01(\x0e\x32!.google.protobuf.SymbolVisibilityR\nvisibility\x1a;\n\x11\x45numReservedRange\x12\x14\n\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n\x03\x65nd\x18\x02 \x01(\x05R\x03\x65nd\"\x83\x01\n\x18\x45numValueDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n\x06number\x18\x02 \x01(\x05R\x06number\x12;\n\x07options\x18\x03 \x01(\x0b\x32!.google.protobuf.EnumValueOptionsR\x07options\"\xb5\x01\n\x16ServiceDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12>\n\x06method\x18\x02 \x03(\x0b\x32&.google.protobuf.MethodDescriptorProtoR\x06method\x12\x39\n\x07options\x18\x03 \x01(\x0b\x32\x1f.google.protobuf.ServiceOptionsR\x07optionsJ\x04\x08\x04\x10\x05R\x06stream\"\x89\x02\n\x15MethodDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x1d\n\ninput_type\x18\x02 \x01(\tR\tinputType\x12\x1f\n\x0boutput_type\x18\x03 \x01(\tR\noutputType\x12\x38\n\x07options\x18\x04 \x01(\x0b\x32\x1e.google.protobuf.MethodOptionsR\x07options\x12\x30\n\x10\x63lient_streaming\x18\x05 \x01(\x08:\x05\x66\x61lseR\x0f\x63lientStreaming\x12\x30\n\x10server_streaming\x18\x06 \x01(\x08:\x05\x66\x61lseR\x0fserverStreaming\"\xfa\n\n\x0b\x46ileOptions\x12!\n\x0cjava_package\x18\x01 \x01(\tR\x0bjavaPackage\x12\x30\n\x14java_outer_classname\x18\x08 \x01(\tR\x12javaOuterClassname\x12\xf9\x01\n\x13java_multiple_files\x18\n \x01(\x08:\x05\x66\x61lseB\xc1\x01\xb2\x01\xbd\x01\x08\xe6\x07 \xe9\x07*\xb4\x01This behavior is enabled by default in editions 2024 and above. To disable it, you can set `features.(pb.java).nest_in_file_class = YES` on individual messages, enums, or services.R\x11javaMultipleFiles\x12\x44\n\x1djava_generate_equals_and_hash\x18\x14 \x01(\x08\x42\x02\x18\x01R\x19javaGenerateEqualsAndHash\x12:\n\x16java_string_check_utf8\x18\x1b \x01(\x08:\x05\x66\x61lseR\x13javaStringCheckUtf8\x12S\n\x0coptimize_for\x18\t \x01(\x0e\x32).google.protobuf.FileOptions.OptimizeMode:\x05SPEEDR\x0boptimizeFor\x12\x1d\n\ngo_package\x18\x0b \x01(\tR\tgoPackage\x12\x35\n\x13\x63\x63_generic_services\x18\x10 \x01(\x08:\x05\x66\x61lseR\x11\x63\x63GenericServices\x12\x39\n\x15java_generic_services\x18\x11 \x01(\x08:\x05\x66\x61lseR\x13javaGenericServices\x12\x35\n\x13py_generic_services\x18\x12 \x01(\x08:\x05\x66\x61lseR\x11pyGenericServices\x12%\n\ndeprecated\x18\x17 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12.\n\x10\x63\x63_enable_arenas\x18\x1f \x01(\x08:\x04trueR\x0e\x63\x63\x45nableArenas\x12*\n\x11objc_class_prefix\x18$ \x01(\tR\x0fobjcClassPrefix\x12)\n\x10\x63sharp_namespace\x18% \x01(\tR\x0f\x63sharpNamespace\x12!\n\x0cswift_prefix\x18\' \x01(\tR\x0bswiftPrefix\x12(\n\x10php_class_prefix\x18( \x01(\tR\x0ephpClassPrefix\x12#\n\rphp_namespace\x18) \x01(\tR\x0cphpNamespace\x12\x34\n\x16php_metadata_namespace\x18, \x01(\tR\x14phpMetadataNamespace\x12!\n\x0cruby_package\x18- \x01(\tR\x0brubyPackage\x12\x37\n\x08\x66\x65\x61tures\x18\x32 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\":\n\x0cOptimizeMode\x12\t\n\x05SPEED\x10\x01\x12\r\n\tCODE_SIZE\x10\x02\x12\x10\n\x0cLITE_RUNTIME\x10\x03*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08*\x10+J\x04\x08&\x10\'R\x14php_generic_services\"\xfc\x03\n\x0eMessageOptions\x12<\n\x17message_set_wire_format\x18\x01 \x01(\x08:\x05\x66\x61lseR\x14messageSetWireFormat\x12L\n\x1fno_standard_descriptor_accessor\x18\x02 \x01(\x08:\x05\x66\x61lseR\x1cnoStandardDescriptorAccessor\x12%\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12\x1b\n\tmap_entry\x18\x07 \x01(\x08R\x08mapEntry\x12V\n&deprecated_legacy_json_field_conflicts\x18\x0b \x01(\x08\x42\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x12\x37\n\x08\x66\x65\x61tures\x18\x0c \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07J\x04\x08\x08\x10\tJ\x04\x08\t\x10\n\"\xce\r\n\x0c\x46ieldOptions\x12\x41\n\x05\x63type\x18\x01 \x01(\x0e\x32#.google.protobuf.FieldOptions.CType:\x06STRINGR\x05\x63type\x12\x16\n\x06packed\x18\x02 \x01(\x08R\x06packed\x12G\n\x06jstype\x18\x06 \x01(\x0e\x32$.google.protobuf.FieldOptions.JSType:\tJS_NORMALR\x06jstype\x12\x19\n\x04lazy\x18\x05 \x01(\x08:\x05\x66\x61lseR\x04lazy\x12.\n\x0funverified_lazy\x18\x0f \x01(\x08:\x05\x66\x61lseR\x0eunverifiedLazy\x12%\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12\x1d\n\x04weak\x18\n \x01(\x08:\x05\x66\x61lseB\x02\x18\x01R\x04weak\x12(\n\x0c\x64\x65\x62ug_redact\x18\x10 \x01(\x08:\x05\x66\x61lseR\x0b\x64\x65\x62ugRedact\x12K\n\tretention\x18\x11 \x01(\x0e\x32-.google.protobuf.FieldOptions.OptionRetentionR\tretention\x12H\n\x07targets\x18\x13 \x03(\x0e\x32..google.protobuf.FieldOptions.OptionTargetTypeR\x07targets\x12W\n\x10\x65\x64ition_defaults\x18\x14 \x03(\x0b\x32,.google.protobuf.FieldOptions.EditionDefaultR\x0f\x65\x64itionDefaults\x12\x37\n\x08\x66\x65\x61tures\x18\x15 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12U\n\x0f\x66\x65\x61ture_support\x18\x16 \x01(\x0b\x32,.google.protobuf.FieldOptions.FeatureSupportR\x0e\x66\x65\x61tureSupport\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x1aZ\n\x0e\x45\x64itionDefault\x12\x32\n\x07\x65\x64ition\x18\x03 \x01(\x0e\x32\x18.google.protobuf.EditionR\x07\x65\x64ition\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\x1a\xbb\x02\n\x0e\x46\x65\x61tureSupport\x12G\n\x12\x65\x64ition_introduced\x18\x01 \x01(\x0e\x32\x18.google.protobuf.EditionR\x11\x65\x64itionIntroduced\x12G\n\x12\x65\x64ition_deprecated\x18\x02 \x01(\x0e\x32\x18.google.protobuf.EditionR\x11\x65\x64itionDeprecated\x12/\n\x13\x64\x65precation_warning\x18\x03 \x01(\tR\x12\x64\x65precationWarning\x12\x41\n\x0f\x65\x64ition_removed\x18\x04 \x01(\x0e\x32\x18.google.protobuf.EditionR\x0e\x65\x64itionRemoved\x12#\n\rremoval_error\x18\x05 \x01(\tR\x0cremovalError\"/\n\x05\x43Type\x12\n\n\x06STRING\x10\x00\x12\x08\n\x04\x43ORD\x10\x01\x12\x10\n\x0cSTRING_PIECE\x10\x02\"5\n\x06JSType\x12\r\n\tJS_NORMAL\x10\x00\x12\r\n\tJS_STRING\x10\x01\x12\r\n\tJS_NUMBER\x10\x02\"U\n\x0fOptionRetention\x12\x15\n\x11RETENTION_UNKNOWN\x10\x00\x12\x15\n\x11RETENTION_RUNTIME\x10\x01\x12\x14\n\x10RETENTION_SOURCE\x10\x02\"\x8c\x02\n\x10OptionTargetType\x12\x17\n\x13TARGET_TYPE_UNKNOWN\x10\x00\x12\x14\n\x10TARGET_TYPE_FILE\x10\x01\x12\x1f\n\x1bTARGET_TYPE_EXTENSION_RANGE\x10\x02\x12\x17\n\x13TARGET_TYPE_MESSAGE\x10\x03\x12\x15\n\x11TARGET_TYPE_FIELD\x10\x04\x12\x15\n\x11TARGET_TYPE_ONEOF\x10\x05\x12\x14\n\x10TARGET_TYPE_ENUM\x10\x06\x12\x1a\n\x16TARGET_TYPE_ENUM_ENTRY\x10\x07\x12\x17\n\x13TARGET_TYPE_SERVICE\x10\x08\x12\x16\n\x12TARGET_TYPE_METHOD\x10\t*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05J\x04\x08\x12\x10\x13\"\xb4\x01\n\x0cOneofOptions\x12\x37\n\x08\x66\x65\x61tures\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xd9\x02\n\x0b\x45numOptions\x12\x1f\n\x0b\x61llow_alias\x18\x02 \x01(\x08R\nallowAlias\x12%\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12V\n&deprecated_legacy_json_field_conflicts\x18\x06 \x01(\x08\x42\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x12\x37\n\x08\x66\x65\x61tures\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x05\x10\x06\"\xe0\x02\n\x10\x45numValueOptions\x12%\n\ndeprecated\x18\x01 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12\x37\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12(\n\x0c\x64\x65\x62ug_redact\x18\x03 \x01(\x08:\x05\x66\x61lseR\x0b\x64\x65\x62ugRedact\x12U\n\x0f\x66\x65\x61ture_support\x18\x04 \x01(\x0b\x32,.google.protobuf.FieldOptions.FeatureSupportR\x0e\x66\x65\x61tureSupport\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xdd\x01\n\x0eServiceOptions\x12\x37\n\x08\x66\x65\x61tures\x18\" \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12%\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xa1\x03\n\rMethodOptions\x12%\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12q\n\x11idempotency_level\x18\" \x01(\x0e\x32/.google.protobuf.MethodOptions.IdempotencyLevel:\x13IDEMPOTENCY_UNKNOWNR\x10idempotencyLevel\x12\x37\n\x08\x66\x65\x61tures\x18# \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\"P\n\x10IdempotencyLevel\x12\x17\n\x13IDEMPOTENCY_UNKNOWN\x10\x00\x12\x13\n\x0fNO_SIDE_EFFECTS\x10\x01\x12\x0e\n\nIDEMPOTENT\x10\x02*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x9a\x03\n\x13UninterpretedOption\x12\x41\n\x04name\x18\x02 \x03(\x0b\x32-.google.protobuf.UninterpretedOption.NamePartR\x04name\x12)\n\x10identifier_value\x18\x03 \x01(\tR\x0fidentifierValue\x12,\n\x12positive_int_value\x18\x04 \x01(\x04R\x10positiveIntValue\x12,\n\x12negative_int_value\x18\x05 \x01(\x03R\x10negativeIntValue\x12!\n\x0c\x64ouble_value\x18\x06 \x01(\x01R\x0b\x64oubleValue\x12!\n\x0cstring_value\x18\x07 \x01(\x0cR\x0bstringValue\x12\'\n\x0f\x61ggregate_value\x18\x08 \x01(\tR\x0e\x61ggregateValue\x1aJ\n\x08NamePart\x12\x1b\n\tname_part\x18\x01 \x02(\tR\x08namePart\x12!\n\x0cis_extension\x18\x02 \x02(\x08R\x0bisExtension\"\xae\x0f\n\nFeatureSet\x12\x91\x01\n\x0e\x66ield_presence\x18\x01 \x01(\x0e\x32).google.protobuf.FeatureSet.FieldPresenceB?\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\r\x12\x08\x45XPLICIT\x18\x84\x07\xa2\x01\r\x12\x08IMPLICIT\x18\xe7\x07\xa2\x01\r\x12\x08\x45XPLICIT\x18\xe8\x07\xb2\x01\x03\x08\xe8\x07R\rfieldPresence\x12l\n\tenum_type\x18\x02 \x01(\x0e\x32$.google.protobuf.FeatureSet.EnumTypeB)\x88\x01\x01\x98\x01\x06\x98\x01\x01\xa2\x01\x0b\x12\x06\x43LOSED\x18\x84\x07\xa2\x01\t\x12\x04OPEN\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\x08\x65numType\x12\x98\x01\n\x17repeated_field_encoding\x18\x03 \x01(\x0e\x32\x31.google.protobuf.FeatureSet.RepeatedFieldEncodingB-\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\r\x12\x08\x45XPANDED\x18\x84\x07\xa2\x01\x0b\x12\x06PACKED\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\x15repeatedFieldEncoding\x12~\n\x0futf8_validation\x18\x04 \x01(\x0e\x32*.google.protobuf.FeatureSet.Utf8ValidationB)\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\t\x12\x04NONE\x18\x84\x07\xa2\x01\x0b\x12\x06VERIFY\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\x0eutf8Validation\x12~\n\x10message_encoding\x18\x05 \x01(\x0e\x32+.google.protobuf.FeatureSet.MessageEncodingB&\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\x14\x12\x0fLENGTH_PREFIXED\x18\x84\x07\xb2\x01\x03\x08\xe8\x07R\x0fmessageEncoding\x12\x82\x01\n\x0bjson_format\x18\x06 \x01(\x0e\x32&.google.protobuf.FeatureSet.JsonFormatB9\x88\x01\x01\x98\x01\x03\x98\x01\x06\x98\x01\x01\xa2\x01\x17\x12\x12LEGACY_BEST_EFFORT\x18\x84\x07\xa2\x01\n\x12\x05\x41LLOW\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\njsonFormat\x12\xbc\x01\n\x14\x65nforce_naming_style\x18\x07 \x01(\x0e\x32..google.protobuf.FeatureSet.EnforceNamingStyleBZ\x88\x01\x02\x98\x01\x01\x98\x01\x02\x98\x01\x03\x98\x01\x04\x98\x01\x05\x98\x01\x06\x98\x01\x07\x98\x01\x08\x98\x01\t\xa2\x01\x11\x12\x0cSTYLE_LEGACY\x18\x84\x07\xa2\x01\x0e\x12\tSTYLE2024\x18\xe9\x07\xa2\x01\x0e\x12\tSTYLE2026\x18\x8fN\xb2\x01\x03\x08\xe9\x07R\x12\x65nforceNamingStyle\x12\xb9\x01\n\x19\x64\x65\x66\x61ult_symbol_visibility\x18\x08 \x01(\x0e\x32\x45.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibilityB6\x88\x01\x02\x98\x01\x01\xa2\x01\x0f\x12\nEXPORT_ALL\x18\x84\x07\xa2\x01\x15\x12\x10\x45XPORT_TOP_LEVEL\x18\xe9\x07\xb2\x01\x03\x08\xe9\x07R\x17\x64\x65\x66\x61ultSymbolVisibility\x1a\xa1\x01\n\x11VisibilityFeature\"\x81\x01\n\x17\x44\x65\x66\x61ultSymbolVisibility\x12%\n!DEFAULT_SYMBOL_VISIBILITY_UNKNOWN\x10\x00\x12\x0e\n\nEXPORT_ALL\x10\x01\x12\x14\n\x10\x45XPORT_TOP_LEVEL\x10\x02\x12\r\n\tLOCAL_ALL\x10\x03\x12\n\n\x06STRICT\x10\x04J\x08\x08\x01\x10\x80\x80\x80\x80\x02\"\\\n\rFieldPresence\x12\x1a\n\x16\x46IELD_PRESENCE_UNKNOWN\x10\x00\x12\x0c\n\x08\x45XPLICIT\x10\x01\x12\x0c\n\x08IMPLICIT\x10\x02\x12\x13\n\x0fLEGACY_REQUIRED\x10\x03\"7\n\x08\x45numType\x12\x15\n\x11\x45NUM_TYPE_UNKNOWN\x10\x00\x12\x08\n\x04OPEN\x10\x01\x12\n\n\x06\x43LOSED\x10\x02\"V\n\x15RepeatedFieldEncoding\x12#\n\x1fREPEATED_FIELD_ENCODING_UNKNOWN\x10\x00\x12\n\n\x06PACKED\x10\x01\x12\x0c\n\x08\x45XPANDED\x10\x02\"I\n\x0eUtf8Validation\x12\x1b\n\x17UTF8_VALIDATION_UNKNOWN\x10\x00\x12\n\n\x06VERIFY\x10\x02\x12\x08\n\x04NONE\x10\x03\"\x04\x08\x01\x10\x01\"S\n\x0fMessageEncoding\x12\x1c\n\x18MESSAGE_ENCODING_UNKNOWN\x10\x00\x12\x13\n\x0fLENGTH_PREFIXED\x10\x01\x12\r\n\tDELIMITED\x10\x02\"H\n\nJsonFormat\x12\x17\n\x13JSON_FORMAT_UNKNOWN\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x12\x16\n\x12LEGACY_BEST_EFFORT\x10\x02\"f\n\x12\x45nforceNamingStyle\x12 \n\x1c\x45NFORCE_NAMING_STYLE_UNKNOWN\x10\x00\x12\r\n\tSTYLE2024\x10\x01\x12\x10\n\x0cSTYLE_LEGACY\x10\x02\x12\r\n\tSTYLE2026\x10\x03*\x06\x08\xe8\x07\x10\x8bN*\x06\x08\x8bN\x10\x90N*\x06\x08\x90N\x10\x91NJ\x06\x08\xe7\x07\x10\xe8\x07\"\xef\x03\n\x12\x46\x65\x61tureSetDefaults\x12X\n\x08\x64\x65\x66\x61ults\x18\x01 \x03(\x0b\x32<.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefaultR\x08\x64\x65\x66\x61ults\x12\x41\n\x0fminimum_edition\x18\x04 \x01(\x0e\x32\x18.google.protobuf.EditionR\x0eminimumEdition\x12\x41\n\x0fmaximum_edition\x18\x05 \x01(\x0e\x32\x18.google.protobuf.EditionR\x0emaximumEdition\x1a\xf8\x01\n\x18\x46\x65\x61tureSetEditionDefault\x12\x32\n\x07\x65\x64ition\x18\x03 \x01(\x0e\x32\x18.google.protobuf.EditionR\x07\x65\x64ition\x12N\n\x14overridable_features\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x13overridableFeatures\x12\x42\n\x0e\x66ixed_features\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\rfixedFeaturesJ\x04\x08\x01\x10\x02J\x04\x08\x02\x10\x03R\x08\x66\x65\x61tures\"\xb5\x02\n\x0eSourceCodeInfo\x12\x44\n\x08location\x18\x01 \x03(\x0b\x32(.google.protobuf.SourceCodeInfo.LocationR\x08location\x1a\xce\x01\n\x08Location\x12\x16\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01R\x04path\x12\x16\n\x04span\x18\x02 \x03(\x05\x42\x02\x10\x01R\x04span\x12)\n\x10leading_comments\x18\x03 \x01(\tR\x0fleadingComments\x12+\n\x11trailing_comments\x18\x04 \x01(\tR\x10trailingComments\x12:\n\x19leading_detached_comments\x18\x06 \x03(\tR\x17leadingDetachedComments*\x0c\x08\x80\xec\xca\xff\x01\x10\x81\xec\xca\xff\x01\"\xd0\x02\n\x11GeneratedCodeInfo\x12M\n\nannotation\x18\x01 \x03(\x0b\x32-.google.protobuf.GeneratedCodeInfo.AnnotationR\nannotation\x1a\xeb\x01\n\nAnnotation\x12\x16\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01R\x04path\x12\x1f\n\x0bsource_file\x18\x02 \x01(\tR\nsourceFile\x12\x14\n\x05\x62\x65gin\x18\x03 \x01(\x05R\x05\x62\x65gin\x12\x10\n\x03\x65nd\x18\x04 \x01(\x05R\x03\x65nd\x12R\n\x08semantic\x18\x05 \x01(\x0e\x32\x36.google.protobuf.GeneratedCodeInfo.Annotation.SemanticR\x08semantic\"(\n\x08Semantic\x12\x08\n\x04NONE\x10\x00\x12\x07\n\x03SET\x10\x01\x12\t\n\x05\x41LIAS\x10\x02*\xd1\x02\n\x07\x45\x64ition\x12\x13\n\x0f\x45\x44ITION_UNKNOWN\x10\x00\x12\x13\n\x0e\x45\x44ITION_LEGACY\x10\x84\x07\x12\x13\n\x0e\x45\x44ITION_PROTO2\x10\xe6\x07\x12\x13\n\x0e\x45\x44ITION_PROTO3\x10\xe7\x07\x12\x11\n\x0c\x45\x44ITION_2023\x10\xe8\x07\x12\x11\n\x0c\x45\x44ITION_2024\x10\xe9\x07\x12\x11\n\x0c\x45\x44ITION_2026\x10\xea\x07\x12\x15\n\x10\x45\x44ITION_UNSTABLE\x10\x8fN\x12\x17\n\x13\x45\x44ITION_1_TEST_ONLY\x10\x01\x12\x17\n\x13\x45\x44ITION_2_TEST_ONLY\x10\x02\x12\x1d\n\x17\x45\x44ITION_99997_TEST_ONLY\x10\x9d\x8d\x06\x12\x1d\n\x17\x45\x44ITION_99998_TEST_ONLY\x10\x9e\x8d\x06\x12\x1d\n\x17\x45\x44ITION_99999_TEST_ONLY\x10\x9f\x8d\x06\x12\x13\n\x0b\x45\x44ITION_MAX\x10\xff\xff\xff\xff\x07*U\n\x10SymbolVisibility\x12\x14\n\x10VISIBILITY_UNSET\x10\x00\x12\x14\n\x10VISIBILITY_LOCAL\x10\x01\x12\x15\n\x11VISIBILITY_EXPORT\x10\x02\x42~\n\x13\x63om.google.protobufB\x10\x44\x65scriptorProtosH\x01Z-google.golang.org/protobuf/types/descriptorpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1aGoogle.Protobuf.Reflection'   ) else:-  DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n google/protobuf/descriptor.proto\x12\x0fgoogle.protobuf\"[\n\x11\x46ileDescriptorSet\x12\x38\n\x04\x66ile\x18\x01 \x03(\x0b\x32$.google.protobuf.FileDescriptorProtoR\x04\x66ile*\x0c\x08\x80\xec\xca\xff\x01\x10\x81\xec\xca\xff\x01\"\xc5\x05\n\x13\x46ileDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n\x07package\x18\x02 \x01(\tR\x07package\x12\x1e\n\ndependency\x18\x03 \x03(\tR\ndependency\x12+\n\x11public_dependency\x18\n \x03(\x05R\x10publicDependency\x12\'\n\x0fweak_dependency\x18\x0b \x03(\x05R\x0eweakDependency\x12+\n\x11option_dependency\x18\x0f \x03(\tR\x10optionDependency\x12\x43\n\x0cmessage_type\x18\x04 \x03(\x0b\x32 .google.protobuf.DescriptorProtoR\x0bmessageType\x12\x41\n\tenum_type\x18\x05 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProtoR\x08\x65numType\x12\x41\n\x07service\x18\x06 \x03(\x0b\x32\'.google.protobuf.ServiceDescriptorProtoR\x07service\x12\x43\n\textension\x18\x07 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProtoR\textension\x12\x36\n\x07options\x18\x08 \x01(\x0b\x32\x1c.google.protobuf.FileOptionsR\x07options\x12I\n\x10source_code_info\x18\t \x01(\x0b\x32\x1f.google.protobuf.SourceCodeInfoR\x0esourceCodeInfo\x12\x16\n\x06syntax\x18\x0c \x01(\tR\x06syntax\x12\x32\n\x07\x65\x64ition\x18\x0e \x01(\x0e\x32\x18.google.protobuf.EditionR\x07\x65\x64ition\"\xfc\x06\n\x0f\x44\x65scriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12;\n\x05\x66ield\x18\x02 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProtoR\x05\x66ield\x12\x43\n\textension\x18\x06 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProtoR\textension\x12\x41\n\x0bnested_type\x18\x03 \x03(\x0b\x32 .google.protobuf.DescriptorProtoR\nnestedType\x12\x41\n\tenum_type\x18\x04 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProtoR\x08\x65numType\x12X\n\x0f\x65xtension_range\x18\x05 \x03(\x0b\x32/.google.protobuf.DescriptorProto.ExtensionRangeR\x0e\x65xtensionRange\x12\x44\n\noneof_decl\x18\x08 \x03(\x0b\x32%.google.protobuf.OneofDescriptorProtoR\toneofDecl\x12\x39\n\x07options\x18\x07 \x01(\x0b\x32\x1f.google.protobuf.MessageOptionsR\x07options\x12U\n\x0ereserved_range\x18\t \x03(\x0b\x32..google.protobuf.DescriptorProto.ReservedRangeR\rreservedRange\x12#\n\rreserved_name\x18\n \x03(\tR\x0creservedName\x12\x41\n\nvisibility\x18\x0b \x01(\x0e\x32!.google.protobuf.SymbolVisibilityR\nvisibility\x1az\n\x0e\x45xtensionRange\x12\x14\n\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n\x03\x65nd\x18\x02 \x01(\x05R\x03\x65nd\x12@\n\x07options\x18\x03 \x01(\x0b\x32&.google.protobuf.ExtensionRangeOptionsR\x07options\x1a\x37\n\rReservedRange\x12\x14\n\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n\x03\x65nd\x18\x02 \x01(\x05R\x03\x65nd\"\xcc\x04\n\x15\x45xtensionRangeOptions\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x12Y\n\x0b\x64\x65\x63laration\x18\x02 \x03(\x0b\x32\x32.google.protobuf.ExtensionRangeOptions.DeclarationB\x03\x88\x01\x02R\x0b\x64\x65\x63laration\x12\x37\n\x08\x66\x65\x61tures\x18\x32 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12m\n\x0cverification\x18\x03 \x01(\x0e\x32\x38.google.protobuf.ExtensionRangeOptions.VerificationState:\nUNVERIFIEDB\x03\x88\x01\x02R\x0cverification\x1a\x94\x01\n\x0b\x44\x65\x63laration\x12\x16\n\x06number\x18\x01 \x01(\x05R\x06number\x12\x1b\n\tfull_name\x18\x02 \x01(\tR\x08\x66ullName\x12\x12\n\x04type\x18\x03 \x01(\tR\x04type\x12\x1a\n\x08reserved\x18\x05 \x01(\x08R\x08reserved\x12\x1a\n\x08repeated\x18\x06 \x01(\x08R\x08repeatedJ\x04\x08\x04\x10\x05\"4\n\x11VerificationState\x12\x0f\n\x0b\x44\x45\x43LARATION\x10\x00\x12\x0e\n\nUNVERIFIED\x10\x01*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xc1\x06\n\x14\x46ieldDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n\x06number\x18\x03 \x01(\x05R\x06number\x12\x41\n\x05label\x18\x04 \x01(\x0e\x32+.google.protobuf.FieldDescriptorProto.LabelR\x05label\x12>\n\x04type\x18\x05 \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.TypeR\x04type\x12\x1b\n\ttype_name\x18\x06 \x01(\tR\x08typeName\x12\x1a\n\x08\x65xtendee\x18\x02 \x01(\tR\x08\x65xtendee\x12#\n\rdefault_value\x18\x07 \x01(\tR\x0c\x64\x65\x66\x61ultValue\x12\x1f\n\x0boneof_index\x18\t \x01(\x05R\noneofIndex\x12\x1b\n\tjson_name\x18\n \x01(\tR\x08jsonName\x12\x37\n\x07options\x18\x08 \x01(\x0b\x32\x1d.google.protobuf.FieldOptionsR\x07options\x12\'\n\x0fproto3_optional\x18\x11 \x01(\x08R\x0eproto3Optional\"\xb6\x02\n\x04Type\x12\x0f\n\x0bTYPE_DOUBLE\x10\x01\x12\x0e\n\nTYPE_FLOAT\x10\x02\x12\x0e\n\nTYPE_INT64\x10\x03\x12\x0f\n\x0bTYPE_UINT64\x10\x04\x12\x0e\n\nTYPE_INT32\x10\x05\x12\x10\n\x0cTYPE_FIXED64\x10\x06\x12\x10\n\x0cTYPE_FIXED32\x10\x07\x12\r\n\tTYPE_BOOL\x10\x08\x12\x0f\n\x0bTYPE_STRING\x10\t\x12\x0e\n\nTYPE_GROUP\x10\n\x12\x10\n\x0cTYPE_MESSAGE\x10\x0b\x12\x0e\n\nTYPE_BYTES\x10\x0c\x12\x0f\n\x0bTYPE_UINT32\x10\r\x12\r\n\tTYPE_ENUM\x10\x0e\x12\x11\n\rTYPE_SFIXED32\x10\x0f\x12\x11\n\rTYPE_SFIXED64\x10\x10\x12\x0f\n\x0bTYPE_SINT32\x10\x11\x12\x0f\n\x0bTYPE_SINT64\x10\x12\"C\n\x05Label\x12\x12\n\x0eLABEL_OPTIONAL\x10\x01\x12\x12\n\x0eLABEL_REPEATED\x10\x03\x12\x12\n\x0eLABEL_REQUIRED\x10\x02\"c\n\x14OneofDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x37\n\x07options\x18\x02 \x01(\x0b\x32\x1d.google.protobuf.OneofOptionsR\x07options\"\xa6\x03\n\x13\x45numDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12?\n\x05value\x18\x02 \x03(\x0b\x32).google.protobuf.EnumValueDescriptorProtoR\x05value\x12\x36\n\x07options\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.EnumOptionsR\x07options\x12]\n\x0ereserved_range\x18\x04 \x03(\x0b\x32\x36.google.protobuf.EnumDescriptorProto.EnumReservedRangeR\rreservedRange\x12#\n\rreserved_name\x18\x05 \x03(\tR\x0creservedName\x12\x41\n\nvisibility\x18\x06 \x01(\x0e\x32!.google.protobuf.SymbolVisibilityR\nvisibility\x1a;\n\x11\x45numReservedRange\x12\x14\n\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n\x03\x65nd\x18\x02 \x01(\x05R\x03\x65nd\"\x83\x01\n\x18\x45numValueDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n\x06number\x18\x02 \x01(\x05R\x06number\x12;\n\x07options\x18\x03 \x01(\x0b\x32!.google.protobuf.EnumValueOptionsR\x07options\"\xb5\x01\n\x16ServiceDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12>\n\x06method\x18\x02 \x03(\x0b\x32&.google.protobuf.MethodDescriptorProtoR\x06method\x12\x39\n\x07options\x18\x03 \x01(\x0b\x32\x1f.google.protobuf.ServiceOptionsR\x07optionsJ\x04\x08\x04\x10\x05R\x06stream\"\x89\x02\n\x15MethodDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x1d\n\ninput_type\x18\x02 \x01(\tR\tinputType\x12\x1f\n\x0boutput_type\x18\x03 \x01(\tR\noutputType\x12\x38\n\x07options\x18\x04 \x01(\x0b\x32\x1e.google.protobuf.MethodOptionsR\x07options\x12\x30\n\x10\x63lient_streaming\x18\x05 \x01(\x08:\x05\x66\x61lseR\x0f\x63lientStreaming\x12\x30\n\x10server_streaming\x18\x06 \x01(\x08:\x05\x66\x61lseR\x0fserverStreaming\"\xf2\n\n\x0b\x46ileOptions\x12!\n\x0cjava_package\x18\x01 \x01(\tR\x0bjavaPackage\x12\x30\n\x14java_outer_classname\x18\x08 \x01(\tR\x12javaOuterClassname\x12\xf9\x01\n\x13java_multiple_files\x18\n \x01(\x08:\x05\x66\x61lseB\xc1\x01\xb2\x01\xbd\x01\x08\xe6\x07 \xe9\x07*\xb4\x01This behavior is enabled by default in editions 2024 and above. To disable it, you can set `features.(pb.java).nest_in_file_class = YES` on individual messages, enums, or services.R\x11javaMultipleFiles\x12\x44\n\x1djava_generate_equals_and_hash\x18\x14 \x01(\x08\x42\x02\x18\x01R\x19javaGenerateEqualsAndHash\x12:\n\x16java_string_check_utf8\x18\x1b \x01(\x08:\x05\x66\x61lseR\x13javaStringCheckUtf8\x12S\n\x0coptimize_for\x18\t \x01(\x0e\x32).google.protobuf.FileOptions.OptimizeMode:\x05SPEEDR\x0boptimizeFor\x12\x1d\n\ngo_package\x18\x0b \x01(\tR\tgoPackage\x12\x35\n\x13\x63\x63_generic_services\x18\x10 \x01(\x08:\x05\x66\x61lseR\x11\x63\x63GenericServices\x12\x39\n\x15java_generic_services\x18\x11 \x01(\x08:\x05\x66\x61lseR\x13javaGenericServices\x12\x35\n\x13py_generic_services\x18\x12 \x01(\x08:\x05\x66\x61lseR\x11pyGenericServices\x12%\n\ndeprecated\x18\x17 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12.\n\x10\x63\x63_enable_arenas\x18\x1f \x01(\x08:\x04trueR\x0e\x63\x63\x45nableArenas\x12*\n\x11objc_class_prefix\x18$ \x01(\tR\x0fobjcClassPrefix\x12)\n\x10\x63sharp_namespace\x18% \x01(\tR\x0f\x63sharpNamespace\x12!\n\x0cswift_prefix\x18\' \x01(\tR\x0bswiftPrefix\x12(\n\x10php_class_prefix\x18( \x01(\tR\x0ephpClassPrefix\x12#\n\rphp_namespace\x18) \x01(\tR\x0cphpNamespace\x12\x34\n\x16php_metadata_namespace\x18, \x01(\tR\x14phpMetadataNamespace\x12!\n\x0cruby_package\x18- \x01(\tR\x0brubyPackage\x12\x37\n\x08\x66\x65\x61tures\x18\x32 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\":\n\x0cOptimizeMode\x12\t\n\x05SPEED\x10\x01\x12\r\n\tCODE_SIZE\x10\x02\x12\x10\n\x0cLITE_RUNTIME\x10\x03*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08*\x10+J\x04\x08&\x10\'R\x14php_generic_services\"\xf4\x03\n\x0eMessageOptions\x12<\n\x17message_set_wire_format\x18\x01 \x01(\x08:\x05\x66\x61lseR\x14messageSetWireFormat\x12L\n\x1fno_standard_descriptor_accessor\x18\x02 \x01(\x08:\x05\x66\x61lseR\x1cnoStandardDescriptorAccessor\x12%\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12\x1b\n\tmap_entry\x18\x07 \x01(\x08R\x08mapEntry\x12V\n&deprecated_legacy_json_field_conflicts\x18\x0b \x01(\x08\x42\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x12\x37\n\x08\x66\x65\x61tures\x18\x0c \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07J\x04\x08\x08\x10\tJ\x04\x08\t\x10\n\"\xc6\r\n\x0c\x46ieldOptions\x12\x41\n\x05\x63type\x18\x01 \x01(\x0e\x32#.google.protobuf.FieldOptions.CType:\x06STRINGR\x05\x63type\x12\x16\n\x06packed\x18\x02 \x01(\x08R\x06packed\x12G\n\x06jstype\x18\x06 \x01(\x0e\x32$.google.protobuf.FieldOptions.JSType:\tJS_NORMALR\x06jstype\x12\x19\n\x04lazy\x18\x05 \x01(\x08:\x05\x66\x61lseR\x04lazy\x12.\n\x0funverified_lazy\x18\x0f \x01(\x08:\x05\x66\x61lseR\x0eunverifiedLazy\x12%\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12\x1d\n\x04weak\x18\n \x01(\x08:\x05\x66\x61lseB\x02\x18\x01R\x04weak\x12(\n\x0c\x64\x65\x62ug_redact\x18\x10 \x01(\x08:\x05\x66\x61lseR\x0b\x64\x65\x62ugRedact\x12K\n\tretention\x18\x11 \x01(\x0e\x32-.google.protobuf.FieldOptions.OptionRetentionR\tretention\x12H\n\x07targets\x18\x13 \x03(\x0e\x32..google.protobuf.FieldOptions.OptionTargetTypeR\x07targets\x12W\n\x10\x65\x64ition_defaults\x18\x14 \x03(\x0b\x32,.google.protobuf.FieldOptions.EditionDefaultR\x0f\x65\x64itionDefaults\x12\x37\n\x08\x66\x65\x61tures\x18\x15 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12U\n\x0f\x66\x65\x61ture_support\x18\x16 \x01(\x0b\x32,.google.protobuf.FieldOptions.FeatureSupportR\x0e\x66\x65\x61tureSupport\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x1aZ\n\x0e\x45\x64itionDefault\x12\x32\n\x07\x65\x64ition\x18\x03 \x01(\x0e\x32\x18.google.protobuf.EditionR\x07\x65\x64ition\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\x1a\xbb\x02\n\x0e\x46\x65\x61tureSupport\x12G\n\x12\x65\x64ition_introduced\x18\x01 \x01(\x0e\x32\x18.google.protobuf.EditionR\x11\x65\x64itionIntroduced\x12G\n\x12\x65\x64ition_deprecated\x18\x02 \x01(\x0e\x32\x18.google.protobuf.EditionR\x11\x65\x64itionDeprecated\x12/\n\x13\x64\x65precation_warning\x18\x03 \x01(\tR\x12\x64\x65precationWarning\x12\x41\n\x0f\x65\x64ition_removed\x18\x04 \x01(\x0e\x32\x18.google.protobuf.EditionR\x0e\x65\x64itionRemoved\x12#\n\rremoval_error\x18\x05 \x01(\tR\x0cremovalError\"/\n\x05\x43Type\x12\n\n\x06STRING\x10\x00\x12\x08\n\x04\x43ORD\x10\x01\x12\x10\n\x0cSTRING_PIECE\x10\x02\"5\n\x06JSType\x12\r\n\tJS_NORMAL\x10\x00\x12\r\n\tJS_STRING\x10\x01\x12\r\n\tJS_NUMBER\x10\x02\"U\n\x0fOptionRetention\x12\x15\n\x11RETENTION_UNKNOWN\x10\x00\x12\x15\n\x11RETENTION_RUNTIME\x10\x01\x12\x14\n\x10RETENTION_SOURCE\x10\x02\"\x8c\x02\n\x10OptionTargetType\x12\x17\n\x13TARGET_TYPE_UNKNOWN\x10\x00\x12\x14\n\x10TARGET_TYPE_FILE\x10\x01\x12\x1f\n\x1bTARGET_TYPE_EXTENSION_RANGE\x10\x02\x12\x17\n\x13TARGET_TYPE_MESSAGE\x10\x03\x12\x15\n\x11TARGET_TYPE_FIELD\x10\x04\x12\x15\n\x11TARGET_TYPE_ONEOF\x10\x05\x12\x14\n\x10TARGET_TYPE_ENUM\x10\x06\x12\x1a\n\x16TARGET_TYPE_ENUM_ENTRY\x10\x07\x12\x17\n\x13TARGET_TYPE_SERVICE\x10\x08\x12\x16\n\x12TARGET_TYPE_METHOD\x10\t*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05J\x04\x08\x12\x10\x13\"\xac\x01\n\x0cOneofOptions\x12\x37\n\x08\x66\x65\x61tures\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xd1\x02\n\x0b\x45numOptions\x12\x1f\n\x0b\x61llow_alias\x18\x02 \x01(\x08R\nallowAlias\x12%\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12V\n&deprecated_legacy_json_field_conflicts\x18\x06 \x01(\x08\x42\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x12\x37\n\x08\x66\x65\x61tures\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x05\x10\x06\"\xd8\x02\n\x10\x45numValueOptions\x12%\n\ndeprecated\x18\x01 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12\x37\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12(\n\x0c\x64\x65\x62ug_redact\x18\x03 \x01(\x08:\x05\x66\x61lseR\x0b\x64\x65\x62ugRedact\x12U\n\x0f\x66\x65\x61ture_support\x18\x04 \x01(\x0b\x32,.google.protobuf.FieldOptions.FeatureSupportR\x0e\x66\x65\x61tureSupport\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xd5\x01\n\x0eServiceOptions\x12\x37\n\x08\x66\x65\x61tures\x18\" \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12%\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x99\x03\n\rMethodOptions\x12%\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12q\n\x11idempotency_level\x18\" \x01(\x0e\x32/.google.protobuf.MethodOptions.IdempotencyLevel:\x13IDEMPOTENCY_UNKNOWNR\x10idempotencyLevel\x12\x37\n\x08\x66\x65\x61tures\x18# \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\"P\n\x10IdempotencyLevel\x12\x17\n\x13IDEMPOTENCY_UNKNOWN\x10\x00\x12\x13\n\x0fNO_SIDE_EFFECTS\x10\x01\x12\x0e\n\nIDEMPOTENT\x10\x02*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x9a\x03\n\x13UninterpretedOption\x12\x41\n\x04name\x18\x02 \x03(\x0b\x32-.google.protobuf.UninterpretedOption.NamePartR\x04name\x12)\n\x10identifier_value\x18\x03 \x01(\tR\x0fidentifierValue\x12,\n\x12positive_int_value\x18\x04 \x01(\x04R\x10positiveIntValue\x12,\n\x12negative_int_value\x18\x05 \x01(\x03R\x10negativeIntValue\x12!\n\x0c\x64ouble_value\x18\x06 \x01(\x01R\x0b\x64oubleValue\x12!\n\x0cstring_value\x18\x07 \x01(\x0cR\x0bstringValue\x12\'\n\x0f\x61ggregate_value\x18\x08 \x01(\tR\x0e\x61ggregateValue\x1aJ\n\x08NamePart\x12\x1b\n\tname_part\x18\x01 \x02(\tR\x08namePart\x12!\n\x0cis_extension\x18\x02 \x02(\x08R\x0bisExtension\"\x8e\x0f\n\nFeatureSet\x12\x91\x01\n\x0e\x66ield_presence\x18\x01 \x01(\x0e\x32).google.protobuf.FeatureSet.FieldPresenceB?\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\r\x12\x08\x45XPLICIT\x18\x84\x07\xa2\x01\r\x12\x08IMPLICIT\x18\xe7\x07\xa2\x01\r\x12\x08\x45XPLICIT\x18\xe8\x07\xb2\x01\x03\x08\xe8\x07R\rfieldPresence\x12l\n\tenum_type\x18\x02 \x01(\x0e\x32$.google.protobuf.FeatureSet.EnumTypeB)\x88\x01\x01\x98\x01\x06\x98\x01\x01\xa2\x01\x0b\x12\x06\x43LOSED\x18\x84\x07\xa2\x01\t\x12\x04OPEN\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\x08\x65numType\x12\x98\x01\n\x17repeated_field_encoding\x18\x03 \x01(\x0e\x32\x31.google.protobuf.FeatureSet.RepeatedFieldEncodingB-\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\r\x12\x08\x45XPANDED\x18\x84\x07\xa2\x01\x0b\x12\x06PACKED\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\x15repeatedFieldEncoding\x12~\n\x0futf8_validation\x18\x04 \x01(\x0e\x32*.google.protobuf.FeatureSet.Utf8ValidationB)\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\t\x12\x04NONE\x18\x84\x07\xa2\x01\x0b\x12\x06VERIFY\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\x0eutf8Validation\x12~\n\x10message_encoding\x18\x05 \x01(\x0e\x32+.google.protobuf.FeatureSet.MessageEncodingB&\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\x14\x12\x0fLENGTH_PREFIXED\x18\x84\x07\xb2\x01\x03\x08\xe8\x07R\x0fmessageEncoding\x12\x82\x01\n\x0bjson_format\x18\x06 \x01(\x0e\x32&.google.protobuf.FeatureSet.JsonFormatB9\x88\x01\x01\x98\x01\x03\x98\x01\x06\x98\x01\x01\xa2\x01\x17\x12\x12LEGACY_BEST_EFFORT\x18\x84\x07\xa2\x01\n\x12\x05\x41LLOW\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\njsonFormat\x12\xab\x01\n\x14\x65nforce_naming_style\x18\x07 \x01(\x0e\x32..google.protobuf.FeatureSet.EnforceNamingStyleBI\x88\x01\x02\x98\x01\x01\x98\x01\x02\x98\x01\x03\x98\x01\x04\x98\x01\x05\x98\x01\x06\x98\x01\x07\x98\x01\x08\x98\x01\t\xa2\x01\x11\x12\x0cSTYLE_LEGACY\x18\x84\x07\xa2\x01\x0e\x12\tSTYLE2024\x18\xe9\x07\xb2\x01\x03\x08\xe9\x07R\x12\x65nforceNamingStyle\x12\xb9\x01\n\x19\x64\x65\x66\x61ult_symbol_visibility\x18\x08 \x01(\x0e\x32\x45.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibilityB6\x88\x01\x02\x98\x01\x01\xa2\x01\x0f\x12\nEXPORT_ALL\x18\x84\x07\xa2\x01\x15\x12\x10\x45XPORT_TOP_LEVEL\x18\xe9\x07\xb2\x01\x03\x08\xe9\x07R\x17\x64\x65\x66\x61ultSymbolVisibility\x1a\xa1\x01\n\x11VisibilityFeature\"\x81\x01\n\x17\x44\x65\x66\x61ultSymbolVisibility\x12%\n!DEFAULT_SYMBOL_VISIBILITY_UNKNOWN\x10\x00\x12\x0e\n\nEXPORT_ALL\x10\x01\x12\x14\n\x10\x45XPORT_TOP_LEVEL\x10\x02\x12\r\n\tLOCAL_ALL\x10\x03\x12\n\n\x06STRICT\x10\x04J\x08\x08\x01\x10\x80\x80\x80\x80\x02\"\\\n\rFieldPresence\x12\x1a\n\x16\x46IELD_PRESENCE_UNKNOWN\x10\x00\x12\x0c\n\x08\x45XPLICIT\x10\x01\x12\x0c\n\x08IMPLICIT\x10\x02\x12\x13\n\x0fLEGACY_REQUIRED\x10\x03\"7\n\x08\x45numType\x12\x15\n\x11\x45NUM_TYPE_UNKNOWN\x10\x00\x12\x08\n\x04OPEN\x10\x01\x12\n\n\x06\x43LOSED\x10\x02\"V\n\x15RepeatedFieldEncoding\x12#\n\x1fREPEATED_FIELD_ENCODING_UNKNOWN\x10\x00\x12\n\n\x06PACKED\x10\x01\x12\x0c\n\x08\x45XPANDED\x10\x02\"I\n\x0eUtf8Validation\x12\x1b\n\x17UTF8_VALIDATION_UNKNOWN\x10\x00\x12\n\n\x06VERIFY\x10\x02\x12\x08\n\x04NONE\x10\x03\"\x04\x08\x01\x10\x01\"S\n\x0fMessageEncoding\x12\x1c\n\x18MESSAGE_ENCODING_UNKNOWN\x10\x00\x12\x13\n\x0fLENGTH_PREFIXED\x10\x01\x12\r\n\tDELIMITED\x10\x02\"H\n\nJsonFormat\x12\x17\n\x13JSON_FORMAT_UNKNOWN\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x12\x16\n\x12LEGACY_BEST_EFFORT\x10\x02\"W\n\x12\x45nforceNamingStyle\x12 \n\x1c\x45NFORCE_NAMING_STYLE_UNKNOWN\x10\x00\x12\r\n\tSTYLE2024\x10\x01\x12\x10\n\x0cSTYLE_LEGACY\x10\x02*\x06\x08\xe8\x07\x10\x8bN*\x06\x08\x8bN\x10\x90N*\x06\x08\x90N\x10\x91NJ\x06\x08\xe7\x07\x10\xe8\x07\"\xef\x03\n\x12\x46\x65\x61tureSetDefaults\x12X\n\x08\x64\x65\x66\x61ults\x18\x01 \x03(\x0b\x32<.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefaultR\x08\x64\x65\x66\x61ults\x12\x41\n\x0fminimum_edition\x18\x04 \x01(\x0e\x32\x18.google.protobuf.EditionR\x0eminimumEdition\x12\x41\n\x0fmaximum_edition\x18\x05 \x01(\x0e\x32\x18.google.protobuf.EditionR\x0emaximumEdition\x1a\xf8\x01\n\x18\x46\x65\x61tureSetEditionDefault\x12\x32\n\x07\x65\x64ition\x18\x03 \x01(\x0e\x32\x18.google.protobuf.EditionR\x07\x65\x64ition\x12N\n\x14overridable_features\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x13overridableFeatures\x12\x42\n\x0e\x66ixed_features\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\rfixedFeaturesJ\x04\x08\x01\x10\x02J\x04\x08\x02\x10\x03R\x08\x66\x65\x61tures\"\xb5\x02\n\x0eSourceCodeInfo\x12\x44\n\x08location\x18\x01 \x03(\x0b\x32(.google.protobuf.SourceCodeInfo.LocationR\x08location\x1a\xce\x01\n\x08Location\x12\x16\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01R\x04path\x12\x16\n\x04span\x18\x02 \x03(\x05\x42\x02\x10\x01R\x04span\x12)\n\x10leading_comments\x18\x03 \x01(\tR\x0fleadingComments\x12+\n\x11trailing_comments\x18\x04 \x01(\tR\x10trailingComments\x12:\n\x19leading_detached_comments\x18\x06 \x03(\tR\x17leadingDetachedComments*\x0c\x08\x80\xec\xca\xff\x01\x10\x81\xec\xca\xff\x01\"\xd0\x02\n\x11GeneratedCodeInfo\x12M\n\nannotation\x18\x01 \x03(\x0b\x32-.google.protobuf.GeneratedCodeInfo.AnnotationR\nannotation\x1a\xeb\x01\n\nAnnotation\x12\x16\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01R\x04path\x12\x1f\n\x0bsource_file\x18\x02 \x01(\tR\nsourceFile\x12\x14\n\x05\x62\x65gin\x18\x03 \x01(\x05R\x05\x62\x65gin\x12\x10\n\x03\x65nd\x18\x04 \x01(\x05R\x03\x65nd\x12R\n\x08semantic\x18\x05 \x01(\x0e\x32\x36.google.protobuf.GeneratedCodeInfo.Annotation.SemanticR\x08semantic\"(\n\x08Semantic\x12\x08\n\x04NONE\x10\x00\x12\x07\n\x03SET\x10\x01\x12\t\n\x05\x41LIAS\x10\x02*\xbe\x02\n\x07\x45\x64ition\x12\x13\n\x0f\x45\x44ITION_UNKNOWN\x10\x00\x12\x13\n\x0e\x45\x44ITION_LEGACY\x10\x84\x07\x12\x13\n\x0e\x45\x44ITION_PROTO2\x10\xe6\x07\x12\x13\n\x0e\x45\x44ITION_PROTO3\x10\xe7\x07\x12\x11\n\x0c\x45\x44ITION_2023\x10\xe8\x07\x12\x11\n\x0c\x45\x44ITION_2024\x10\xe9\x07\x12\x15\n\x10\x45\x44ITION_UNSTABLE\x10\x8fN\x12\x17\n\x13\x45\x44ITION_1_TEST_ONLY\x10\x01\x12\x17\n\x13\x45\x44ITION_2_TEST_ONLY\x10\x02\x12\x1d\n\x17\x45\x44ITION_99997_TEST_ONLY\x10\x9d\x8d\x06\x12\x1d\n\x17\x45\x44ITION_99998_TEST_ONLY\x10\x9e\x8d\x06\x12\x1d\n\x17\x45\x44ITION_99999_TEST_ONLY\x10\x9f\x8d\x06\x12\x13\n\x0b\x45\x44ITION_MAX\x10\xff\xff\xff\xff\x07*U\n\x10SymbolVisibility\x12\x14\n\x10VISIBILITY_UNSET\x10\x00\x12\x14\n\x10VISIBILITY_LOCAL\x10\x01\x12\x15\n\x11VISIBILITY_EXPORT\x10\x02\x42~\n\x13\x63om.google.protobufB\x10\x44\x65scriptorProtosH\x01Z-google.golang.org/protobuf/types/descriptorpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1aGoogle.Protobuf.Reflection')+  DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n google/protobuf/descriptor.proto\x12\x0fgoogle.protobuf\"[\n\x11\x46ileDescriptorSet\x12\x38\n\x04\x66ile\x18\x01 \x03(\x0b\x32$.google.protobuf.FileDescriptorProtoR\x04\x66ile*\x0c\x08\x80\xec\xca\xff\x01\x10\x81\xec\xca\xff\x01\"\xc5\x05\n\x13\x46ileDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n\x07package\x18\x02 \x01(\tR\x07package\x12\x1e\n\ndependency\x18\x03 \x03(\tR\ndependency\x12+\n\x11public_dependency\x18\n \x03(\x05R\x10publicDependency\x12\'\n\x0fweak_dependency\x18\x0b \x03(\x05R\x0eweakDependency\x12+\n\x11option_dependency\x18\x0f \x03(\tR\x10optionDependency\x12\x43\n\x0cmessage_type\x18\x04 \x03(\x0b\x32 .google.protobuf.DescriptorProtoR\x0bmessageType\x12\x41\n\tenum_type\x18\x05 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProtoR\x08\x65numType\x12\x41\n\x07service\x18\x06 \x03(\x0b\x32\'.google.protobuf.ServiceDescriptorProtoR\x07service\x12\x43\n\textension\x18\x07 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProtoR\textension\x12\x36\n\x07options\x18\x08 \x01(\x0b\x32\x1c.google.protobuf.FileOptionsR\x07options\x12I\n\x10source_code_info\x18\t \x01(\x0b\x32\x1f.google.protobuf.SourceCodeInfoR\x0esourceCodeInfo\x12\x16\n\x06syntax\x18\x0c \x01(\tR\x06syntax\x12\x32\n\x07\x65\x64ition\x18\x0e \x01(\x0e\x32\x18.google.protobuf.EditionR\x07\x65\x64ition\"\xfc\x06\n\x0f\x44\x65scriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12;\n\x05\x66ield\x18\x02 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProtoR\x05\x66ield\x12\x43\n\textension\x18\x06 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProtoR\textension\x12\x41\n\x0bnested_type\x18\x03 \x03(\x0b\x32 .google.protobuf.DescriptorProtoR\nnestedType\x12\x41\n\tenum_type\x18\x04 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProtoR\x08\x65numType\x12X\n\x0f\x65xtension_range\x18\x05 \x03(\x0b\x32/.google.protobuf.DescriptorProto.ExtensionRangeR\x0e\x65xtensionRange\x12\x44\n\noneof_decl\x18\x08 \x03(\x0b\x32%.google.protobuf.OneofDescriptorProtoR\toneofDecl\x12\x39\n\x07options\x18\x07 \x01(\x0b\x32\x1f.google.protobuf.MessageOptionsR\x07options\x12U\n\x0ereserved_range\x18\t \x03(\x0b\x32..google.protobuf.DescriptorProto.ReservedRangeR\rreservedRange\x12#\n\rreserved_name\x18\n \x03(\tR\x0creservedName\x12\x41\n\nvisibility\x18\x0b \x01(\x0e\x32!.google.protobuf.SymbolVisibilityR\nvisibility\x1az\n\x0e\x45xtensionRange\x12\x14\n\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n\x03\x65nd\x18\x02 \x01(\x05R\x03\x65nd\x12@\n\x07options\x18\x03 \x01(\x0b\x32&.google.protobuf.ExtensionRangeOptionsR\x07options\x1a\x37\n\rReservedRange\x12\x14\n\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n\x03\x65nd\x18\x02 \x01(\x05R\x03\x65nd\"\xd4\x04\n\x15\x45xtensionRangeOptions\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x12Y\n\x0b\x64\x65\x63laration\x18\x02 \x03(\x0b\x32\x32.google.protobuf.ExtensionRangeOptions.DeclarationB\x03\x88\x01\x02R\x0b\x64\x65\x63laration\x12\x37\n\x08\x66\x65\x61tures\x18\x32 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12m\n\x0cverification\x18\x03 \x01(\x0e\x32\x38.google.protobuf.ExtensionRangeOptions.VerificationState:\nUNVERIFIEDB\x03\x88\x01\x02R\x0cverification\x1a\x94\x01\n\x0b\x44\x65\x63laration\x12\x16\n\x06number\x18\x01 \x01(\x05R\x06number\x12\x1b\n\tfull_name\x18\x02 \x01(\tR\x08\x66ullName\x12\x12\n\x04type\x18\x03 \x01(\tR\x04type\x12\x1a\n\x08reserved\x18\x05 \x01(\x08R\x08reserved\x12\x1a\n\x08repeated\x18\x06 \x01(\x08R\x08repeatedJ\x04\x08\x04\x10\x05\"4\n\x11VerificationState\x12\x0f\n\x0b\x44\x45\x43LARATION\x10\x00\x12\x0e\n\nUNVERIFIED\x10\x01*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xc1\x06\n\x14\x46ieldDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n\x06number\x18\x03 \x01(\x05R\x06number\x12\x41\n\x05label\x18\x04 \x01(\x0e\x32+.google.protobuf.FieldDescriptorProto.LabelR\x05label\x12>\n\x04type\x18\x05 \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.TypeR\x04type\x12\x1b\n\ttype_name\x18\x06 \x01(\tR\x08typeName\x12\x1a\n\x08\x65xtendee\x18\x02 \x01(\tR\x08\x65xtendee\x12#\n\rdefault_value\x18\x07 \x01(\tR\x0c\x64\x65\x66\x61ultValue\x12\x1f\n\x0boneof_index\x18\t \x01(\x05R\noneofIndex\x12\x1b\n\tjson_name\x18\n \x01(\tR\x08jsonName\x12\x37\n\x07options\x18\x08 \x01(\x0b\x32\x1d.google.protobuf.FieldOptionsR\x07options\x12\'\n\x0fproto3_optional\x18\x11 \x01(\x08R\x0eproto3Optional\"\xb6\x02\n\x04Type\x12\x0f\n\x0bTYPE_DOUBLE\x10\x01\x12\x0e\n\nTYPE_FLOAT\x10\x02\x12\x0e\n\nTYPE_INT64\x10\x03\x12\x0f\n\x0bTYPE_UINT64\x10\x04\x12\x0e\n\nTYPE_INT32\x10\x05\x12\x10\n\x0cTYPE_FIXED64\x10\x06\x12\x10\n\x0cTYPE_FIXED32\x10\x07\x12\r\n\tTYPE_BOOL\x10\x08\x12\x0f\n\x0bTYPE_STRING\x10\t\x12\x0e\n\nTYPE_GROUP\x10\n\x12\x10\n\x0cTYPE_MESSAGE\x10\x0b\x12\x0e\n\nTYPE_BYTES\x10\x0c\x12\x0f\n\x0bTYPE_UINT32\x10\r\x12\r\n\tTYPE_ENUM\x10\x0e\x12\x11\n\rTYPE_SFIXED32\x10\x0f\x12\x11\n\rTYPE_SFIXED64\x10\x10\x12\x0f\n\x0bTYPE_SINT32\x10\x11\x12\x0f\n\x0bTYPE_SINT64\x10\x12\"C\n\x05Label\x12\x12\n\x0eLABEL_OPTIONAL\x10\x01\x12\x12\n\x0eLABEL_REPEATED\x10\x03\x12\x12\n\x0eLABEL_REQUIRED\x10\x02\"c\n\x14OneofDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x37\n\x07options\x18\x02 \x01(\x0b\x32\x1d.google.protobuf.OneofOptionsR\x07options\"\xa6\x03\n\x13\x45numDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12?\n\x05value\x18\x02 \x03(\x0b\x32).google.protobuf.EnumValueDescriptorProtoR\x05value\x12\x36\n\x07options\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.EnumOptionsR\x07options\x12]\n\x0ereserved_range\x18\x04 \x03(\x0b\x32\x36.google.protobuf.EnumDescriptorProto.EnumReservedRangeR\rreservedRange\x12#\n\rreserved_name\x18\x05 \x03(\tR\x0creservedName\x12\x41\n\nvisibility\x18\x06 \x01(\x0e\x32!.google.protobuf.SymbolVisibilityR\nvisibility\x1a;\n\x11\x45numReservedRange\x12\x14\n\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n\x03\x65nd\x18\x02 \x01(\x05R\x03\x65nd\"\x83\x01\n\x18\x45numValueDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n\x06number\x18\x02 \x01(\x05R\x06number\x12;\n\x07options\x18\x03 \x01(\x0b\x32!.google.protobuf.EnumValueOptionsR\x07options\"\xb5\x01\n\x16ServiceDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12>\n\x06method\x18\x02 \x03(\x0b\x32&.google.protobuf.MethodDescriptorProtoR\x06method\x12\x39\n\x07options\x18\x03 \x01(\x0b\x32\x1f.google.protobuf.ServiceOptionsR\x07optionsJ\x04\x08\x04\x10\x05R\x06stream\"\x89\x02\n\x15MethodDescriptorProto\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x1d\n\ninput_type\x18\x02 \x01(\tR\tinputType\x12\x1f\n\x0boutput_type\x18\x03 \x01(\tR\noutputType\x12\x38\n\x07options\x18\x04 \x01(\x0b\x32\x1e.google.protobuf.MethodOptionsR\x07options\x12\x30\n\x10\x63lient_streaming\x18\x05 \x01(\x08:\x05\x66\x61lseR\x0f\x63lientStreaming\x12\x30\n\x10server_streaming\x18\x06 \x01(\x08:\x05\x66\x61lseR\x0fserverStreaming\"\xfa\n\n\x0b\x46ileOptions\x12!\n\x0cjava_package\x18\x01 \x01(\tR\x0bjavaPackage\x12\x30\n\x14java_outer_classname\x18\x08 \x01(\tR\x12javaOuterClassname\x12\xf9\x01\n\x13java_multiple_files\x18\n \x01(\x08:\x05\x66\x61lseB\xc1\x01\xb2\x01\xbd\x01\x08\xe6\x07 \xe9\x07*\xb4\x01This behavior is enabled by default in editions 2024 and above. To disable it, you can set `features.(pb.java).nest_in_file_class = YES` on individual messages, enums, or services.R\x11javaMultipleFiles\x12\x44\n\x1djava_generate_equals_and_hash\x18\x14 \x01(\x08\x42\x02\x18\x01R\x19javaGenerateEqualsAndHash\x12:\n\x16java_string_check_utf8\x18\x1b \x01(\x08:\x05\x66\x61lseR\x13javaStringCheckUtf8\x12S\n\x0coptimize_for\x18\t \x01(\x0e\x32).google.protobuf.FileOptions.OptimizeMode:\x05SPEEDR\x0boptimizeFor\x12\x1d\n\ngo_package\x18\x0b \x01(\tR\tgoPackage\x12\x35\n\x13\x63\x63_generic_services\x18\x10 \x01(\x08:\x05\x66\x61lseR\x11\x63\x63GenericServices\x12\x39\n\x15java_generic_services\x18\x11 \x01(\x08:\x05\x66\x61lseR\x13javaGenericServices\x12\x35\n\x13py_generic_services\x18\x12 \x01(\x08:\x05\x66\x61lseR\x11pyGenericServices\x12%\n\ndeprecated\x18\x17 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12.\n\x10\x63\x63_enable_arenas\x18\x1f \x01(\x08:\x04trueR\x0e\x63\x63\x45nableArenas\x12*\n\x11objc_class_prefix\x18$ \x01(\tR\x0fobjcClassPrefix\x12)\n\x10\x63sharp_namespace\x18% \x01(\tR\x0f\x63sharpNamespace\x12!\n\x0cswift_prefix\x18\' \x01(\tR\x0bswiftPrefix\x12(\n\x10php_class_prefix\x18( \x01(\tR\x0ephpClassPrefix\x12#\n\rphp_namespace\x18) \x01(\tR\x0cphpNamespace\x12\x34\n\x16php_metadata_namespace\x18, \x01(\tR\x14phpMetadataNamespace\x12!\n\x0cruby_package\x18- \x01(\tR\x0brubyPackage\x12\x37\n\x08\x66\x65\x61tures\x18\x32 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\":\n\x0cOptimizeMode\x12\t\n\x05SPEED\x10\x01\x12\r\n\tCODE_SIZE\x10\x02\x12\x10\n\x0cLITE_RUNTIME\x10\x03*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08*\x10+J\x04\x08&\x10\'R\x14php_generic_services\"\xfc\x03\n\x0eMessageOptions\x12<\n\x17message_set_wire_format\x18\x01 \x01(\x08:\x05\x66\x61lseR\x14messageSetWireFormat\x12L\n\x1fno_standard_descriptor_accessor\x18\x02 \x01(\x08:\x05\x66\x61lseR\x1cnoStandardDescriptorAccessor\x12%\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12\x1b\n\tmap_entry\x18\x07 \x01(\x08R\x08mapEntry\x12V\n&deprecated_legacy_json_field_conflicts\x18\x0b \x01(\x08\x42\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x12\x37\n\x08\x66\x65\x61tures\x18\x0c \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07J\x04\x08\x08\x10\tJ\x04\x08\t\x10\n\"\xce\r\n\x0c\x46ieldOptions\x12\x41\n\x05\x63type\x18\x01 \x01(\x0e\x32#.google.protobuf.FieldOptions.CType:\x06STRINGR\x05\x63type\x12\x16\n\x06packed\x18\x02 \x01(\x08R\x06packed\x12G\n\x06jstype\x18\x06 \x01(\x0e\x32$.google.protobuf.FieldOptions.JSType:\tJS_NORMALR\x06jstype\x12\x19\n\x04lazy\x18\x05 \x01(\x08:\x05\x66\x61lseR\x04lazy\x12.\n\x0funverified_lazy\x18\x0f \x01(\x08:\x05\x66\x61lseR\x0eunverifiedLazy\x12%\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12\x1d\n\x04weak\x18\n \x01(\x08:\x05\x66\x61lseB\x02\x18\x01R\x04weak\x12(\n\x0c\x64\x65\x62ug_redact\x18\x10 \x01(\x08:\x05\x66\x61lseR\x0b\x64\x65\x62ugRedact\x12K\n\tretention\x18\x11 \x01(\x0e\x32-.google.protobuf.FieldOptions.OptionRetentionR\tretention\x12H\n\x07targets\x18\x13 \x03(\x0e\x32..google.protobuf.FieldOptions.OptionTargetTypeR\x07targets\x12W\n\x10\x65\x64ition_defaults\x18\x14 \x03(\x0b\x32,.google.protobuf.FieldOptions.EditionDefaultR\x0f\x65\x64itionDefaults\x12\x37\n\x08\x66\x65\x61tures\x18\x15 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12U\n\x0f\x66\x65\x61ture_support\x18\x16 \x01(\x0b\x32,.google.protobuf.FieldOptions.FeatureSupportR\x0e\x66\x65\x61tureSupport\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x1aZ\n\x0e\x45\x64itionDefault\x12\x32\n\x07\x65\x64ition\x18\x03 \x01(\x0e\x32\x18.google.protobuf.EditionR\x07\x65\x64ition\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\x1a\xbb\x02\n\x0e\x46\x65\x61tureSupport\x12G\n\x12\x65\x64ition_introduced\x18\x01 \x01(\x0e\x32\x18.google.protobuf.EditionR\x11\x65\x64itionIntroduced\x12G\n\x12\x65\x64ition_deprecated\x18\x02 \x01(\x0e\x32\x18.google.protobuf.EditionR\x11\x65\x64itionDeprecated\x12/\n\x13\x64\x65precation_warning\x18\x03 \x01(\tR\x12\x64\x65precationWarning\x12\x41\n\x0f\x65\x64ition_removed\x18\x04 \x01(\x0e\x32\x18.google.protobuf.EditionR\x0e\x65\x64itionRemoved\x12#\n\rremoval_error\x18\x05 \x01(\tR\x0cremovalError\"/\n\x05\x43Type\x12\n\n\x06STRING\x10\x00\x12\x08\n\x04\x43ORD\x10\x01\x12\x10\n\x0cSTRING_PIECE\x10\x02\"5\n\x06JSType\x12\r\n\tJS_NORMAL\x10\x00\x12\r\n\tJS_STRING\x10\x01\x12\r\n\tJS_NUMBER\x10\x02\"U\n\x0fOptionRetention\x12\x15\n\x11RETENTION_UNKNOWN\x10\x00\x12\x15\n\x11RETENTION_RUNTIME\x10\x01\x12\x14\n\x10RETENTION_SOURCE\x10\x02\"\x8c\x02\n\x10OptionTargetType\x12\x17\n\x13TARGET_TYPE_UNKNOWN\x10\x00\x12\x14\n\x10TARGET_TYPE_FILE\x10\x01\x12\x1f\n\x1bTARGET_TYPE_EXTENSION_RANGE\x10\x02\x12\x17\n\x13TARGET_TYPE_MESSAGE\x10\x03\x12\x15\n\x11TARGET_TYPE_FIELD\x10\x04\x12\x15\n\x11TARGET_TYPE_ONEOF\x10\x05\x12\x14\n\x10TARGET_TYPE_ENUM\x10\x06\x12\x1a\n\x16TARGET_TYPE_ENUM_ENTRY\x10\x07\x12\x17\n\x13TARGET_TYPE_SERVICE\x10\x08\x12\x16\n\x12TARGET_TYPE_METHOD\x10\t*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05J\x04\x08\x12\x10\x13\"\xb4\x01\n\x0cOneofOptions\x12\x37\n\x08\x66\x65\x61tures\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xd9\x02\n\x0b\x45numOptions\x12\x1f\n\x0b\x61llow_alias\x18\x02 \x01(\x08R\nallowAlias\x12%\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12V\n&deprecated_legacy_json_field_conflicts\x18\x06 \x01(\x08\x42\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x12\x37\n\x08\x66\x65\x61tures\x18\x07 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x05\x10\x06\"\xe0\x02\n\x10\x45numValueOptions\x12%\n\ndeprecated\x18\x01 \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12\x37\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12(\n\x0c\x64\x65\x62ug_redact\x18\x03 \x01(\x08:\x05\x66\x61lseR\x0b\x64\x65\x62ugRedact\x12U\n\x0f\x66\x65\x61ture_support\x18\x04 \x01(\x0b\x32,.google.protobuf.FieldOptions.FeatureSupportR\x0e\x66\x65\x61tureSupport\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xdd\x01\n\x0eServiceOptions\x12\x37\n\x08\x66\x65\x61tures\x18\" \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12%\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xa1\x03\n\rMethodOptions\x12%\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lseR\ndeprecated\x12q\n\x11idempotency_level\x18\" \x01(\x0e\x32/.google.protobuf.MethodOptions.IdempotencyLevel:\x13IDEMPOTENCY_UNKNOWNR\x10idempotencyLevel\x12\x37\n\x08\x66\x65\x61tures\x18# \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x08\x66\x65\x61tures\x12X\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\"P\n\x10IdempotencyLevel\x12\x17\n\x13IDEMPOTENCY_UNKNOWN\x10\x00\x12\x13\n\x0fNO_SIDE_EFFECTS\x10\x01\x12\x0e\n\nIDEMPOTENT\x10\x02*\x06\x08\xde\x07\x10\xe7\x07*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x9a\x03\n\x13UninterpretedOption\x12\x41\n\x04name\x18\x02 \x03(\x0b\x32-.google.protobuf.UninterpretedOption.NamePartR\x04name\x12)\n\x10identifier_value\x18\x03 \x01(\tR\x0fidentifierValue\x12,\n\x12positive_int_value\x18\x04 \x01(\x04R\x10positiveIntValue\x12,\n\x12negative_int_value\x18\x05 \x01(\x03R\x10negativeIntValue\x12!\n\x0c\x64ouble_value\x18\x06 \x01(\x01R\x0b\x64oubleValue\x12!\n\x0cstring_value\x18\x07 \x01(\x0cR\x0bstringValue\x12\'\n\x0f\x61ggregate_value\x18\x08 \x01(\tR\x0e\x61ggregateValue\x1aJ\n\x08NamePart\x12\x1b\n\tname_part\x18\x01 \x02(\tR\x08namePart\x12!\n\x0cis_extension\x18\x02 \x02(\x08R\x0bisExtension\"\xae\x0f\n\nFeatureSet\x12\x91\x01\n\x0e\x66ield_presence\x18\x01 \x01(\x0e\x32).google.protobuf.FeatureSet.FieldPresenceB?\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\r\x12\x08\x45XPLICIT\x18\x84\x07\xa2\x01\r\x12\x08IMPLICIT\x18\xe7\x07\xa2\x01\r\x12\x08\x45XPLICIT\x18\xe8\x07\xb2\x01\x03\x08\xe8\x07R\rfieldPresence\x12l\n\tenum_type\x18\x02 \x01(\x0e\x32$.google.protobuf.FeatureSet.EnumTypeB)\x88\x01\x01\x98\x01\x06\x98\x01\x01\xa2\x01\x0b\x12\x06\x43LOSED\x18\x84\x07\xa2\x01\t\x12\x04OPEN\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\x08\x65numType\x12\x98\x01\n\x17repeated_field_encoding\x18\x03 \x01(\x0e\x32\x31.google.protobuf.FeatureSet.RepeatedFieldEncodingB-\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\r\x12\x08\x45XPANDED\x18\x84\x07\xa2\x01\x0b\x12\x06PACKED\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\x15repeatedFieldEncoding\x12~\n\x0futf8_validation\x18\x04 \x01(\x0e\x32*.google.protobuf.FeatureSet.Utf8ValidationB)\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\t\x12\x04NONE\x18\x84\x07\xa2\x01\x0b\x12\x06VERIFY\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\x0eutf8Validation\x12~\n\x10message_encoding\x18\x05 \x01(\x0e\x32+.google.protobuf.FeatureSet.MessageEncodingB&\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\x14\x12\x0fLENGTH_PREFIXED\x18\x84\x07\xb2\x01\x03\x08\xe8\x07R\x0fmessageEncoding\x12\x82\x01\n\x0bjson_format\x18\x06 \x01(\x0e\x32&.google.protobuf.FeatureSet.JsonFormatB9\x88\x01\x01\x98\x01\x03\x98\x01\x06\x98\x01\x01\xa2\x01\x17\x12\x12LEGACY_BEST_EFFORT\x18\x84\x07\xa2\x01\n\x12\x05\x41LLOW\x18\xe7\x07\xb2\x01\x03\x08\xe8\x07R\njsonFormat\x12\xbc\x01\n\x14\x65nforce_naming_style\x18\x07 \x01(\x0e\x32..google.protobuf.FeatureSet.EnforceNamingStyleBZ\x88\x01\x02\x98\x01\x01\x98\x01\x02\x98\x01\x03\x98\x01\x04\x98\x01\x05\x98\x01\x06\x98\x01\x07\x98\x01\x08\x98\x01\t\xa2\x01\x11\x12\x0cSTYLE_LEGACY\x18\x84\x07\xa2\x01\x0e\x12\tSTYLE2024\x18\xe9\x07\xa2\x01\x0e\x12\tSTYLE2026\x18\x8fN\xb2\x01\x03\x08\xe9\x07R\x12\x65nforceNamingStyle\x12\xb9\x01\n\x19\x64\x65\x66\x61ult_symbol_visibility\x18\x08 \x01(\x0e\x32\x45.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibilityB6\x88\x01\x02\x98\x01\x01\xa2\x01\x0f\x12\nEXPORT_ALL\x18\x84\x07\xa2\x01\x15\x12\x10\x45XPORT_TOP_LEVEL\x18\xe9\x07\xb2\x01\x03\x08\xe9\x07R\x17\x64\x65\x66\x61ultSymbolVisibility\x1a\xa1\x01\n\x11VisibilityFeature\"\x81\x01\n\x17\x44\x65\x66\x61ultSymbolVisibility\x12%\n!DEFAULT_SYMBOL_VISIBILITY_UNKNOWN\x10\x00\x12\x0e\n\nEXPORT_ALL\x10\x01\x12\x14\n\x10\x45XPORT_TOP_LEVEL\x10\x02\x12\r\n\tLOCAL_ALL\x10\x03\x12\n\n\x06STRICT\x10\x04J\x08\x08\x01\x10\x80\x80\x80\x80\x02\"\\\n\rFieldPresence\x12\x1a\n\x16\x46IELD_PRESENCE_UNKNOWN\x10\x00\x12\x0c\n\x08\x45XPLICIT\x10\x01\x12\x0c\n\x08IMPLICIT\x10\x02\x12\x13\n\x0fLEGACY_REQUIRED\x10\x03\"7\n\x08\x45numType\x12\x15\n\x11\x45NUM_TYPE_UNKNOWN\x10\x00\x12\x08\n\x04OPEN\x10\x01\x12\n\n\x06\x43LOSED\x10\x02\"V\n\x15RepeatedFieldEncoding\x12#\n\x1fREPEATED_FIELD_ENCODING_UNKNOWN\x10\x00\x12\n\n\x06PACKED\x10\x01\x12\x0c\n\x08\x45XPANDED\x10\x02\"I\n\x0eUtf8Validation\x12\x1b\n\x17UTF8_VALIDATION_UNKNOWN\x10\x00\x12\n\n\x06VERIFY\x10\x02\x12\x08\n\x04NONE\x10\x03\"\x04\x08\x01\x10\x01\"S\n\x0fMessageEncoding\x12\x1c\n\x18MESSAGE_ENCODING_UNKNOWN\x10\x00\x12\x13\n\x0fLENGTH_PREFIXED\x10\x01\x12\r\n\tDELIMITED\x10\x02\"H\n\nJsonFormat\x12\x17\n\x13JSON_FORMAT_UNKNOWN\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x12\x16\n\x12LEGACY_BEST_EFFORT\x10\x02\"f\n\x12\x45nforceNamingStyle\x12 \n\x1c\x45NFORCE_NAMING_STYLE_UNKNOWN\x10\x00\x12\r\n\tSTYLE2024\x10\x01\x12\x10\n\x0cSTYLE_LEGACY\x10\x02\x12\r\n\tSTYLE2026\x10\x03*\x06\x08\xe8\x07\x10\x8bN*\x06\x08\x8bN\x10\x90N*\x06\x08\x90N\x10\x91NJ\x06\x08\xe7\x07\x10\xe8\x07\"\xef\x03\n\x12\x46\x65\x61tureSetDefaults\x12X\n\x08\x64\x65\x66\x61ults\x18\x01 \x03(\x0b\x32<.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefaultR\x08\x64\x65\x66\x61ults\x12\x41\n\x0fminimum_edition\x18\x04 \x01(\x0e\x32\x18.google.protobuf.EditionR\x0eminimumEdition\x12\x41\n\x0fmaximum_edition\x18\x05 \x01(\x0e\x32\x18.google.protobuf.EditionR\x0emaximumEdition\x1a\xf8\x01\n\x18\x46\x65\x61tureSetEditionDefault\x12\x32\n\x07\x65\x64ition\x18\x03 \x01(\x0e\x32\x18.google.protobuf.EditionR\x07\x65\x64ition\x12N\n\x14overridable_features\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\x13overridableFeatures\x12\x42\n\x0e\x66ixed_features\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.FeatureSetR\rfixedFeaturesJ\x04\x08\x01\x10\x02J\x04\x08\x02\x10\x03R\x08\x66\x65\x61tures\"\xb5\x02\n\x0eSourceCodeInfo\x12\x44\n\x08location\x18\x01 \x03(\x0b\x32(.google.protobuf.SourceCodeInfo.LocationR\x08location\x1a\xce\x01\n\x08Location\x12\x16\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01R\x04path\x12\x16\n\x04span\x18\x02 \x03(\x05\x42\x02\x10\x01R\x04span\x12)\n\x10leading_comments\x18\x03 \x01(\tR\x0fleadingComments\x12+\n\x11trailing_comments\x18\x04 \x01(\tR\x10trailingComments\x12:\n\x19leading_detached_comments\x18\x06 \x03(\tR\x17leadingDetachedComments*\x0c\x08\x80\xec\xca\xff\x01\x10\x81\xec\xca\xff\x01\"\xd0\x02\n\x11GeneratedCodeInfo\x12M\n\nannotation\x18\x01 \x03(\x0b\x32-.google.protobuf.GeneratedCodeInfo.AnnotationR\nannotation\x1a\xeb\x01\n\nAnnotation\x12\x16\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01R\x04path\x12\x1f\n\x0bsource_file\x18\x02 \x01(\tR\nsourceFile\x12\x14\n\x05\x62\x65gin\x18\x03 \x01(\x05R\x05\x62\x65gin\x12\x10\n\x03\x65nd\x18\x04 \x01(\x05R\x03\x65nd\x12R\n\x08semantic\x18\x05 \x01(\x0e\x32\x36.google.protobuf.GeneratedCodeInfo.Annotation.SemanticR\x08semantic\"(\n\x08Semantic\x12\x08\n\x04NONE\x10\x00\x12\x07\n\x03SET\x10\x01\x12\t\n\x05\x41LIAS\x10\x02*\xd1\x02\n\x07\x45\x64ition\x12\x13\n\x0f\x45\x44ITION_UNKNOWN\x10\x00\x12\x13\n\x0e\x45\x44ITION_LEGACY\x10\x84\x07\x12\x13\n\x0e\x45\x44ITION_PROTO2\x10\xe6\x07\x12\x13\n\x0e\x45\x44ITION_PROTO3\x10\xe7\x07\x12\x11\n\x0c\x45\x44ITION_2023\x10\xe8\x07\x12\x11\n\x0c\x45\x44ITION_2024\x10\xe9\x07\x12\x11\n\x0c\x45\x44ITION_2026\x10\xea\x07\x12\x15\n\x10\x45\x44ITION_UNSTABLE\x10\x8fN\x12\x17\n\x13\x45\x44ITION_1_TEST_ONLY\x10\x01\x12\x17\n\x13\x45\x44ITION_2_TEST_ONLY\x10\x02\x12\x1d\n\x17\x45\x44ITION_99997_TEST_ONLY\x10\x9d\x8d\x06\x12\x1d\n\x17\x45\x44ITION_99998_TEST_ONLY\x10\x9e\x8d\x06\x12\x1d\n\x17\x45\x44ITION_99999_TEST_ONLY\x10\x9f\x8d\x06\x12\x13\n\x0b\x45\x44ITION_MAX\x10\xff\xff\xff\xff\x07*U\n\x10SymbolVisibility\x12\x14\n\x10VISIBILITY_UNSET\x10\x00\x12\x14\n\x10VISIBILITY_LOCAL\x10\x01\x12\x15\n\x11VISIBILITY_EXPORT\x10\x02\x42~\n\x13\x63om.google.protobufB\x10\x44\x65scriptorProtosH\x01Z-google.golang.org/protobuf/types/descriptorpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1aGoogle.Protobuf.Reflection') @@ -79,33 +79,38 @@       _descriptor.EnumValueDescriptor(-        name='EDITION_UNSTABLE', index=6, number=9999,-        serialized_options=None,-        type=None,-        create_key=_descriptor._internal_create_key),-      _descriptor.EnumValueDescriptor(-        name='EDITION_1_TEST_ONLY', index=7, number=1,-        serialized_options=None,-        type=None,-        create_key=_descriptor._internal_create_key),-      _descriptor.EnumValueDescriptor(-        name='EDITION_2_TEST_ONLY', index=8, number=2,-        serialized_options=None,-        type=None,-        create_key=_descriptor._internal_create_key),-      _descriptor.EnumValueDescriptor(-        name='EDITION_99997_TEST_ONLY', index=9, number=99997,-        serialized_options=None,-        type=None,-        create_key=_descriptor._internal_create_key),-      _descriptor.EnumValueDescriptor(-        name='EDITION_99998_TEST_ONLY', index=10, number=99998,-        serialized_options=None,-        type=None,-        create_key=_descriptor._internal_create_key),-      _descriptor.EnumValueDescriptor(-        name='EDITION_99999_TEST_ONLY', index=11, number=99999,-        serialized_options=None,-        type=None,-        create_key=_descriptor._internal_create_key),-      _descriptor.EnumValueDescriptor(-        name='EDITION_MAX', index=12, number=2147483647,+        name='EDITION_2026', index=6, number=1002,+        serialized_options=None,+        type=None,+        create_key=_descriptor._internal_create_key),+      _descriptor.EnumValueDescriptor(+        name='EDITION_UNSTABLE', index=7, number=9999,+        serialized_options=None,+        type=None,+        create_key=_descriptor._internal_create_key),+      _descriptor.EnumValueDescriptor(+        name='EDITION_1_TEST_ONLY', index=8, number=1,+        serialized_options=None,+        type=None,+        create_key=_descriptor._internal_create_key),+      _descriptor.EnumValueDescriptor(+        name='EDITION_2_TEST_ONLY', index=9, number=2,+        serialized_options=None,+        type=None,+        create_key=_descriptor._internal_create_key),+      _descriptor.EnumValueDescriptor(+        name='EDITION_99997_TEST_ONLY', index=10, number=99997,+        serialized_options=None,+        type=None,+        create_key=_descriptor._internal_create_key),+      _descriptor.EnumValueDescriptor(+        name='EDITION_99998_TEST_ONLY', index=11, number=99998,+        serialized_options=None,+        type=None,+        create_key=_descriptor._internal_create_key),+      _descriptor.EnumValueDescriptor(+        name='EDITION_99999_TEST_ONLY', index=12, number=99999,+        serialized_options=None,+        type=None,+        create_key=_descriptor._internal_create_key),+      _descriptor.EnumValueDescriptor(+        name='EDITION_MAX', index=13, number=2147483647,         serialized_options=None,@@ -737,2 +742,7 @@         create_key=_descriptor._internal_create_key),+      _descriptor.EnumValueDescriptor(+        name='STYLE2026', index=3, number=3,+        serialized_options=None,+        type=None,+        create_key=_descriptor._internal_create_key),     ],@@ -1198,3 +1208,3 @@     is_extendable=True,-    extension_ranges=[(1000, 536870912), ],+    extension_ranges=[(990, 999), (1000, 536870912), ],     oneofs=[@@ -1754,3 +1764,3 @@     is_extendable=True,-    extension_ranges=[(1000, 536870912), ],+    extension_ranges=[(990, 999), (1000, 536870912), ],     oneofs=[@@ -1825,3 +1835,3 @@     is_extendable=True,-    extension_ranges=[(1000, 536870912), ],+    extension_ranges=[(990, 999), (1000, 536870912), ],     oneofs=[@@ -2040,3 +2050,3 @@     is_extendable=True,-    extension_ranges=[(1000, 536870912), ],+    extension_ranges=[(990, 999), (1000, 536870912), ],     oneofs=[@@ -2076,3 +2086,3 @@     is_extendable=True,-    extension_ranges=[(1000, 536870912), ],+    extension_ranges=[(990, 999), (1000, 536870912), ],     oneofs=[@@ -2133,3 +2143,3 @@     is_extendable=True,-    extension_ranges=[(1000, 536870912), ],+    extension_ranges=[(990, 999), (1000, 536870912), ],     oneofs=[@@ -2190,3 +2200,3 @@     is_extendable=True,-    extension_ranges=[(1000, 536870912), ],+    extension_ranges=[(990, 999), (1000, 536870912), ],     oneofs=[@@ -2233,3 +2243,3 @@     is_extendable=True,-    extension_ranges=[(1000, 536870912), ],+    extension_ranges=[(990, 999), (1000, 536870912), ],     oneofs=[@@ -2284,3 +2294,3 @@     is_extendable=True,-    extension_ranges=[(1000, 536870912), ],+    extension_ranges=[(990, 999), (1000, 536870912), ],     oneofs=[@@ -2474,3 +2484,3 @@         is_extension=False, extension_scope=None,-        serialized_options=b'\210\001\002\230\001\001\230\001\002\230\001\003\230\001\004\230\001\005\230\001\006\230\001\007\230\001\010\230\001\t\242\001\021\022\014STYLE_LEGACY\030\204\007\242\001\016\022\tSTYLE2024\030\351\007\262\001\003\010\351\007', json_name='enforceNamingStyle', file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),+        serialized_options=b'\210\001\002\230\001\001\230\001\002\230\001\003\230\001\004\230\001\005\230\001\006\230\001\007\230\001\010\230\001\t\242\001\021\022\014STYLE_LEGACY\030\204\007\242\001\016\022\tSTYLE2024\030\351\007\242\001\016\022\tSTYLE2026\030\217N\262\001\003\010\351\007', json_name='enforceNamingStyle', file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),       _descriptor.FieldDescriptor(@@ -3200,2 +3210,3 @@   _FEATURESET_ENFORCENAMINGSTYLE.values[2]._features = _ResolvedFeatures(field_presence=_FEATURESET_FIELDPRESENCE.values_by_name["EXPLICIT"].number,enum_type=_FEATURESET_ENUMTYPE.values_by_name["CLOSED"].number,repeated_field_encoding=_FEATURESET_REPEATEDFIELDENCODING.values_by_name["EXPANDED"].number,utf8_validation=_FEATURESET_UTF8VALIDATION.values_by_name["NONE"].number,message_encoding=_FEATURESET_MESSAGEENCODING.values_by_name["LENGTH_PREFIXED"].number,json_format=_FEATURESET_JSONFORMAT.values_by_name["LEGACY_BEST_EFFORT"].number)+  _FEATURESET_ENFORCENAMINGSTYLE.values[3]._features = _ResolvedFeatures(field_presence=_FEATURESET_FIELDPRESENCE.values_by_name["EXPLICIT"].number,enum_type=_FEATURESET_ENUMTYPE.values_by_name["CLOSED"].number,repeated_field_encoding=_FEATURESET_REPEATEDFIELDENCODING.values_by_name["EXPANDED"].number,utf8_validation=_FEATURESET_UTF8VALIDATION.values_by_name["NONE"].number,message_encoding=_FEATURESET_MESSAGEENCODING.values_by_name["LENGTH_PREFIXED"].number,json_format=_FEATURESET_JSONFORMAT.values_by_name["LEGACY_BEST_EFFORT"].number)   _FEATURESET_VISIBILITYFEATURE_DEFAULTSYMBOLVISIBILITY._features = _ResolvedFeatures(field_presence=_FEATURESET_FIELDPRESENCE.values_by_name["EXPLICIT"].number,enum_type=_FEATURESET_ENUMTYPE.values_by_name["CLOSED"].number,repeated_field_encoding=_FEATURESET_REPEATEDFIELDENCODING.values_by_name["EXPANDED"].number,utf8_validation=_FEATURESET_UTF8VALIDATION.values_by_name["NONE"].number,message_encoding=_FEATURESET_MESSAGEENCODING.values_by_name["LENGTH_PREFIXED"].number,json_format=_FEATURESET_JSONFORMAT.values_by_name["LEGACY_BEST_EFFORT"].number)@@ -3224,2 +3235,3 @@   _EDITION.values[12]._features = _ResolvedFeatures(field_presence=_FEATURESET_FIELDPRESENCE.values_by_name["EXPLICIT"].number,enum_type=_FEATURESET_ENUMTYPE.values_by_name["CLOSED"].number,repeated_field_encoding=_FEATURESET_REPEATEDFIELDENCODING.values_by_name["EXPANDED"].number,utf8_validation=_FEATURESET_UTF8VALIDATION.values_by_name["NONE"].number,message_encoding=_FEATURESET_MESSAGEENCODING.values_by_name["LENGTH_PREFIXED"].number,json_format=_FEATURESET_JSONFORMAT.values_by_name["LEGACY_BEST_EFFORT"].number)+  _EDITION.values[13]._features = _ResolvedFeatures(field_presence=_FEATURESET_FIELDPRESENCE.values_by_name["EXPLICIT"].number,enum_type=_FEATURESET_ENUMTYPE.values_by_name["CLOSED"].number,repeated_field_encoding=_FEATURESET_REPEATEDFIELDENCODING.values_by_name["EXPANDED"].number,utf8_validation=_FEATURESET_UTF8VALIDATION.values_by_name["NONE"].number,message_encoding=_FEATURESET_MESSAGEENCODING.values_by_name["LENGTH_PREFIXED"].number,json_format=_FEATURESET_JSONFORMAT.values_by_name["LEGACY_BEST_EFFORT"].number)   _SYMBOLVISIBILITY._features = _ResolvedFeatures(field_presence=_FEATURESET_FIELDPRESENCE.values_by_name["EXPLICIT"].number,enum_type=_FEATURESET_ENUMTYPE.values_by_name["CLOSED"].number,repeated_field_encoding=_FEATURESET_REPEATEDFIELDENCODING.values_by_name["EXPANDED"].number,utf8_validation=_FEATURESET_UTF8VALIDATION.values_by_name["NONE"].number,message_encoding=_FEATURESET_MESSAGEENCODING.values_by_name["LENGTH_PREFIXED"].number,json_format=_FEATURESET_JSONFORMAT.values_by_name["LEGACY_BEST_EFFORT"].number)@@ -3261,3 +3273,3 @@   _globals['_FEATURESET'].fields_by_name['enforce_naming_style']._loaded_options = None-  _globals['_FEATURESET'].fields_by_name['enforce_naming_style']._serialized_options = b'\210\001\002\230\001\001\230\001\002\230\001\003\230\001\004\230\001\005\230\001\006\230\001\007\230\001\010\230\001\t\242\001\021\022\014STYLE_LEGACY\030\204\007\242\001\016\022\tSTYLE2024\030\351\007\262\001\003\010\351\007'+  _globals['_FEATURESET'].fields_by_name['enforce_naming_style']._serialized_options = b'\210\001\002\230\001\001\230\001\002\230\001\003\230\001\004\230\001\005\230\001\006\230\001\007\230\001\010\230\001\t\242\001\021\022\014STYLE_LEGACY\030\204\007\242\001\016\022\tSTYLE2024\030\351\007\242\001\016\022\tSTYLE2026\030\217N\262\001\003\010\351\007'   _globals['_FEATURESET'].fields_by_name['default_symbol_visibility']._loaded_options = None@@ -3270,6 +3282,6 @@   _globals['_GENERATEDCODEINFO_ANNOTATION'].fields_by_name['path']._serialized_options = b'\020\001'-  _globals['_EDITION']._serialized_start=12919-  _globals['_EDITION']._serialized_end=13237-  _globals['_SYMBOLVISIBILITY']._serialized_start=13239-  _globals['_SYMBOLVISIBILITY']._serialized_end=13324+  _globals['_EDITION']._serialized_start=13023+  _globals['_EDITION']._serialized_end=13360+  _globals['_SYMBOLVISIBILITY']._serialized_start=13362+  _globals['_SYMBOLVISIBILITY']._serialized_end=13447   _globals['_FILEDESCRIPTORSET']._serialized_start=53@@ -3285,3 +3297,3 @@   _globals['_EXTENSIONRANGEOPTIONS']._serialized_start=1754-  _globals['_EXTENSIONRANGEOPTIONS']._serialized_end=2342+  _globals['_EXTENSIONRANGEOPTIONS']._serialized_end=2350   _globals['_EXTENSIONRANGEOPTIONS_DECLARATION']._serialized_start=2129@@ -3290,90 +3302,90 @@   _globals['_EXTENSIONRANGEOPTIONS_VERIFICATIONSTATE']._serialized_end=2331-  _globals['_FIELDDESCRIPTORPROTO']._serialized_start=2345-  _globals['_FIELDDESCRIPTORPROTO']._serialized_end=3178-  _globals['_FIELDDESCRIPTORPROTO_TYPE']._serialized_start=2799-  _globals['_FIELDDESCRIPTORPROTO_TYPE']._serialized_end=3109-  _globals['_FIELDDESCRIPTORPROTO_LABEL']._serialized_start=3111-  _globals['_FIELDDESCRIPTORPROTO_LABEL']._serialized_end=3178-  _globals['_ONEOFDESCRIPTORPROTO']._serialized_start=3180-  _globals['_ONEOFDESCRIPTORPROTO']._serialized_end=3279-  _globals['_ENUMDESCRIPTORPROTO']._serialized_start=3282-  _globals['_ENUMDESCRIPTORPROTO']._serialized_end=3704-  _globals['_ENUMDESCRIPTORPROTO_ENUMRESERVEDRANGE']._serialized_start=3645-  _globals['_ENUMDESCRIPTORPROTO_ENUMRESERVEDRANGE']._serialized_end=3704-  _globals['_ENUMVALUEDESCRIPTORPROTO']._serialized_start=3707-  _globals['_ENUMVALUEDESCRIPTORPROTO']._serialized_end=3838-  _globals['_SERVICEDESCRIPTORPROTO']._serialized_start=3841-  _globals['_SERVICEDESCRIPTORPROTO']._serialized_end=4022-  _globals['_METHODDESCRIPTORPROTO']._serialized_start=4025-  _globals['_METHODDESCRIPTORPROTO']._serialized_end=4290-  _globals['_FILEOPTIONS']._serialized_start=4293-  _globals['_FILEOPTIONS']._serialized_end=5687-  _globals['_FILEOPTIONS_OPTIMIZEMODE']._serialized_start=5584-  _globals['_FILEOPTIONS_OPTIMIZEMODE']._serialized_end=5642-  _globals['_MESSAGEOPTIONS']._serialized_start=5690-  _globals['_MESSAGEOPTIONS']._serialized_end=6190-  _globals['_FIELDOPTIONS']._serialized_start=6193-  _globals['_FIELDOPTIONS']._serialized_end=7927-  _globals['_FIELDOPTIONS_EDITIONDEFAULT']._serialized_start=7034-  _globals['_FIELDOPTIONS_EDITIONDEFAULT']._serialized_end=7124-  _globals['_FIELDOPTIONS_FEATURESUPPORT']._serialized_start=7127-  _globals['_FIELDOPTIONS_FEATURESUPPORT']._serialized_end=7442-  _globals['_FIELDOPTIONS_CTYPE']._serialized_start=7444-  _globals['_FIELDOPTIONS_CTYPE']._serialized_end=7491-  _globals['_FIELDOPTIONS_JSTYPE']._serialized_start=7493-  _globals['_FIELDOPTIONS_JSTYPE']._serialized_end=7546-  _globals['_FIELDOPTIONS_OPTIONRETENTION']._serialized_start=7548-  _globals['_FIELDOPTIONS_OPTIONRETENTION']._serialized_end=7633-  _globals['_FIELDOPTIONS_OPTIONTARGETTYPE']._serialized_start=7636-  _globals['_FIELDOPTIONS_OPTIONTARGETTYPE']._serialized_end=7904-  _globals['_ONEOFOPTIONS']._serialized_start=7930-  _globals['_ONEOFOPTIONS']._serialized_end=8102-  _globals['_ENUMOPTIONS']._serialized_start=8105-  _globals['_ENUMOPTIONS']._serialized_end=8442-  _globals['_ENUMVALUEOPTIONS']._serialized_start=8445-  _globals['_ENUMVALUEOPTIONS']._serialized_end=8789-  _globals['_SERVICEOPTIONS']._serialized_start=8792-  _globals['_SERVICEOPTIONS']._serialized_end=9005-  _globals['_METHODOPTIONS']._serialized_start=9008-  _globals['_METHODOPTIONS']._serialized_end=9417-  _globals['_METHODOPTIONS_IDEMPOTENCYLEVEL']._serialized_start=9326-  _globals['_METHODOPTIONS_IDEMPOTENCYLEVEL']._serialized_end=9406-  _globals['_UNINTERPRETEDOPTION']._serialized_start=9420-  _globals['_UNINTERPRETEDOPTION']._serialized_end=9830-  _globals['_UNINTERPRETEDOPTION_NAMEPART']._serialized_start=9756-  _globals['_UNINTERPRETEDOPTION_NAMEPART']._serialized_end=9830-  _globals['_FEATURESET']._serialized_start=9833-  _globals['_FEATURESET']._serialized_end=11767-  _globals['_FEATURESET_VISIBILITYFEATURE']._serialized_start=11012-  _globals['_FEATURESET_VISIBILITYFEATURE']._serialized_end=11173-  _globals['_FEATURESET_VISIBILITYFEATURE_DEFAULTSYMBOLVISIBILITY']._serialized_start=11034-  _globals['_FEATURESET_VISIBILITYFEATURE_DEFAULTSYMBOLVISIBILITY']._serialized_end=11163-  _globals['_FEATURESET_FIELDPRESENCE']._serialized_start=11175-  _globals['_FEATURESET_FIELDPRESENCE']._serialized_end=11267-  _globals['_FEATURESET_ENUMTYPE']._serialized_start=11269-  _globals['_FEATURESET_ENUMTYPE']._serialized_end=11324-  _globals['_FEATURESET_REPEATEDFIELDENCODING']._serialized_start=11326-  _globals['_FEATURESET_REPEATEDFIELDENCODING']._serialized_end=11412-  _globals['_FEATURESET_UTF8VALIDATION']._serialized_start=11414-  _globals['_FEATURESET_UTF8VALIDATION']._serialized_end=11487
… 109 more lines (truncated)
google/protobuf/duration_pb2.py +3 lines
--- +++ @@ -4,3 +4,3 @@ # source: google/protobuf/duration.proto-# Protobuf Python Version: 7.34.2+# Protobuf Python Version: 7.35.1 """Generated protocol buffer code."""@@ -14,4 +14,4 @@     7,-    34,-    2,+    35,+    1,     '',
google/protobuf/empty_pb2.py +3 lines
--- +++ @@ -4,3 +4,3 @@ # source: google/protobuf/empty.proto-# Protobuf Python Version: 7.34.2+# Protobuf Python Version: 7.35.1 """Generated protocol buffer code."""@@ -14,4 +14,4 @@     7,-    34,-    2,+    35,+    1,     '',
google/protobuf/field_mask_pb2.py +3 lines
--- +++ @@ -4,3 +4,3 @@ # source: google/protobuf/field_mask.proto-# Protobuf Python Version: 7.34.2+# Protobuf Python Version: 7.35.1 """Generated protocol buffer code."""@@ -14,4 +14,4 @@     7,-    34,-    2,+    35,+    1,     '',
google/protobuf/internal/field_mask.py +60 lines
--- +++ @@ -239,5 +239,12 @@       self.AddPath(prefix)-    for name in node:-      child_path = prefix + '.' + name-      self.AddLeafNodes(child_path, node[name])+      return+    stack = [(prefix, node)]+    while stack:+      current_prefix, current_node = stack.pop()+      if not current_node:+        self.AddPath(current_prefix)+        continue+      for name in current_node:+        child_path = current_prefix + '.' + name+        stack.append((child_path, current_node[name])) @@ -264,37 +271,41 @@   """Merge all fields specified by a sub-tree from source to destination."""-  source_descriptor = source.DESCRIPTOR-  for name in node:-    child = node[name]-    field = source_descriptor.fields_by_name[name]-    if field is None:-      raise ValueError('Error: Can\'t find field {0} in message {1}.'.format(-          name, source_descriptor.full_name))-    if child:-      # Sub-paths are only allowed for singular message fields.-      if (field.is_repeated or-          field.cpp_type != FieldDescriptor.CPPTYPE_MESSAGE):-        raise ValueError('Error: Field {0} in message {1} is not a singular '-                         'message field and cannot have sub-fields.'.format(-                             name, source_descriptor.full_name))-      if source.HasField(name):-        _MergeMessage(-            child, getattr(source, name), getattr(destination, name),-            replace_message, replace_repeated)-      continue-    if field.is_repeated:-      if replace_repeated:-        destination.ClearField(_StrConvert(name))-      repeated_source = getattr(source, name)-      repeated_destination = getattr(destination, name)-      repeated_destination.MergeFrom(repeated_source)-    else:-      if field.cpp_type == FieldDescriptor.CPPTYPE_MESSAGE:-        if replace_message:-          destination.ClearField(_StrConvert(name))-        if source.HasField(name):-          getattr(destination, name).MergeFrom(getattr(source, name))-      elif not field.has_presence or source.HasField(name):-        setattr(destination, name, getattr(source, name))+  stack = [(node, source, destination)]+  while stack:+    current_node, current_source, current_destination = stack.pop()+    source_descriptor = current_source.DESCRIPTOR+    for name in current_node:+      child = current_node[name]+      field = source_descriptor.fields_by_name[name]+      if field is None:+        raise ValueError('Error: Can\'t find field {0} in message {1}.'.format(+            name, source_descriptor.full_name))+      if child:+        # Sub-paths are only allowed for singular message fields.+        if (field.is_repeated or+            field.cpp_type != FieldDescriptor.CPPTYPE_MESSAGE):+          raise ValueError('Error: Field {0} in message {1} is not a singular '+                           'message field and cannot have sub-fields.'.format(+                               name, source_descriptor.full_name))+        if current_source.HasField(name):+          stack.append(+              (child, getattr(current_source, name),+               getattr(current_destination, name)))+        continue+      if field.is_repeated:+        if replace_repeated:+          current_destination.ClearField(_StrConvert(name))+        repeated_source = getattr(current_source, name)+        repeated_destination = getattr(current_destination, name)+        repeated_destination.MergeFrom(repeated_source)       else:-        destination.ClearField(_StrConvert(name))+        if field.cpp_type == FieldDescriptor.CPPTYPE_MESSAGE:+          if replace_message:+            current_destination.ClearField(_StrConvert(name))+          if current_source.HasField(name):+            getattr(current_destination, name).MergeFrom(+                getattr(current_source, name))+        elif not field.has_presence or current_source.HasField(name):+          setattr(current_destination, name, getattr(current_source, name))+        else:+          current_destination.ClearField(_StrConvert(name)) @@ -303,10 +314,13 @@   """Adds the field paths descended from node to field_mask."""-  if not node and prefix:-    field_mask.paths.append(prefix)-    return-  for name in sorted(node):-    if prefix:-      child_path = prefix + '.' + name-    else:-      child_path = name-    _AddFieldPaths(node[name], child_path, field_mask)+  stack = [(node, prefix)]+  while stack:+    current_node, current_prefix = stack.pop()+    if not current_node and current_prefix:+      field_mask.paths.append(current_prefix)+      continue+    for name in sorted(current_node, reverse=True):+      if current_prefix:+        child_path = current_prefix + '.' + name+      else:+        child_path = name+      stack.append((current_node[name], child_path))
google/protobuf/internal/python_edition_defaults.py +1 lines
--- +++ @@ -4,2 +4,2 @@ """-_PROTOBUF_INTERNAL_PYTHON_EDITION_DEFAULTS = b"\n\027\030\204\007\"\000*\020\010\001\020\002\030\002 \003(\0010\0028\002@\001\n\027\030\347\007\"\000*\020\010\002\020\001\030\001 \002(\0010\0018\002@\001\n\027\030\350\007\"\014\010\001\020\001\030\001 \002(\0010\001*\0048\002@\001\n\027\030\351\007\"\020\010\001\020\001\030\001 \002(\0010\0018\001@\002*\000 \346\007(\351\007"+_PROTOBUF_INTERNAL_PYTHON_EDITION_DEFAULTS = b"\n\027\030\204\007\"\000*\020\010\001\020\002\030\002 \003(\0010\0028\002@\001\n\027\030\347\007\"\000*\020\010\002\020\001\030\001 \002(\0010\0018\002@\001\n\027\030\350\007\"\014\010\001\020\001\030\001 \002(\0010\001*\0048\002@\001\n\027\030\351\007\"\020\010\001\020\001\030\001 \002(\0010\0018\001@\002*\000\n\027\030\217N\"\020\010\001\020\001\030\001 \002(\0010\0018\003@\002*\000 \346\007(\351\007"
google/protobuf/json_format.py +28 lines
--- +++ @@ -88,2 +88,4 @@     always_print_fields_with_no_presence=False,+    *,+    unquote_int64_if_possible=False, ):@@ -109,2 +111,5 @@       False, Unicode strings are returned unchanged.+    unquote_int64_if_possible: If True, unquote int64 fields for values that+      are safe to emit as numbers (all values smaller than 2^53 and a sparse+      set of values that are larger). @@ -118,2 +123,3 @@       always_print_fields_with_no_presence,+      unquote_int64_if_possible=unquote_int64_if_possible,   )@@ -128,2 +134,4 @@     descriptor_pool=None,+    *,+    unquote_int64_if_possible=False, ):@@ -145,2 +153,5 @@       default.+    unquote_int64_if_possible: If True, unquote int64 fields for values that+      are safe to emit as numbers (all values smaller than 2^53 and a sparse+      set of values that are larger). @@ -154,2 +165,3 @@       always_print_fields_with_no_presence,+      unquote_int64_if_possible=unquote_int64_if_possible,   )@@ -176,2 +188,4 @@       always_print_fields_with_no_presence=False,+      *,+      unquote_int64_if_possible=False,   ):@@ -183,2 +197,3 @@     self.descriptor_pool = descriptor_pool+    self.unquote_int64_if_possible = unquote_int64_if_possible @@ -296,3 +311,6 @@     elif field.cpp_type in _INT64_TYPES:-      return str(value)+      if self.unquote_int64_if_possible and float(value) == value:+        return value+      else:+        return str(value)     elif field.cpp_type in _FLOAT_TYPES:@@ -508,2 +526,6 @@     """+    # Increment recursion depth at message entry. The max_recursion_depth limit+    # is exclusive: a depth value equal to max_recursion_depth will trigger an+    # error. For example, with max_recursion_depth=5, nesting up to depth 4 is+    # allowed, but attempting depth 5 raises ParseError.     self.recursion_depth += 1@@ -728,8 +750,7 @@     elif full_name in _WKTJSONMETHODS:-      methodcaller(-          _WKTJSONMETHODS[full_name][1],-          value['value'],-          sub_message,-          '{0}.value'.format(path),-      )(self)+      # For well-known types (including nested Any), use ConvertMessage+      # to ensure recursion depth is properly tracked+      self.ConvertMessage(+          value['value'], sub_message, '{0}.value'.format(path)+      )     else:
google/protobuf/runtime_version.py +2 lines
--- +++ @@ -30,4 +30,4 @@ OSS_MAJOR = 7-OSS_MINOR = 34-OSS_PATCH = 2+OSS_MINOR = 35+OSS_PATCH = 1 OSS_SUFFIX = ''
google/protobuf/source_context_pb2.py +3 lines
--- +++ @@ -4,3 +4,3 @@ # source: google/protobuf/source_context.proto-# Protobuf Python Version: 7.34.2+# Protobuf Python Version: 7.35.1 """Generated protocol buffer code."""@@ -14,4 +14,4 @@     7,-    34,-    2,+    35,+    1,     '',
google/protobuf/struct_pb2.py +3 lines
--- +++ @@ -4,3 +4,3 @@ # source: google/protobuf/struct.proto-# Protobuf Python Version: 7.34.2+# Protobuf Python Version: 7.35.1 """Generated protocol buffer code."""@@ -14,4 +14,4 @@     7,-    34,-    2,+    35,+    1,     '',
google/protobuf/text_format.py +66 lines
--- +++ @@ -635,3 +635,4 @@           descriptor_pool=None,-          allow_unknown_field=False):+          allow_unknown_field=False,+          max_recursion_depth=None):   """Parses a text representation of a protocol message into a message.@@ -673,2 +674,5 @@       errors (e.g. spelling error on field name)+    max_recursion_depth: Optional maximum recursion depth of a text proto+      message to be deserialized. Text proto messages over this depth will+      fail to parse. ``None`` keeps the historical unbounded behavior. @@ -685,3 +689,4 @@                     descriptor_pool=descriptor_pool,-                    allow_unknown_field=allow_unknown_field)+                    allow_unknown_field=allow_unknown_field,+                    max_recursion_depth=max_recursion_depth) @@ -693,3 +698,4 @@           descriptor_pool=None,-          allow_unknown_field=False):+          allow_unknown_field=False,+          max_recursion_depth=None):   """Parses a text representation of a protocol message into a message.@@ -710,2 +716,5 @@       errors (e.g. spelling error on field name)+    max_recursion_depth: Optional maximum recursion depth of a text proto+      message to be deserialized. Text proto messages over this depth will+      fail to parse. ``None`` keeps the historical unbounded behavior. @@ -723,3 +732,4 @@       descriptor_pool=descriptor_pool,-      allow_unknown_field=allow_unknown_field)+      allow_unknown_field=allow_unknown_field,+      max_recursion_depth=max_recursion_depth) @@ -731,3 +741,4 @@                descriptor_pool=None,-               allow_unknown_field=False):+               allow_unknown_field=False,+               max_recursion_depth=None):   """Parses a text representation of a protocol message into a message.@@ -746,2 +757,5 @@       errors (e.g. spelling error on field name)+    max_recursion_depth: Optional maximum recursion depth of a text proto+      message to be deserialized. Text proto messages over this depth will+      fail to parse. ``None`` keeps the historical unbounded behavior. @@ -756,3 +770,4 @@                    descriptor_pool=descriptor_pool,-                   allow_unknown_field=allow_unknown_field)+                   allow_unknown_field=allow_unknown_field,+                   max_recursion_depth=max_recursion_depth)   return parser.ParseLines(lines, message)@@ -765,3 +780,4 @@                descriptor_pool=None,-               allow_unknown_field=False):+               allow_unknown_field=False,+               max_recursion_depth=None):   """Parses a text representation of a protocol message into a message.@@ -780,2 +796,5 @@       errors (e.g. spelling error on field name)+    max_recursion_depth: Optional maximum recursion depth of a text proto+      message to be deserialized. Text proto messages over this depth will+      fail to parse. ``None`` keeps the historical unbounded behavior. @@ -790,3 +809,4 @@                    descriptor_pool=descriptor_pool,-                   allow_unknown_field=allow_unknown_field)+                   allow_unknown_field=allow_unknown_field,+                   max_recursion_depth=max_recursion_depth)   return parser.MergeLines(lines, message)@@ -801,3 +821,4 @@                descriptor_pool=None,-               allow_unknown_field=False):+               allow_unknown_field=False,+               max_recursion_depth=None):     self.allow_unknown_extension = allow_unknown_extension@@ -806,2 +827,4 @@     self.allow_unknown_field = allow_unknown_field+    self.max_recursion_depth = max_recursion_depth+    self.recursion_depth = 0 @@ -839,4 +862,34 @@       self.root_type = message.DESCRIPTOR.full_name+    self.recursion_depth += 1+    if (+        self.max_recursion_depth is not None+        and self.recursion_depth > self.max_recursion_depth+    ):+      raise ParseError(+          'Message too deep. Max recursion depth is {0}'.format(+              self.max_recursion_depth+          )+      )     while not tokenizer.AtEnd():       self._MergeField(tokenizer, message)+    self.recursion_depth -= 1++  def _MergeMessage(self, tokenizer, message, end_token):+    self.recursion_depth += 1+    if (+        self.max_recursion_depth is not None+        and self.recursion_depth > self.max_recursion_depth+    ):+      raise ParseError(+          'Message too deep. Max recursion depth is {0}'.format(+              self.max_recursion_depth+          )+      )+    while not tokenizer.TryConsume(end_token):+      if tokenizer.AtEnd():+        raise tokenizer.ParseErrorPreviousToken(+            'Expected "%s".' % (end_token,)+        )+      self._MergeField(tokenizer, message)+    self.recursion_depth -= 1 @@ -875,7 +928,5 @@                          packed_type_name)-      while not tokenizer.TryConsume(expanded_any_end_token):-        if tokenizer.AtEnd():-          raise tokenizer.ParseErrorPreviousToken('Expected "%s".' %-                                                  (expanded_any_end_token,))-        self._MergeField(tokenizer, expanded_any_sub_message)+      self._MergeMessage(+          tokenizer, expanded_any_sub_message, expanded_any_end_token+      )       deterministic = False@@ -1097,6 +1148,3 @@ -    while not tokenizer.TryConsume(end_token):-      if tokenizer.AtEnd():-        raise tokenizer.ParseErrorPreviousToken('Expected "%s".' % (end_token,))-      self._MergeField(tokenizer, sub_message)+    self._MergeMessage(tokenizer, sub_message, end_token) 
google/protobuf/timestamp_pb2.py +3 lines
--- +++ @@ -4,3 +4,3 @@ # source: google/protobuf/timestamp.proto-# Protobuf Python Version: 7.34.2+# Protobuf Python Version: 7.35.1 """Generated protocol buffer code."""@@ -14,4 +14,4 @@     7,-    34,-    2,+    35,+    1,     '',
google/protobuf/type_pb2.py +3 lines
--- +++ @@ -4,3 +4,3 @@ # source: google/protobuf/type.proto-# Protobuf Python Version: 7.34.2+# Protobuf Python Version: 7.35.1 """Generated protocol buffer code."""@@ -14,4 +14,4 @@     7,-    34,-    2,+    35,+    1,     '',
google/protobuf/wrappers_pb2.py +3 lines
--- +++ @@ -4,3 +4,3 @@ # source: google/protobuf/wrappers.proto-# Protobuf Python Version: 7.34.2+# Protobuf Python Version: 7.35.1 """Generated protocol buffer code."""@@ -14,4 +14,4 @@     7,-    34,-    2,+    35,+    1,     '',
pydantic pypi
2.13.4 2mo ago incident on record
YANK ×2BURST ×4
latest 2.13.4 versions 203 maintainers 1
2.12.1
2.12.2
2.12.3
2.12.4
2.12.5
1.10.25
1.10.26
2.13.0
2.13.1
2.13.2
2.13.3
2.13.4
YANK
1.10.3 marked yanked (still downloadable)
high · registry-verified · 2022-12-29 · 3y ago
YANK
2.12.1 marked yanked (still downloadable)
high · registry-verified · 2025-10-13 · 9mo ago
BURST
2 releases in 50m: 0.2, 0.2.1
info · registry-verified · 2017-06-07 · 9y ago
BURST
3 releases in 56m: 1.6.2, 1.7.4, 1.8.2
info · registry-verified · 2021-05-11 · 5y ago
BURST
2 releases in 4m: 1.10.11, 2.0.1
info · registry-verified · 2023-07-04 · 3y ago
BURST
2 releases in 59m: 2.11.8, 1.10.23
info · registry-verified · 2025-09-13 · 10mo ago
release diff 2.13.3 → 2.13.4
+0 added · -0 removed · ~10 modified
pydantic/_internal/_generate_schema.py +12 lines
--- +++ @@ -842,4 +842,13 @@                 if cls.__pydantic_root_model__:-                    # FIXME: should the common field metadata be used here?-                    inner_schema, _ = self._common_field_schema('root', fields['root'], decorators)+                    inner_schema, metadata = self._common_field_schema('root', fields['root'], decorators)+                    if cls.__doc__ and metadata.get('pydantic_js_updates', {}).get('description'):+                        # This is a bit of a leaky abstraction, but as the model docstring takes priority+                        # over the root field's description, we need to override it here. This can't be done+                        # in the JSON Schema generation logic because the metadata's `pydantic_js_updates` are+                        # applied last, and overrides any value previously set (so the description set from the+                        # docstring in `GenerateJsonSchema._update_class_schema()` is overridden):+                        update_core_metadata(+                            metadata, pydantic_js_updates={'description': inspect.cleandoc(cls.__doc__)}+                        )+                     inner_schema = apply_model_validators(inner_schema, model_validators, 'inner')@@ -854,2 +863,3 @@                         ref=model_ref,+                        metadata=metadata,                     )
pydantic/json_schema.py +0 lines
--- +++ @@ -1638,3 +1638,2 @@         from .main import BaseModel-        from .root_model import RootModel @@ -1666,4 +1665,2 @@             json_schema.setdefault('description', inspect.cleandoc(docstring))-        elif issubclass(cls, RootModel) and (root_description := cls.__pydantic_fields__['root'].description):-            json_schema.setdefault('description', root_description) 
pydantic/version.py +2 lines
--- +++ @@ -10,3 +10,3 @@ -VERSION = '2.13.3'+VERSION = '2.13.4' """The version of Pydantic.@@ -21,3 +21,3 @@ # Keep this in sync with the version constraint in the `pyproject.toml` dependencies:-_COMPATIBLE_PYDANTIC_CORE_VERSION = '2.46.3'+_COMPATIBLE_PYDANTIC_CORE_VERSION = '2.46.4' 
pyproject.toml +1 lines
--- +++ @@ -49,3 +49,3 @@     # Keep this in sync with the version in the `check_pydantic_core_version()` function:-    'pydantic-core==2.46.3',+    'pydantic-core==2.46.4',     'typing-inspection>=0.4.2',
tests/test_json_schema.py +32 lines
--- +++ @@ -5393,2 +5393,34 @@ +def test_root_model_annotated_root_type_parameterized() -> None:+    """https://github.com/pydantic/pydantic/issues/13123"""++    MyType = Annotated[str, Field(examples=['hello'], description='desc', deprecated=True)]++    class MyModel(RootModel[MyType]):+        pass++    assert MyModel.model_json_schema() == {+        'deprecated': True,+        'description': 'desc',+        'examples': ['hello'],+        'title': 'MyModel',+        'type': 'string',+    }+++def test_root_model_annotated_root_type() -> None:+    """https://github.com/pydantic/pydantic/issues/13123"""++    class MyModel(RootModel):+        root: Annotated[str, Field(examples=['hello'], description='desc', deprecated=True)]++    assert MyModel.model_json_schema() == {+        'deprecated': True,+        'description': 'desc',+        'examples': ['hello'],+        'title': 'MyModel',+        'type': 'string',+    }++ def test_type_adapter_json_schemas_title_description():
tests/test_main.py +1 lines
--- +++ @@ -2012,7 +2012,3 @@ def test_class_kwargs_custom_config():-    if platform.python_implementation() == 'PyPy':-        msg = r"__init_subclass__\(\) got an unexpected keyword argument 'some_config'"-    else:-        msg = r'__init_subclass__\(\) takes no keyword arguments'-    with pytest.raises(TypeError, match=msg):+    with pytest.raises(TypeError, match=r'__init_subclass__\(\) takes no keyword arguments'): 
tests/test_missing_sentinel.py +6 lines
--- +++ @@ -4,2 +4,3 @@ import pytest+import typing_extensions from annotated_types import Ge@@ -55,3 +56,7 @@ [email protected](reason="PEP 661 sentinels aren't picklable yet in the experimental typing-extensions implementation")[email protected](+    # Unreleased typing-extensions has the final sentinel implementation with pickle support:+    condition=not hasattr(typing_extensions, 'sentinel'),+    reason="PEP 661 sentinels aren't picklable yet in the experimental typing-extensions implementation",+) def test_missing_sentinel_pickle() -> None:
tests/test_pickle.py +25 lines
--- +++ @@ -8,3 +8,3 @@ from textwrap import dedent-from typing import Optional+from typing import TYPE_CHECKING, Optional @@ -17,6 +17,14 @@ -try:+IS_PYPY = sys.implementation.name == 'pypy' and sys.version_info >= (3, 11)++if TYPE_CHECKING:     import cloudpickle-except ImportError:-    cloudpickle = None+else:+    if not IS_PYPY:+        try:+            import cloudpickle+        except ImportError:+            cloudpickle = None+    else:+        cloudpickle = None @@ -24,6 +32,12 @@ -pytestmark = pytest.mark.skipif(cloudpickle is None, reason='cloudpickle is not installed')-+pytestmark = pytest.mark.skipif(+    cloudpickle is None,+    reason='cloudpickle is not installed, or tests are running with PyPy (https://github.com/cloudpipe/cloudpickle/issues/592).',+)++# Note: this xfail marker was used when cloudpickle was partially compatible with PyPy. Since PyPy 7.3.22, it isn't compatible+# at all (importing it fails), so all tests are skipped as per the module's `pytestmark`. We keep the xfail marker if this ever+# changes: cloudpickle_pypy_xfail = pytest.mark.xfail(-    condition=sys.implementation.name == 'pypy' and sys.version_info >= (3, 11),+    condition=IS_PYPY,     reason='Cloudpickle issue: - possibly https://github.com/cloudpipe/cloudpickle/issues/557',@@ -101,3 +115,6 @@         (ImportableModel, True),-        # Locally-defined model can only be pickled with cloudpickle.+        # Locally-defined model can only be pickle+        # # Note: this xfail marker was used when cloudpickle was partially compatible with PyPy. Since PyPy 7.3.22, it is completelyisn't compatible+        # # at all (importing it fails), so all tests are skipped as per the module's `pytestmark`. We keep the xfail marker if this ever+        # # changes:d with cloudpickle.         pytest.param(model_factory(), True, marks=cloudpickle_pypy_xfail),
pydantic-core pypi
2.47.0 1mo ago incident on record
YANK ×3BURST
latest 2.47.0 versions 156 maintainers 1
2.41.4
2.41.5
2.42.0
2.43.0
2.44.0
2.45.0
2.46.0
2.46.1
2.46.2
2.46.3
2.46.4
2.47.0
YANK
2.41.3 marked yanked (still downloadable)
high · registry-verified · 2025-10-13 · 9mo ago
YANK
2.43.0 marked yanked (still downloadable)
high · registry-verified · 2026-03-27 · 3mo ago
YANK
2.44.0 marked yanked (still downloadable)
high · registry-verified · 2026-03-27 · 3mo ago
BURST
2 releases in 44m: 2.6.2, 2.6.3
info · registry-verified · 2023-08-23 · 2y ago
release diff 2.46.4 → 2.47.0
+0 added · -1 removed · ~59 modified
+16 more files not shown
Cargo.toml +1 lines
--- +++ @@ -2,3 +2,3 @@ name = "pydantic-core"-version = "2.46.4"+version = "2.47.0" edition = "2024"
pyproject.toml +4 lines
--- +++ @@ -1,3 +1,3 @@ [build-system]-requires = ['maturin>=1.10,<2']+requires = ['maturin>=1.13.3,<2'] build-backend = 'maturin'@@ -7,3 +7,3 @@ description = "Core functionality for Pydantic validation and serialization"-requires-python = '>=3.9'+requires-python = '>=3.10' license = 'MIT'@@ -23,3 +23,2 @@     'Programming Language :: Python :: 3 :: Only',-    'Programming Language :: Python :: 3.9',     'Programming Language :: Python :: 3.10',@@ -98,3 +97,3 @@ line-length = 120-target-version = 'py39'+target-version = 'py310' @@ -118,8 +117,3 @@ log_format = '%(name)s %(levelname)s: %(message)s'-filterwarnings = [-    'error',-    # Python 3.9 and below allowed truncation of float to integers in some-    # cases, by not making this an error we can test for this behaviour-    'ignore:(.+)Implicit conversion to integers using __int__ is deprecated',-]+filterwarnings = ['error'] timeout = 30
python/pydantic_core/core_schema.py +122 lines
--- +++ @@ -9,3 +9,3 @@ import warnings-from collections.abc import Generator, Hashable, Mapping+from collections.abc import Callable, Generator, Hashable, Mapping from datetime import date, datetime, time, timedelta@@ -13,3 +13,3 @@ from re import Pattern-from typing import TYPE_CHECKING, Any, Callable, Literal, Union+from typing import TYPE_CHECKING, Any, Literal @@ -23,3 +23,5 @@ if sys.version_info < (3, 11):-    from typing_extensions import Protocol, Required, TypeAlias+    from typing import TypeAlias++    from typing_extensions import Protocol, Required else:@@ -39,3 +41,3 @@ -ExtraBehavior = Literal['allow', 'forbid', 'ignore']+ExtraBehavior: TypeAlias = Literal['allow', 'forbid', 'ignore'] @@ -119,3 +121,3 @@     regex_engine: Literal['rust-regex', 'python-re']  # default: 'rust-regex'-    cache_strings: Union[bool, Literal['all', 'keys', 'none']]  # default: 'True'+    cache_strings: bool | Literal['all', 'keys', 'none']  # default: 'True'     validate_by_alias: bool  # default: True@@ -243,3 +245,3 @@ -ExpectedSerializationTypes = Literal[+ExpectedSerializationTypes: TypeAlias = Literal[     'none',@@ -284,17 +286,17 @@ # (input_value: Any, /) -> Any-GeneralPlainNoInfoSerializerFunction = Callable[[Any], Any]+GeneralPlainNoInfoSerializerFunction: TypeAlias = Callable[[Any], Any] # (input_value: Any, info: FieldSerializationInfo, /) -> Any-GeneralPlainInfoSerializerFunction = Callable[[Any, SerializationInfo[Any]], Any]+GeneralPlainInfoSerializerFunction: TypeAlias = Callable[[Any, SerializationInfo[Any]], Any] # (model: Any, input_value: Any, /) -> Any-FieldPlainNoInfoSerializerFunction = Callable[[Any, Any], Any]+FieldPlainNoInfoSerializerFunction: TypeAlias = Callable[[Any, Any], Any] # (model: Any, input_value: Any, info: FieldSerializationInfo, /) -> Any-FieldPlainInfoSerializerFunction = Callable[[Any, Any, FieldSerializationInfo[Any]], Any]-SerializerFunction = Union[-    GeneralPlainNoInfoSerializerFunction,-    GeneralPlainInfoSerializerFunction,-    FieldPlainNoInfoSerializerFunction,-    FieldPlainInfoSerializerFunction,-]--WhenUsed = Literal['always', 'unless-none', 'json', 'json-unless-none']+FieldPlainInfoSerializerFunction: TypeAlias = Callable[[Any, Any, FieldSerializationInfo[Any]], Any]+SerializerFunction: TypeAlias = (+    GeneralPlainNoInfoSerializerFunction+    | GeneralPlainInfoSerializerFunction+    | FieldPlainNoInfoSerializerFunction+    | FieldPlainInfoSerializerFunction+)++WhenUsed: TypeAlias = Literal['always', 'unless-none', 'json', 'json-unless-none'] """@@ -355,15 +357,19 @@ # (input_value: Any, serializer: SerializerFunctionWrapHandler, /) -> Any-GeneralWrapNoInfoSerializerFunction = Callable[[Any, SerializerFunctionWrapHandler], Any]+GeneralWrapNoInfoSerializerFunction: TypeAlias = Callable[[Any, SerializerFunctionWrapHandler], Any] # (input_value: Any, serializer: SerializerFunctionWrapHandler, info: SerializationInfo, /) -> Any-GeneralWrapInfoSerializerFunction = Callable[[Any, SerializerFunctionWrapHandler, SerializationInfo[Any]], Any]+GeneralWrapInfoSerializerFunction: TypeAlias = Callable[+    [Any, SerializerFunctionWrapHandler, SerializationInfo[Any]], Any+] # (model: Any, input_value: Any, serializer: SerializerFunctionWrapHandler, /) -> Any-FieldWrapNoInfoSerializerFunction = Callable[[Any, Any, SerializerFunctionWrapHandler], Any]+FieldWrapNoInfoSerializerFunction: TypeAlias = Callable[[Any, Any, SerializerFunctionWrapHandler], Any] # (model: Any, input_value: Any, serializer: SerializerFunctionWrapHandler, info: FieldSerializationInfo, /) -> Any-FieldWrapInfoSerializerFunction = Callable[[Any, Any, SerializerFunctionWrapHandler, FieldSerializationInfo[Any]], Any]-WrapSerializerFunction = Union[-    GeneralWrapNoInfoSerializerFunction,-    GeneralWrapInfoSerializerFunction,-    FieldWrapNoInfoSerializerFunction,-    FieldWrapInfoSerializerFunction,+FieldWrapInfoSerializerFunction: TypeAlias = Callable[+    [Any, Any, SerializerFunctionWrapHandler, FieldSerializationInfo[Any]], Any ]+WrapSerializerFunction: TypeAlias = (+    GeneralWrapNoInfoSerializerFunction+    | GeneralWrapInfoSerializerFunction+    | FieldWrapNoInfoSerializerFunction+    | FieldWrapInfoSerializerFunction+) @@ -471,10 +477,10 @@ -SerSchema = Union[-    SimpleSerSchema,-    PlainSerializerFunctionSerSchema,-    WrapSerializerFunctionSerSchema,-    FormatSerSchema,-    ToStringSerSchema,-    ModelSerSchema,-]+SerSchema: TypeAlias = (+    SimpleSerSchema+    | PlainSerializerFunctionSerSchema+    | WrapSerializerFunctionSerSchema+    | FormatSerSchema+    | ToStringSerSchema+    | ModelSerSchema+) @@ -874,3 +880,3 @@     type: Required[Literal['str']]-    pattern: Union[str, Pattern[str]]+    pattern: str | Pattern[str]     max_length: int@@ -1074,3 +1080,3 @@     gt: time-    tz_constraint: Union[Literal['aware', 'naive'], int]+    tz_constraint: Literal['aware', 'naive'] | int     microseconds_precision: Literal['truncate', 'error']@@ -1141,3 +1147,3 @@     now_op: Literal['past', 'future']-    tz_constraint: Union[Literal['aware', 'naive'], int]+    tz_constraint: Literal['aware', 'naive'] | int     # defaults to current local utc offset from `time.localtime().tm_gmtoff`@@ -1544,3 +1550,3 @@ -IncExSeqOrElseSerSchema = Union[IncExSeqSerSchema, SerSchema]+IncExSeqOrElseSerSchema: TypeAlias = IncExSeqSerSchema | SerSchema @@ -1937,3 +1943,3 @@ -IncExDict = set[Union[int, str]]+IncExDict: TypeAlias = set[int | str] @@ -1950,3 +1956,3 @@ -IncExDictOrElseSerSchema = Union[IncExDictSerSchema, SerSchema]+IncExDictOrElseSerSchema: TypeAlias = IncExDictSerSchema | SerSchema @@ -2017,3 +2023,3 @@ # (input_value: Any, /) -> Any-NoInfoValidatorFunction = Callable[[Any], Any]+NoInfoValidatorFunction: TypeAlias = Callable[[Any], Any] @@ -2026,3 +2032,3 @@ # (input_value: Any, info: ValidationInfo, /) -> Any-WithInfoValidatorFunction = Callable[[Any, ValidationInfo[Any]], Any]+WithInfoValidatorFunction: TypeAlias = Callable[[Any, ValidationInfo[Any]], Any] @@ -2035,3 +2041,3 @@ -ValidationFunction = Union[NoInfoValidatorFunctionSchema, WithInfoValidatorFunctionSchema]+ValidationFunction: TypeAlias = NoInfoValidatorFunctionSchema | WithInfoValidatorFunctionSchema @@ -2264,3 +2270,3 @@ # (input_value: Any, validator: ValidatorFunctionWrapHandler, /) -> Any-NoInfoWrapValidatorFunction = Callable[[Any, ValidatorFunctionWrapHandler], Any]+NoInfoWrapValidatorFunction: TypeAlias = Callable[[Any, ValidatorFunctionWrapHandler], Any] @@ -2273,3 +2279,3 @@ # (input_value: Any, validator: ValidatorFunctionWrapHandler, info: ValidationInfo, /) -> Any-WithInfoWrapValidatorFunction = Callable[[Any, ValidatorFunctionWrapHandler, ValidationInfo[Any]], Any]+WithInfoWrapValidatorFunction: TypeAlias = Callable[[Any, ValidatorFunctionWrapHandler, ValidationInfo[Any]], Any] @@ -2282,3 +2288,3 @@ -WrapValidatorFunction = Union[NoInfoWrapValidatorFunctionSchema, WithInfoWrapValidatorFunctionSchema]+WrapValidatorFunction: TypeAlias = NoInfoWrapValidatorFunctionSchema | WithInfoWrapValidatorFunctionSchema @@ -2505,3 +2511,3 @@     default: Any-    default_factory: Union[Callable[[], Any], Callable[[dict[str, Any]], Any]]+    default_factory: Callable[[], Any] | Callable[[dict[str, Any]], Any]     default_factory_takes_data: bool@@ -2519,3 +2525,3 @@     default: Any = PydanticUndefined,-    default_factory: Union[Callable[[], Any], Callable[[dict[str, Any]], Any], None] = None,+    default_factory: Callable[[], Any] | Callable[[dict[str, Any]], Any] | None = None,     default_factory_takes_data: bool | None = None,@@ -2613,3 +2619,3 @@     type: Required[Literal['union']]-    choices: Required[list[Union[CoreSchema, tuple[CoreSchema, str]]]]+    choices: Required[list[CoreSchema | tuple[CoreSchema, str]]]     # default true, whether to automatically collapse unions with one element to the inner validator@@ -2618,3 +2624,3 @@     custom_error_message: str-    custom_error_context: dict[str, Union[str, int, float]]+    custom_error_context: dict[str, str | int | float]     mode: Literal['smart', 'left_to_right']  # default: 'smart'@@ -2680,6 +2686,6 @@     choices: Required[dict[Hashable, CoreSchema]]-    discriminator: Required[Union[str, list[Union[str, int]], list[list[Union[str, int]]], Callable[[Any], Hashable]]]+    discriminator: Required[str | list[str | int] | list[list[str | int]] | Callable[[Any], Hashable]]     custom_error_type: str     custom_error_message: str-    custom_error_context: dict[str, Union[str, int, float]]+    custom_error_context: dict[str, str | int | float]     strict: bool@@ -2941,3 +2947,3 @@     required: bool-    validation_alias: Union[str, list[Union[str, int]], list[list[Union[str, int]]]]+    validation_alias: str | list[str | int] | list[list[str | int]]     serialization_alias: str@@ -3072,3 +3078,3 @@     schema: Required[CoreSchema]-    validation_alias: Union[str, list[Union[str, int]], list[list[Union[str, int]]]]+    validation_alias: str | list[str | int] | list[list[str | int]]     serialization_alias: str@@ -3303,3 +3309,3 @@     frozen: bool  # default: False-    validation_alias: Union[str, list[Union[str, int]], list[list[Union[str, int]]]]+    validation_alias: str | list[str | int] | list[list[str | int]]     serialization_alias: str@@ -3511,3 +3517,3 @@     mode: Literal['positional_only', 'positional_or_keyword', 'keyword_only']  # default positional_or_keyword-    alias: Union[str, list[Union[str, int]], list[list[Union[str, int]]]]+    alias: str | list[str | int] | list[list[str | int]] @@ -3627,3 +3633,3 @@     ]  # default positional_or_keyword-    alias: Union[str, list[Union[str, int]], list[list[Union[str, int]]]]+    alias: str | list[str | int] | list[list[str | int]] @@ -3800,3 +3806,3 @@     custom_error_message: str-    custom_error_context: dict[str, Union[str, int, float]]+    custom_error_context: dict[str, str | int | float]     ref: str@@ -4121,56 +4127,56 @@ if not MYPY:-    CoreSchema = Union[-        InvalidSchema,-        AnySchema,-        NoneSchema,-        BoolSchema,-        IntSchema,-        FloatSchema,-        DecimalSchema,-        StringSchema,-        BytesSchema,-        DateSchema,-        TimeSchema,-        DatetimeSchema,-        TimedeltaSchema,-        LiteralSchema,-        MissingSentinelSchema,-        EnumSchema,
… 107 more lines (truncated)
src/self_schema.py +6852 lines
--- +++ @@ -1,2 +1,6853 @@ # this file is auto-generated by generate_self_schema.py, DO NOT edit manually-self_schema = {'type': 'definitions', 'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'definitions': [{'type': 'tagged-union', 'choices': {'invalid': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['invalid']}, 'required': True}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'any': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['any']}, 'required': True}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'none': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none']}, 'required': True}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'bool': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['bool']}, 'required': True}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'int': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['int']}, 'required': True}, 'multiple_of': {'schema': {'type': 'int'}, 'required': False}, 'le': {'schema': {'type': 'int'}, 'required': False}, 'ge': {'schema': {'type': 'int'}, 'required': False}, 'lt': {'schema': {'type': 'int'}, 'required': False}, 'gt': {'schema': {'type': 'int'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'float': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['float']}, 'required': True}, 'allow_inf_nan': {'schema': {'type': 'bool'}, 'required': False}, 'multiple_of': {'schema': {'type': 'float'}, 'required': False}, 'le': {'schema': {'type': 'float'}, 'required': False}, 'ge': {'schema': {'type': 'float'}, 'required': False}, 'lt': {'schema': {'type': 'float'}, 'required': False}, 'gt': {'schema': {'type': 'float'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'decimal': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['decimal']}, 'required': True}, 'allow_inf_nan': {'schema': {'type': 'bool'}, 'required': False}, 'multiple_of': {'schema': {'type': 'decimal'}, 'required': False}, 'le': {'schema': {'type': 'decimal'}, 'required': False}, 'ge': {'schema': {'type': 'decimal'}, 'required': False}, 'lt': {'schema': {'type': 'decimal'}, 'required': False}, 'gt': {'schema': {'type': 'decimal'}, 'required': False}, 'max_digits': {'schema': {'type': 'int'}, 'required': False}, 'decimal_places': {'schema': {'type': 'int'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'str': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['str']}, 'required': True}, 'pattern': {'schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'any'}]}, 'required': False}, 'max_length': {'schema': {'type': 'int'}, 'required': False}, 'min_length': {'schema': {'type': 'int'}, 'required': False}, 'strip_whitespace': {'schema': {'type': 'bool'}, 'required': False}, 'to_lower': {'schema': {'type': 'bool'}, 'required': False}, 'to_upper': {'schema': {'type': 'bool'}, 'required': False}, 'regex_engine': {'schema': {'type': 'literal', 'expected': ['rust-regex', 'python-re']}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'coerce_numbers_to_str': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'bytes': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['bytes']}, 'required': True}, 'max_length': {'schema': {'type': 'int'}, 'required': False}, 'min_length': {'schema': {'type': 'int'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'date': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['date']}, 'required': True}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'le': {'schema': {'type': 'date'}, 'required': False}, 'ge': {'schema': {'type': 'date'}, 'required': False}, 'lt': {'schema': {'type': 'date'}, 'required': False}, 'gt': {'schema': {'type': 'date'}, 'required': False}, 'now_op': {'schema': {'type': 'literal', 'expected': ['past', 'future']}, 'required': False}, 'now_utc_offset': {'schema': {'type': 'int', 'gt': -86400, 'lt': 86400}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'time': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['time']}, 'required': True}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'le': {'schema': {'type': 'time'}, 'required': False}, 'ge': {'schema': {'type': 'time'}, 'required': False}, 'lt': {'schema': {'type': 'time'}, 'required': False}, 'gt': {'schema': {'type': 'time'}, 'required': False}, 'tz_constraint': {'schema': {'type': 'union', 'choices': [{'type': 'literal', 'expected': ['aware', 'naive']}, {'type': 'int'}]}, 'required': False}, 'microseconds_precision': {'schema': {'type': 'literal', 'expected': ['truncate', 'error']}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'datetime': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['datetime']}, 'required': True}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'le': {'schema': {'type': 'datetime'}, 'required': False}, 'ge': {'schema': {'type': 'datetime'}, 'required': False}, 'lt': {'schema': {'type': 'datetime'}, 'required': False}, 'gt': {'schema': {'type': 'datetime'}, 'required': False}, 'now_op': {'schema': {'type': 'literal', 'expected': ['past', 'future']}, 'required': False}, 'tz_constraint': {'schema': {'type': 'union', 'choices': [{'type': 'literal', 'expected': ['aware', 'naive']}, {'type': 'int'}]}, 'required': False}, 'now_utc_offset': {'schema': {'type': 'int', 'gt': -86400, 'lt': 86400}, 'required': False}, 'microseconds_precision': {'schema': {'type': 'literal', 'expected': ['truncate', 'error']}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'timedelta': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['timedelta']}, 'required': True}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'le': {'schema': {'type': 'timedelta'}, 'required': False}, 'ge': {'schema': {'type': 'timedelta'}, 'required': False}, 'lt': {'schema': {'type': 'timedelta'}, 'required': False}, 'gt': {'schema': {'type': 'timedelta'}, 'required': False}, 'microseconds_precision': {'schema': {'type': 'literal', 'expected': ['truncate', 'error']}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'literal': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['literal']}, 'required': True}, 'expected': {'schema': {'type': 'list', 'items_schema': {'type': 'any'}}, 'required': True}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'enum': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['enum']}, 'required': True}, 'cls': {'schema': {'type': 'any'}, 'required': True}, 'members': {'schema': {'type': 'list', 'items_schema': {'type': 'any'}}, 'required': True}, 'sub_type': {'schema': {'type': 'literal', 'expected': ['str', 'int', 'float']}, 'required': False}, 'missing': {'schema': {'type': 'callable'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'is-instance': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['is-instance']}, 'required': True}, 'cls': {'schema': {'type': 'any'}, 'required': True}, 'cls_repr': {'schema': {'type': 'str'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'is-subclass': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['is-subclass']}, 'required': True}, 'cls': {'schema': {'type': 'any'}, 'required': True}, 'cls_repr': {'schema': {'type': 'str'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'callable': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['callable']}, 'required': True}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'list': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['list']}, 'required': True}, 'items_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'min_length': {'schema': {'type': 'int'}, 'required': False}, 'max_length': {'schema': {'type': 'int'}, 'required': False}, 'fail_fast': {'schema': {'type': 'bool'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'tagged-union', 'discriminator': 'type', 'choices': {'include-exclude-sequence': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['include-exclude-sequence']}, 'required': True}, 'include': {'schema': {'type': 'set', 'items_schema': {'type': 'int'}}, 'required': False}, 'exclude': {'schema': {'type': 'set', 'items_schema': {'type': 'int'}}, 'required': False}}, 'extra_behavior': 'forbid'}, 'none': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'int': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'bool': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'float': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'str': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'bytes': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'bytearray': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'list': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'tuple': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'set': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'frozenset': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'generator': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'dict': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'datetime': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'date': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'time': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'timedelta': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'url': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'multi-host-url': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'json': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'uuid': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'any': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'function-plain': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['function-plain']}, 'required': True}, 'function': {'schema': {'type': 'union', 'choices': [{'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}]}, 'required': True}, 'is_field_serializer': {'schema': {'type': 'bool'}, 'required': False}, 'info_arg': {'schema': {'type': 'bool'}, 'required': False}, 'return_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'function-wrap': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['function-wrap']}, 'required': True}, 'function': {'schema': {'type': 'union', 'choices': [{'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}]}, 'required': True}, 'is_field_serializer': {'schema': {'type': 'bool'}, 'required': False}, 'info_arg': {'schema': {'type': 'bool'}, 'required': False}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'return_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'format': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['format']}, 'required': True}, 'formatting_string': {'schema': {'type': 'str'}, 'required': True}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'to-string': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['to-string']}, 'required': True}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'model': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['model']}, 'required': True}, 'cls': {'schema': {'type': 'any'}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}}, 'extra_behavior': 'forbid'}}}, 'required': False}}, 'extra_behavior': 'forbid'}, 'tuple': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['tuple']}, 'required': True}, 'items_schema': {'schema': {'type': 'list', 'items_schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}}, 'required': True}, 'variadic_item_index': {'schema': {'type': 'int'}, 'required': False}, 'min_length': {'schema': {'type': 'int'}, 'required': False}, 'max_length': {'schema': {'type': 'int'}, 'required': False}, 'fail_fast': {'schema': {'type': 'bool'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'tagged-union', 'discriminator': 'type', 'choices': {'include-exclude-sequence': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['include-exclude-sequence']}, 'required': True}, 'include': {'schema': {'type': 'set', 'items_schema': {'type': 'int'}}, 'required': False}, 'exclude': {'schema': {'type': 'set', 'items_schema': {'type': 'int'}}, 'required': False}}, 'extra_behavior': 'forbid'}, 'none': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'int': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'bool': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'float': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'str': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'bytes': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'bytearray': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'list': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'tuple': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'set': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'frozenset': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'generator': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'dict': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'datetime': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'date': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'time': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'timedelta': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'url': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'multi-host-url': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'json': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'uuid': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'any': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'function-plain': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['function-plain']}, 'required': True}, 'function': {'schema': {'type': 'union', 'choices': [{'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}]}, 'required': True}, 'is_field_serializer': {'schema': {'type': 'bool'}, 'required': False}, 'info_arg': {'schema': {'type': 'bool'}, 'required': False}, 'return_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'function-wrap': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['function-wrap']}, 'required': True}, 'function': {'schema': {'type': 'union', 'choices': [{'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}]}, 'required': True}, 'is_field_serializer': {'schema': {'type': 'bool'}, 'required': False}, 'info_arg': {'schema': {'type': 'bool'}, 'required': False}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'return_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'format': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['format']}, 'required': True}, 'formatting_string': {'schema': {'type': 'str'}, 'required': True}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'to-string': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['to-string']}, 'required': True}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'model': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['model']}, 'required': True}, 'cls': {'schema': {'type': 'any'}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}}, 'extra_behavior': 'forbid'}}}, 'required': False}}, 'extra_behavior': 'forbid'}, 'set': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['set']}, 'required': True}, 'items_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'min_length': {'schema': {'type': 'int'}, 'required': False}, 'max_length': {'schema': {'type': 'int'}, 'required': False}, 'fail_fast': {'schema': {'type': 'bool'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'frozenset': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['frozenset']}, 'required': True}, 'items_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'min_length': {'schema': {'type': 'int'}, 'required': False}, 'max_length': {'schema': {'type': 'int'}, 'required': False}, 'fail_fast': {'schema': {'type': 'bool'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'generator': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['generator']}, 'required': True}, 'items_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'min_length': {'schema': {'type': 'int'}, 'required': False}, 'max_length': {'schema': {'type': 'int'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'tagged-union', 'discriminator': 'type', 'choices': {'include-exclude-sequence': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['include-exclude-sequence']}, 'required': True}, 'include': {'schema': {'type': 'set', 'items_schema': {'type': 'int'}}, 'required': False}, 'exclude': {'schema': {'type': 'set', 'items_schema': {'type': 'int'}}, 'required': False}}, 'extra_behavior': 'forbid'}, 'none': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'int': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'bool': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'float': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'str': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'bytes': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'bytearray': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'list': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'tuple': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'set': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'frozenset': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'generator': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'dict': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'datetime': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'date': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'time': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'timedelta': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'url': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'multi-host-url': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'json': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'uuid': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'any': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'function-plain': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['function-plain']}, 'required': True}, 'function': {'schema': {'type': 'union', 'choices': [{'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}]}, 'required': True}, 'is_field_serializer': {'schema': {'type': 'bool'}, 'required': False}, 'info_arg': {'schema': {'type': 'bool'}, 'required': False}, 'return_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'function-wrap': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['function-wrap']}, 'required': True}, 'function': {'schema': {'type': 'union', 'choices': [{'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}]}, 'required': True}, 'is_field_serializer': {'schema': {'type': 'bool'}, 'required': False}, 'info_arg': {'schema': {'type': 'bool'}, 'required': False}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'return_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'format': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['format']}, 'required': True}, 'formatting_string': {'schema': {'type': 'str'}, 'required': True}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'to-string': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['to-string']}, 'required': True}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'model': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['model']}, 'required': True}, 'cls': {'schema': {'type': 'any'}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}}, 'extra_behavior': 'forbid'}}}, 'required': False}}, 'extra_behavior': 'forbid'}, 'dict': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['dict']}, 'required': True}, 'keys_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'values_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'min_length': {'schema': {'type': 'int'}, 'required': False}, 'max_length': {'schema': {'type': 'int'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'tagged-union', 'discriminator': 'type', 'choices': {'include-exclude-dict': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['include-exclude-dict']}, 'required': True}, 'include': {'schema': {'type': 'set', 'items_schema': {'type': 'union', 'choices': [{'type': 'int'}, {'type': 'str'}]}}, 'required': False}, 'exclude': {'schema': {'type': 'set', 'items_schema': {'type': 'union', 'choices': [{'type': 'int'}, {'type': 'str'}]}}, 'required': False}}, 'extra_behavior': 'forbid'}, 'none': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'int': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'bool': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'float': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'str': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'bytes': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'bytearray': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'list': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'tuple': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'set': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'frozenset': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'generator': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'dict': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'datetime': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'date': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'time': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'timedelta': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'url': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'multi-host-url': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'json': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'uuid': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'any': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'function-plain': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['function-plain']}, 'required': True}, 'function': {'schema': {'type': 'union', 'choices': [{'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}]}, 'required': True}, 'is_field_serializer': {'schema': {'type': 'bool'}, 'required': False}, 'info_arg': {'schema': {'type': 'bool'}, 'required': False}, 'return_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'function-wrap': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['function-wrap']}, 'required': True}, 'function': {'schema': {'type': 'union', 'choices': [{'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}]}, 'required': True}, 'is_field_serializer': {'schema': {'type': 'bool'}, 'required': False}, 'info_arg': {'schema': {'type': 'bool'}, 'required': False}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'return_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'format': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['format']}, 'required': True}, 'formatting_string': {'schema': {'type': 'str'}, 'required': True}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'to-string': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['to-string']}, 'required': True}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'model': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['model']}, 'required': True}, 'cls': {'schema': {'type': 'any'}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}}, 'extra_behavior': 'forbid'}}}, 'required': False}}, 'extra_behavior': 'forbid'}, 'function-after': {'type': 'typed-dict', 'fields': {'function': {'schema': {'type': 'union', 'choices': [{'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['no-info']}, 'required': True}, 'function': {'schema': {'type': 'callable'}, 'required': True}}, 'extra_behavior': 'forbid'}, {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['with-info']}, 'required': True}, 'function': {'schema': {'type': 'callable'}, 'required': True}, 'field_name': {'schema': {'type': 'str'}, 'required': False}}, 'extra_behavior': 'forbid'}]}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}, 'type': {'schema': {'type': 'literal', 'expected': ['function-after']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'function-before': {'type': 'typed-dict', 'fields': {'function': {'schema': {'type': 'union', 'choices': [{'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['no-info']}, 'required': True}, 'function': {'schema': {'type': 'callable'}, 'required': True}}, 'extra_behavior': 'forbid'}, {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['with-info']}, 'required': True}, 'function': {'schema': {'type': 'callable'}, 'required': True}, 'field_name': {'schema': {'type': 'str'}, 'required': False}}, 'extra_behavior': 'forbid'}]}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}, 'type': {'schema': {'type': 'literal', 'expected': ['function-before']}, 'required': True}, 'json_schema_input_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'function-wrap': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['function-wrap']}, 'required': True}, 'function': {'schema': {'type': 'union', 'choices': [{'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['no-info']}, 'required': True}, 'function': {'schema': {'type': 'callable'}, 'required': True}}, 'extra_behavior': 'forbid'}, {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['with-info']}, 'required': True}, 'function': {'schema': {'type': 'callable'}, 'required': True}, 'field_name': {'schema': {'type': 'str'}, 'required': False}}, 'extra_behavior': 'forbid'}]}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'json_schema_input_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'function-plain': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['function-plain']}, 'required': True}, 'function': {'schema': {'type': 'union', 'choices': [{'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['no-info']}, 'required': True}, 'function': {'schema': {'type': 'callable'}, 'required': True}}, 'extra_behavior': 'forbid'}, {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['with-info']}, 'required': True}, 'function': {'schema': {'type': 'callable'}, 'required': True}, 'field_name': {'schema': {'type': 'str'}, 'required': False}}, 'extra_behavior': 'forbid'}]}, 'required': True}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'json_schema_input_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'default': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['default']}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'default': {'schema': {'type': 'any'}, 'required': False}, 'default_factory': {'schema': {'type': 'union', 'choices': [{'type': 'callable'}, {'type': 'callable'}]}, 'required': False}, 'default_factory_takes_data': {'schema': {'type': 'bool'}, 'required': False}, 'on_error': {'schema': {'type': 'literal', 'expected': ['raise', 'omit', 'default']}, 'required': False}, 'validate_default': {'schema': {'type': 'bool'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'nullable': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['nullable']}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'union': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['union']}, 'required': True}, 'choices': {'schema': {'type': 'list', 'items_schema': {'type': 'union', 'choices': [{'type': 'definition-ref', 'schema_ref': 'root-schema'}, {'type': 'tuple', 'items_schema': [{'type': 'definition-ref', 'schema_ref': 'root-schema'}, {'type': 'str'}]}]}}, 'required': True}, 'auto_collapse': {'schema': {'type': 'bool'}, 'required': False}, 'custom_error_type': {'schema': {'type': 'str'}, 'required': False}, 'custom_error_message': {'schema': {'type': 'str'}, 'required': False}, 'custom_error_context': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'int'}, {'type': 'float'}]}}, 'required': False}, 'mode': {'schema': {'type': 'literal', 'expected': ['smart', 'left_to_right']}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'tagged-union': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['tagged-union']}, 'required': True}, 'choices': {'schema': {'type': 'dict', 'keys_schema': {'type': 'any'}, 'values_schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}}, 'required': True}, 'discriminator': {'schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'list', 'items_schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'int'}]}}, {'type': 'list', 'items_schema': {'type': 'list', 'items_schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'int'}]}}}, {'type': 'callable'}]}, 'required': True}, 'custom_error_type': {'schema': {'type': 'str'}, 'required': False}, 'custom_error_message': {'schema': {'type': 'str'}, 'required': False}, 'custom_error_context': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'int'}, {'type': 'float'}]}}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'from_attributes': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'chain': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['chain']}, 'required': True}, 'steps': {'schema': {'type': 'list', 'items_schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}}, 'required': True}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'lax-or-strict': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['lax-or-strict']}, 'required': True}, 'lax_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'strict_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'json-or-python': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['json-or-python']}, 'required': True}, 'json_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'python_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'typed-dict': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['typed-dict']}, 'required': True}, 'fields': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['typed-dict-field']}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'required': {'schema': {'type': 'bool'}, 'required': False}, 'validation_alias': {'schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'list', 'items_schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'int'}]}}, {'type': 'list', 'items_schema': {'type': 'list', 'items_schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'int'}]}}}]}, 'required': False}, 'serialization_alias': {'schema': {'type': 'str'}, 'required': False}, 'serialization_exclude': {'schema': {'type': 'bool'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}}, 'extra_behavior': 'forbid'}}, 'required': True}, 'cls': {'schema': {'type': 'any'}, 'required': False}, 'cls_name': {'schema': {'type': 'str'}, 'required': False}, 'computed_fields': {'schema': {'type': 'list', 'items_schema': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['computed-field']}, 'required': True}, 'property_name': {'schema': {'type': 'str'}, 'required': True}, 'return_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'alias': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}}, 'extra_behavior': 'forbid'}}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'extras_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'extra_behavior': {'schema': {'type': 'literal', 'expected': ['allow', 'forbid', 'ignore']}, 'required': False}, 'total': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}, 'config': {'schema': {'type': 'typed-dict', 'fields': {'title': {'schema': {'type': 'str'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'extra_fields_behavior': {'schema': {'type': 'literal', 'expected': ['allow', 'forbid', 'ignore']}, 'required': False}, 'typed_dict_total': {'schema': {'type': 'bool'}, 'required': False}, 'from_attributes': {'schema': {'type': 'bool'}, 'required': False}, 'loc_by_alias': {'schema': {'type': 'bool'}, 'required': False}, 'revalidate_instances': {'schema': {'type': 'literal', 'expected': ['always', 'never', 'subclass-instances']}, 'required': False}, 'validate_default': {'schema': {'type': 'bool'}, 'required': False}, 'str_max_length': {'schema': {'type': 'int'}, 'required': False}, 'str_min_length': {'schema': {'type': 'int'}, 'required': False}, 'str_strip_whitespace': {'schema': {'type': 'bool'}, 'required': False}, 'str_to_lower': {'schema': {'type': 'bool'}, 'required': False}, 'str_to_upper': {'schema': {'type': 'bool'}, 'required': False}, 'allow_inf_nan': {'schema': {'type': 'bool'}, 'required': False}, 'ser_json_timedelta': {'schema': {'type': 'literal', 'expected': ['iso8601', 'float']}, 'required': False}, 'ser_json_bytes': {'schema': {'type': 'literal', 'expected': ['utf8', 'base64', 'hex']}, 'required': False}, 'ser_json_inf_nan': {'schema': {'type': 'literal', 'expected': ['null', 'constants', 'strings']}, 'required': False}, 'val_json_bytes': {'schema': {'type': 'literal', 'expected': ['utf8', 'base64', 'hex']}, 'required': False}, 'hide_input_in_errors': {'schema': {'type': 'bool'}, 'required': False}, 'validation_error_cause': {'schema': {'type': 'bool'}, 'required': False}, 'coerce_numbers_to_str': {'schema': {'type': 'bool'}, 'required': False}, 'regex_engine': {'schema': {'type': 'literal', 'expected': ['rust-regex', 'python-re']}, 'required': False}, 'cache_strings': {'schema': {'type': 'union', 'choices': [{'type': 'bool'}, {'type': 'literal', 'expected': ['all', 'keys', 'none']}]}, 'required': False}, 'validate_by_alias': {'schema': {'type': 'bool'}, 'required': False}, 'validate_by_name': {'schema': {'type': 'bool'}, 'required': False}, 'serialize_by_alias': {'schema': {'type': 'bool'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'model-fields': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['model-fields']}, 'required': True}, 'fields': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['model-field']}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'validation_alias': {'schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'list', 'items_schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'int'}]}}, {'type': 'list', 'items_schema': {'type': 'list', 'items_schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'int'}]}}}]}, 'required': False}, 'serialization_alias': {'schema': {'type': 'str'}, 'required': False}, 'serialization_exclude': {'schema': {'type': 'bool'}, 'required': False}, 'frozen': {'schema': {'type': 'bool'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}}, 'extra_behavior': 'forbid'}}, 'required': True}, 'model_name': {'schema': {'type': 'str'}, 'required': False}, 'computed_fields': {'schema': {'type': 'list', 'items_schema': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['computed-field']}, 'required': True}, 'property_name': {'schema': {'type': 'str'}, 'required': True}, 'return_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'alias': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}}, 'extra_behavior': 'forbid'}}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'extras_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'extras_keys_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'extra_behavior': {'schema': {'type': 'literal', 'expected': ['allow', 'forbid', 'ignore']}, 'required': False}, 'from_attributes': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'model': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['model']}, 'required': True}, 'cls': {'schema': {'type': 'any'}, 'required': True}, 'generic_origin': {'schema': {'type': 'any'}, 'required': False}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'custom_init': {'schema': {'type': 'bool'}, 'required': False}, 'root_model': {'schema': {'type': 'bool'}, 'required': False}, 'post_init': {'schema': {'type': 'str'}, 'required': False}, 'revalidate_instances': {'schema': {'type': 'literal', 'expected': ['always', 'never', 'subclass-instances']}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'frozen': {'schema': {'type': 'bool'}, 'required': False}, 'extra_behavior': {'schema': {'type': 'literal', 'expected': ['allow', 'forbid', 'ignore']}, 'required': False}, 'config': {'schema': {'type': 'typed-dict', 'fields': {'title': {'schema': {'type': 'str'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'extra_fields_behavior': {'schema': {'type': 'literal', 'expected': ['allow', 'forbid', 'ignore']}, 'required': False}, 'typed_dict_total': {'schema': {'type': 'bool'}, 'required': False}, 'from_attributes': {'schema': {'type': 'bool'}, 'required': False}, 'loc_by_alias': {'schema': {'type': 'bool'}, 'required': False}, 'revalidate_instances': {'schema': {'type': 'literal', 'expected': ['always', 'never', 'subclass-instances']}, 'required': False}, 'validate_default': {'schema': {'type': 'bool'}, 'required': False}, 'str_max_length': {'schema': {'type': 'int'}, 'required': False}, 'str_min_length': {'schema': {'type': 'int'}, 'required': False}, 'str_strip_whitespace': {'schema': {'type': 'bool'}, 'required': False}, 'str_to_lower': {'schema': {'type': 'bool'}, 'required': False}, 'str_to_upper': {'schema': {'type': 'bool'}, 'required': False}, 'allow_inf_nan': {'schema': {'type': 'bool'}, 'required': False}, 'ser_json_timedelta': {'schema': {'type': 'literal', 'expected': ['iso8601', 'float']}, 'required': False}, 'ser_json_bytes': {'schema': {'type': 'literal', 'expected': ['utf8', 'base64', 'hex']}, 'required': False}, 'ser_json_inf_nan': {'schema': {'type': 'literal', 'expected': ['null', 'constants', 'strings']}, 'required': False}, 'val_json_bytes': {'schema': {'type': 'literal', 'expected': ['utf8', 'base64', 'hex']}, 'required': False}, 'hide_input_in_errors': {'schema': {'type': 'bool'}, 'required': False}, 'validation_error_cause': {'schema': {'type': 'bool'}, 'required': False}, 'coerce_numbers_to_str': {'schema': {'type': 'bool'}, 'required': False}, 'regex_engine': {'schema': {'type': 'literal', 'expected': ['rust-regex', 'python-re']}, 'required': False}, 'cache_strings': {'schema': {'type': 'union', 'choices': [{'type': 'bool'}, {'type': 'literal', 'expected': ['all', 'keys', 'none']}]}, 'required': False}, 'validate_by_alias': {'schema': {'type': 'bool'}, 'required': False}, 'validate_by_name': {'schema': {'type': 'bool'}, 'required': False}, 'serialize_by_alias': {'schema': {'type': 'bool'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'dataclass-args': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['dataclass-args']}, 'required': True}, 'dataclass_name': {'schema': {'type': 'str'}, 'required': True}, 'fields': {'schema': {'type': 'list', 'items_schema': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['dataclass-field']}, 'required': True}, 'name': {'schema': {'type': 'str'}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'kw_only': {'schema': {'type': 'bool'}, 'required': False}, 'init': {'schema': {'type': 'bool'}, 'required': False}, 'init_only': {'schema': {'type': 'bool'}, 'required': False}, 'frozen': {'schema': {'type': 'bool'}, 'required': False}, 'validation_alias': {'schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'list', 'items_schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'int'}]}}, {'type': 'list', 'items_schema': {'type': 'list', 'items_schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'int'}]}}}]}, 'required': False}, 'serialization_alias': {'schema': {'type': 'str'}, 'required': False}, 'serialization_exclude': {'schema': {'type': 'bool'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}}, 'extra_behavior': 'forbid'}}, 'required': True}, 'computed_fields': {'schema': {'type': 'list', 'items_schema': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['computed-field']}, 'required': True}, 'property_name': {'schema': {'type': 'str'}, 'required': True}, 'return_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'alias': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}}, 'extra_behavior': 'forbid'}}, 'required': False}, 'collect_init_only': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}, 'extra_behavior': {'schema': {'type': 'literal', 'expected': ['allow', 'forbid', 'ignore']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'dataclass': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['dataclass']}, 'required': True}, 'cls': {'schema': {'type': 'any'}, 'required': True}, 'generic_origin': {'schema': {'type': 'any'}, 'required': False}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'fields': {'schema': {'type': 'list', 'items_schema': {'type': 'str'}}, 'required': True}, 'cls_name': {'schema': {'type': 'str'}, 'required': False}, 'post_init': {'schema': {'type': 'bool'}, 'required': False}, 'revalidate_instances': {'schema': {'type': 'literal', 'expected': ['always', 'never', 'subclass-instances']}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'frozen': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}, 'slots': {'schema': {'type': 'bool'}, 'required': False}, 'config': {'schema': {'type': 'typed-dict', 'fields': {'title': {'schema': {'type': 'str'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'extra_fields_behavior': {'schema': {'type': 'literal', 'expected': ['allow', 'forbid', 'ignore']}, 'required': False}, 'typed_dict_total': {'schema': {'type': 'bool'}, 'required': False}, 'from_attributes': {'schema': {'type': 'bool'}, 'required': False}, 'loc_by_alias': {'schema': {'type': 'bool'}, 'required': False}, 'revalidate_instances': {'schema': {'type': 'literal', 'expected': ['always', 'never', 'subclass-instances']}, 'required': False}, 'validate_default': {'schema': {'type': 'bool'}, 'required': False}, 'str_max_length': {'schema': {'type': 'int'}, 'required': False}, 'str_min_length': {'schema': {'type': 'int'}, 'required': False}, 'str_strip_whitespace': {'schema': {'type': 'bool'}, 'required': False}, 'str_to_lower': {'schema': {'type': 'bool'}, 'required': False}, 'str_to_upper': {'schema': {'type': 'bool'}, 'required': False}, 'allow_inf_nan': {'schema': {'type': 'bool'}, 'required': False}, 'ser_json_timedelta': {'schema': {'type': 'literal', 'expected': ['iso8601', 'float']}, 'required': False}, 'ser_json_bytes': {'schema': {'type': 'literal', 'expected': ['utf8', 'base64', 'hex']}, 'required': False}, 'ser_json_inf_nan': {'schema': {'type': 'literal', 'expected': ['null', 'constants', 'strings']}, 'required': False}, 'val_json_bytes': {'schema': {'type': 'literal', 'expected': ['utf8', 'base64', 'hex']}, 'required': False}, 'hide_input_in_errors': {'schema': {'type': 'bool'}, 'required': False}, 'validation_error_cause': {'schema': {'type': 'bool'}, 'required': False}, 'coerce_numbers_to_str': {'schema': {'type': 'bool'}, 'required': False}, 'regex_engine': {'schema': {'type': 'literal', 'expected': ['rust-regex', 'python-re']}, 'required': False}, 'cache_strings': {'schema': {'type': 'union', 'choices': [{'type': 'bool'}, {'type': 'literal', 'expected': ['all', 'keys', 'none']}]}, 'required': False}, 'validate_by_alias': {'schema': {'type': 'bool'}, 'required': False}, 'validate_by_name': {'schema': {'type': 'bool'}, 'required': False}, 'serialize_by_alias': {'schema': {'type': 'bool'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'arguments': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['arguments']}, 'required': True}, 'arguments_schema': {'schema': {'type': 'list', 'items_schema': {'type': 'typed-dict', 'fields': {'name': {'schema': {'type': 'str'}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'mode': {'schema': {'type': 'literal', 'expected': ['positional_only', 'positional_or_keyword', 'keyword_only']}, 'required': False}, 'alias': {'schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'list', 'items_schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'int'}]}}, {'type': 'list', 'items_schema': {'type': 'list', 'items_schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'int'}]}}}]}, 'required': False}}, 'extra_behavior': 'forbid'}}, 'required': True}, 'validate_by_name': {'schema': {'type': 'bool'}, 'required': False}, 'validate_by_alias': {'schema': {'type': 'bool'}, 'required': False}, 'var_args_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'var_kwargs_mode': {'schema': {'type': 'literal', 'expected': ['uniform', 'unpacked-typed-dict']}, 'required': False}, 'var_kwargs_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'arguments-v3': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['arguments-v3']}, 'required': True}, 'arguments_schema': {'schema': {'type': 'list', 'items_schema': {'type': 'typed-dict', 'fields': {'name': {'schema': {'type': 'str'}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'mode': {'schema': {'type': 'literal', 'expected': ['positional_only', 'positional_or_keyword', 'keyword_only', 'var_args', 'var_kwargs_uniform', 'var_kwargs_unpacked_typed_dict']}, 'required': False}, 'alias': {'schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'list', 'items_schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'int'}]}}, {'type': 'list', 'items_schema': {'type': 'list', 'items_schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'int'}]}}}]}, 'required': False}}, 'extra_behavior': 'forbid'}}, 'required': True}, 'validate_by_name': {'schema': {'type': 'bool'}, 'required': False}, 'validate_by_alias': {'schema': {'type': 'bool'}, 'required': False}, 'extra_behavior': {'schema': {'type': 'literal', 'expected': ['forbid', 'ignore']}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'call': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['call']}, 'required': True}, 'arguments_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'function': {'schema': {'type': 'callable'}, 'required': True}, 'function_name': {'schema': {'type': 'str'}, 'required': False}, 'return_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'custom-error': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['custom-error']}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'custom_error_type': {'schema': {'type': 'str'}, 'required': True}, 'custom_error_message': {'schema': {'type': 'str'}, 'required': False}, 'custom_error_context': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'int'}, {'type': 'float'}]}}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'json': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['json']}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'url': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['url']}, 'required': True}, 'max_length': {'schema': {'type': 'int'}, 'required': False}, 'allowed_schemes': {'schema': {'type': 'list', 'items_schema': {'type': 'str'}}, 'required': False}, 'host_required': {'schema': {'type': 'bool'}, 'required': False}, 'default_host': {'schema': {'type': 'str'}, 'required': False}, 'default_port': {'schema': {'type': 'int'}, 'required': False}, 'default_path': {'schema': {'type': 'str'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'multi-host-url': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['multi-host-url']}, 'required': True}, 'max_length': {'schema': {'type': 'int'}, 'required': False}, 'allowed_schemes': {'schema': {'type': 'list', 'items_schema': {'type': 'str'}}, 'required': False}, 'host_required': {'schema': {'type': 'bool'}, 'required': False}, 'default_host': {'schema': {'type': 'str'}, 'required': False}, 'default_port': {'schema': {'type': 'int'}, 'required': False}, 'default_path': {'schema': {'type': 'str'}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'definitions': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['definitions']}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}, 'definitions': {'schema': {'type': 'list', 'items_schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}}, 'required': True}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'definition-ref': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['definition-ref']}, 'required': True}, 'schema_ref': {'schema': {'type': 'str'}, 'required': True}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'uuid': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['uuid']}, 'required': True}, 'version': {'schema': {'type': 'literal', 'expected': [1, 3, 4, 5, 7]}, 'required': False}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}, 'complex': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['complex']}, 'required': True}, 'strict': {'schema': {'type': 'bool'}, 'required': False}, 'ref': {'schema': {'type': 'str'}, 'required': False}, 'metadata': {'schema': {'type': 'dict', 'keys_schema': {'type': 'str'}, 'values_schema': {'type': 'any'}}, 'required': False}, 'serialization': {'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'}, 'required': False}}, 'extra_behavior': 'forbid'}}, 'discriminator': 'type', 'ref': 'root-schema'}, {'type': 'tagged-union', 'discriminator': 'type', 'choices': {'none': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'int': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'bool': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'float': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'str': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'bytes': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'bytearray': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'list': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'tuple': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'set': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'frozenset': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'generator': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'dict': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'datetime': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'date': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'time': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'timedelta': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'url': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'multi-host-url': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'json': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'uuid': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'any': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['none', 'int', 'bool', 'float', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset', 'generator', 'dict', 'datetime', 'date', 'time', 'timedelta', 'url', 'multi-host-url', 'json', 'uuid', 'any']}, 'required': True}}, 'extra_behavior': 'forbid'}, 'function-plain': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['function-plain']}, 'required': True}, 'function': {'schema': {'type': 'union', 'choices': [{'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}]}, 'required': True}, 'is_field_serializer': {'schema': {'type': 'bool'}, 'required': False}, 'info_arg': {'schema': {'type': 'bool'}, 'required': False}, 'return_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'function-wrap': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['function-wrap']}, 'required': True}, 'function': {'schema': {'type': 'union', 'choices': [{'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}, {'type': 'callable'}]}, 'required': True}, 'is_field_serializer': {'schema': {'type': 'bool'}, 'required': False}, 'info_arg': {'schema': {'type': 'bool'}, 'required': False}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'return_schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': False}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'format': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['format']}, 'required': True}, 'formatting_string': {'schema': {'type': 'str'}, 'required': True}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'to-string': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['to-string']}, 'required': True}, 'when_used': {'schema': {'type': 'literal', 'expected': ['always', 'unless-none', 'json', 'json-unless-none']}, 'required': False}}, 'extra_behavior': 'forbid'}, 'model': {'type': 'typed-dict', 'fields': {'type': {'schema': {'type': 'literal', 'expected': ['model']}, 'required': True}, 'cls': {'schema': {'type': 'any'}, 'required': True}, 'schema': {'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'}, 'required': True}}, 'extra_behavior': 'forbid'}}, 'ref': 'ser-schema'}]}+self_schema = {+    'type': 'definitions',+    'schema': {'type': 'definition-ref', 'schema_ref': 'root-schema'},+    'definitions': [+        {+            'type': 'tagged-union',+            'choices': {+                'invalid': {+                    'type': 'typed-dict',+                    'fields': {+                        'type': {'schema': {'type': 'literal', 'expected': ['invalid']}, 'required': True},+                        'ref': {'schema': {'type': 'str'}, 'required': False},+                        'metadata': {+                            'schema': {+                                'type': 'dict',+                                'keys_schema': {'type': 'str'},+                                'values_schema': {'type': 'any'},+                            },+                            'required': False,+                        },+                        'serialization': {+                            'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'},+                            'required': False,+                        },+                    },+                    'extra_behavior': 'forbid',+                },+                'any': {+                    'type': 'typed-dict',+                    'fields': {+                        'type': {'schema': {'type': 'literal', 'expected': ['any']}, 'required': True},+                        'ref': {'schema': {'type': 'str'}, 'required': False},+                        'metadata': {+                            'schema': {+                                'type': 'dict',+                                'keys_schema': {'type': 'str'},+                                'values_schema': {'type': 'any'},+                            },+                            'required': False,+                        },+                        'serialization': {+                            'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'},+                            'required': False,+                        },+                    },+                    'extra_behavior': 'forbid',+                },+                'none': {+                    'type': 'typed-dict',+                    'fields': {+                        'type': {'schema': {'type': 'literal', 'expected': ['none']}, 'required': True},+                        'ref': {'schema': {'type': 'str'}, 'required': False},+                        'metadata': {+                            'schema': {+                                'type': 'dict',+                                'keys_schema': {'type': 'str'},+                                'values_schema': {'type': 'any'},+                            },+                            'required': False,+                        },+                        'serialization': {+                            'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'},+                            'required': False,+                        },+                    },+                    'extra_behavior': 'forbid',+                },+                'bool': {+                    'type': 'typed-dict',+                    'fields': {+                        'type': {'schema': {'type': 'literal', 'expected': ['bool']}, 'required': True},+                        'strict': {'schema': {'type': 'bool'}, 'required': False},+                        'ref': {'schema': {'type': 'str'}, 'required': False},+                        'metadata': {+                            'schema': {+                                'type': 'dict',+                                'keys_schema': {'type': 'str'},+                                'values_schema': {'type': 'any'},+                            },+                            'required': False,+                        },+                        'serialization': {+                            'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'},+                            'required': False,+                        },+                    },+                    'extra_behavior': 'forbid',+                },+                'int': {+                    'type': 'typed-dict',+                    'fields': {+                        'type': {'schema': {'type': 'literal', 'expected': ['int']}, 'required': True},+                        'multiple_of': {'schema': {'type': 'int'}, 'required': False},+                        'le': {'schema': {'type': 'int'}, 'required': False},+                        'ge': {'schema': {'type': 'int'}, 'required': False},+                        'lt': {'schema': {'type': 'int'}, 'required': False},+                        'gt': {'schema': {'type': 'int'}, 'required': False},+                        'strict': {'schema': {'type': 'bool'}, 'required': False},+                        'ref': {'schema': {'type': 'str'}, 'required': False},+                        'metadata': {+                            'schema': {+                                'type': 'dict',+                                'keys_schema': {'type': 'str'},+                                'values_schema': {'type': 'any'},+                            },+                            'required': False,+                        },+                        'serialization': {+                            'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'},+                            'required': False,+                        },+                    },+                    'extra_behavior': 'forbid',+                },+                'float': {+                    'type': 'typed-dict',+                    'fields': {+                        'type': {'schema': {'type': 'literal', 'expected': ['float']}, 'required': True},+                        'allow_inf_nan': {'schema': {'type': 'bool'}, 'required': False},+                        'multiple_of': {'schema': {'type': 'float'}, 'required': False},+                        'le': {'schema': {'type': 'float'}, 'required': False},+                        'ge': {'schema': {'type': 'float'}, 'required': False},+                        'lt': {'schema': {'type': 'float'}, 'required': False},+                        'gt': {'schema': {'type': 'float'}, 'required': False},+                        'strict': {'schema': {'type': 'bool'}, 'required': False},+                        'ref': {'schema': {'type': 'str'}, 'required': False},+                        'metadata': {+                            'schema': {+                                'type': 'dict',+                                'keys_schema': {'type': 'str'},+                                'values_schema': {'type': 'any'},+                            },+                            'required': False,+                        },+                        'serialization': {+                            'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'},+                            'required': False,+                        },+                    },+                    'extra_behavior': 'forbid',+                },+                'decimal': {+                    'type': 'typed-dict',+                    'fields': {+                        'type': {'schema': {'type': 'literal', 'expected': ['decimal']}, 'required': True},+                        'allow_inf_nan': {'schema': {'type': 'bool'}, 'required': False},+                        'multiple_of': {'schema': {'type': 'decimal'}, 'required': False},+                        'le': {'schema': {'type': 'decimal'}, 'required': False},+                        'ge': {'schema': {'type': 'decimal'}, 'required': False},+                        'lt': {'schema': {'type': 'decimal'}, 'required': False},+                        'gt': {'schema': {'type': 'decimal'}, 'required': False},+                        'max_digits': {'schema': {'type': 'int'}, 'required': False},+                        'decimal_places': {'schema': {'type': 'int'}, 'required': False},+                        'strict': {'schema': {'type': 'bool'}, 'required': False},+                        'ref': {'schema': {'type': 'str'}, 'required': False},+                        'metadata': {+                            'schema': {+                                'type': 'dict',+                                'keys_schema': {'type': 'str'},+                                'values_schema': {'type': 'any'},+                            },+                            'required': False,+                        },+                        'serialization': {+                            'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'},+                            'required': False,+                        },+                    },+                    'extra_behavior': 'forbid',+                },+                'str': {+                    'type': 'typed-dict',+                    'fields': {+                        'type': {'schema': {'type': 'literal', 'expected': ['str']}, 'required': True},+                        'pattern': {+                            'schema': {'type': 'union', 'choices': [{'type': 'str'}, {'type': 'any'}]},+                            'required': False,+                        },+                        'max_length': {'schema': {'type': 'int'}, 'required': False},+                        'min_length': {'schema': {'type': 'int'}, 'required': False},+                        'strip_whitespace': {'schema': {'type': 'bool'}, 'required': False},+                        'to_lower': {'schema': {'type': 'bool'}, 'required': False},+                        'to_upper': {'schema': {'type': 'bool'}, 'required': False},+                        'regex_engine': {+                            'schema': {'type': 'literal', 'expected': ['rust-regex', 'python-re']},+                            'required': False,+                        },+                        'strict': {'schema': {'type': 'bool'}, 'required': False},+                        'coerce_numbers_to_str': {'schema': {'type': 'bool'}, 'required': False},+                        'ref': {'schema': {'type': 'str'}, 'required': False},+                        'metadata': {+                            'schema': {+                                'type': 'dict',+                                'keys_schema': {'type': 'str'},+                                'values_schema': {'type': 'any'},+                            },+                            'required': False,+                        },+                        'serialization': {+                            'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'},+                            'required': False,+                        },+                    },+                    'extra_behavior': 'forbid',+                },+                'bytes': {+                    'type': 'typed-dict',+                    'fields': {+                        'type': {'schema': {'type': 'literal', 'expected': ['bytes']}, 'required': True},+                        'max_length': {'schema': {'type': 'int'}, 'required': False},+                        'min_length': {'schema': {'type': 'int'}, 'required': False},+                        'strict': {'schema': {'type': 'bool'}, 'required': False},+                        'ref': {'schema': {'type': 'str'}, 'required': False},+                        'metadata': {+                            'schema': {+                                'type': 'dict',+                                'keys_schema': {'type': 'str'},+                                'values_schema': {'type': 'any'},+                            },+                            'required': False,+                        },+                        'serialization': {+                            'schema': {'type': 'definition-ref', 'schema_ref': 'ser-schema'},+                            'required': False,+                        },+                    },+                    'extra_behavior': 'forbid',+                },+                'date': {+                    'type': 'typed-dict',+                    'fields': {+                        'type': {'schema': {'type': 'literal', 'expected': ['date']}, 'required': True},+                        'strict': {'schema': {'type': 'bool'}, 'required': False},+                        'le': {'schema': {'type': 'date'}, 'required': False},+                        'ge': {'schema': {'type': 'date'}, 'required': False},+                        'lt': {'schema': {'type': 'date'}, 'required': False},+                        'gt': {'schema': {'type': 'date'}, 'required': False},+                        'now_op': {'schema': {'type': 'literal', 'expected': ['past', 'future']}, 'required': False},+                        'now_utc_offset': {'schema': {'type': 'int', 'gt': -86400, 'lt': 86400}, 'required': False},+                        'ref': {'schema': {'type': 'str'}, 'required': False},+                        'metadata': {+                            'schema': {+                                'type': 'dict',+                                'keys_schema': {'type': 'str'},+                                'values_schema': {'type': 'any'},
… 6607 more lines (truncated)
tests/benchmarks/test_nested_benchmark.py +1 lines
--- +++ @@ -4,3 +4,3 @@ -from typing import Callable+from collections.abc import Callable 
tests/conftest.py +2 lines
--- +++ @@ -9,2 +9,3 @@ import sys+from collections.abc import Callable from dataclasses import dataclass@@ -12,3 +13,3 @@ from time import sleep, time-from typing import Any, Callable, Literal+from typing import Any, Literal 
tests/serializers/test_any.py +0 lines
--- +++ @@ -546,3 +546,2 @@ [email protected](sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python >= 3.10') def test_dataclass_slots(any_serializer):@@ -566,3 +565,2 @@ [email protected](sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python >= 3.10') def test_dataclass_slots_init_vars(any_serializer):@@ -580,3 +578,2 @@ [email protected](sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python > 3.10') def test_slots_mixed(any_serializer):
tests/serializers/test_bytes.py +5 lines
--- +++ @@ -90,3 +90,7 @@     'input_value,expected_json',-    [(BytesSubclass(b'foo'), 'foo'), (BytesMixin(b'foo'), 'foo'), (BytesEnum.foo, 'foo-value')],+    [+        pytest.param(BytesSubclass(b'foo'), 'foo', id='BytesSubclass'),+        pytest.param(BytesMixin(b'foo'), 'foo', id='BytesMixin'),+        pytest.param(BytesEnum.foo, 'foo-value', id='BytesEnum'),+    ], )
tests/serializers/test_complex.py +0 lines
--- +++ @@ -21,3 +21,2 @@         (complex(2, float('nan')), '2+NaNj'),-        (complex(2, float('-nan')), '2+NaNj'),     ],
tests/serializers/test_dataclasses.py +0 lines
--- +++ @@ -3,3 +3,2 @@ import platform-import sys from typing import ClassVar@@ -140,3 +139,2 @@ [email protected](sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python > 3.10') def test_slots_mixed():
tests/serializers/test_literal.py +2 lines
--- +++ @@ -2,3 +2,3 @@ from enum import Enum-from typing import Literal, Union+from typing import Literal @@ -96,3 +96,3 @@     class Yard:-        pet: Union[Dog, Cat]+        pet: Dog | Cat 
tests/serializers/test_model_root.py +3 lines
--- +++ @@ -4,3 +4,3 @@ from pathlib import Path-from typing import Any, Union+from typing import Any @@ -156,3 +156,3 @@         class Model(RootModel):-            root: list[Union[BModel, RModel]]+            root: list[BModel | RModel] @@ -163,3 +163,3 @@         class Model(RootModel):-            root: list[Union[RModel, BModel]]+            root: list[RModel | BModel] 
tests/serializers/test_serialize_as_any.py +2 lines
--- +++ @@ -1,3 +1,4 @@+from collections.abc import Callable from dataclasses import dataclass-from typing import Callable, Optional+from typing import Optional 
tests/serializers/test_simple.py +2 lines
--- +++ @@ -34,3 +34,3 @@     [-        ('int', 1, 1, b'1'),+        pytest.param('int', 1, 1, b'1', id='int-1_int-1_int-1_bytes'),         ('int', int(_BIG_NUMBER_BYTES), int(_BIG_NUMBER_BYTES), _BIG_NUMBER_BYTES),@@ -42,3 +42,3 @@         ('int', IntSubClass(42), IntSubClass(42), b'42'),-        ('int', MyIntEnum.one, MyIntEnum.one, b'1'),+        pytest.param('int', MyIntEnum.one, MyIntEnum.one, b'1', id='int-MyIntEnum.one_int-MyIntEnum.one_int-1_bytes'),         ('float', FloatSubClass(42), FloatSubClass(42), b'42.0'),
tests/serializers/test_string.py +12 lines
--- +++ @@ -44,8 +44,9 @@         ('\U0001d120', '"\\ud834\\udd20"'),-        ('\u03b1\u03a9', '"\\u03b1\\u03a9"'),+        pytest.param('\u03b1\u03a9', '"\\u03b1\\u03a9"', id='\\u03b1\\u03a9'),         ("`1~!@#$%^&*()_+-={':[,]}|;.</>?", '"`1~!@#$%^&*()_+-={\':[,]}|;.</>?"'),-        ('\x08\x0c\n\r\t', '"\\b\\f\\n\\r\\t"'),-        ('\u0123\u4567\u89ab\ucdef\uabcd\uef4a', '"\\u0123\\u4567\\u89ab\\ucdef\\uabcd\\uef4a"'),-        ('\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}', '"\\u03b1\\u03a9"'),-        ('\U0001d120', '"\\ud834\\udd20"'),+        pytest.param(+            '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}',+            '"\\u03b1\\u03a9"',+            id='\\N{GREEK SMALL LETTER ALPHA}\\N{GREEK CAPITAL LETTER OMEGA}',+        ),     ],@@ -169,3 +170,8 @@ @pytest.mark.parametrize(-    'input_value,expected', [(StrSubclass('foo'), 'foo'), (StrMixin('foo'), 'foo'), (StrEnum.foo, 'foo-value')]+    'input_value,expected',+    [+        pytest.param(StrSubclass('foo'), 'foo', id='StrSubclass'),+        pytest.param(StrMixin('foo'), 'foo', id='StrMixin'),+        pytest.param(StrEnum.foo, 'foo-value', id='StrEnum'),+    ], )
tests/serializers/test_union.py +3 lines
--- +++ @@ -7,3 +7,3 @@ from decimal import Decimal-from typing import Any, ClassVar, Literal, Union+from typing import Any, ClassVar, Literal @@ -380,4 +380,4 @@     class Model(BaseModel):-        value: Union[Literal[False], str]-        value_types_reversed: Union[str, Literal[False]]+        value: Literal[False] | str+        value_types_reversed: str | Literal[False] 
tests/test_custom_errors.py +2 lines
--- +++ @@ -1,2 +1,2 @@-from typing import Any, Optional+from typing import Any from unittest import TestCase@@ -133,3 +133,3 @@         def __new__(-            cls, error_type: LiteralString, my_custom_setting: str, context: Optional[dict[str, Any]] = None+            cls, error_type: LiteralString, my_custom_setting: str, context: dict[str, Any] | None = None         ) -> Self:
tests/test_docstrings.py +3 lines
--- +++ @@ -5,5 +5,5 @@ -try:+if sys.platform != 'emscripten':     from pytest_examples import CodeExample, EvalExample, find_examples-except ImportError:+else:     # pytest_examples is not installed on emscripten@@ -11,3 +11,3 @@ -    def find_examples(*_directories):+    def find_examples(*args, **kwargs):         return []
tests/test_errors.py +6 lines
--- +++ @@ -7,3 +7,3 @@ from decimal import Decimal-from typing import Any, Optional+from typing import Any @@ -203,3 +203,3 @@ @pytest.mark.parametrize('ctx', [None, {}])-def test_pydantic_error_type_raise_custom_no_ctx(ctx: Optional[dict]):+def test_pydantic_error_type_raise_custom_no_ctx(ctx: dict | None):     def f(input_value, info):@@ -239,3 +239,3 @@ @pytest.mark.parametrize('ctx', [None, {}])-def test_pydantic_custom_error_type_raise_custom_no_ctx(ctx: Optional[dict]):+def test_pydantic_custom_error_type_raise_custom_no_ctx(ctx: dict | None):     def f(input_value, info):@@ -542,3 +542,5 @@         literal = ''.join(f'\n    {e!r},' for e in error_types)-        print(f'python code (end of python/pydantic_core/core_schema.py):\n\nErrorType = Literal[{literal}\n]')+        print(+            f'python code (end of python/pydantic_core/core_schema.py):\n\nErrorType: TypeAlias = Literal[{literal}\n]'+        )         pytest.fail('core_schema.ErrorType needs to be updated')@@ -1127,6 +1129,2 @@ [email protected](-    sys.version_info < (3, 9) and sys.implementation.name == 'pypy',-    reason='PyPy before 3.9 cannot pickle this correctly',-) def test_validation_error_pickle() -> None:
tests/test_json.py +8 lines
--- +++ @@ -32,3 +32,10 @@ [email protected]('input_value', ['[1, 2, 3]', b'[1, 2, 3]', bytearray(b'[1, 2, 3]')])[email protected](+    'input_value',+    [+        pytest.param('[1, 2, 3]', id='[1, 2, 3]_list'),+        pytest.param(b'[1, 2, 3]', id='[1, 2, 3]_bytes'),+        pytest.param(bytearray(b'[1, 2, 3]'), id='[1, 2, 3]_bytearray'),+    ],+) def test_input_types(input_value):
tests/test_misc.py +2 lines
--- +++ @@ -5,3 +5,3 @@ import pytest-from typing_extensions import (+from typing_extensions import (  # noqa: UP035 (for `get_args` and `get_origin`)     get_args,@@ -202,3 +202,3 @@         print(-            f'python code (near end of python/pydantic_core/core_schema.py):\n\nCoreSchemaType = Literal[{literal}\n]'+            f'python code (near end of python/pydantic_core/core_schema.py):\n\nCoreSchemaType: TypeAlias = Literal[{literal}\n]'         )
tests/test_prebuilt.py +1 lines
--- +++ @@ -1,3 +1 @@-from typing import Union- from pydantic_core import SchemaSerializer, SchemaValidator, core_schema@@ -59,3 +57,3 @@ -    def serialize_inner(v: InnerModel, serializer) -> Union[dict[str, str], str]:+    def serialize_inner(v: InnerModel, serializer) -> dict[str, str] | str:         v.x = v.x + ' modified'
tests/test_schema_functions.py +1 lines
--- +++ @@ -6,3 +6,3 @@ import pytest-from typing_extensions import get_args, get_type_hints+from typing_extensions import get_args, get_type_hints  # noqa: UP035 from typing_inspection.introspection import UNKNOWN, AnnotationSource, inspect_annotation
tests/test_strict.py +10 lines
--- +++ @@ -15,10 +15,10 @@     [-        (False, False, 123, 123),-        (False, False, '123', 123),-        (None, False, 123, 123),-        (None, False, '123', 123),+        pytest.param(False, False, 123, 123, id='False-False-123_int-123_int'),+        pytest.param(False, False, '123', 123, id='False-False-123_str-123_int'),+        pytest.param(None, False, 123, 123, id='None-False-123_int-123_int'),+        pytest.param(None, False, '123', 123, id='None-False-123_str-123_int'),         (True, False, 123, 123),         (True, False, '123', Err('Input should be a valid integer [type=int_type')),-        (False, True, 123, 123),-        (False, True, '123', 123),+        pytest.param(False, True, 123, 123, id='False-True-123_int-123_int'),+        pytest.param(False, True, '123', 123, id='False-True-123_str-123_int'),         (None, True, 123, 123),@@ -27,6 +27,6 @@         (True, True, '123', Err('Input should be a valid integer [type=int_type')),-        (False, None, 123, 123),-        (False, None, '123', 123),-        (None, None, 123, 123),-        (None, None, '123', 123),+        pytest.param(False, None, 123, 123, id='False-None-123_int-123_int'),+        pytest.param(False, None, '123', 123, id='False-None-123_str-123_int'),+        pytest.param(None, None, 123, 123, id='None-None-123_int-123_int'),+        pytest.param(None, None, '123', 123, id='None-None-123_str-123_int'),         (True, None, 123, 123),
tests/test_typing.py +2 lines
--- +++ @@ -2,4 +2,5 @@ +from collections.abc import Callable from datetime import date, datetime, time-from typing import Any, Callable+from typing import Any 
pytest pypi
9.1.1 23d ago incident on record
YANKBURST ×3
latest 9.1.1 versions 192 maintainers 1
8.3.3
8.3.4
8.3.5
8.4.0
8.4.1
8.4.2
9.0.0
9.0.1
9.0.2
9.0.3
9.1.0
9.1.1
YANK
8.1.0 marked yanked (still downloadable)
high · registry-verified · 2024-03-03 · 2y ago
BURST
2 releases in 9m: 2.2.2, 2.2.3
info · registry-verified · 2012-02-06 · 14y ago
BURST
2 releases in 58m: 5.0.0, 4.6.4
info · registry-verified · 2019-06-29 · 7y ago
BURST
2 releases in 53m: 8.3.0, 8.3.1
info · registry-verified · 2024-07-20 · 1y ago
release diff 9.1.0 → 9.1.1
+1 added · -0 removed · ~24 modified
src/_pytest/_version.py +2 lines
--- +++ @@ -20,4 +20,4 @@ -__version__ = version = '9.1.0'-__version_tuple__ = version_tuple = (9, 1, 0)+__version__ = version = '9.1.1'+__version_tuple__ = version_tuple = (9, 1, 1) 
src/_pytest/config/__init__.py +9 lines
--- +++ @@ -647,14 +647,14 @@             anchor = absolutepath(invocation_dir / path)-             # Ensure we do not break if what appears to be an anchor             # is in fact a very long option (#10169, #11394).-            if safe_exists(anchor):-                anchors.append(anchor)-                # Let's also consider test* subdirs.-                if anchor.is_dir():-                    for x in anchor.glob("test*"):-                        if x.is_dir():-                            anchors.append(x)+            if not safe_exists(anchor):+                continue++            anchors.append(anchor)+            # Let's also consider test* subdirs.+            if anchor.is_dir():+                anchors.extend(x for x in anchor.glob("test*") if x.is_dir())         if not anchors:-            anchors = [invocation_dir]+            anchors.append(invocation_dir)+            anchors.extend(x for x in invocation_dir.glob("test*") if x.is_dir()) 
src/_pytest/fixtures.py +14 lines
--- +++ @@ -66,2 +66,3 @@ from _pytest.main import Session+from _pytest.mark import Mark from _pytest.mark import ParameterSet@@ -1900,2 +1901,7 @@         """Generate new tests based on parametrized fixtures used by the given metafunc"""++        def get_parametrize_mark_argnames(mark: Mark) -> Sequence[str]:+            args, _ = ParameterSet._parse_parametrize_args(*mark.args, **mark.kwargs)+            return args+         for argname in metafunc.fixturenames:@@ -1903,2 +1909,10 @@             fixture_defs = metafunc._arg2fixturedefs.get(argname, ())++            # If the test itself parametrizes using this argname, give it+            # precedence.+            if any(+                argname in get_parametrize_mark_argnames(mark)+                for mark in metafunc.definition.iter_markers("parametrize")+            ):+                continue 
src/_pytest/mark/structures.py +5 lines
--- +++ @@ -23,3 +23,2 @@ from .._code import getfslineno-from ..compat import deprecated from ..compat import NOTSET@@ -539,7 +538,9 @@     class _ParametrizeMarkDecorator(MarkDecorator):-        @overload  # type: ignore[override,no-overload-impl]-        def __call__(+        def __call__(  # type: ignore[override]             self,             argnames: str | Sequence[str],-            argvalues: Collection[ParameterSet | Sequence[object] | object],+            argvalues: Iterable[ParameterSet | Sequence[object] | object],+            # TODO(pytest10): Change to below after PARAMETRIZE_NON_COLLECTION_ITERABLE deprecation.+            #                 Overload doesn't work, see #14606.+            # argvalues: Collection[ParameterSet | Sequence[object] | object],             *,@@ -547,19 +548,2 @@             ids: Iterable[None | str | float | int | bool | _HiddenParam]-            | Callable[[Any], object | None]-            | None = ...,-            scope: ScopeName | None = ...,-        ) -> MarkDecorator: ...--        @overload-        @deprecated(-            "Passing a non-Collection iterable to the 'argvalues' parameter of @pytest.mark.parametrize is deprecated. "-            "Convert argvalues to a list or tuple.",-        )-        def __call__(-            self,-            argnames: str | Sequence[str],-            argvalues: Iterable[ParameterSet | Sequence[object] | object],-            *,-            indirect: bool | Sequence[str] = ...,-            ids: Iterable[None | str | float | int | bool]             | Callable[[Any], object | None]
src/_pytest/raises.py +1 lines
--- +++ @@ -1356,3 +1356,3 @@             for i_actual, actual in enumerate(actual_exceptions):-                if results.get_result(i_exp, i_actual) is None:+                if results.get_result(i_failed, i_actual) is None:                     # we print full repr of match target
testing/python/fixtures.py +56 lines
--- +++ @@ -1187,3 +1187,5 @@             import pytest+             values = []+             @pytest.fixture(scope='module', autouse=True)@@ -1191,2 +1193,3 @@                 values.append("module")+             @pytest.fixture(autouse=True)@@ -1198,6 +1201,8 @@ -            class TestClass(object):+            class TestClass:                 @pytest.fixture(scope="class", autouse=True)-                def setup_class(self):+                @classmethod+                def setup_class(cls):                     values.append("class")+                 @pytest.fixture(autouse=True)@@ -1205,7 +1210,15 @@                     values.append("method")+                 def test_method(self):                     pass+             def test_all():-                assert values == ["module", "function", "class",-                             "function", "method", "function"]+                assert values == [+                    "module",+                    "function",+                    "class",+                    "function",+                    "method",+                    "function",+                ]         """@@ -2469,3 +2482,4 @@                 @pytest.fixture(scope="class", autouse=True)-                def setup_teardown(self, item):+                @classmethod+                def setup_teardown(cls, item):                     values.append("setup-%d" % item)@@ -2622,2 +2636,28 @@         """+        )+        reprec = pytester.inline_run()+        reprec.assertoutcome(passed=2)++    def test_override_parametrized_fixture_with_indirect(+        self, pytester: Pytester+    ) -> None:+        """Make sure a parametrized argument can override a parametrized fixture.++        This was a regression introduced in the fix for #736.+        """+        pytester.makepyfile(+            """+            import pytest++            @pytest.fixture(params=["a"])+            def fixt(request):+                return request.param * 2++            def test_fixt(fixt):+                assert fixt == "aa"++            @pytest.mark.parametrize("fixt", ['b'], indirect=True)+            def test_indirect(fixt):+                assert fixt == "bb"+            """         )@@ -3248,7 +3288,8 @@             class TestClass(object):+                @pytest.fixture(scope="class", autouse=True)                 @classmethod-                @pytest.fixture(scope="class", autouse=True)-                def setup1(self, request, param1):+                def setup1(cls, request, param1):                     values.append(1)-                    request.addfinalizer(self.teardown1)+                    request.addfinalizer(cls.teardown1)+                 @classmethod@@ -3256,9 +3297,13 @@                     assert values.pop() == 1+                 @pytest.fixture(scope="class", autouse=True)-                def setup2(self, request, param1):+                @classmethod+                def setup2(cls, request, param1):                     values.append(2)-                    request.addfinalizer(self.teardown2)+                    request.addfinalizer(cls.teardown2)+                 @classmethod-                def teardown2(self):+                def teardown2(cls):                     assert values.pop() == 2+                 def test(self):
testing/python/metafunc.py +2 lines
--- +++ @@ -1745,3 +1745,4 @@                 @pytest.fixture(scope="class")-                def fixture(self, fixture):+                @classmethod+                def fixture(cls, fixture):                     pass
testing/python/raises_group.py +18 lines
--- +++ @@ -1352 +1352,19 @@         RaisesGroup((ValueError, IndexError))  # type: ignore[call-overload]+++def test_expected_matching_only_on_matching() -> None:+    """Regression test for #14220, logic error which caused the "which was+    paired with" message to appear for wrong pairs."""+    with (+        fails_raises_group(+            "\n"+            "1 matched exception. \n"+            "Too few exceptions raised!\n"+            "The following expected exceptions did not find a match:\n"+            "  ValueError\n"+            "  TypeError\n"+            "    It matches `TypeError()` which was paired with `TypeError`",+        ),+        RaisesGroup(TypeError, ValueError, TypeError),+    ):+        raise ExceptionGroup("", [TypeError()])
testing/test_conftest.py +22 lines
--- +++ @@ -440,2 +440,24 @@     result.stdout.fnmatch_lines(["*--xyz*"])+++def test_conftests_in_invocation_dir_tests_is_initial(pytester: Pytester) -> None:+    """An option registered in a conftest under ``test*`` subdir of the+    invocation dir is loaded as initial when no command-line arguments+    or `testpaths` are given (#14608).+    """+    pytester.makepyfile(+        **{+            "tests/conftest.py": """+                def pytest_addoption(parser):+                    parser.addoption("--db-url")+            """,+            "test_it.py": """+                def test_it(request):+                    assert request.config.getoption("--db-url") == "scheme://host/db"+            """,+        }+    )+    result = pytester.runpytest("--db-url", "scheme://host/db")+    assert result.ret == ExitCode.OK+    result.assert_outcomes(passed=1) 
testing/test_unittest.py +3 lines
--- +++ @@ -869,5 +869,7 @@             @pytest.fixture(scope="class", autouse=True)-            def perclass(self, request):+            @classmethod+            def perclass(cls, request):                 request.cls.hello = "world"                 {stmt}+             @pytest.fixture(scope="function", autouse=True)
testing/typing_checks.py +6 lines
--- +++ @@ -69,9 +69,2 @@ -# Test @pytest.mark.parametrize iterator argvalues deprecation.-# Will be complain about unused type ignore if doesn't work.[email protected]("x", iter(range(10)))  # type: ignore[deprecated]-def test_it(x: int) -> None:-    pass-- # Issue #14137.@@ -81 +74,7 @@     assert_type(custom_scope, ScopeName)+++# Issue #14606.[email protected]("x", [ImportError, AttributeError])+def check_mypy_bug_with_argvalues(x) -> None:+    pass
requests pypi
2.34.2 1mo ago incident on record
critical-tier YANK ×2BURST ×8
latest 2.34.2 versions 163 maintainers 1 critical-tier (snapshotted)
2.31.0
2.32.0
2.32.1
2.32.2
2.32.3
2.32.4
2.32.5
2.33.0
2.33.1
2.34.0
2.34.1
2.34.2
YANK
2.32.0 marked yanked (still downloadable)
high · registry-verified · 2024-05-20 · 2y ago
YANK
2.32.1 marked yanked (still downloadable)
high · registry-verified · 2024-05-20 · 2y ago
BURST
2 releases in 48m: 0.6.3, 0.6.4
info · registry-verified · 2011-10-14 · 14y ago
BURST
2 releases in 21m: 0.7.1, 0.7.2
info · registry-verified · 2011-10-23 · 14y ago
BURST
3 releases in 56m: 0.8.8, 0.8.9, 0.9.0
info · registry-verified · 2011-12-28 · 14y ago
BURST
2 releases in 11m: 1.0.1, 1.0.2
info · registry-verified · 2012-12-17 · 13y ago
BURST
2 releases in 2m: 2.0.0, 2.0.1
info · registry-verified · 2013-11-15 · 12y ago
BURST
2 releases in 15m: 2.9.2, 2.10.0
info · registry-verified · 2016-04-29 · 10y ago
BURST
2 releases in 20m: 2.17.2, 2.17.3
info · registry-verified · 2017-05-29 · 9y ago
BURST
2 releases in 0m: 2.24.0, 2.23.0
info · registry-verified · 2020-06-17 · 6y ago
release diff 2.34.1 → 2.34.2
+0 added · -0 removed · ~6 modified
src/requests/__version__.py +2 lines
--- +++ @@ -7,4 +7,4 @@ __url__ = "https://requests.readthedocs.io"-__version__ = "2.34.1"-__build__ = 0x023401+__version__ = "2.34.2"+__build__ = 0x023402 __author__ = "Kenneth Reitz"
src/requests/_types.py +1 lines
--- +++ @@ -111,3 +111,3 @@ -    HeadersType: TypeAlias = MutableMapping[str, str | bytes] | None+    HeadersType: TypeAlias = Mapping[str, str | bytes] | None 
src/requests/models.py +1 lines
--- +++ @@ -85,3 +85,2 @@ if TYPE_CHECKING:-    from collections.abc import MutableMapping     from http.cookiejar import CookieJar@@ -313,3 +312,3 @@     url: _t.UriType | None-    headers: MutableMapping[str, str | bytes]+    headers: Mapping[str, str | bytes]     files: _t.FilesType
s3transfer pypi
0.19.1 2d ago incident on record
YANKINSTALL-EXEC
latest 0.19.1 versions 62 maintainers 1
0.12.0
0.13.0
0.13.1
0.14.0
0.15.0
0.16.0
0.16.1
0.17.0
0.17.1
0.18.0
0.19.0
0.19.1
YANK
0.8.1 marked yanked (still downloadable)
high · registry-verified · 2023-11-28 · 2y ago
INSTALL-EXEC
setup.py in sdist uses subprocess/exec (runs at pip install)
warn · snapshot-derived
release diff 0.19.0 → 0.19.1
+0 added · -0 removed · ~7 modified
s3transfer/__init__.py +1 lines
--- +++ @@ -147,3 +147,3 @@ __author__ = 'Amazon Web Services'-__version__ = '0.19.0'+__version__ = '0.19.1' 
s3transfer/copies.py +11 lines
--- +++ @@ -132,4 +132,6 @@         preserved_metadata = {}+        call_args = transfer_future.meta.call_args         source_version_id = None-        call_args = transfer_future.meta.call_args+        if isinstance(call_args.copy_source, dict):+            source_version_id = call_args.copy_source.get('VersionId')         if (@@ -168,5 +170,2 @@             preserved_metadata = self._extract_preserved_metadata(response)-            # Pin the source version so all subsequent reads (tags, annotations)-            # are consistent with the object from the head call-            source_version_id = response.get('VersionId') @@ -354,3 +353,4 @@         result = {-            k: v for k, v in extra_args.items()+            k: v+            for k, v in extra_args.items()             if k not in self.PRESERVED_METADATA_FIELDS@@ -420,3 +420,5 @@ -    def _apply_tags(self, client, call_args, source_version_id, dest_version_id):+    def _apply_tags(+        self, client, call_args, source_version_id, dest_version_id+    ):         extra_args = call_args.extra_args@@ -508,3 +510,5 @@                 'AnnotationName': name,-                'AnnotationPayload': payload_response['AnnotationPayload'].read(),+                'AnnotationPayload': payload_response[+                    'AnnotationPayload'+                ].read(),                 **put_passthrough,
s3transfer/manager.py +8 lines
--- +++ @@ -464,3 +464,6 @@         # input has no effect.-        if extra_args.get('Metadata') and extra_args.get('MetadataDirective') is None:+        if (+            extra_args.get('Metadata')+            and extra_args.get('MetadataDirective') is None+        ):             logger.warning(@@ -471,3 +474,6 @@             )-        if extra_args.get('Tagging') and extra_args.get('TaggingDirective') is None:+        if (+            extra_args.get('Tagging')+            and extra_args.get('TaggingDirective') is None+        ):             logger.warning(
tests/functional/test_copy.py +58 lines
--- +++ @@ -766,3 +766,3 @@ -    def test_mp_copy_tagging_copy_pins_source_version_id(self):+    def test_mp_copy_tagging_copy_does_not_pin_discovered_version_id(self):         source_version_id = 'abc123version'@@ -783,5 +783,24 @@         self.add_successful_copy_responses(**add_copy_kwargs)-        self.stubber.add_response(-            'get_object_tagging',-            service_response={'TagSet': source_tags},+        self.add_get_object_tagging_response(source_tags)+        self.add_put_object_tagging_response(source_tags)+        future = self.manager.copy(+            self.copy_source,+            self.bucket,+            self.key,+            {'TaggingDirective': 'COPY'},+        )+        future.result()+        self.stubber.assert_no_pending_responses()++    def test_mp_copy_tagging_copy_pins_user_supplied_source_version_id(self):+        source_version_id = 'abc123version'+        source_tags = [{'Key': 'env', 'Value': 'prod'}]+        self.copy_source['VersionId'] = source_version_id+        self.stubber.add_response(+            'head_object',+            service_response={+                'ContentLength': len(self.content),+                'ETag': self.etag,+                'VersionId': source_version_id,+            },             expected_params={@@ -792,5 +811,18 @@         )+        _, add_copy_kwargs = self._get_expected_params()+        self.add_successful_copy_responses(**add_copy_kwargs)+        self.stubber.add_response(+            'get_object_tagging',+            service_response={'TagSet': source_tags},+            expected_params={+                'Bucket': 'mysourcebucket',+                'Key': 'mysourcekey',+                'VersionId': source_version_id,+            },+        )         self.add_put_object_tagging_response(source_tags)         future = self.manager.copy(-            self.copy_source, self.bucket, self.key,+            self.copy_source,+            self.bucket,+            self.key,             {'TaggingDirective': 'COPY'},@@ -825,3 +857,5 @@         future = self.manager.copy(-            self.copy_source, self.bucket, self.key,+            self.copy_source,+            self.bucket,+            self.key,             {'Tagging': 'env=prod', 'TaggingDirective': 'REPLACE'},@@ -831,3 +865,5 @@ -    def test_mp_copy_forwards_passthrough_args_to_tag_and_annotation_calls(self):+    def test_mp_copy_forwards_passthrough_args_to_tag_and_annotation_calls(+        self,+    ):         # RequestPayer/ExpectedBucketOwner go to all five tag/annotation ops;@@ -884,9 +920,11 @@             service_response={-                'Annotations': [{-                    'AnnotationName': 'note',-                    'LastModified': datetime.datetime(-                        2026, 1, 1, tzinfo=datetime.timezone.utc-                    ),-                    'Size': len(annotation_payload),-                }],+                'Annotations': [+                    {+                        'AnnotationName': 'note',+                        'LastModified': datetime.datetime(+                            2026, 1, 1, tzinfo=datetime.timezone.utc+                        ),+                        'Size': len(annotation_payload),+                    }+                ],             },@@ -922,3 +960,5 @@         future = self.manager.copy(-            self.copy_source, self.bucket, self.key,+            self.copy_source,+            self.bucket,+            self.key,             {@@ -940,3 +980,5 @@ -    def test_mp_copy_metadata_supplied_without_directive_preserves_source(self):+    def test_mp_copy_metadata_supplied_without_directive_preserves_source(+        self,+    ):         head_metadata = {
tests/unit/test_copies.py +178 lines
--- +++ @@ -52,3 +52,5 @@ class FakeCallArgs:-    def __init__(self, copy_source, bucket, key, extra_args=None, source_client=None):+    def __init__(+        self, copy_source, bucket, key, extra_args=None, source_client=None+    ):         self.copy_source = copy_source@@ -71,3 +73,6 @@         return FakeCallArgs(-            self.copy_source, self.bucket, self.key, extra_args,+            self.copy_source,+            self.bucket,+            self.key,+            extra_args,             source_client=source_client,@@ -75,3 +80,5 @@ -    def _apply(self, client, call_args, source_version_id=None, dest_version_id=None):+    def _apply(+        self, client, call_args, source_version_id=None, dest_version_id=None+    ):         # Default source_client to the same client unless test overrode it@@ -94,12 +101,20 @@         self._apply(client, call_args)-        self.assertEqual(client.calls, [-            ('put_object_tagging', {-                'Bucket': self.bucket,-                'Key': self.key,-                'Tagging': {'TagSet': [-                    {'Key': 'env', 'Value': 'prod'},-                    {'Key': 'team', 'Value': 'sdk'},-                ]},-            })-        ])+        self.assertEqual(+            client.calls,+            [+                (+                    'put_object_tagging',+                    {+                        'Bucket': self.bucket,+                        'Key': self.key,+                        'Tagging': {+                            'TagSet': [+                                {'Key': 'env', 'Value': 'prod'},+                                {'Key': 'team', 'Value': 'sdk'},+                            ]+                        },+                    },+                )+            ],+        ) @@ -107,5 +122,7 @@         source_tags = [{'Key': 'env', 'Value': 'prod'}]-        client = RecordingClient(responses={-            'get_object_tagging': {'TagSet': source_tags},-        })+        client = RecordingClient(+            responses={+                'get_object_tagging': {'TagSet': source_tags},+            }+        )         call_args = self._make_call_args({'TaggingDirective': 'COPY'})@@ -114,9 +131,13 @@         self.assertEqual(methods, ['get_object_tagging', 'put_object_tagging'])-        self.assertEqual(client.calls[1], (-            'put_object_tagging', {-                'Bucket': self.bucket,-                'Key': self.key,-                'Tagging': {'TagSet': source_tags},-            }-        ))+        self.assertEqual(+            client.calls[1],+            (+                'put_object_tagging',+                {+                    'Bucket': self.bucket,+                    'Key': self.key,+                    'Tagging': {'TagSet': source_tags},+                },+            ),+        ) @@ -124,5 +145,7 @@         source_tags = [{'Key': 'env', 'Value': 'prod'}]-        client = RecordingClient(responses={-            'get_object_tagging': {'TagSet': source_tags},-        })+        client = RecordingClient(+            responses={+                'get_object_tagging': {'TagSet': source_tags},+            }+        )         call_args = self._make_call_args({'TaggingDirective': 'COPY'})@@ -134,3 +157,5 @@         client = RecordingClient()-        call_args = self._make_call_args({'TaggingDirective': 'REPLACE', 'Tagging': 'k=v'})+        call_args = self._make_call_args(+            {'TaggingDirective': 'REPLACE', 'Tagging': 'k=v'}+        )         self._apply(client, call_args, dest_version_id='dest-v1')@@ -141,3 +166,5 @@         client = RecordingClient()-        call_args = self._make_call_args({'TaggingDirective': 'REPLACE', 'Tagging': 'k=v'})+        call_args = self._make_call_args(+            {'TaggingDirective': 'REPLACE', 'Tagging': 'k=v'}+        )         self._apply(client, call_args, dest_version_id=None)@@ -147,5 +174,7 @@     def test_copy_directive_omits_version_id_when_none(self):-        client = RecordingClient(responses={-            'get_object_tagging': {'TagSet': []},-        })+        client = RecordingClient(+            responses={+                'get_object_tagging': {'TagSet': []},+            }+        )         call_args = self._make_call_args({'TaggingDirective': 'COPY'})@@ -174,2 +203,3 @@             """RecordingClient whose list_object_annotations returns a single 'note' annotation."""+             def list_object_annotations(self, **kwargs):@@ -182,3 +212,6 @@         return FakeCallArgs(-            self.copy_source, self.bucket, self.key, extra_args,+            self.copy_source,+            self.bucket,+            self.key,+            extra_args,             source_client=source_client,@@ -207,3 +240,5 @@         client = RecordingClient()-        self._apply(client, self._make_call_args({'AnnotationDirective': 'EXCLUDE'}))+        self._apply(+            client, self._make_call_args({'AnnotationDirective': 'EXCLUDE'})+        )         self.assertEqual(client.calls, [])@@ -212,10 +247,12 @@         annotation_payload = b'hello annotation'-        client = RecordingClient(responses={-            'list_object_annotations': {-                'Annotations': [{'AnnotationName': 'my-note'}]-            },-            'get_object_annotation': {-                'AnnotationPayload': io.BytesIO(annotation_payload)-            },-        })+        client = RecordingClient(+            responses={+                'list_object_annotations': {+                    'Annotations': [{'AnnotationName': 'my-note'}]+                },+                'get_object_annotation': {+                    'AnnotationPayload': io.BytesIO(annotation_payload)+                },+            }+        )         call_args = self._make_call_args({'AnnotationDirective': 'COPY'})@@ -225,3 +262,7 @@             methods,-            ['list_object_annotations', 'get_object_annotation', 'put_object_annotation'],+            [+                'list_object_annotations',+                'get_object_annotation',+                'put_object_annotation',+            ],         )@@ -234,5 +275,7 @@     def test_copy_directive_with_no_source_annotations_skips_put(self):-        client = RecordingClient(responses={-            'list_object_annotations': {'Annotations': []},-        })+        client = RecordingClient(+            responses={+                'list_object_annotations': {'Annotations': []},+            }+        )         call_args = self._make_call_args({'AnnotationDirective': 'COPY'})@@ -244,10 +287,19 @@     def test_copy_directive_pins_dest_version_and_etag_on_put(self):-        client = self.AnnotationListClient(responses={-            'get_object_annotation': {'AnnotationPayload': io.BytesIO(b'data')},-        })+        client = self.AnnotationListClient(+            responses={+                'get_object_annotation': {+                    'AnnotationPayload': io.BytesIO(b'data')+                },+            }+        )         call_args = self._make_call_args({'AnnotationDirective': 'COPY'})         self._apply(-            client, call_args, dest_version_id='dest-v1', dest_etag='"destetag"'-        )-        _, put_kwargs = next((m, k) for m, k in client.calls if m == 'put_object_annotation')+            client,+            call_args,+            dest_version_id='dest-v1',+            dest_etag='"destetag"',+        )+        _, put_kwargs = next(+            (m, k) for m, k in client.calls if m == 'put_object_annotation'+        )         self.assertEqual(put_kwargs.get('VersionId'), 'dest-v1')@@ -256,8 +308,14 @@     def test_copy_directive_omits_dest_pins_when_not_in_result(self):-        client = self.AnnotationListClient(responses={-            'get_object_annotation': {'AnnotationPayload': io.BytesIO(b'data')},-        })+        client = self.AnnotationListClient(+            responses={+                'get_object_annotation': {+                    'AnnotationPayload': io.BytesIO(b'data')+                },+            }+        )         call_args = self._make_call_args({'AnnotationDirective': 'COPY'})         self._apply(client, call_args)-        _, put_kwargs = next((m, k) for m, k in client.calls if m == 'put_object_annotation')+        _, put_kwargs = next(+            (m, k) for m, k in client.calls if m == 'put_object_annotation'+        )         self.assertNotIn('VersionId', put_kwargs)@@ -267,11 +325,17 @@         annotation_payload = b'data'-        client = self.AnnotationListClient(responses={-            'get_object_annotation': {-                'AnnotationPayload': io.BytesIO(annotation_payload)-            },-        })+        client = self.AnnotationListClient(+            responses={+                'get_object_annotation': {+                    'AnnotationPayload': io.BytesIO(annotation_payload)+                },+            }+        )         call_args = self._make_call_args({'AnnotationDirective': 'COPY'})         self._apply(client, call_args, source_version_id='v456')-        list_kwargs = next(k for m, k in client.calls if m == 'list_object_annotations')-        get_kwargs = next(k for m, k in client.calls if m == 'get_object_annotation')+        list_kwargs = next(+            k for m, k in client.calls if m == 'list_object_annotations'+        )+        get_kwargs = next(
… 99 more lines (truncated)
setuptools pypi
83.0.0 8d ago incident on record
critical-tier YANK ×9BURST ×35INSTALL-EXEC
latest 83.0.0 versions 624 maintainers 1 critical-tier (snapshotted)
80.7.0
80.7.1
80.8.0
80.9.0
75.3.3
80.10.1
80.10.2
81.0.0
75.3.4
82.0.0
82.0.1
83.0.0
YANK
59.1.0 marked yanked (still downloadable)
high · registry-verified · 2021-11-15 · 4y ago
YANK
60.3.0 marked yanked (still downloadable)
high · registry-verified · 2022-01-06 · 4y ago
YANK
69.3.0 marked yanked (still downloadable)
high · registry-verified · 2024-04-12 · 2y ago
YANK
69.4.0 marked yanked (still downloadable)
high · registry-verified · 2024-04-12 · 2y ago
YANK
71.0.1 marked yanked (still downloadable)
high · registry-verified · 2024-07-18 · 1y ago
YANK
72.0.0 marked yanked (still downloadable)
high · registry-verified · 2024-07-29 · 1y ago
YANK
75.9.0 marked yanked (still downloadable)
high · registry-verified · 2025-03-09 · 1y ago
YANK
80.3.0 marked yanked (still downloadable)
high · registry-verified · 2025-05-03 · 1y ago
YANK
80.7.0 marked yanked (still downloadable)
high · registry-verified · 2025-05-14 · 1y ago
BURST
2 releases in 21m: 0.9.2, 0.9.3
info · registry-verified · 2013-07-15 · 13y ago
BURST
2 releases in 3m: 1.1.2, 1.1.3
info · registry-verified · 2013-09-06 · 12y ago
BURST
4 releases in 3m: 3.1, 3.0, 3.0.1, 3.0.2
info · registry-verified · 2014-03-08 · 12y ago
BURST
2 releases in 15m: 3.5.2, 3.6
info · registry-verified · 2014-05-07 · 12y ago
BURST
2 releases in 17m: 3.7, 3.8
info · registry-verified · 2014-06-01 · 12y ago
BURST
2 releases in 0m: 4.0, 4.0.1
info · registry-verified · 2014-06-15 · 12y ago
BURST
2 releases in 28m: 8.1, 8.2
info · registry-verified · 2014-12-18 · 11y ago
BURST
2 releases in 59m: 12.0, 12.0.1
info · registry-verified · 2015-01-16 · 11y ago
BURST
2 releases in 14m: 12.0.2, 12.0.3
info · registry-verified · 2015-01-19 · 11y ago
BURST
2 releases in 26m: 20.8.0, 20.8.1
info · registry-verified · 2016-04-15 · 10y ago
BURST
2 releases in 8m: 22.0.1, 22.0.2
info · registry-verified · 2016-06-03 · 10y ago
BURST
2 releases in 25m: 22.0.4, 22.0.5
info · registry-verified · 2016-06-03 · 10y ago
BURST
2 releases in 9m: 24.1.1, 24.2.0
info · registry-verified · 2016-07-20 · 9y ago
BURST
2 releases in 2m: 25.0.0, 24.3.1
info · registry-verified · 2016-07-23 · 9y ago
BURST
2 releases in 52m: 25.1.5, 25.1.6
info · registry-verified · 2016-08-05 · 9y ago
BURST
2 releases in 11m: 25.3.0, 25.4.0
info · registry-verified · 2016-08-19 · 9y ago
BURST
2 releases in 41m: 27.0.0, 27.1.0
info · registry-verified · 2016-09-09 · 9y ago
BURST
2 releases in 10m: 28.8.1, 29.0.1
info · registry-verified · 2016-11-27 · 9y ago
BURST
2 releases in 23m: 30.2.1, 30.3.0
info · registry-verified · 2016-12-08 · 9y ago
BURST
2 releases in 19m: 36.6.1, 36.7.0
info · registry-verified · 2017-11-10 · 8y ago
BURST
2 releases in 48m: 38.0.0, 38.1.0
info · registry-verified · 2017-11-25 · 8y ago
BURST
2 releases in 7m: 38.6.1, 38.7.0
info · registry-verified · 2018-03-17 · 8y ago
BURST
2 releases in 16m: 40.1.1, 40.2.0
info · registry-verified · 2018-08-21 · 7y ago
BURST
2 releases in 5m: 41.3.0, 41.4.0
info · registry-verified · 2019-10-07 · 6y ago
BURST
3 releases in 19m: 44.1.0, 46.1.0, 46.1.1
info · registry-verified · 2020-03-21 · 6y ago
BURST
2 releases in 27m: 47.0.0, 47.1.0
info · registry-verified · 2020-05-28 · 6y ago
BURST
2 releases in 16m: 44.1.1, 47.1.1
info · registry-verified · 2020-05-29 · 6y ago
BURST
2 releases in 44m: 54.1.3, 54.2.0
info · registry-verified · 2021-03-22 · 5y ago
BURST
2 releases in 12m: 58.5.0, 58.5.1
info · registry-verified · 2021-11-03 · 4y ago
BURST
2 releases in 1m: 60.4.0, 60.5.0
info · registry-verified · 2022-01-08 · 4y ago
BURST
3 releases in 4m: 69.3.1, 69.4.1, 69.5.0
info · registry-verified · 2024-04-13 · 2y ago
BURST
2 releases in 51m: 74.1.3, 75.0.0
info · registry-verified · 2024-09-15 · 1y ago
BURST
2 releases in 8m: 75.3.1, 75.3.2
info · registry-verified · 2025-03-11 · 1y ago
BURST
2 releases in 19m: 80.6.0, 80.7.0
info · registry-verified · 2025-05-14 · 1y ago
BURST
2 releases in 56m: 75.3.4, 82.0.0
info · registry-verified · 2026-02-08 · 5mo ago
INSTALL-EXEC
setup.py in sdist uses install-hook, obfuscation (runs at pip install)
warn · snapshot-derived
release diff 82.0.1 → 83.0.0
+2 added · -0 removed · ~47 modified
+13 more files not shown
pyproject.toml +7 lines
--- +++ @@ -12,3 +12,3 @@ name = "setuptools"-version = "82.0.1"+version = "83.0.0" authors = [@@ -28,3 +28,3 @@ ]-requires-python = ">=3.9"+requires-python = ">=3.10" license = "MIT"@@ -111,3 +111,3 @@ 	# upstream-	"pytest-checkdocs >= 2.4",+	"pytest-checkdocs >= 2.14", 	"pytest-ruff >= 0.2.1; sys_platform != 'cygwin'",@@ -125,3 +125,3 @@ enabler = [-	"pytest-enabler >= 2.2",+	"pytest-enabler >= 3.4", ]@@ -130,3 +130,5 @@ 	# upstream-	"pytest-mypy",+	+    # Exclude PyPy from type checks (python/mypy#20454 jaraco/skeleton#187)+	"pytest-mypy >= 1.0.1; platform_python_implementation != 'PyPy'", 
setuptools/_distutils/_modified.py +1 lines
--- +++ @@ -60,3 +60,3 @@     newer_pairs = filter(splat(newer), zip_strict(sources, targets))-    return tuple(map(list, zip(*newer_pairs))) or ([], [])+    return tuple(map(list, zip(*newer_pairs, strict=False))) or ([], []) 
setuptools/_distutils/command/build.py +4 lines
--- +++ @@ -138,12 +138,12 @@ -    def has_pure_modules(self):+    def has_pure_modules(self) -> bool:         return self.distribution.has_pure_modules() -    def has_c_libraries(self):+    def has_c_libraries(self) -> bool:         return self.distribution.has_c_libraries() -    def has_ext_modules(self):+    def has_ext_modules(self) -> bool:         return self.distribution.has_ext_modules() -    def has_scripts(self):+    def has_scripts(self) -> bool:         return self.distribution.has_scripts()
setuptools/_distutils/command/build_ext.py +1 lines
--- +++ @@ -501,3 +501,3 @@             ]-            for ext, fut in zip(self.extensions, futures):+            for ext, fut in zip(self.extensions, futures, strict=False):                 with self._filter_build_errors(ext):
setuptools/_distutils/command/install.py +9 lines
--- +++ @@ -266,8 +266,8 @@         # that installation scheme.-        self.install_purelib = None  # for pure module distributions-        self.install_platlib = None  # non-pure (dists w/ extensions)-        self.install_headers = None  # for C/C++ headers+        self.install_purelib: str | None = None  # for pure module distributions+        self.install_platlib: str | None = None  # non-pure (dists w/ extensions)+        self.install_headers: str | None = None  # for C/C++ headers         self.install_lib: str | None = None  # set to either purelib or platlib-        self.install_scripts = None-        self.install_data = None+        self.install_scripts: str | None = None+        self.install_data: str | None = None         self.install_userbase = USER_BASE@@ -774,3 +774,3 @@ -    def has_lib(self):+    def has_lib(self) -> bool:         """Returns true if the current distribution has any Python@@ -781,3 +781,3 @@ -    def has_headers(self):+    def has_headers(self) -> bool:         """Returns true if the current distribution has any headers to@@ -786,3 +786,3 @@ -    def has_scripts(self):+    def has_scripts(self) -> bool:         """Returns true if the current distribution has any scripts to.@@ -791,3 +791,3 @@ -    def has_data(self):+    def has_data(self) -> bool:         """Returns true if the current distribution has any data to.
setuptools/_distutils/command/install_egg_info.py +3 lines
--- +++ @@ -61,5 +61,5 @@ -# The following routines are taken from setuptools' pkg_resources module and-# can be replaced by importing them from pkg_resources once it is included-# in the stdlib.+# The following routines were originally copied from setuptools' pkg_resources+# module and intended to be replaced by stdlib versions. They're now just legacy+# cruft. 
setuptools/_distutils/compat/py39.py +1 lines
--- +++ @@ -56,3 +56,3 @@         # All sizes are equal, we can use the built-in zip.-        return zip(*iterables)+        return zip(*iterables, strict=False)     # If any one of the iterables didn't have a length, start reading
setuptools/_distutils/compilers/C/base.py +6 lines
--- +++ @@ -18,3 +18,2 @@     TypeVar,-    Union,     overload,@@ -41,3 +40,5 @@ if TYPE_CHECKING:-    from typing_extensions import TypeAlias, TypeVarTuple, Unpack+    from typing import TypeAlias++    from typing_extensions import TypeVarTuple, Unpack @@ -45,3 +46,3 @@ -_Macro: TypeAlias = Union[tuple[str], tuple[str, Union[str, None]]]+_Macro: TypeAlias = tuple[str] | tuple[str, str | None] _StrPathT = TypeVar("_StrPathT", bound="str | os.PathLike[str]")@@ -72,3 +73,3 @@     # responsible for updating 'compiler_class'!-    compiler_type: ClassVar[str] = None  # type: ignore[assignment]+    compiler_type: ClassVar[str] = None @@ -860,3 +861,3 @@ -    def runtime_library_dir_option(self, dir: str) -> str:+    def runtime_library_dir_option(self, dir: str) -> str | list[str]:         """Return the compiler option to add 'dir' to the list of
setuptools/_distutils/compilers/C/cygwin.py +3 lines
--- +++ @@ -7,2 +7,4 @@ """++from __future__ import annotations @@ -329,3 +331,3 @@ -def is_cygwincc(cc):+def is_cygwincc(cc: str | shlex._ShlexInstream) -> bool:     """Try to determine if the compiler that would be used is from cygwin."""
setuptools/_distutils/compilers/C/msvc.py +2 lines
--- +++ @@ -97,3 +97,4 @@             path = (-                subprocess.check_output([+                subprocess+                .check_output([                     os.path.join(
setuptools/_distutils/compilers/C/tests/test_base.py +2 lines
--- +++ @@ -20,3 +20,4 @@     payload = (-        textwrap.dedent(+        textwrap+        .dedent(             """
setuptools/_distutils/compilers/C/unix.py +1 lines
--- +++ @@ -324,3 +324,3 @@ -    def runtime_library_dir_option(self, dir: str) -> str | list[str]:  # type: ignore[override] # Fixed in pypa/distutils#339+    def runtime_library_dir_option(self, dir: str) -> str | list[str]:         # XXX Hackish, at the very least.  See Python bug #445902:
setuptools/_distutils/dist.py +15 lines
--- +++ @@ -24,3 +24,2 @@     TypeVar,-    Union,     overload,@@ -42,4 +41,5 @@ if TYPE_CHECKING:+    from typing import TypeAlias+     from _typeshed import SupportsWrite-    from typing_extensions import TypeAlias @@ -47,2 +47,3 @@     from .cmd import Command+    from .extension import Extension @@ -50,3 +51,3 @@ _OptionsList: TypeAlias = list[-    Union[tuple[str, Union[str, None], str, int], tuple[str, Union[str, None], str]]+    tuple[str, str | None, str, int] | tuple[str, str | None, str] ]@@ -220,9 +221,9 @@         # Distribution as a convenience to the developer.-        self.packages = None+        self.packages: list[str] | None = None         self.package_data: dict[str, list[str]] = {}-        self.package_dir = None-        self.py_modules = None+        self.package_dir: dict[str, str] | None = None+        self.py_modules: list[str] | None = None         self.libraries = None         self.headers = None-        self.ext_modules = None+        self.ext_modules: list[Extension] | None = None         self.ext_package = None@@ -231,3 +232,3 @@         self.scripts = None-        self.data_files = None+        self.data_files: list[str | tuple] | None = None         self.password = ''@@ -1024,9 +1025,9 @@     def has_pure_modules(self) -> bool:-        return len(self.packages or self.py_modules or []) > 0+        return bool(self.packages or self.py_modules)      def has_ext_modules(self) -> bool:-        return self.ext_modules and len(self.ext_modules) > 0+        return bool(self.ext_modules)      def has_c_libraries(self) -> bool:-        return self.libraries and len(self.libraries) > 0+        return bool(self.libraries) @@ -1036,9 +1037,9 @@     def has_headers(self) -> bool:-        return self.headers and len(self.headers) > 0+        return bool(self.headers)      def has_scripts(self) -> bool:-        return self.scripts and len(self.scripts) > 0+        return bool(self.scripts)      def has_data_files(self) -> bool:-        return self.data_files and len(self.data_files) > 0+        return bool(self.data_files) 
setuptools/_distutils/fancy_getopt.py +1 lines
--- +++ @@ -107,3 +107,3 @@ -    def has_option(self, long_option):+    def has_option(self, long_option: str) -> bool:         """Return true if the option table for this parser has an
setuptools/_distutils/tests/compat/py39.py +18 lines
--- +++ @@ -1,40 +1,18 @@-import sys--if sys.version_info >= (3, 10):-    from test.support.import_helper import (-        CleanImport as CleanImport,-    )-    from test.support.import_helper import (-        DirsOnSysPath as DirsOnSysPath,-    )-    from test.support.os_helper import (-        EnvironmentVarGuard as EnvironmentVarGuard,-    )-    from test.support.os_helper import (-        rmtree as rmtree,-    )-    from test.support.os_helper import (-        skip_unless_symlink as skip_unless_symlink,-    )-    from test.support.os_helper import (-        unlink as unlink,-    )-else:-    from test.support import (-        CleanImport as CleanImport,-    )-    from test.support import (-        DirsOnSysPath as DirsOnSysPath,-    )-    from test.support import (-        EnvironmentVarGuard as EnvironmentVarGuard,-    )-    from test.support import (-        rmtree as rmtree,-    )-    from test.support import (-        skip_unless_symlink as skip_unless_symlink,-    )-    from test.support import (-        unlink as unlink,-    )+from test.support.import_helper import (+    CleanImport as CleanImport,+)+from test.support.import_helper import (+    DirsOnSysPath as DirsOnSysPath,+)+from test.support.os_helper import (+    EnvironmentVarGuard as EnvironmentVarGuard,+)+from test.support.os_helper import (+    rmtree as rmtree,+)+from test.support.os_helper import (+    skip_unless_symlink as skip_unless_symlink,+)+from test.support.os_helper import (+    unlink as unlink,+)
setuptools/_distutils/tests/test_check.py +56 lines
--- +++ @@ -2,5 +2,7 @@ +import distutils.command.check as _check+import importlib import os+import sys import textwrap-from distutils.command.check import check from distutils.errors import DistutilsSetupError@@ -10,9 +12,30 @@ -try:-    import pygments-except ImportError:-    pygments = None-- HERE = os.path.dirname(__file__)++[email protected]+def hide_pygments(monkeypatch, request):+    """+    Clear docutils and hide the presence of pygments.+    """+    clear_docutils(monkeypatch)+    monkeypatch.setitem(sys.modules, 'pygments', None)+    reload_check()+    # restore 'check' to its normal state after monkeypatch is undone+    request.addfinalizer(reload_check)+++def clear_docutils(monkeypatch):+    docutils_names = [+        name for name in sys.modules if name.partition('.')[0] == 'docutils'+    ]+    for name in docutils_names:+        monkeypatch.delitem(sys.modules, name)+++def reload_check():+    """+    Reload the 'check' command module to reflect the import state.+    """+    importlib.reload(_check) @@ -28,3 +51,3 @@         pkg_info, dist = self.create_dist(**metadata)-        cmd = check(dist)+        cmd = _check.check(dist)         cmd.initialize_options()@@ -105,5 +128,4 @@     def test_check_document(self):-        pytest.importorskip('docutils')         pkg_info, dist = self.create_dist()-        cmd = check(dist)+        cmd = _check.check(dist) @@ -120,3 +142,2 @@     def test_check_restructuredtext(self):-        pytest.importorskip('docutils')         # let's see if it detects broken rest in long_description@@ -124,3 +145,3 @@         pkg_info, dist = self.create_dist(long_description=broken_rest)-        cmd = check(dist)+        cmd = _check.check(dist)         cmd.check_restructuredtext()@@ -150,12 +171,8 @@ -    def test_check_restructuredtext_with_syntax_highlight(self):-        pytest.importorskip('docutils')-        # Don't fail if there is a `code` or `code-block` directive--        example_rst_docs = [-            textwrap.dedent(-                """\+    code_examples = [+        textwrap.dedent(+            f"""             Here's some code: -            .. code:: python+            .. {directive}:: python @@ -164,28 +181,21 @@             """-            ),-            textwrap.dedent(-                """\-            Here's some code:--            .. code-block:: python--                def foo():-                    pass-            """-            ),-        ]--        for rest_with_code in example_rst_docs:-            pkg_info, dist = self.create_dist(long_description=rest_with_code)-            cmd = check(dist)-            cmd.check_restructuredtext()-            msgs = cmd._check_rst_data(rest_with_code)-            if pygments is not None:-                assert len(msgs) == 0-            else:-                assert len(msgs) == 1-                assert (-                    str(msgs[0][1])-                    == 'Cannot analyze code. Pygments package not found.'-                )+        ).lstrip()+        for directive in ['code', 'code-block']+    ]++    def check_rst_data(self, descr):+        pkg_info, dist = self.create_dist(long_description=descr)+        cmd = _check.check(dist)+        cmd.check_restructuredtext()+        return cmd._check_rst_data(descr)++    @pytest.mark.parametrize('descr', code_examples)+    def test_check_rst_with_syntax_highlight_pygments(self, descr):+        assert self.check_rst_data(descr) == []++    @pytest.mark.parametrize('descr', code_examples)+    def test_check_rst_with_syntax_highlight_no_pygments(self, descr, hide_pygments):+        (msg,) = self.check_rst_data(descr)+        _, exc, _, _ = msg+        assert str(exc) == 'Cannot analyze code. Pygments package not found.' 
setuptools/_distutils/tests/test_filelist.py +12 lines
--- +++ @@ -5,2 +5,3 @@ import re+import sys from distutils import debug, filelist@@ -47,5 +48,5 @@     def test_glob_to_re(self):-        sep = os.sep-        if os.sep == '\\':-            sep = re.escape(os.sep)+        sep = re.escape(os.sep)+        # https://docs.python.org/3/whatsnew/3.14.html#re+        end_of_str_metachar = r"\z" if sys.version_info >= (3, 14) else r"\Z" @@ -53,12 +54,12 @@             # simple cases-            ('foo*', r'(?s:foo[^%(sep)s]*)\Z'),-            ('foo?', r'(?s:foo[^%(sep)s])\Z'),-            ('foo??', r'(?s:foo[^%(sep)s][^%(sep)s])\Z'),+            ('foo*', r'(?s:foo[^%(sep)s]*)%(eos)s'),+            ('foo?', r'(?s:foo[^%(sep)s])%(eos)s'),+            ('foo??', r'(?s:foo[^%(sep)s][^%(sep)s])%(eos)s'),             # special cases-            (r'foo\\*', r'(?s:foo\\\\[^%(sep)s]*)\Z'),-            (r'foo\\\*', r'(?s:foo\\\\\\[^%(sep)s]*)\Z'),-            ('foo????', r'(?s:foo[^%(sep)s][^%(sep)s][^%(sep)s][^%(sep)s])\Z'),-            (r'foo\\??', r'(?s:foo\\\\[^%(sep)s][^%(sep)s])\Z'),+            (r'foo\\*', r'(?s:foo\\\\[^%(sep)s]*)%(eos)s'),+            (r'foo\\\*', r'(?s:foo\\\\\\[^%(sep)s]*)%(eos)s'),+            ('foo????', r'(?s:foo[^%(sep)s][^%(sep)s][^%(sep)s][^%(sep)s])%(eos)s'),+            (r'foo\\??', r'(?s:foo\\\\[^%(sep)s][^%(sep)s])%(eos)s'),         ):-            regex = regex % {'sep': sep}+            regex = regex % {'sep': sep, 'eos': end_of_str_metachar}             assert glob_to_re(glob) == regex
setuptools/_distutils/tests/test_util.py +1 lines
--- +++ @@ -45,10 +45,3 @@     def test_get_host_platform(self):-        with mock.patch('os.name', 'nt'):-            with mock.patch('sys.version', '... [... (ARM64)]'):-                assert get_host_platform() == 'win-arm64'-            with mock.patch('sys.version', '... [... (ARM)]'):-                assert get_host_platform() == 'win-arm32'--        with mock.patch('sys.version_info', (3, 9, 0, 'final', 0)):-            assert get_host_platform() == stdlib_sysconfig.get_platform()+        assert get_host_platform() == stdlib_sysconfig.get_platform() 
setuptools/_distutils/util.py +1 lines
--- +++ @@ -503,3 +503,3 @@ -def is_freethreaded():+def is_freethreaded() -> bool:     """Return True if the Python interpreter is built with free threading support."""
setuptools/_importlib.py +1 lines
--- +++ @@ -1,9 +1,2 @@-import sys--if sys.version_info < (3, 10):-    import importlib_metadata as metadata  # pragma: no cover-else:-    import importlib.metadata as metadata  # noqa: F401--+import importlib.metadata as metadata  # noqa: F401 import importlib.resources as resources  # noqa: F401
setuptools/_path.py +4 lines
--- +++ @@ -5,3 +5,3 @@ import sys-from typing import TYPE_CHECKING, TypeVar, Union+from typing import TYPE_CHECKING, TypeVar @@ -10,6 +10,6 @@ if TYPE_CHECKING:-    from typing_extensions import TypeAlias+    from typing import TypeAlias -StrPath: TypeAlias = Union[str, os.PathLike[str]]  #  Same as _typeshed.StrPath-StrPathT = TypeVar("StrPathT", bound=Union[str, os.PathLike[str]])+StrPath: TypeAlias = str | os.PathLike[str]  #  Same as _typeshed.StrPath+StrPathT = TypeVar("StrPathT", bound=str | os.PathLike[str]) 
setuptools/_reqs.py +4 lines
--- +++ @@ -2,5 +2,5 @@ -from collections.abc import Iterable, Iterator+from collections.abc import Callable, Iterable, Iterator from functools import lru_cache-from typing import TYPE_CHECKING, Callable, TypeVar, Union, overload+from typing import TYPE_CHECKING, TypeVar, overload @@ -10,6 +10,6 @@ if TYPE_CHECKING:-    from typing_extensions import TypeAlias+    from typing import TypeAlias  _T = TypeVar("_T")-_StrOrIter: TypeAlias = Union[str, Iterable[str]]+_StrOrIter: TypeAlias = str | Iterable[str] 
setuptools/_shutil.py +2 lines
--- +++ @@ -4,3 +4,4 @@ import stat-from typing import Callable, TypeVar+from collections.abc import Callable+from typing import TypeVar 
setuptools/build_meta.py +3 lines
--- +++ @@ -41,3 +41,3 @@ from pathlib import Path-from typing import TYPE_CHECKING, NoReturn, Union+from typing import TYPE_CHECKING, NoReturn @@ -54,3 +54,3 @@ if TYPE_CHECKING:-    from typing_extensions import TypeAlias+    from typing import TypeAlias @@ -146,3 +146,3 @@ -_ConfigSettings: TypeAlias = Union[Mapping[str, Union[str, list[str], None]], None]+_ConfigSettings: TypeAlias = Mapping[str, str | list[str] | None] | None """
setuptools/command/bdist_egg.py +2 lines
--- +++ @@ -25,4 +25,5 @@ if TYPE_CHECKING:+    from typing import TypeAlias+     from _typeshed import GenericPath-    from typing_extensions import TypeAlias 
urllib3 pypi
2.7.0 2mo ago incident on record
critical-tier YANK ×4BURST ×3
latest 2.7.0 versions 108 maintainers 1 critical-tier (snapshotted)
2.2.2
1.26.19
1.26.20
2.2.3
2.3.0
2.4.0
2.5.0
2.6.0
2.6.1
2.6.2
2.6.3
2.7.0
YANK
1.25 marked yanked (still downloadable)
high · registry-verified · 2019-04-22 · 7y ago
YANK
1.25.1 marked yanked (still downloadable)
high · registry-verified · 2019-04-24 · 7y ago
YANK
2.0.0 marked yanked (still downloadable)
high · registry-verified · 2023-04-26 · 3y ago
YANK
2.0.1 marked yanked (still downloadable)
high · registry-verified · 2023-04-30 · 3y ago
BURST
2 releases in 2m: 1.9.1, 1.10
info · registry-verified · 2014-12-14 · 11y ago
BURST
2 releases in 0m: 1.26.17, 2.0.6
info · registry-verified · 2023-10-02 · 2y ago
BURST
2 releases in 0m: 2.0.7, 1.26.18
info · registry-verified · 2023-10-17 · 2y ago
release diff 2.6.3 → 2.7.0
+0 added · -0 removed · ~40 modified
+9 more files not shown
src/urllib3/connection.py +4 lines · 2 flagged
--- +++ @@ -533,4 +533,4 @@             "HTTPConnection.request_chunked() is deprecated and will be removed "-            "in urllib3 v2.1.0. Instead use HTTPConnection.request(..., chunked=True).",-            category=DeprecationWarning,+            "in urllib3 v3.0. Instead use HTTPConnection.request(..., chunked=True).",+            category=FutureWarning,             stacklevel=2,@@ -699,5 +699,5 @@             "HTTPSConnection.set_cert() is deprecated and will be removed "-            "in urllib3 v2.1.0. Instead provide the parameters to the "+            "in urllib3 v3.0. Instead provide the parameters to the "             "HTTPSConnection constructor.",-            category=DeprecationWarning,+            category=FutureWarning,             stacklevel=2,
src/urllib3/connectionpool.py +23 lines · 1 flagged
--- +++ @@ -218,4 +218,4 @@             # Enable Nagle's algorithm for proxies, to avoid packet fragmentation.-            # We cannot know if the user has added default socket options, so we cannot replace the-            # list.+            # Defaulting `socket_options` to an empty list avoids it defaulting to+            # ``HTTPConnection.default_socket_options``.             self.conn_kw.setdefault("socket_options", [])@@ -704,4 +704,11 @@         """-        parsed_url = parse_url(url)-        destination_scheme = parsed_url.scheme+        # Ensure that the URL we're connecting to is properly encoded+        if url.startswith("/"):+            # URLs starting with / are inherently schemeless.+            url = to_str(_encode_target(url))+            destination_scheme = None+        else:+            parsed_url = parse_url(url)+            destination_scheme = parsed_url.scheme+            url = to_str(parsed_url.url) @@ -719,8 +726,2 @@             raise HostChangedError(self, url, retries)--        # Ensure that the URL we're connecting to is properly encoded-        if url.startswith("/"):-            url = to_str(_encode_target(url))-        else:-            url = to_str(parsed_url.url) @@ -897,2 +898,14 @@                 headers = HTTPHeaderDict(headers)._prepare_for_method_change()++            # Strip headers marked as unsafe to forward to the redirected location.+            # Check remove_headers_on_redirect to avoid a potential network call within+            # self.is_same_host() which may use socket.gethostbyname() in the future.+            if retries.remove_headers_on_redirect and not self.is_same_host(+                redirect_location+            ):+                new_headers = headers.copy()  # type: ignore[union-attr]+                for header in headers:+                    if header.lower() in retries.remove_headers_on_redirect:+                        new_headers.pop(header, None)+                headers = new_headers 
src/urllib3/contrib/socks.py +1 lines · 1 flagged
--- +++ @@ -143,3 +143,3 @@                     )-            else:+            else:  # Defensive: see https://github.com/urllib3/urllib3/pull/3728#pullrequestreview-3816302703                 raise NewConnectionError(
src/urllib3/exceptions.py +2 lines · 1 flagged
--- +++ @@ -157,4 +157,4 @@             "The 'pool' property is deprecated and will be removed "-            "in urllib3 v2.1.0. Use 'conn' instead.",-            DeprecationWarning,+            "in urllib3 v3.0. Use 'conn' instead.",+            FutureWarning,             stacklevel=2,
src/urllib3/fields.py +14 lines · 9 flagged
--- +++ @@ -47,3 +47,3 @@     .. deprecated:: 2.0.0-        Will be removed in urllib3 v2.1.0. This is not valid for+        Will be removed in urllib3 v3.0. This is not valid for         ``multipart/form-data`` header parameters.@@ -53,6 +53,6 @@     warnings.warn(-        "'format_header_param_rfc2231' is deprecated and will be "-        "removed in urllib3 v2.1.0. This is not valid for "+        "'format_header_param_rfc2231' is insecure, deprecated and will be "+        "removed in urllib3 v3.0. This is not valid for "         "multipart/form-data header parameters.",-        DeprecationWarning,+        FutureWarning,         stacklevel=2,@@ -106,3 +106,3 @@         ``format_header_param``. The old names will be removed in-        urllib3 v2.1.0.+        urllib3 v3.0.     """@@ -120,3 +120,3 @@         Renamed to :func:`format_multipart_header_param`. Will be-        removed in urllib3 v2.1.0.+        removed in urllib3 v3.0.     """@@ -127,4 +127,4 @@         "'format_multipart_header_param'. The old name will be "-        "removed in urllib3 v2.1.0.",-        DeprecationWarning,+        "removed in urllib3 v3.0.",+        FutureWarning,         stacklevel=2,@@ -138,3 +138,3 @@         Renamed to :func:`format_multipart_header_param`. Will be-        removed in urllib3 v2.1.0.+        removed in urllib3 v3.0.     """@@ -145,4 +145,4 @@         "'format_multipart_header_param'. The old name will be "-        "removed in urllib3 v2.1.0.",-        DeprecationWarning,+        "removed in urllib3 v3.0.",+        FutureWarning,         stacklevel=2,@@ -167,3 +167,3 @@         The ``header_formatter`` parameter is deprecated and will-        be removed in urllib3 v2.1.0.+        be removed in urllib3 v3.0.     """@@ -190,4 +190,4 @@                 "The 'header_formatter' parameter is deprecated and "-                "will be removed in urllib3 v2.1.0.",-                DeprecationWarning,+                "will be removed in urllib3 v3.0.",+                FutureWarning,                 stacklevel=2,
src/urllib3/poolmanager.py +9 lines · 2 flagged
--- +++ @@ -330,4 +330,4 @@                 "The 'strict' parameter is no longer needed on Python 3+. "-                "This will raise an error in urllib3 v2.1.0.",-                DeprecationWarning,+                "This will raise an error in urllib3 v3.0.",+                FutureWarning,             )@@ -438,6 +438,6 @@                 "URLs without a scheme (ie 'https://') are deprecated and will raise an error "-                "in a future version of urllib3. To avoid this DeprecationWarning ensure all URLs "+                "in urllib3 v3.0. To avoid this FutureWarning ensure all URLs "                 "start with 'https://' or 'http://'. Read more in this issue: "                 "https://github.com/urllib3/urllib3/issues/2920",-                category=DeprecationWarning,+                category=FutureWarning,                 stacklevel=2,@@ -546,5 +546,6 @@ -        resp1 = proxy.request("GET", "https://google.com/")-        resp2 = proxy.request("GET", "https://httpbin.org/")-+        resp1 = proxy.request("GET", "http://google.com/")+        resp2 = proxy.request("GET", "http://httpbin.org/")++        # One pool was shared by both plain HTTP requests.         print(len(proxy.pools))@@ -555,2 +556,3 @@ +        # A separate pool was added for each HTTPS target.         print(len(proxy.pools))
src/urllib3/response.py +35 lines · 1 flagged
--- +++ @@ -665,3 +665,3 @@     # Compatibility methods for `io` module-    def readinto(self, b: bytearray) -> int:+    def readinto(self, b: bytearray | memoryview[int]) -> int:         temp = self.read(len(b))@@ -757,2 +757,3 @@         self._body = None+        self._uncached_read_occurred = False         self._fp: _HttplibHTTPResponse | None = None@@ -799,9 +800,10 @@         try:-            self.read(-                # Do not spend resources decoding the content unless-                # decoding has already been initiated.-                decode_content=self._has_decoded_content,-            )+            self._raw_read()         except (HTTPError, OSError, BaseSSLError, HTTPException):             pass+        if self._has_decoded_content:+            # `_raw_read` skips decompression, so we should clean up the+            # decoder to avoid keeping unnecessary data in memory.+            self._decoded_buffer = BytesQueueBuffer()+            self._decoder = None @@ -828,3 +830,3 @@         Obtain the number of bytes pulled over the wire so far. May differ from-        the amount of content returned by :meth:``urllib3.response.HTTPResponse.read``+        the amount of content returned by :meth:`HTTPResponse.read`         if bytes are encoded on the wire (e.g, compressed).@@ -910,8 +912,4 @@             except BaseSSLError as e:-                # FIXME: Is there a better way to differentiate between SSLErrors?-                if "read operation timed out" not in str(e):-                    # SSL errors related to framing/MAC get wrapped and reraised here-                    raise SSLError(e) from e--                raise ReadTimeoutError(self._pool, None, "Read timed out.") from e  # type: ignore[arg-type]+                # SSL errors related to framing/MAC get wrapped and reraised here+                raise SSLError(e) from e @@ -968,7 +966,3 @@ -        The known cases:-          * CPython < 3.9.7 because of a bug-            https://github.com/urllib3/urllib3/issues/2513#issuecomment-1152559900.-          * urllib3 injected with pyOpenSSL-backed SSL-support.-          * CPython < 3.10 only when `amt` does not fit 32-bit int.+        This happens to urllib3 injected with pyOpenSSL-backed SSL-support.         """@@ -983,3 +977,3 @@             )-        ) and (util.IS_PYOPENSSL or sys.version_info < (3, 10)):+        ) and util.IS_PYOPENSSL:             if read1:@@ -1100,3 +1094,7 @@ -            if self._decoder and self._decoder.has_unconsumed_tail:+            if (+                self._decoder+                and self._decoder.has_unconsumed_tail+                and len(self._decoded_buffer) < amt+            ):                 decoded_data = self._decode(@@ -1112,2 +1110,4 @@         data = self._raw_read(amt)+        if not cache_content:+            self._uncached_read_occurred = True @@ -1124,3 +1124,9 @@             data = self._decode(data, decode_content, flush_decoder)-            if cache_content:+            # It's possible that there is buffered decoded data after a+            # partial read.+            if decode_content and len(self._decoded_buffer) > 0:+                self._decoded_buffer.put(data)+                data = self._decoded_buffer.get_all()++            if cache_content and not self._uncached_read_occurred:                 self._body = data@@ -1212,2 +1218,3 @@         data = self._raw_read(amt, read1=True)+        self._uncached_read_occurred = True         if not decode_content or data is None:@@ -1248,2 +1255,5 @@         """+        if amt == 0:+            return+         if self.chunked and self.supports_chunked_reads():@@ -1407,3 +1417,5 @@ -            if amt and amt < 0:+            if amt == 0:+                return+            elif amt and amt < 0:                 # Negative numbers and `None` should be treated the same,@@ -1418,2 +1430,3 @@                     self._update_chunk_length()+                    self._uncached_read_occurred = True                     if self.chunk_left == 0:
src/urllib3/util/ssl_.py +11 lines · 1 flagged
--- +++ @@ -29,34 +29,4 @@ -def _is_bpo_43522_fixed(-    implementation_name: str,-    version_info: _TYPE_VERSION_INFO,-    pypy_version_info: _TYPE_VERSION_INFO | None,-) -> bool:-    """Return True for CPython 3.9.3+ or 3.10+ and PyPy 7.3.8+ where-    setting SSLContext.hostname_checks_common_name to False works.--    Outside of CPython and PyPy we don't know which implementations work-    or not so we conservatively use our hostname matching as we know that works-    on all implementations.--    https://github.com/urllib3/urllib3/issues/2192#issuecomment-821832963-    https://foss.heptapod.net/pypy/pypy/-/issues/3539-    """-    if implementation_name == "pypy":-        # https://foss.heptapod.net/pypy/pypy/-/issues/3129-        return pypy_version_info >= (7, 3, 8)  # type: ignore[operator]-    elif implementation_name == "cpython":-        major_minor = version_info[:2]-        micro = version_info[2]-        return (major_minor == (3, 9) and micro >= 3) or major_minor >= (3, 10)-    else:  # Defensive:-        return False-- def _is_has_never_check_common_name_reliable(     openssl_version: str,-    openssl_version_number: int,-    implementation_name: str,-    version_info: _TYPE_VERSION_INFO,-    pypy_version_info: _TYPE_VERSION_INFO | None, ) -> bool:@@ -65,12 +35,4 @@     is_openssl = openssl_version.startswith("OpenSSL ")-    # Before fixing OpenSSL issue #14579, the SSL_new() API was not copying hostflags-    # like X509_CHECK_FLAG_NEVER_CHECK_SUBJECT, which tripped up CPython.-    # https://github.com/openssl/openssl/issues/14579-    # This was released in OpenSSL 1.1.1l+ (>=0x101010cf)-    is_openssl_issue_14579_fixed = openssl_version_number >= 0x101010CF--    return is_openssl and (-        is_openssl_issue_14579_fixed-        or _is_bpo_43522_fixed(implementation_name, version_info, pypy_version_info)-    )++    return is_openssl @@ -100,5 +62,5 @@         OPENSSL_VERSION,-        OPENSSL_VERSION_NUMBER,         PROTOCOL_TLS,         PROTOCOL_TLS_CLIENT,+        VERIFY_X509_PARTIAL_CHAIN,         VERIFY_X509_STRICT,@@ -112,14 +74,7 @@ -    # Needed for Python 3.9 which does not define this-    VERIFY_X509_PARTIAL_CHAIN = getattr(ssl, "VERIFY_X509_PARTIAL_CHAIN", 0x80000)--    # Setting SSLContext.hostname_checks_common_name = False didn't work before CPython-    # 3.9.3, and 3.10 (but OK on PyPy) or OpenSSL 1.1.1l++    # Setting SSLContext.hostname_checks_common_name = False didn't work with+    # LibreSSL, check details in the used function.     if HAS_NEVER_CHECK_COMMON_NAME and not _is_has_never_check_common_name_reliable(         OPENSSL_VERSION,-        OPENSSL_VERSION_NUMBER,-        sys.implementation.name,-        sys.version_info,-        sys.pypy_version_info if sys.implementation.name == "pypy" else None,  # type: ignore[attr-defined]-    ):  # Defensive: for Python < 3.9.3+    ):  # Defensive:         HAS_NEVER_CHECK_COMMON_NAME = False@@ -144,3 +99,3 @@     PROTOCOL_TLS_CLIENT = 16  # type: ignore[assignment, misc]-    VERIFY_X509_PARTIAL_CHAIN = 0x80000+    VERIFY_X509_PARTIAL_CHAIN = 0x80000  # type: ignore[assignment,misc]     VERIFY_X509_STRICT = 0x20  # type: ignore[assignment, misc]@@ -291,4 +246,4 @@                 "'ssl_version' option is deprecated and will be "-                "removed in urllib3 v2.6.0. Instead use 'ssl_minimum_version'",-                category=DeprecationWarning,+                "removed in urllib3 v3.0. Instead use 'ssl_minimum_version'",+                category=FutureWarning,                 stacklevel=2,@@ -296,8 +251,6 @@ -    # PROTOCOL_TLS is deprecated in Python 3.10 so we always use PROTOCOL_TLS_CLIENT     context = SSLContext(PROTOCOL_TLS_CLIENT)-     if ssl_minimum_version is not None:         context.minimum_version = ssl_minimum_version-    else:  # Python <3.10 defaults to 'MINIMUM_SUPPORTED' so explicitly set TLSv1.2 here+    else:  # pyOpenSSL defaults to 'MINIMUM_SUPPORTED' so explicitly set TLSv1.2 here         context.minimum_version = TLSVersion.TLSv1_2@@ -361,6 +314,3 @@ -    try:-        context.hostname_checks_common_name = False-    except AttributeError:  # Defensive: for CPython < 3.9.3; for PyPy < 7.3.8-        pass+    context.hostname_checks_common_name = False 
test/contrib/emscripten/test_emscripten.py +61 lines · 2 flagged
--- +++ @@ -33,3 +33,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int, prefer_jspi: bool) -> None:  # type: ignore[no-untyped-def]@@ -68,3 +68,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int, https_port: int, prefer_jspi: bool) -> None:  # type: ignore[no-untyped-def]@@ -78,3 +78,5 @@         resp = http.request("GET", f"http://{host}:{port}/")-        assert resp.data.decode("utf-8") == "Dummy server!"+        # ensure that the response is cached and can be read multiple times+        for _ in range(2):+            assert resp.data.decode("utf-8") == "Dummy server!" @@ -137,3 +139,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -158,3 +160,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -179,3 +181,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -196,3 +198,3 @@ def test_404(selenium_coverage: typing.Any, testserver_http: PyodideServerInfo) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -220,3 +222,3 @@ ) -> None:-    @run_in_pyodide()  # type: ignore[misc]+    @run_in_pyodide()  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -312,3 +314,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int, connection_cls: str) -> None:  # type: ignore[no-untyped-def]@@ -336,3 +338,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -376,3 +378,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -420,3 +422,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -604,3 +606,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -635,3 +637,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -676,3 +678,3 @@ ) -> None:-    @run_in_pyodide(packages=["micropip"])  # type: ignore[misc]+    @run_in_pyodide(packages=["micropip"])  # type: ignore[untyped-decorator]     async def test_fn(@@ -704,3 +706,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -820,3 +822,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -864,3 +866,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -884,3 +886,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -905,3 +907,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -940,3 +942,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage: typing.Any, host: str, port: int) -> None:@@ -961,3 +963,3 @@ -    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage: typing.Any, host: str, port: int) -> None:@@ -1002,3 +1004,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int, https_port: int) -> None:  # type: ignore[no-untyped-def]@@ -1102,2 +1104,5 @@         assert len(all_data.decode("utf-8")) == 17825792+        # ensure that the content is not cached+        assert response._body is None+        assert response.data == b"" @@ -1149,2 +1154,30 @@ +def test_cache_content_ignored_during_and_after_partial_read(+    selenium_coverage: typing.Any, testserver_http: PyodideServerInfo+) -> None:+    @run_in_pyodide+    def pyodide_test(selenium, host, port):  # type: ignore[no-untyped-def]+        from urllib3.connection import HTTPConnection+        from urllib3.response import BaseHTTPResponse++        conn = HTTPConnection(host, port)+        conn.request("GET", f"http://{host}:{port}/dripfeed", preload_content=False)+        response = conn.getresponse()+        assert isinstance(response, BaseHTTPResponse)+        # read some of the data but not all of it+        data = response.read(32768, cache_content=True)+        assert len(data) == 32768+        # check that the cached content is empty+        assert response._body is None+        # ensure the rest of the data is not cached either+        data += response.read(cache_content=True)+        assert len(data) == 17825792+        assert response._body is None+        assert response.data == b""++    pyodide_test(+        selenium_coverage, testserver_http.http_host, testserver_http.http_port+    )++ @pytest.mark.node_without_jspi@@ -1156,3 +1189,3 @@ -    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -1183,3 +1216,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -1206,3 +1239,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -1250,3 +1283,3 @@ ) -> None:-    @run_in_pyodide  # type: ignore[misc]+    @run_in_pyodide  # type: ignore[untyped-decorator]     def pyodide_test(selenium_coverage, host: str, port: int) -> None:  # type: ignore[no-untyped-def]@@ -1282,3 +1315,3 @@ -@run_in_pyodide  # type: ignore[misc]+@run_in_pyodide  # type: ignore[untyped-decorator] def test_pool_no_port(selenium_coverage: typing.Any) -> None:
test/test_connection.py +7 lines · 1 flagged
--- +++ @@ -302,10 +302,10 @@ -        # When dropping support for Python 3.9, this can be rewritten to parenthesized-        # context managers-        with mock.patch("urllib3.util.connection.create_connection"):-            with mock.patch(+        with (+            mock.patch("urllib3.util.connection.create_connection"),+            mock.patch(                 "urllib3.connection._HTTPConnection.putheader"-            ) as http_client_putheader:-                conn = HTTPConnection("")-                conn.request("GET", "/headers", headers=headers, chunked=chunked)+            ) as http_client_putheader,+        ):+            conn = HTTPConnection("")+            conn.request("GET", "/headers", headers=headers, chunked=chunked) 
test/test_connectionpool.py +22 lines · 1 flagged
--- +++ @@ -594 +594,23 @@                     pool._make_request(conn, "", "", timeout=timeout)++    @pytest.mark.parametrize(+        "path",+        [+            "//v:h",+            "//host:8080/path",+            "//host/path",+            "//v:h?key=val",+            "/",+        ],+    )+    def test_paths_arent_parsed_as_urls(self, path: str) -> None:+        """See https://github.com/urllib3/urllib3/issues/3352."""+        with HTTPConnectionPool(host="localhost", port=80) as pool:+            with patch.object(+                pool, "_make_request", return_value=HTTPResponse(status=200)+            ) as mock_request:+                pool.urlopen("GET", path)++            # Verify the URL isn't mangled+            actual_url = mock_request.call_args[0][2]+            assert actual_url == path
test/test_exceptions.py +2 lines · 1 flagged
--- +++ @@ -79,3 +79,3 @@         err = NewConnectionError(HTTPConnection("localhost"), "test")-        with pytest.warns(DeprecationWarning) as records:+        with pytest.warns(FutureWarning) as records:             err_pool = err.pool@@ -85,3 +85,3 @@             "The 'pool' property is deprecated and will be removed "-            "in urllib3 v2.1.0. Use 'conn' instead."+            "in urllib3 v3.0. Use 'conn' instead."         )
test/test_fields.py +4 lines · 4 flagged
--- +++ @@ -74,3 +74,3 @@     ) -> None:-        with pytest.deprecated_call(match=r"urllib3 v2\.1\.0"):+        with pytest.deprecated_call(match=r"urllib3 v3\.0"):             param = format_header_param_rfc2231("filename", value)@@ -80,6 +80,6 @@     def test_format_header_param_html5_deprecated(self) -> None:-        with pytest.deprecated_call(match=r"urllib3 v2\.1\.0"):+        with pytest.deprecated_call(match=r"urllib3 v3\.0"):             param2 = format_header_param_html5("filename", "name") -        with pytest.deprecated_call(match=r"urllib3 v2\.1\.0"):+        with pytest.deprecated_call(match=r"urllib3 v3\.0"):             param1 = format_header_param("filename", "name")@@ -113,3 +113,3 @@     def test_from_tuples_rfc2231(self) -> None:-        with pytest.deprecated_call(match=r"urllib3 v2\.1\.0"):+        with pytest.deprecated_call(match=r"urllib3 v3\.0"):             field = RequestField.from_tuples(
test/test_poolmanager.py +6 lines · 2 flagged
--- +++ @@ -263,3 +263,3 @@     def test_deprecated_no_scheme(self, connection_from_host: mock.MagicMock) -> None:-        # Don't actually make a network connection, just verify the DeprecationWarning+        # Don't actually make a network connection, just verify the FutureWarning         connection_from_host.side_effect = ConnectionError("Not attempting connection")@@ -267,3 +267,3 @@ -        with pytest.warns(DeprecationWarning) as records:+        with pytest.warns(FutureWarning) as records:             with pytest.raises(ConnectionError):@@ -273,3 +273,3 @@             "URLs without a scheme (ie 'https://') are deprecated and will raise an error "-            "in a future version of urllib3. To avoid this DeprecationWarning ensure all URLs "+            "in urllib3 v3.0. To avoid this FutureWarning ensure all URLs "             "start with 'https://' or 'http://'. Read more in this issue: "@@ -279,3 +279,3 @@         assert len(records) == 1-        assert isinstance(records[0].message, DeprecationWarning)+        assert isinstance(records[0].message, FutureWarning)         assert records[0].message.args[0] == msg@@ -293,3 +293,3 @@         }-        with pytest.warns(DeprecationWarning) as records:+        with pytest.warns(FutureWarning) as records:             p.connection_from_context(context)@@ -298,3 +298,3 @@             "The 'strict' parameter is no longer needed on Python 3+. "-            "This will raise an error in urllib3 v2.1.0."+            "This will raise an error in urllib3 v3.0."         )
test/test_ssl.py +3 lines · 1 flagged
--- +++ @@ -72,7 +72,3 @@         else:-            # Needed for Python 3.9 which does not define this-            assert not (-                context.verify_flags-                & getattr(ssl, "VERIFY_X509_PARTIAL_CHAIN", 0x80000)-            )+            assert not (context.verify_flags & ssl.VERIFY_X509_PARTIAL_CHAIN)             assert not (context.verify_flags & ssl.VERIFY_X509_STRICT)@@ -241,5 +237,5 @@         with pytest.warns(-            DeprecationWarning,+            FutureWarning,             match=r"'ssl_version' option is deprecated and will be removed in "-            r"urllib3 v2\.6\.0\. Instead use 'ssl_minimum_version'",+            r"urllib3 v3\.0\. Instead use 'ssl_minimum_version'",         ):
test/with_dummyserver/test_connectionpool.py +3 lines · 1 flagged
--- +++ @@ -498,3 +498,3 @@             with warnings.catch_warnings():-                warnings.simplefilter("error", DeprecationWarning)+                warnings.simplefilter("error", FutureWarning)                 pool.request("GET", "/redirect", fields={"target": "/"})@@ -1100,6 +1100,6 @@ -            with pytest.warns(DeprecationWarning) as w:+            with pytest.warns(FutureWarning) as w:                 conn.request_chunked("GET", "/headers")  # type: ignore[attr-defined]             assert len(w) == 1 and str(w[0].message) == (-                "HTTPConnection.request_chunked() is deprecated and will be removed in urllib3 v2.1.0. "+                "HTTPConnection.request_chunked() is deprecated and will be removed in urllib3 v3.0. "                 "Instead use HTTPConnection.request(..., chunked=True)."
test/with_dummyserver/test_https.py +11 lines · 5 flagged
--- +++ @@ -763,5 +763,5 @@                 cmgr = pytest.warns(-                    DeprecationWarning,+                    FutureWarning,                     match=r"'ssl_version' option is deprecated and will be removed "-                    r"in urllib3 v2\.6\.0\. Instead use 'ssl_minimum_version'",+                    r"in urllib3 v3\.0\. Instead use 'ssl_minimum_version'",                 )@@ -773,3 +773,3 @@         conn = VerifiedHTTPSConnection(self.host, self.port)-        with pytest.warns(DeprecationWarning) as w:+        with pytest.warns(FutureWarning) as w:             conn.set_cert()@@ -777,3 +777,3 @@         assert len(w) == 1 and str(w[0].message) == (-            "HTTPSConnection.set_cert() is deprecated and will be removed in urllib3 v2.1.0. "+            "HTTPSConnection.set_cert() is deprecated and will be removed in urllib3 v3.0. "             "Instead provide the parameters to the HTTPSConnection constructor."@@ -789,3 +789,3 @@         conn = HTTPSConnection(self.host, self.port, ssl_context=ssl_context)-        with pytest.warns(DeprecationWarning) as w:+        with pytest.warns(FutureWarning) as w:             conn.set_cert()@@ -797,3 +797,3 @@         assert len(w) == 1 and str(w[0].message) == (-            "HTTPSConnection.set_cert() is deprecated and will be removed in urllib3 v2.1.0. "+            "HTTPSConnection.set_cert() is deprecated and will be removed in urllib3 v3.0. "             "Instead provide the parameters to the HTTPSConnection constructor."@@ -830,3 +830,3 @@             with contextlib.closing(https_pool._get_conn()) as conn:-                with pytest.warns(DeprecationWarning) as w:+                with pytest.warns(FutureWarning) as w:                     conn.connect()@@ -834,3 +834,3 @@         assert len(w) >= 1-        assert any(x.category == DeprecationWarning for x in w)+        assert any(x.category == FutureWarning for x in w)         assert any(@@ -839,3 +839,3 @@                 "'ssl_version' option is deprecated and will be removed in "-                "urllib3 v2.6.0. Instead use 'ssl_minimum_version'"+                "urllib3 v3.0. Instead use 'ssl_minimum_version'"             )@@ -1144,5 +1144,5 @@         with pytest.warns(-            DeprecationWarning,+            FutureWarning,             match=r"'ssl_version' option is deprecated and will be removed in "-            r"urllib3 v2\.6\.0\. Instead use 'ssl_minimum_version'",+            r"urllib3 v3\.0\. Instead use 'ssl_minimum_version'",         ):
test/with_dummyserver/test_proxy_poolmanager.py +72 lines · 1 flagged
--- +++ @@ -39,2 +39,3 @@ from urllib3.poolmanager import ProxyManager, proxy_from_url+from urllib3.util.retry import RequestHistory from urllib3.util.ssl_ import create_urllib3_context@@ -301,2 +302,73 @@             assert r._pool.host != self.http_host_alt++    _sensitive_headers = {+        "Authorization": "foo",+        "Proxy-Authorization": "bar",+        "Cookie": "foo=bar",+    }++    @pytest.mark.parametrize(+        "sensitive_headers",+        (_sensitive_headers, {k.lower(): v for k, v in _sensitive_headers.items()}),+        ids=("capitalized", "lowercase"),+    )+    def test_cross_host_redirect_remove_headers_via_proxy_manager(+        self, sensitive_headers: dict[str, str]+    ) -> None:+        headers_url = f"{self.http_url_alt}/headers"+        initial_url = f"{self.http_url}/redirect?target={headers_url}"+        with proxy_from_url(self.proxy_url) as proxy_mgr:+            r = proxy_mgr.request(+                "GET", initial_url, headers=sensitive_headers, retries=1+            )+            assert r.status == 200+            assert r.retries is not None+            assert r.retries.history == (+                RequestHistory(+                    method="GET",+                    url=initial_url,+                    error=None,+                    status=303,+                    redirect_location=headers_url,+                ),+            )+            data = r.json()+            for header in sensitive_headers:+                assert header not in data++    @pytest.mark.parametrize(+        "sensitive_headers",+        (_sensitive_headers, {k.lower(): v for k, v in _sensitive_headers.items()}),+        ids=("capitalized", "lowercase"),+    )+    def test_cross_host_redirect_remove_headers_via_pool(+        self, sensitive_headers: dict[str, str]+    ) -> None:+        headers_url = f"{self.http_url_alt}/headers"+        initial_url = f"{self.http_url}/redirect?target={headers_url}"+        with proxy_from_url(self.proxy_url) as proxy_mgr:+            pool = proxy_mgr.connection_from_url(self.http_url)+            r = pool.urlopen(+                "GET",+                initial_url,+                headers=sensitive_headers,+                retries=1,+                redirect=True,+                assert_same_host=False,+                preload_content=True,+            )+            assert r.status == 200+            assert r.retries is not None+            assert r.retries.history == (+                RequestHistory(+                    method="GET",+                    url=initial_url,+                    error=None,+                    status=303,+                    redirect_location=headers_url,+                ),+            )+            data = r.json()+            for header in sensitive_headers:+                assert header not in data 
dummyserver/asgi_proxy.py +1 lines
--- +++ @@ -58,2 +58,3 @@                 url=scope["path"],+                params=scope["query_string"].decode(),                 headers=list(scope["headers"]),
dummyserver/testcase.py +2 lines
--- +++ @@ -31,3 +31,3 @@             b = sock.recv(chunks)-        except (TimeoutError, socket.timeout):+        except TimeoutError:             continue@@ -104,3 +104,3 @@                         break-                    except (TimeoutError, socket.timeout):+                    except TimeoutError:                         continue
pyproject.toml +35 lines
--- +++ @@ -3,3 +3,3 @@ [build-system]-requires = ["hatchling>=1.27.0,<2", "hatch-vcs>=0.4.0,<0.6.0", "setuptools-scm>=8,<10"]+requires = ["hatchling>=1.27.0,<2", "hatch-vcs>=0.4.0,<0.6.0", "setuptools-scm>=8,<11"] build-backend = "hatchling.build"@@ -27,3 +27,2 @@   "Programming Language :: Python :: 3",-  "Programming Language :: Python :: 3.9",   "Programming Language :: Python :: 3.10",@@ -40,3 +39,3 @@ ]-requires-python = ">=3.9"+requires-python = ">=3.10" dynamic = ["version"]@@ -59,3 +58,3 @@ [dependency-groups]-dev = [+dev-base = [     "anyio[trio]>=4.8.0",@@ -63,3 +62,2 @@     "coverage>=7.8.0",-    "cryptography>=44.0.2",     "h2>=4.1.0",@@ -67,4 +65,2 @@     "hypercorn",-    "idna>=3.10",-    "pyopenssl>=25.0.0",     "pysocks>=1.7.1",@@ -77,4 +73,23 @@     "towncrier>=24.8.0",+    "trio>=0.27.0",+]+dev = [+    {include-group = "dev-base"},+    "cryptography>=44.0.2",+    "idna>=3.10",+    "pyopenssl>=25.0.0",     "trustme>=1.2.1",-    "trio>=0.27.0",+]+dev-min-pyopenssl = [+    {include-group = "dev-base"},+    # 19.0.0 (2019-01-21) was the first version to support OpenSSL 1.1.1.+    # The following versions of pyOpenSSL and cryptography are documented+    # as the minimum supported ones in our docs.+    "pyopenssl==19.0.0",+    "cryptography==2.3",+    # We document 2.1 as the minimum supported version of idna from+    # cryptography, but 2.8 is the minimum needed for tests because of anyio.+    "idna==2.8",+    # The last version of trustme to support cryptography < 3.1.+    "trustme==0.9.0", ]@@ -98,3 +113,3 @@     "build>=1.2.2.post1",-    "pytest-pyodide>=0.58.4 ; python_full_version >= '3.10'",+    "pytest-pyodide>=0.58.4",     "selenium>=4.27.1",@@ -164,3 +179,3 @@     # https://github.com/SeleniumHQ/selenium/issues/14686-    '''default:setting remote_server_addr in RemoteConnection\(\) is deprecated, set in ClientConfig instance instead:DeprecationWarning'''+    '''default:setting remote_server_addr in RemoteConnection\(\) is deprecated, set in ClientConfig instance instead:FutureWarning''' ]@@ -194,2 +209,12 @@ package = true+conflicts = [+  [+    {group = "dev"},+    {group = "dev-min-pyopenssl"},+  ],+  [+    {group = "dev-min-pyopenssl"},+    {group = "mypy"},+  ],+] 
src/urllib3/_base_connection.py +3 lines
--- +++ @@ -8,3 +8,5 @@ -_TYPE_BODY = typing.Union[bytes, typing.IO[typing.Any], typing.Iterable[bytes], str]+_TYPE_BODY = typing.Union[+    bytes, typing.IO[typing.Any], typing.Iterable[bytes | str], str+] 
src/urllib3/_collections.py +0 lines
--- +++ @@ -358,3 +358,2 @@         elif isinstance(other, typing.Iterable):-            other = typing.cast(typing.Iterable[tuple[str, str]], other)             for key, value in other:
src/urllib3/_version.py +8 lines
--- +++ @@ -1,3 +1,4 @@-# file generated by setuptools-scm+# file generated by vcs-versioning # don't change, don't track in version control+from __future__ import annotations @@ -12,22 +13,11 @@ -TYPE_CHECKING = False-if TYPE_CHECKING:-    from typing import Tuple-    from typing import Union--    VERSION_TUPLE = Tuple[Union[int, str], ...]-    COMMIT_ID = Union[str, None]-else:-    VERSION_TUPLE = object-    COMMIT_ID = object- version: str __version__: str-__version_tuple__: VERSION_TUPLE-version_tuple: VERSION_TUPLE-commit_id: COMMIT_ID-__commit_id__: COMMIT_ID+__version_tuple__: tuple[int | str, ...]+version_tuple: tuple[int | str, ...]+commit_id: str | None+__commit_id__: str | None -__version__ = version = '2.6.3'-__version_tuple__ = version_tuple = (2, 6, 3)+__version__ = version = '2.7.0'+__version_tuple__ = version_tuple = (2, 7, 0) 
src/urllib3/contrib/emscripten/response.py +5 lines
--- +++ @@ -38,2 +38,3 @@         self._body = None+        self._uncached_read_occurred = False         self._response = internal_response@@ -162,6 +163,9 @@                 data = self._response.body.read(amt)+                self._uncached_read_occurred = True             else:  # read all we can (and cache it)                 data = self._response.body.read()-                if cache_content:+                if cache_content and not self._uncached_read_occurred:                     self._body = data+                else:+                    self._uncached_read_occurred = True             if self.length_remaining is not None:
aiobotocore pypi
3.7.0 2mo ago nominal
critical-tier BURST ×2
latest 3.7.0 versions 134 maintainers 1 critical-tier (snapshotted)
3.0.0
3.1.0
3.1.1
3.1.2
3.1.3
3.2.0
3.2.1
3.3.0
3.4.0
3.5.0
3.6.0
3.7.0
BURST
2 releases in 29m: 2.1.2, 2.5.2
info · registry-verified · 2023-07-07 · 3y ago
BURST
2 releases in 27m: 2.10.0, 2.11.0
info · registry-verified · 2024-01-19 · 2y ago
release diff 3.6.0 → 3.7.0
+1 added · -0 removed · ~12 modified
aiobotocore/credentials.py +28 lines · 2 flagged
--- +++ @@ -554,2 +554,9 @@ +def _run_credential_process_sync(process_list):+    # Synchronous fallback for event loops that don't implement+    # subprocess transports. Caller runs this via ``asyncio.to_thread``.+    p = subprocess.run(process_list, capture_output=True, check=False)+    return p.stdout, p.stderr, p.returncode++ class AioProcessProvider(ProcessProvider):@@ -585,7 +592,19 @@         process_list = compat_shell_split(credential_process)-        p = await self._popen(-            *process_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE-        )-        stdout, stderr = await p.communicate()-        if p.returncode != 0:+        try:+            p = await self._popen(+                *process_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE+            )+            stdout, stderr = await p.communicate()+            returncode = p.returncode+        except NotImplementedError:+            # Some event loops don't implement subprocess transports —+            # notably ``asyncio.SelectorEventLoop`` on Windows, which+            # users select when integrating with libraries that don't+            # support the Proactor loop (e.g. ``psycopg``). Fall back+            # to running the credential process synchronously in a+            # worker thread so the loop stays unblocked. (#1415)+            stdout, stderr, returncode = await asyncio.to_thread(+                _run_credential_process_sync, process_list+            )+        if returncode != 0:             raise CredentialRetrievalError(@@ -777,2 +796,6 @@     async def load(self):+        # Reset visited profiles on each load() call to avoid false positives+        # when multiple async tasks concurrently call load() on the same provider+        # instance and one task's _visited_profiles state leaks into another.+        self._visited_profiles = [self._profile_name]         self._loaded_config = self._load_config()
aiobotocore/__init__.py +1 lines
--- +++ @@ -2,2 +2,2 @@ -__version__ = '3.6.0'+__version__ = '3.7.0'
aiobotocore/config.py +2 lines
--- +++ @@ -46,2 +46,3 @@         http_session_cls: type[_HttpSessionType] = DEFAULT_HTTP_SESSION_CLS,+        warm_up_loader_caches: bool = False,         **kwargs,@@ -54,2 +55,3 @@         self.http_session_cls: type[_HttpSessionType] = http_session_cls+        self.warm_up_loader_caches: bool = warm_up_loader_caches         self._validate_connector_args(
aiobotocore/session.py +52 lines
--- +++ @@ -1 +1,4 @@+import asyncio+import contextlib+ from botocore import UNSIGNED, translate@@ -127,2 +130,45 @@         return service_data++    def warm_up_loader_caches(+        self,+        service_name: str | None = None,+        api_version: str | None = None,+    ):+        loader = self.get_component('data_loader')++        # load generic data+        loader.load_data_with_path('_retry')+        loader.load_data_with_path('endpoints')+        loader.load_data_with_path('partitions')+        loader.load_data_with_path('sdk-default-configuration')+        services = loader.list_available_services(type_name='service-2')++        # load service-specific data+        for service_name in (service_name,) if service_name else services:+            # from session.py+            loader.load_service_model(+                service_name, type_name='service-2', api_version=api_version+            )+            with contextlib.suppress(UnknownServiceError):+                loader.load_service_model(+                    service_name, 'paginators-1', api_version+                )+            with contextlib.suppress(UnknownServiceError):+                loader.load_service_model(+                    service_name, 'waiters-2', api_version+                )++            # from client.py+            loader.load_service_model(+                service_name, 'service-2', api_version=api_version+            )+            loader.load_service_model(+                service_name, 'endpoint-rule-set-1', api_version=api_version+            )++            # from docs/service.py+            with contextlib.suppress(UnknownServiceError):+                loader.load_service_model(+                    service_name, 'examples-1', api_version+                ) @@ -169,2 +215,8 @@         loader = self.get_component('data_loader')++        if getattr(config, 'warm_up_loader_caches', False):+            await asyncio.to_thread(+                self.warm_up_loader_caches, service_name, api_version+            )+         event_emitter = self.get_component('event_emitter')
pyproject.toml +4 lines
--- +++ @@ -75,2 +75,3 @@     "pre-commit >= 3.5.0, < 5",+    "pytest-mock >= 3.14.1, < 4",  # Used in test_session.py     "pytest-rerunfailures >= 16.0.1, < 17", # Used in test_lambda.py@@ -99,2 +100,5 @@ anyio_mode = "auto"+# So tests can ``from scripts.changelog import ...`` (the centralized+# CHANGES.rst parser shared with .github/workflows/auto-release-on-merge.yml).+pythonpath = ["."] markers = [
tests/test_config.py +17 lines
--- +++ @@ -187 +187,18 @@             await s3_client.get_object(Bucket='foo', Key='bar')++[email protected](+    "warm_up_loader_caches, expected",+    [+        (None, False),+        (False, False),+        (True, True),+    ],+)+def test_config_warm_up_loader_caches(warm_up_loader_caches, expected):+    if warm_up_loader_caches is None:+        config = AioConfig()+    else:+        config = AioConfig(warm_up_loader_caches=warm_up_loader_caches)++    assert config.warm_up_loader_caches is expected
tests/test_credentials.py +57 lines
--- +++ @@ -0,0 +1,57 @@+import asyncio+from unittest import mock++from aiobotocore import credentials+++async def test_assumerolecredprovider_concurrent_load_no_race_condition():+    """Regression test for https://github.com/aio-libs/aiobotocore/issues/1455.++    When multiple async tasks share the same AioAssumeRoleProvider and call+    load() concurrently, _visited_profiles must not leak between tasks.+    Without the fix, a second task entering load() while the first task is+    awaiting inside _resolve_credentials_from_profile would see the first+    task's _visited_profiles entries and raise InfiniteLoopConfigError.+    """+    fake_config = {+        'profiles': {+            'a': {+                'role_arn': 'arn:aws:iam::123456789012:role/RoleA',+                'source_profile': 'b',+            },+            'b': {+                'aws_access_key_id': 'akid',+                'aws_secret_access_key': 'skid',+            },+        }+    }++    # A mock provider whose load() yields control via asyncio.sleep(0),+    # allowing another task to interleave and expose the race condition.+    static_creds = credentials.AioCredentials('akid', 'skid')++    class _YieldingProvider:+        METHOD = 'mock-static'+        CANONICAL_NAME = None++        async def load(self):+            await asyncio.sleep(0)+            return static_creds++    mock_builder = mock.Mock()+    mock_builder.providers.return_value = [_YieldingProvider()]++    # client_creator is never invoked: load() returns AioDeferredRefreshableCredentials+    # without calling STS, so a bare Mock() is sufficient.+    provider = credentials.AioAssumeRoleProvider(+        lambda: fake_config,+        mock.Mock(),+        cache={},+        profile_name='a',+        profile_provider_builder=mock_builder,+    )++    # Both tasks must succeed; without the fix the second task raises+    # InfiniteLoopConfigError because it sees 'b' already in _visited_profiles.+    results = await asyncio.gather(provider.load(), provider.load())+    assert all(r is not None for r in results)
tests/test_session.py +193 lines
--- +++ @@ -1 +1,2 @@+import itertools import logging@@ -56 +57,193 @@     assert session.user_agent_extra.startswith("botocore/")++[email protected](+    "service_name, api_version",+    [+        (None, None),+        ("iot", None),+        ("s3", None),+        ("s3", "2006-03-01"),+        ("ec2", "2016-11-16"),+    ],+)+def test_warm_up_loader_caches(+    session: AioSession, service_name, api_version, mocker+):+    if service_name is None:+        services = [+            "ec2",+            "iot",+            "s3",+        ]+    else:+        services = [service_name]++    loader = mocker.Mock()+    get_component = mocker.patch.object(+        session, "get_component", return_value=loader+    )+    loader.list_available_services.return_value = services++    session.warm_up_loader_caches(service_name, api_version)++    get_component.assert_called_once_with("data_loader")+    assert loader.mock_calls == [+        # generic calls+        mocker.call.load_data_with_path("_retry"),+        mocker.call.load_data_with_path("endpoints"),+        mocker.call.load_data_with_path("partitions"),+        mocker.call.load_data_with_path("sdk-default-configuration"),+        mocker.call.list_available_services(type_name="service-2"),+        # service-specific calls+        *itertools.chain.from_iterable(+            (+                mocker.call.load_service_model(+                    service_name,+                    type_name="service-2",+                    api_version=api_version,+                ),+                mocker.call.load_service_model(+                    service_name, "paginators-1", api_version+                ),+                mocker.call.load_service_model(+                    service_name, "waiters-2", api_version+                ),+                mocker.call.load_service_model(+                    service_name, "service-2", api_version=api_version+                ),+                mocker.call.load_service_model(+                    service_name,+                    "endpoint-rule-set-1",+                    api_version=api_version,+                ),+                mocker.call.load_service_model(+                    service_name, "examples-1", api_version+                ),+            )+            for service_name in services+        ),+    ]++[email protected](+    "service_name",+    # services without a ``waiters-2``, ``paginators-1``, or ``examples-1``+    # data file exercise the ``UnknownServiceError`` suppression in+    # ``warm_up_loader_caches``. ``iot`` lacks ``waiters-2``;+    # ``accessanalyzer`` lacks ``waiters-2`` and ``examples-1``.+    ["iot", "accessanalyzer"],+)+def test_warm_up_loader_caches_optional_models(+    session: AioSession, service_name: str+):+    # uses the real loader; must not raise for services missing optional models+    session.warm_up_loader_caches(service_name)++[email protected](+    "warm_up_loader_caches",+    [False, True],+)+async def test_warm_up_loader_caches_config(+    session: AioSession,+    warm_up_loader_caches: bool,+    mocker,+):+    config = AioConfig(warm_up_loader_caches=warm_up_loader_caches)+    mocker.patch.object(+        session, "warm_up_loader_caches", wraps=session.warm_up_loader_caches+    )++    async with session.create_client(+        "s3",+        config=config,+        aws_secret_access_key="xxx",+        aws_access_key_id="xxx",+    ):+        pass++    if warm_up_loader_caches:+        session.warm_up_loader_caches.assert_called_once_with("s3", None)+    else:+        session.warm_up_loader_caches.assert_not_called()++[email protected](+    "warm_up_loader_caches",+    [False, True],+)+async def test_non_blocking_create_client(+    session: AioSession,+    warm_up_loader_caches: bool,+    mocker,+):+    config = AioConfig(warm_up_loader_caches=warm_up_loader_caches)+    loader = session.get_component("data_loader")+    file_loader = mocker.patch.object(+        loader, "file_loader", wraps=loader.file_loader+    )+    # perform implicit warm-up, while avoiding any other file I/O by stubbing relevant codepathes+    session._internal_components.lazy_register_component(+        'endpoint_resolver', lambda: None+    )+    mocker.patch.object(+        session, "_resolve_defaults_mode", return_value="legacy"+    )+    client_creator_cls_mock = mocker.patch(+        "aiobotocore.session.AioClientCreator", autospec=True+    )++    async with session.create_client(+        "s3",+        config=config,+        aws_secret_access_key="xxx",+        aws_access_key_id="xxx",+    ):+        pass++    if warm_up_loader_caches:+        # warm-up triggered file I/O (non-blocking)+        file_loader.exists.assert_called()+        file_loader.load_file.assert_called()+    else:+        # no file I/O+        file_loader.exists.assert_not_called()+        file_loader.load_file.assert_not_called()++    mocker.stop(client_creator_cls_mock)+    session._register_endpoint_resolver()+    file_loader.reset_mock()++    # regular client creation #1+    async with session.create_client(+        "s3",+        config=config,+        aws_secret_access_key="xxx",+        aws_access_key_id="xxx",+    ):+        pass++    if warm_up_loader_caches:+        # no file I/O+        file_loader.exists.assert_not_called()+        file_loader.load_file.assert_not_called()+    else:+        # file I/O (blocking)+        file_loader.exists.assert_called()+        file_loader.load_file.assert_called()++    file_loader.reset_mock()++    # regular client creation #2+    async with session.create_client(+        "s3",+        config=config,+        aws_secret_access_key="xxx",+        aws_access_key_id="xxx",+    ):+        pass++    # no file I/O+    file_loader.exists.assert_not_called()+    file_loader.load_file.assert_not_called()
tests/test_version.py +21 lines
--- +++ @@ -1,9 +1,3 @@-import re-from datetime import datetime from pathlib import Path -import docutils.frontend-import docutils.nodes-import docutils.parsers.rst-import docutils.utils from packaging import version@@ -11,2 +5,3 @@ import aiobotocore+from scripts.changelog import parse, validate @@ -15,59 +10,27 @@ -# date can be YYYY-MM-DD or "TBD"-_rst_ver_date_str_re = re.compile(-    r'(?P<version>\d+\.\d+\.\d+(\.dev\d+)?) \((?P<date>\d{4}-\d{2}-\d{2}|TBD)\)'-)---# from: https://stackoverflow.com/a/75996218-def _parse_rst(text: str) -> docutils.nodes.document:-    parser = docutils.parsers.rst.Parser()-    settings = docutils.frontend.get_default_settings(-        docutils.parsers.rst.Parser-    )-    document = docutils.utils.new_document('<rst-doc>', settings=settings)-    parser.parse(text, document)-    return document-- def test_release_versions():-    # ensures versions in CHANGES.rst + __init__.py match+    # Cross-checks the top entry of CHANGES.rst against+    # aiobotocore/__init__.py and the entry below it. The CHANGES.rst+    # parser + format invariants live in scripts/changelog.py so the+    # auto-release workflow can use the same logic without installing+    # the project's dev deps.     init_version = version.parse(aiobotocore.__version__)--    # the init version should be in canonical from+    # init version should be in canonical form     assert str(init_version) == aiobotocore.__version__ -    changes_path = _root_path / 'CHANGES.rst'-    changes_doc = _parse_rst(changes_path.read_text())+    changes_text = (_root_path / 'CHANGES.rst').read_text(encoding='utf-8') -    rst_ver_str = changes_doc[0][1][0][0]  # ex: 0.11.1 (2020-01-03)-    rst_prev_ver_str = changes_doc[0][2][0][0]+    # Format invariants: top entry version matches __init__.py, top+    # entry's version > previous entry's version, dates are non-+    # increasing (or TBD).+    validate(changes_text, expected_top_version=aiobotocore.__version__) -    rst_ver_groups = _rst_ver_date_str_re.match(rst_ver_str)-    rst_prev_ver_groups = _rst_ver_date_str_re.match(rst_prev_ver_str)--    rst_ver = version.parse(rst_ver_groups['version'])-    rst_prev_ver = version.parse(rst_prev_ver_groups['version'])--    # first the init version should match the rst version-    assert init_version == rst_ver--    # the current version must be greater than the previous version-    assert rst_ver > rst_prev_ver--    rst_date = rst_ver_groups['date']-    rst_prev_date = rst_prev_ver_groups['date']--    if rst_date == 'TBD':-        # TODO: we can now lock if we're a prerelease version-        pass-        # assert (-        #     rst_ver.is_prerelease-        # ), 'Version must be prerelease if final release date not set'-    else:-        rst_date = datetime.strptime(rst_date, '%Y-%m-%d').date()-        rst_prev_date = datetime.strptime(rst_prev_date, '%Y-%m-%d').date()--        assert rst_date >= rst_prev_date, (-            'Current release must be after last release'-        )+    # Stronger version-ordering check using packaging's PEP 440 parser+    # (catches edge cases like 1.2.3rc1 vs 1.2.3 that the simple tuple+    # comparison in scripts/changelog.py treats differently).+    entries = parse(changes_text)+    assert len(entries) >= 2, 'CHANGES.rst should have at least two entries'+    top, prev = entries[0], entries[1]+    assert version.parse(top.version) > version.parse(prev.version), (+        f'top entry {top.version} should be > previous {prev.version}'+    )
boto3 pypi
1.43.46 2d ago nominal
critical-tier BURSTINSTALL-EXEC
latest 1.43.46 versions 2070 maintainers 1 critical-tier (snapshotted)
1.43.35
1.43.36
1.43.37
1.43.38
1.43.39
1.43.40
1.43.41
1.43.42
1.43.43
1.43.44
1.43.45
1.43.46
BURST
2 releases in 36m: 1.2.0, 1.2.1
info · registry-verified · 2015-10-23 · 10y ago
INSTALL-EXEC
setup.py in sdist uses subprocess/exec (runs at pip install)
warn · snapshot-derived
release diff 1.43.45 → 1.43.46
+0 added · -0 removed · ~6 modified
boto3/__init__.py +1 lines
--- +++ @@ -20,3 +20,3 @@ __author__ = 'Amazon Web Services'-__version__ = '1.43.45'+__version__ = '1.43.46' 
setup.cfg +1 lines
--- +++ @@ -5,3 +5,3 @@ requires_dist = -	botocore>=1.43.45,<1.44.0+	botocore>=1.43.46,<1.44.0 	jmespath>=0.7.1,<2.0.0
setup.py +1 lines
--- +++ @@ -16,3 +16,3 @@ requires = [-    'botocore>=1.43.45,<1.44.0',+    'botocore>=1.43.46,<1.44.0',     'jmespath>=0.7.1,<2.0.0',
botocore pypi
1.43.46 2d ago nominal
critical-tier BURST ×2
latest 1.43.46 versions 2468 maintainers 1 critical-tier (snapshotted)
1.43.35
1.43.36
1.43.37
1.43.38
1.43.39
1.43.40
1.43.41
1.43.42
1.43.43
1.43.44
1.43.45
1.43.46
BURST
2 releases in 14m: 0.13.0, 0.13.1
info · registry-verified · 2013-07-18 · 12y ago
BURST
2 releases in 4m: 0.15.0, 0.15.1
info · registry-verified · 2013-08-23 · 12y ago
release diff 1.43.45 → 1.43.46
+0 added · -0 removed · ~12 modified
botocore/__init__.py +1 lines
--- +++ @@ -19,3 +19,3 @@ -__version__ = '1.43.45'+__version__ = '1.43.46' 
botocore/data/cloudwatch/2010-08-01/service-2.json +29 lines
--- +++ @@ -1058,2 +1058,6 @@       "members":{+        "AnomalyDetectorId":{+          "shape":"AnomalyDetectorId",+          "documentation":"<p>The unique identifier of the anomaly detector.</p> <note> <p>The identifier does not restrict access to a specific anomaly detector in an IAM policy. Permissions for anomaly detector operations apply to all anomaly detectors in the account.</p> </note>"+        },         "Namespace":{@@ -1122,2 +1126,13 @@       "member":{"shape":"Range"}+    },+    "AnomalyDetectorId":{+      "type":"string",+      "max":128,+      "min":1,+      "pattern":"[A-Za-z0-9_./:%()+-]+"+    },+    "AnomalyDetectorIds":{+      "type":"list",+      "member":{"shape":"AnomalyDetectorId"},+      "max":50     },@@ -1541,2 +1556,6 @@       "members":{+        "AnomalyDetectorId":{+          "shape":"AnomalyDetectorId",+          "documentation":"<p>Specifies the unique identifier of the anomaly detector to delete. If you specify this parameter, you do not need to specify a metric to identify the detector.</p>"+        },         "Namespace":{@@ -1819,2 +1838,6 @@       "members":{+        "AnomalyDetectorIds":{+          "shape":"AnomalyDetectorIds",+          "documentation":"<p>Specifies the unique identifiers of the anomaly detectors to describe. You can specify up to 50 identifiers. If you specify this parameter, you cannot also specify the <code>Namespace</code>, <code>MetricName</code>, <code>Dimensions</code>, or <code>AnomalyDetectorTypes</code> metric filters.</p>"+        },         "NextToken":{@@ -4029,3 +4052,8 @@       "type":"structure",-      "members":{}+      "members":{+        "AnomalyDetectorId":{+          "shape":"AnomalyDetectorId",+          "documentation":"<p>The unique identifier of the anomaly detector that you created or updated.</p>"+        }+      }     },
botocore/data/ec2/2016-11-15/service-2.json +194 lines
--- +++ @@ -47871,3 +47871,196 @@         "m8id.metal-96xl",-        "hpc8a.96xlarge"+        "hpc8a.96xlarge",+        "c8in.large",+        "c8in.xlarge",+        "c8in.2xlarge",+        "c8in.4xlarge",+        "c8in.8xlarge",+        "c8in.12xlarge",+        "c8in.16xlarge",+        "c8in.24xlarge",+        "c8in.32xlarge",+        "c8in.48xlarge",+        "c8in.96xlarge",+        "c8in.metal-48xl",+        "c8in.metal-96xl",+        "c8ib.large",+        "c8ib.xlarge",+        "c8ib.2xlarge",+        "c8ib.4xlarge",+        "c8ib.8xlarge",+        "c8ib.12xlarge",+        "c8ib.16xlarge",+        "c8ib.24xlarge",+        "c8ib.32xlarge",+        "c8ib.48xlarge",+        "c8ib.96xlarge",+        "c8ib.metal-48xl",+        "c8ib.metal-96xl",+        "r8in.large",+        "r8in.xlarge",+        "r8in.2xlarge",+        "r8in.4xlarge",+        "r8in.8xlarge",+        "r8in.12xlarge",+        "r8in.16xlarge",+        "r8in.24xlarge",+        "r8in.32xlarge",+        "r8in.48xlarge",+        "r8in.96xlarge",+        "r8ib.large",+        "r8ib.xlarge",+        "r8ib.2xlarge",+        "r8ib.4xlarge",+        "r8ib.8xlarge",+        "r8ib.12xlarge",+        "r8ib.16xlarge",+        "r8ib.24xlarge",+        "r8ib.32xlarge",+        "r8ib.48xlarge",+        "r8ib.96xlarge",+        "m8in.large",+        "m8in.xlarge",+        "m8in.2xlarge",+        "m8in.4xlarge",+        "m8in.8xlarge",+        "m8in.12xlarge",+        "m8in.16xlarge",+        "m8in.24xlarge",+        "m8in.32xlarge",+        "m8in.48xlarge",+        "m8in.96xlarge",+        "m8ib.large",+        "m8ib.xlarge",+        "m8ib.2xlarge",+        "m8ib.4xlarge",+        "m8ib.8xlarge",+        "m8ib.12xlarge",+        "m8ib.16xlarge",+        "m8ib.24xlarge",+        "m8ib.32xlarge",+        "m8ib.48xlarge",+        "m8ib.96xlarge",+        "m8ine.large",+        "m8ine.xlarge",+        "m8ine.2xlarge",+        "m8ine.4xlarge",+        "m8ine.8xlarge",+        "m8ine.12xlarge",+        "c8ine.large",+        "c8ine.xlarge",+        "c8ine.2xlarge",+        "c8ine.4xlarge",+        "c8ine.8xlarge",+        "c8ine.12xlarge",+        "m8idn.large",+        "m8idn.xlarge",+        "m8idn.2xlarge",+        "m8idn.4xlarge",+        "m8idn.8xlarge",+        "m8idn.12xlarge",+        "m8idn.16xlarge",+        "m8idn.24xlarge",+        "m8idn.32xlarge",+        "m8idn.48xlarge",+        "m8idn.96xlarge",+        "r8idn.large",+        "r8idn.xlarge",+        "r8idn.2xlarge",+        "r8idn.4xlarge",+        "r8idn.8xlarge",+        "r8idn.12xlarge",+        "r8idn.16xlarge",+        "r8idn.24xlarge",+        "r8idn.32xlarge",+        "r8idn.48xlarge",+        "r8idn.96xlarge",+        "m8idb.large",+        "m8idb.xlarge",+        "m8idb.2xlarge",+        "m8idb.4xlarge",+        "m8idb.8xlarge",+        "m8idb.12xlarge",+        "m8idb.16xlarge",+        "m8idb.24xlarge",+        "m8idb.32xlarge",+        "m8idb.48xlarge",+        "m8idb.96xlarge",+        "r8idb.large",+        "r8idb.xlarge",+        "r8idb.2xlarge",+        "r8idb.4xlarge",+        "r8idb.8xlarge",+        "r8idb.12xlarge",+        "r8idb.16xlarge",+        "r8idb.24xlarge",+        "r8idb.32xlarge",+        "r8idb.48xlarge",+        "r8idb.96xlarge",+        "mac-m3ultra.metal",+        "m9g.large",+        "m9g.xlarge",+        "m9g.2xlarge",+        "m9g.4xlarge",+        "m9g.8xlarge",+        "m9g.12xlarge",+        "m9g.16xlarge",+        "m9g.24xlarge",+        "m9g.48xlarge",+        "m9g.metal-24xl",+        "m9g.metal-48xl",+        "m9gd.large",+        "m9gd.xlarge",+        "m9gd.2xlarge",+        "m9gd.4xlarge",+        "m9gd.8xlarge",+        "m9gd.12xlarge",+        "m9gd.16xlarge",+        "m9gd.24xlarge",+        "m9gd.48xlarge",+        "m9gd.metal-24xl",+        "m9gd.metal-48xl",+        "r8in.metal-48xl",+        "r8in.metal-96xl",+        "r8ib.metal-48xl",+        "r8ib.metal-96xl",+        "r8idn.metal-48xl",+        "r8idn.metal-96xl",+        "r8idb.metal-48xl",+        "r8idb.metal-96xl",+        "m8in.metal-48xl",+        "m8in.metal-96xl",+        "m8ib.metal-48xl",+        "m8ib.metal-96xl",+        "m8idn.metal-48xl",+        "m8idn.metal-96xl",+        "m8idb.metal-48xl",+        "m8idb.metal-96xl",+        "g7.2xlarge",+        "g7.4xlarge",+        "g7.8xlarge",+        "g7.12xlarge",+        "g7.24xlarge",+        "g7.48xlarge",+        "c9g.medium",+        "c9g.large",+        "c9g.xlarge",+        "c9g.2xlarge",+        "c9g.4xlarge",+        "c9g.8xlarge",+        "c9g.12xlarge",+        "c9g.16xlarge",+        "c9g.24xlarge",+        "c9g.48xlarge",+        "c9g.metal-48xl",+        "c9gd.medium",+        "c9gd.large",+        "c9gd.xlarge",+        "c9gd.2xlarge",+        "c9gd.4xlarge",+        "c9gd.8xlarge",+        "c9gd.12xlarge",+        "c9gd.16xlarge",+        "c9gd.24xlarge",+        "c9gd.48xlarge",+        "c9gd.metal-48xl"       ]
botocore/data/endpoints.json +1 lines
--- +++ @@ -2987,2 +2987,3 @@           "ap-southeast-5" : { },+          "ap-southeast-6" : { },           "ap-southeast-7" : { },
botocore/data/inspector2/2020-06-08/service-2.json +6 lines
--- +++ @@ -6133,3 +6133,5 @@         "DAYS_90",-        "DAYS_180"+        "DAYS_180",+        "DAYS_3",+        "DAYS_7"       ]@@ -6165,3 +6167,5 @@         "DAYS_60",-        "DAYS_90"+        "DAYS_90",+        "DAYS_3",+        "DAYS_7"       ]
botocore/data/lambda/2015-03-31/service-2.json +66 lines
--- +++ @@ -2198,3 +2198,7 @@         },-        "PropagateTags":{"shape":"PropagateTags"}+        "PropagateTags":{"shape":"PropagateTags"},+        "TelemetryConfig":{+          "shape":"CapacityProviderTelemetryConfig",+          "documentation":"<p>The telemetry configuration for the capacity provider, including logging settings.</p>"+        }       },@@ -2234,2 +2238,16 @@       "exception":true+    },+    "CapacityProviderLoggingConfig":{+      "type":"structure",+      "members":{+        "SystemLogLevel":{+          "shape":"SystemLogLevel",+          "documentation":"<p>Set this property to filter the system logs for your capacity provider that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where <code>DEBUG</code> is the highest level and <code>WARN</code> is the lowest.</p>"+        },+        "LogGroup":{+          "shape":"LogGroup",+          "documentation":"<p>The name of the Amazon CloudWatch log group the capacity provider sends logs to. By default, Lambda capacity providers send logs to a default log group named <code>/aws/lambda/capacity-provider/&lt;capacity provider name&gt;</code>. To use a different log group, enter an existing log group or enter a new log group name.</p>"+        }+      },+      "documentation":"<p>The capacity provider's Amazon CloudWatch Logs configuration settings.</p>"     },@@ -2314,2 +2332,12 @@     },+    "CapacityProviderTelemetryConfig":{+      "type":"structure",+      "members":{+        "LoggingConfig":{+          "shape":"CapacityProviderLoggingConfig",+          "documentation":"<p>The capacity provider's Amazon CloudWatch Logs configuration settings.</p>"+        }+      },+      "documentation":"<p>Configuration that specifies the telemetry collection for the capacity provider.</p>"+    },     "CapacityProviderVpcConfig":{@@ -2857,2 +2885,6 @@           "documentation":"<p>The tag propagation configuration for the capacity provider. Specifies tags to apply to managed resources at launch.</p>"+        },+        "TelemetryConfig":{+          "shape":"CapacityProviderTelemetryConfig",+          "documentation":"<p>The telemetry configuration for the capacity provider. Specifies logging settings for managed resources.</p>"         }@@ -5998,2 +6030,30 @@         },+        "LogType":{+          "shape":"LogType",+          "documentation":"<p>Set to <code>Tail</code> to include the execution log in the response. Applies to synchronously invoked functions only.</p>",+          "location":"header",+          "locationName":"X-Amz-Log-Type"+        },+        "ClientContext":{+          "shape":"String",+          "documentation":"<p>Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object.</p>",+          "location":"header",+          "locationName":"X-Amz-Client-Context"+        },+        "Qualifier":{+          "shape":"NumericLatestPublishedOrAliasQualifier",+          "documentation":"<p>The alias name.</p>",+          "location":"querystring",+          "locationName":"Qualifier"+        },+        "Payload":{+          "shape":"Blob",+          "documentation":"<p>The JSON that you want to provide to your Lambda function as input.</p> <p>You can enter the JSON directly. For example, <code>--payload '{ \"key\": \"value\" }'</code>. You can also specify a file path. For example, <code>--payload file://payload.json</code>.</p>"+        },+        "TenantId":{+          "shape":"TenantId",+          "documentation":"<p>The identifier of the tenant in a multi-tenant Lambda function.</p>",+          "location":"header",+          "locationName":"X-Amz-Tenant-Id"+        },         "InvocationType":{@@ -6003,30 +6063,2 @@           "locationName":"X-Amz-Invocation-Type"-        },-        "LogType":{-          "shape":"LogType",-          "documentation":"<p>Set to <code>Tail</code> to include the execution log in the response. Applies to synchronously invoked functions only.</p>",-          "location":"header",-          "locationName":"X-Amz-Log-Type"-        },-        "ClientContext":{-          "shape":"String",-          "documentation":"<p>Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object.</p>",-          "location":"header",-          "locationName":"X-Amz-Client-Context"-        },-        "Qualifier":{-          "shape":"NumericLatestPublishedOrAliasQualifier",-          "documentation":"<p>The alias name.</p>",-          "location":"querystring",-          "locationName":"Qualifier"-        },-        "Payload":{-          "shape":"Blob",-          "documentation":"<p>The JSON that you want to provide to your Lambda function as input.</p> <p>You can enter the JSON directly. For example, <code>--payload '{ \"key\": \"value\" }'</code>. You can also specify a file path. For example, <code>--payload file://payload.json</code>.</p>"-        },-        "TenantId":{-          "shape":"TenantId",-          "documentation":"<p>The identifier of the tenant in a multi-tenant Lambda function.</p>",-          "location":"header",-          "locationName":"X-Amz-Tenant-Id"         }@@ -9365,3 +9397,7 @@         },-        "PropagateTags":{"shape":"PropagateTags"}+        "PropagateTags":{"shape":"PropagateTags"},+        "TelemetryConfig":{+          "shape":"CapacityProviderTelemetryConfig",+          "documentation":"<p>The updated telemetry configuration for the capacity provider.</p>"+        }       }
botocore/data/license-manager/2018-08-01/service-2.json +4 lines
--- +++ @@ -2032,2 +2032,6 @@           "documentation":"<p>Current version of the license.</p>"+        },+        "ResetUsage":{+          "shape":"Boolean",+          "documentation":"<p>Specifies whether to reset the license usage for the new license version. If you don't specify a value, the license usage is not reset.</p>"         }
botocore/data/quicksight/2018-04-01/service-2.json +365 lines
--- +++ @@ -434,2 +434,24 @@     },+    "CreateKnowledgeBase":{+      "name":"CreateKnowledgeBase",+      "http":{+        "method":"POST",+        "requestUri":"/v1/accounts/{AwsAccountId}/knowledge-bases",+        "responseCode":202+      },+      "input":{"shape":"CreateKnowledgeBaseRequest"},+      "output":{"shape":"CreateKnowledgeBaseResponse"},+      "errors":[+        {"shape":"ResourceExistsException"},+        {"shape":"ThrottlingException"},+        {"shape":"InvalidRequestException"},+        {"shape":"InvalidParameterValueException"},+        {"shape":"InternalFailureException"},+        {"shape":"PreconditionNotMetException"},+        {"shape":"ResourceNotFoundException"},+        {"shape":"LimitExceededException"},+        {"shape":"AccessDeniedException"}+      ],+      "documentation":"<p>Creates a knowledge base from a specified data source. Supported data source connector types include:</p> <ul> <li> <p> <code>S3_KNOWLEDGE_BASE</code> – Uses an Amazon S3 bucket as the data source.</p> </li> <li> <p> <code>WEB_CRAWLER</code> – Uses web pages indexed by the built-in web crawler as the data source.</p> </li> <li> <p> <code>GOOGLE_DRIVE</code> – Uses Google Drive as the data source. Supports service account authentication only.</p> </li> <li> <p> <code>SHAREPOINT</code> – Uses SharePoint as the data source. Supports two-legged OAuth only.</p> </li> <li> <p> <code>ONE_DRIVE</code> – Uses OneDrive as the data source. Supports two-legged OAuth only.</p> </li> </ul>"+    },     "CreateNamespace":{@@ -4590,2 +4612,25 @@     },+    "UpdateKnowledgeBase":{+      "name":"UpdateKnowledgeBase",+      "http":{+        "method":"POST",+        "requestUri":"/v1/accounts/{AwsAccountId}/knowledge-bases/{KnowledgeBaseId}",+        "responseCode":202+      },+      "input":{"shape":"UpdateKnowledgeBaseRequest"},+      "output":{"shape":"UpdateKnowledgeBaseResponse"},+      "errors":[+        {"shape":"ThrottlingException"},+        {"shape":"InvalidRequestException"},+        {"shape":"InvalidParameterValueException"},+        {"shape":"InternalFailureException"},+        {"shape":"PreconditionNotMetException"},+        {"shape":"ResourceNotFoundException"},+        {"shape":"LimitExceededException"},+        {"shape":"AccessDeniedException"},+        {"shape":"ConflictException"}+      ],+      "documentation":"<p>Updates the properties of an existing knowledge base.</p>",+      "idempotent":true+    },     "UpdateKnowledgeBasePermissions":{@@ -5107,2 +5152,13 @@       "documentation":"<p>Configuration for API key-based authentication to external services.</p>"+    },+    "AccessControlConfiguration":{+      "type":"structure",+      "members":{+        "isACLEnabled":{+          "shape":"Boolean",+          "documentation":"<p>Specifies whether ACLs are enabled for the knowledge base.</p>",+          "box":true+        }+      },+      "documentation":"<p>The access control settings for a knowledge base. Use this structure to enable or disable document-level access control lists (ACLs) that filter query results based on the permissions from the source data connector.</p>"     },@@ -8004,2 +8060,10 @@     },+    "AuthType":{+      "type":"string",+      "enum":[+        "THREE_LEGGED_OAUTH",+        "TWO_LEGGED_OAUTH",+        "SERVICE_ACCOUNT"+      ]+    },     "AuthenticationMetadata":{@@ -13444,2 +13508,86 @@     },+    "CreateKnowledgeBaseRequest":{+      "type":"structure",+      "required":[+        "AwsAccountId",+        "KnowledgeBaseId",+        "Name",+        "DataSourceArn",+        "KnowledgeBaseConfiguration"+      ],+      "members":{+        "AwsAccountId":{+          "shape":"KbAwsAccountId",+          "documentation":"<p>The ID of the Amazon Web Services account that contains the knowledge base.</p>",+          "location":"uri",+          "locationName":"AwsAccountId"+        },+        "KnowledgeBaseId":{+          "shape":"KnowledgeBaseId",+          "documentation":"<p>The unique identifier for the knowledge base.</p>"+        },+        "Name":{+          "shape":"KnowledgeBaseName",+          "documentation":"<p>The name of the knowledge base.</p>"+        },+        "DataSourceArn":{+          "shape":"DataSourceArn",+          "documentation":"<p>The Amazon Resource Name (ARN) of the data source for the knowledge base.</p>"+        },+        "KnowledgeBaseConfiguration":{"shape":"KnowledgeBaseConfiguration"},+        "Description":{+          "shape":"KnowledgeBaseDescription",+          "documentation":"<p>A description for the knowledge base. If you don't specify a description, the knowledge base is created without one.</p>"+        },+        "Permissions":{+          "shape":"ResourcePermissionList",+          "documentation":"<p>A list of resource permissions on the knowledge base. Each entry grants a specified Amazon QuickSight principal either owner or viewer access. If you don't specify permissions, only the primary owner (if provided) receives owner access.</p>"+        },+        "MediaExtractionConfiguration":{"shape":"MediaExtractionConfiguration"},+        "AccessControlConfiguration":{+          "shape":"AccessControlConfiguration",+          "documentation":"<p>The access control configuration for the knowledge base. If you don't specify this parameter, document-level ACLs are disabled.</p>"+        },+        "PrimaryOwnerArn":{+          "shape":"String",+          "documentation":"<p>The Amazon Resource Name (ARN) of the primary owner for the knowledge base. The specified user is always granted owner access, regardless of what is specified in the <code>Permissions</code> field. If you don't specify a primary owner, the knowledge base is created without one.</p>"+        },+        "Tags":{+          "shape":"TagList",+          "documentation":"<p>The tags to assign to the knowledge base. If you don't specify tags, the knowledge base is created without tags.</p>"+        }+      }+    },+    "CreateKnowledgeBaseResponse":{+      "type":"structure",+      "required":[+        "KnowledgeBaseArn",+        "KnowledgeBaseId",+        "CreationStatus"+      ],+      "members":{+        "KnowledgeBaseArn":{+          "shape":"KnowledgeBaseArn",+          "documentation":"<p>The Amazon Resource Name (ARN) of the knowledge base.</p>"+        },+        "KnowledgeBaseId":{+          "shape":"KnowledgeBaseId",+          "documentation":"<p>The unique identifier for the knowledge base.</p>"+        },+        "CreationStatus":{+          "shape":"DataSetStatus",+          "documentation":"<p>The creation status of the knowledge base.</p>"+        },+        "RequestId":{+          "shape":"String",+          "documentation":"<p>The Amazon Web Services request ID for this operation.</p>"+        },+        "Status":{+          "shape":"StatusCode",+          "documentation":"<p>The HTTP status of the request.</p>",+          "box":true,+          "location":"statusCode"+        }+      }+    },     "CreateNamespaceRequest":{@@ -14257,2 +14405,10 @@       "documentation":"<p>The combination of user name and password that are used as credentials.</p>"+    },+    "CredentialStatus":{+      "type":"string",+      "enum":[+        "CONNECTED",+        "AUTH_FAILED",+        "NOT_VERIFIED"+      ]     },@@ -16476,2 +16632,10 @@           "documentation":"<p>The Amazon Resource Name (ARN) of the secret associated with the data source in Amazon Secrets Manager.</p>"+        },+        "CredentialStatus":{+          "shape":"CredentialStatus",+          "documentation":"<p>The credential verification status of the data source. Valid values include:</p> <ul> <li> <p> <code>CONNECTED</code> – Credential validation succeeded.</p> </li> <li> <p> <code>AUTH_FAILED</code> – Credential validation failed.</p> </li> <li> <p> <code>NOT_VERIFIED</code> – Credential validation has not been performed.</p> </li> </ul>"+        },+        "LastCredentialVerifiedAt":{+          "shape":"Timestamp",+          "documentation":"<p>The time that the credentials were last verified.</p>"         }@@ -16691,2 +16855,18 @@           "documentation":"<p>The parameters for Amazon Q Business.</p>"+        },+        "SharePointParameters":{+          "shape":"SharePointParameters",+          "documentation":"<p>The parameters for a SharePoint data source.</p>"+        },+        "GoogleDriveParameters":{+          "shape":"GoogleDriveParameters",+          "documentation":"<p>The parameters for a Google Drive data source.</p>"+        },+        "OneDriveParameters":{+          "shape":"OneDriveParameters",+          "documentation":"<p>The parameters for an OneDrive data source.</p>"+        },+        "FMKBParameters":{+          "shape":"FMKBParameters",+          "documentation":"<p>The parameters for a fully managed knowledge base data source.</p>"         }@@ -22993,2 +23173,23 @@     },+    "FMKBKnowledgeBaseArn":{+      "type":"string",+      "max":128,+      "min":47,+      "pattern":"^arn:aws(-cn|-us-gov)?:bedrock:[a-zA-Z0-9-]*:[0-9]{12}:knowledge-base/[0-9a-zA-Z]+"+    },+    "FMKBParameters":{+      "type":"structure",+      "required":["KnowledgeBaseArn"],+      "members":{+        "KnowledgeBaseArn":{+          "shape":"FMKBKnowledgeBaseArn",+          "documentation":"<p>The Amazon Resource Name (ARN) of the Amazon Bedrock knowledge base.</p>"+        },+        "LinkedDataSourceIds":{+          "shape":"LinkedDataSourceIds",+          "documentation":"<p>The IDs of the linked data sources.</p>"+        }+      },+      "documentation":"<p>The connection parameters for a fully managed knowledge base data source. Provide these parameters in the <code>DataSourceParameters</code> object when you create or update a data source that uses a fully managed knowledge base.</p>"+    },     "FailedKeyRegistrationEntries":{@@ -26500,2 +26701,12 @@       "documentation":"<p>Determines the border options for a table visual.</p>"+    },+    "GoogleDriveParameters":{+      "type":"structure",+      "members":{+        "AuthType":{+          "shape":"AuthType",+          "documentation":"<p>The authentication type for the Google Drive data source. Valid values include:</p> <ul> <li> <p> <code>SERVICE_ACCOUNT</code> – Server-to-server authentication using a Google service account key.</p> </li> <li> <p> <code>THREE_LEGGED_OAUTH</code> – Interactive OAuth that requires user consent.</p> </li> </ul>"+        }+      },+      "documentation":"<p>The connection parameters for a Google Drive data source. Provide these parameters in the <code>DataSourceParameters</code> object when you create or update a data source that uses Google Drive.</p>"     },@@ -28691,2 +28902,6 @@         },+        "AccessControlConfiguration":{+          "shape":"AccessControlConfiguration",+          "documentation":"<p>The access control configuration for the knowledge base.</p>"+        },         "Type":{
… 185 more lines (truncated)
botocore/data/sagemaker/2017-07-24/service-2.json +34 lines
--- +++ @@ -10534,3 +10534,3 @@           "shape":"ImageId",-          "documentation":"<p>When configuring your HyperPod cluster, you can specify an image ID using one of the following options:</p> <ul> <li> <p> <code>HyperPodPublicAmiId</code>: Use a HyperPod public AMI</p> </li> <li> <p> <code>CustomAmiId</code>: Use your custom AMI</p> </li> <li> <p> <code>default</code>: Use the default latest system image</p> </li> </ul> <p>If you choose to use a custom AMI (<code>CustomAmiId</code>), ensure it meets the following requirements:</p> <ul> <li> <p>Encryption: The custom AMI must be unencrypted.</p> </li> <li> <p>Ownership: The custom AMI must be owned by the same Amazon Web Services account that is creating the HyperPod cluster.</p> </li> <li> <p>Volume support: Only the primary AMI snapshot volume is supported; additional AMI volumes are not supported.</p> </li> </ul> <p>When updating the instance group's AMI through the <code>UpdateClusterSoftware</code> operation, if an instance group uses a custom AMI, you must provide an <code>ImageId</code> or use the default as input. Note that if you don't specify an instance group in your <code>UpdateClusterSoftware</code> request, then all of the instance groups are patched with the specified image.</p>"+          "documentation":"<p>When configuring your HyperPod cluster, you can specify an image ID using one of the following options:</p> <ul> <li> <p> <code>HyperPodPublicAmiId</code>: Use a HyperPod public AMI</p> </li> <li> <p> <code>CustomAmiId</code>: Use your custom AMI</p> </li> <li> <p> <code>default</code>: Use the default latest system image. For clusters with continuous scaling node provisioning mode, new instance groups inherit the AMI from the earliest existing instance group</p> </li> </ul> <p>If you choose to use a custom AMI (<code>CustomAmiId</code>), ensure it meets the following requirements:</p> <ul> <li> <p>Encryption: The custom AMI must be unencrypted.</p> </li> <li> <p>Ownership: The custom AMI must be owned by the same Amazon Web Services account that is creating the HyperPod cluster.</p> </li> <li> <p>Volume support: Only the primary AMI snapshot volume is supported; additional AMI volumes are not supported.</p> </li> </ul> <p>When updating the instance group's AMI through the <code>UpdateClusterSoftware</code> operation, if an instance group uses a custom AMI, you must provide an <code>ImageId</code> or use the default as input. Note that if you don't specify an instance group in your <code>UpdateClusterSoftware</code> request, then all of the instance groups are patched with the specified image.</p>"         },@@ -10797,3 +10797,35 @@         "ml.g7e.48xlarge",-        "ml.p6-b300.48xlarge"+        "ml.p6-b300.48xlarge",+        "ml.g4dn.xlarge",+        "ml.g4dn.2xlarge",+        "ml.g4dn.4xlarge",+        "ml.g4dn.8xlarge",+        "ml.g4dn.12xlarge",+        "ml.g4dn.16xlarge",+        "ml.c6g.medium",+        "ml.c6g.large",+        "ml.c6g.xlarge",+        "ml.c6g.2xlarge",+        "ml.c6g.4xlarge",+        "ml.c6g.8xlarge",+        "ml.c6g.12xlarge",+        "ml.c6g.16xlarge",+        "ml.c7g.medium",+        "ml.c7g.large",+        "ml.c7g.xlarge",+        "ml.c7g.2xlarge",+        "ml.c7g.4xlarge",+        "ml.c7g.8xlarge",+        "ml.c7g.12xlarge",+        "ml.c7g.16xlarge",+        "ml.c8g.medium",+        "ml.c8g.large",+        "ml.c8g.xlarge",+        "ml.c8g.2xlarge",+        "ml.c8g.4xlarge",+        "ml.c8g.8xlarge",+        "ml.c8g.12xlarge",+        "ml.c8g.16xlarge",+        "ml.c8g.24xlarge",+        "ml.c8g.48xlarge"       ]
docs/source/conf.py +1 lines
--- +++ @@ -61,3 +61,3 @@ # The full version, including alpha/beta/rc tags.-release = '1.43.45'+release = '1.43.46' 
idna pypi
3.18 1mo ago nominal
critical-tier BURST
latest 3.18 versions 41 maintainers 1 critical-tier (snapshotted)
3.7
3.8
3.9
3.10
3.11
3.12
3.13
3.14
3.15
3.16
3.17
3.18
BURST
2 releases in 23m: 0.7, 0.8
info · registry-verified · 2014-07-10 · 12y ago
release diff 3.17 → 3.18
+0 added · -0 removed · ~6 modified
idna/core.py +17 lines
--- +++ @@ -586,2 +586,3 @@     std3_rules: bool = False,+    display: bool = False, ) -> str:@@ -600,2 +601,9 @@         ``True``.+    :param display: If ``True``, any ``xn--`` label that fails IDNA+        validation is passed through unchanged (lowercased) rather than+        aborting the whole call. Intended for "decode for display"+        consumers (e.g. URL libraries, HTTP clients) that want to show+        the user the label as it appears on the wire when it cannot be+        rendered as Unicode. Matches the per-label recovery prescribed+        by UTS #46 §4 and the WHATWG URL "domain to Unicode" algorithm.     :returns: The decoded domain as a Unicode string.@@ -626,5 +634,11 @@     for label in labels:-        s = ulabel(label)-        if s:-            result.append(s)+        try:+            u = ulabel(label)+        except IDNAError:+            if display and label[:4].lower() == "xn--":+                u = label.lower()+            else:+                raise+        if u:+            result.append(u)         else:
idna/package_data.py +1 lines
--- +++ @@ -1 +1 @@-__version__ = "3.17"+__version__ = "3.18"
tests/test_idna.py +55 lines
--- +++ @@ -351,2 +351,57 @@ +    def test_decode_display(self):+        # A label whose Punycode decode succeeds but contains disallowed+        # codepoints — under display decoding, the original A-label is kept.+        self.assertRaises(idna.IDNAError, idna.decode, "a.b.c.xn--pokxncvks")+        self.assertEqual(+            idna.decode("a.b.c.xn--pokxncvks", display=True),+            "a.b.c.xn--pokxncvks",+        )++        # Mixed valid/invalid labels: the valid label still decodes, the+        # invalid xn-- label is preserved verbatim.+        self.assertEqual(+            idna.decode("xn--zckzah.xn--pokxncvks", display=True),+            "テスト.xn--pokxncvks",+        )++        # A label whose Punycode itself is malformed.+        self.assertEqual(+            idna.decode("xn--.example", display=True),+            "xn--.example",+        )++        # Uppercase A-label prefix: the kept label is lowercased to match+        # what a successful ulabel() call would have returned.+        self.assertEqual(+            idna.decode("XN--POKXNCVKS.example", display=True),+            "xn--pokxncvks.example",+        )++        # display must not swallow errors for non-xn-- labels.+        self.assertRaises(+            idna.IDNAError,+            idna.decode,+            "-bad.example",+            display=True,+        )++        # display should be a no-op for fully valid input.+        self.assertEqual(+            idna.decode("xn--zckzah.xn--zckzah", display=True),+            "テスト.テスト",+        )++        # Trailing dot preserved under display recovery.+        self.assertEqual(+            idna.decode("xn--pokxncvks.", display=True),+            "xn--pokxncvks.",+        )++        # Bytes input is supported, matching decode()'s normal contract.+        self.assertEqual(+            idna.decode(b"a.b.c.xn--pokxncvks", display=True),+            "a.b.c.xn--pokxncvks",+        )+ 
iniconfig pypi
2.3.0 8mo ago nominal
no findings
latest 2.3.0 versions 11 maintainers 1
0.1
1.0.0
1.0.1
1.1.0
1.1.1
2.0.0
2.1.0
2.2.0
2.3.0
CLEAN
no findings — nominal
release diff 2.2.0 → 2.3.0
+0 added · -0 removed · ~7 modified
src/iniconfig/__init__.py +75 lines
--- +++ @@ -98,29 +98,82 @@         encoding: str = "utf-8",+        *,+        _sections: Mapping[str, Mapping[str, str]] | None = None,+        _sources: Mapping[tuple[str, str | None], int] | None = None,     ) -> None:         self.path = os.fspath(path)++        # Determine sections and sources+        if _sections is not None and _sources is not None:+            # Use provided pre-parsed data (called from parse())+            sections_data = _sections+            sources = _sources+        else:+            # Parse the data (backward compatible path)+            if data is None:+                with open(self.path, encoding=encoding) as fp:+                    data = fp.read()++            # Use old behavior (no stripping) for backward compatibility+            sections_data, sources = _parse.parse_ini_data(+                self.path, data, strip_inline_comments=False+            )++        # Assign once to Final attributes+        self._sources = sources+        self.sections = sections_data++    @classmethod+    def parse(+        cls,+        path: str | os.PathLike[str],+        data: str | None = None,+        encoding: str = "utf-8",+        *,+        strip_inline_comments: bool = True,+        strip_section_whitespace: bool = False,+    ) -> "IniConfig":+        """Parse an INI file.++        Args:+            path: Path to the INI file (used for error messages)+            data: Optional INI content as string. If None, reads from path.+            encoding: Encoding to use when reading the file (default: utf-8)+            strip_inline_comments: Whether to strip inline comments from values+                (default: True). When True, comments starting with # or ; are+                removed from values, matching the behavior for section comments.+            strip_section_whitespace: Whether to strip whitespace from section and key names+                (default: False). When True, strips Unicode whitespace from section and key names,+                addressing issue #4. When False, preserves existing behavior for backward compatibility.++        Returns:+            IniConfig instance with parsed configuration++        Example:+            # With comment stripping (default):+            config = IniConfig.parse("setup.cfg")+            # value = "foo" instead of "foo # comment"++            # Without comment stripping (old behavior):+            config = IniConfig.parse("setup.cfg", strip_inline_comments=False)+            # value = "foo # comment"++            # With section name stripping (opt-in for issue #4):+            config = IniConfig.parse("setup.cfg", strip_section_whitespace=True)+            # section names and keys have Unicode whitespace stripped+        """+        fspath = os.fspath(path)+         if data is None:-            with open(self.path, encoding=encoding) as fp:+            with open(fspath, encoding=encoding) as fp:                 data = fp.read() -        tokens = _parse.parse_lines(self.path, data.splitlines(True))--        self._sources = {}-        sections_data: dict[str, dict[str, str]]-        self.sections = sections_data = {}--        for lineno, section, name, value in tokens:-            if section is None:-                raise ParseError(self.path, lineno, "no section header defined")-            self._sources[section, name] = lineno-            if name is None:-                if section in self.sections:-                    raise ParseError(-                        self.path, lineno, f"duplicate section {section!r}"-                    )-                sections_data[section] = {}-            else:-                if name in self.sections[section]:-                    raise ParseError(self.path, lineno, f"duplicate name {name!r}")-                assert value is not None-                sections_data[section][name] = value+        sections_data, sources = _parse.parse_ini_data(+            fspath,+            data,+            strip_inline_comments=strip_inline_comments,+            strip_section_whitespace=strip_section_whitespace,+        )++        # Call constructor with pre-parsed sections and sources+        return cls(path=fspath, _sections=sections_data, _sources=sources) 
src/iniconfig/_parse.py +89 lines
--- +++ @@ -1 +1,2 @@+from collections.abc import Mapping from typing import NamedTuple@@ -14,3 +15,57 @@ -def parse_lines(path: str, line_iter: list[str]) -> list[ParsedLine]:+def parse_ini_data(+    path: str,+    data: str,+    *,+    strip_inline_comments: bool,+    strip_section_whitespace: bool = False,+) -> tuple[Mapping[str, Mapping[str, str]], Mapping[tuple[str, str | None], int]]:+    """Parse INI data and return sections and sources mappings.++    Args:+        path: Path for error messages+        data: INI content as string+        strip_inline_comments: Whether to strip inline comments from values+        strip_section_whitespace: Whether to strip whitespace from section and key names+            (default: False). When True, addresses issue #4 by stripping Unicode whitespace.++    Returns:+        Tuple of (sections_data, sources) where:+        - sections_data: mapping of section -> {name -> value}+        - sources: mapping of (section, name) -> line number+    """+    tokens = parse_lines(+        path,+        data.splitlines(True),+        strip_inline_comments=strip_inline_comments,+        strip_section_whitespace=strip_section_whitespace,+    )++    sources: dict[tuple[str, str | None], int] = {}+    sections_data: dict[str, dict[str, str]] = {}++    for lineno, section, name, value in tokens:+        if section is None:+            raise ParseError(path, lineno, "no section header defined")+        sources[section, name] = lineno+        if name is None:+            if section in sections_data:+                raise ParseError(path, lineno, f"duplicate section {section!r}")+            sections_data[section] = {}+        else:+            if name in sections_data[section]:+                raise ParseError(path, lineno, f"duplicate name {name!r}")+            assert value is not None+            sections_data[section][name] = value++    return sections_data, sources+++def parse_lines(+    path: str,+    line_iter: list[str],+    *,+    strip_inline_comments: bool = False,+    strip_section_whitespace: bool = False,+) -> list[ParsedLine]:     result: list[ParsedLine] = []@@ -18,3 +73,5 @@     for lineno, line in enumerate(line_iter):-        name, data = _parseline(path, line, lineno)+        name, data = _parseline(+            path, line, lineno, strip_inline_comments, strip_section_whitespace+        )         # new value@@ -44,3 +101,9 @@ -def _parseline(path: str, line: str, lineno: int) -> tuple[str | None, str | None]:+def _parseline(+    path: str,+    line: str,+    lineno: int,+    strip_inline_comments: bool,+    strip_section_whitespace: bool,+) -> tuple[str | None, str | None]:     # blank lines@@ -58,3 +121,7 @@         if line[-1] == "]":-            return line[1:-1], None+            section_name = line[1:-1]+            # Optionally strip whitespace from section name (issue #4)+            if strip_section_whitespace:+                section_name = section_name.strip()+            return section_name, None         return None, realline.strip()@@ -71,6 +138,22 @@                 raise ParseError(path, lineno, f"unexpected line: {line!r}") from None-        return name.strip(), value.strip()++        # Strip key name (always for backward compatibility, optionally with unicode awareness)+        key_name = name.strip()++        # Strip value+        value = value.strip()+        # Strip inline comments from values if requested (issue #55)+        if strip_inline_comments:+            for c in COMMENTCHARS:+                value = value.split(c)[0].rstrip()++        return key_name, value     # continuation     else:-        return None, line.strip()+        line = line.strip()+        # Strip inline comments from continuations if requested (issue #55)+        if strip_inline_comments:+            for c in COMMENTCHARS:+                line = line.split(c)[0].rstrip()+        return None, line 
src/iniconfig/_version.py +3 lines
--- +++ @@ -30,5 +30,5 @@ -__version__ = version = '2.2.0'-__version_tuple__ = version_tuple = (2, 2, 0)+__version__ = version = '2.3.0'+__version_tuple__ = version_tuple = (2, 3, 0) -__commit_id__ = commit_id = 'g57b7ed9c7'+__commit_id__ = commit_id = 'g7faed13ae'
testing/test_iniconfig.py +109 lines
--- +++ @@ -127,3 +127,3 @@     with pytest.raises(TypeError):-        IniConfig(data=path.read_text())  # type: ignore+        IniConfig(data=path.read_text())  # type: ignore[call-arg] @@ -306 +306,109 @@     assert iscommentline(line)+++def test_parse_strips_inline_comments() -> None:+    """Test that IniConfig.parse() strips inline comments from values by default."""+    config = IniConfig.parse(+        "test.ini",+        data=dedent(+            """+            [section1]+            name1 = value1 # this is a comment+            name2 = value2 ; this is also a comment+            name3 = value3# no space before comment+            list = a, b, c # some items+            """+        ),+    )+    assert config["section1"]["name1"] == "value1"+    assert config["section1"]["name2"] == "value2"+    assert config["section1"]["name3"] == "value3"+    assert config["section1"]["list"] == "a, b, c"+++def test_parse_strips_inline_comments_from_continuations() -> None:+    """Test that inline comments are stripped from continuation lines."""+    config = IniConfig.parse(+        "test.ini",+        data=dedent(+            """+            [section]+            names =+                Alice # first person+                Bob ; second person+                Charlie+            """+        ),+    )+    assert config["section"]["names"] == "Alice\nBob\nCharlie"+++def test_parse_preserves_inline_comments_when_disabled() -> None:+    """Test that IniConfig.parse(strip_inline_comments=False) preserves comments."""+    config = IniConfig.parse(+        "test.ini",+        data=dedent(+            """+            [section1]+            name1 = value1 # this is a comment+            name2 = value2 ; this is also a comment+            list = a, b, c # some items+            """+        ),+        strip_inline_comments=False,+    )+    assert config["section1"]["name1"] == "value1 # this is a comment"+    assert config["section1"]["name2"] == "value2 ; this is also a comment"+    assert config["section1"]["list"] == "a, b, c # some items"+++def test_constructor_preserves_inline_comments_for_backward_compatibility() -> None:+    """Test that IniConfig() constructor preserves old behavior (no stripping)."""+    config = IniConfig(+        "test.ini",+        data=dedent(+            """+            [section1]+            name1 = value1 # this is a comment+            name2 = value2 ; this is also a comment+            """+        ),+    )+    assert config["section1"]["name1"] == "value1 # this is a comment"+    assert config["section1"]["name2"] == "value2 ; this is also a comment"+++def test_unicode_whitespace_stripped() -> None:+    """Test that Unicode whitespace is stripped (issue #4)."""+    config = IniConfig(+        "test.ini",+        data="[section]\n"+        + "name1 = \u00a0value1\u00a0\n"  # NO-BREAK SPACE+        + "name2 = \u2000value2\u2000\n"  # EN QUAD+        + "name3 = \u3000value3\u3000\n",  # IDEOGRAPHIC SPACE+    )+    assert config["section"]["name1"] == "value1"+    assert config["section"]["name2"] == "value2"+    assert config["section"]["name3"] == "value3"+++def test_unicode_whitespace_in_section_names_with_opt_in() -> None:+    """Test that Unicode whitespace can be stripped from section names with opt-in (issue #4)."""+    config = IniConfig.parse(+        "test.ini",+        data="[section\u00a0]\n"  # NO-BREAK SPACE at end+        + "key = value\n",+        strip_section_whitespace=True,+    )+    assert "section" in config+    assert config["section"]["key"] == "value"+++def test_unicode_whitespace_in_key_names() -> None:+    """Test that Unicode whitespace is stripped from key names (issue #4)."""+    config = IniConfig(+        "test.ini",+        data="[section]\n" + "key\u00a0 = value\n",  # NO-BREAK SPACE after key+    )+    assert "key" in config["section"]+    assert config["section"]["key"] == "value"
pycparser pypi
3.0 5mo ago nominal
no findings
latest 3.0 versions 24 maintainers 1
2.13
2.14
2.15
2.16
2.17
2.18
2.19
2.20
2.21
2.22
2.23
3.0
CLEAN
no findings — nominal
release diff 2.23 → 3.0
+1 added · -11 removed · ~33 modified
+4 more files not shown
setup.py +2 lines · 1 flagged
--- +++ @@ -1,67 +1,3 @@-import os, sys-try:-    from setuptools import setup-    from setuptools.command.install import install as _install-    from setuptools.command.sdist import sdist as _sdist-except ImportError:-    from distutils.core import setup-    from distutils.command.install import install as _install-    from distutils.command.sdist import sdist as _sdist+from setuptools import setup --def _run_build_tables(dir):-    from subprocess import check_call-    # This is run inside the install staging directory (that had no .pyc files)-    # We don't want to generate any.-    # https://github.com/eliben/pycparser/pull/135-    check_call([sys.executable, '-B', '_build_tables.py'],-               cwd=os.path.join(dir, 'pycparser'))---class install(_install):-    def run(self):-        _install.run(self)-        self.execute(_run_build_tables, (self.install_lib,),-                     msg="Build the lexing/parsing tables")---class sdist(_sdist):-    def make_release_tree(self, basedir, files):-        _sdist.make_release_tree(self, basedir, files)-        self.execute(_run_build_tables, (basedir,),-                     msg="Build the lexing/parsing tables")---setup(-    # metadata-    name='pycparser',-    description='C parser in Python',-    long_description="""-        pycparser is a complete parser of the C language, written in-        pure Python using the PLY parsing library.-        It parses C code into an AST and can serve as a front-end for-        C compilers or analysis tools.-    """,-    license='BSD-3-Clause',-    version='2.23',-    author='Eli Bendersky',-    maintainer='Eli Bendersky',-    author_email='[email protected]',-    url='https://github.com/eliben/pycparser',-    platforms='Cross Platform',-    classifiers = [-        'Development Status :: 5 - Production/Stable',-        'License :: OSI Approved :: BSD License',-        'Programming Language :: Python :: 3',-        'Programming Language :: Python :: 3.8',-        'Programming Language :: Python :: 3.9',-        'Programming Language :: Python :: 3.10',-        'Programming Language :: Python :: 3.11',-        'Programming Language :: Python :: 3.12',-        'Programming Language :: Python :: 3.13',-    ],-    python_requires=">=3.8",-    packages=['pycparser', 'pycparser.ply'],-    package_data={'pycparser': ['*.cfg']},-    cmdclass={'install': install, 'sdist': sdist},-)+setup()
examples/c-to-c.py +5 lines
--- +++ @@ -1,2 +1,2 @@-#------------------------------------------------------------------------------+# ------------------------------------------------------------------------------ # pycparser: c-to-c.py@@ -8,3 +8,3 @@ # License: BSD-#------------------------------------------------------------------------------+# ------------------------------------------------------------------------------ import sys@@ -13,3 +13,3 @@ # your site-packages/ with setup.py-sys.path.extend(['.', '..'])+sys.path.extend([".", ".."]) @@ -18,5 +18,4 @@ -def translate_to_c(filename):-    """ Simply use the c_generator module to emit a parsed AST.-    """+def translate_to_c(filename: str) -> None:+    """Simply use the c_generator module to emit a parsed AST."""     ast = parse_file(filename, use_cpp=True)
examples/c_json.py +71 lines
--- +++ @@ -1,2 +1,2 @@-#------------------------------------------------------------------------------+# ------------------------------------------------------------------------------ # pycparser: c_json.py@@ -35,3 +35,3 @@ #     }-#------------------------------------------------------------------------------+# ------------------------------------------------------------------------------ import json@@ -39,2 +39,3 @@ import re+from typing import Any, Callable, Dict, Optional, Set, TypeVar @@ -42,10 +43,10 @@ # your site-packages/ with setup.py-sys.path.extend(['.', '..'])+sys.path.extend([".", ".."])  from pycparser import parse_file, c_ast-from pycparser.plyparser import Coord---RE_CHILD_ARRAY = re.compile(r'(.*)\[(.*)\]')-RE_INTERNAL_ATTR = re.compile('__.*__')+from pycparser.c_parser import Coord+++RE_CHILD_ARRAY = re.compile(r"(.*)\[(.*)\]")+RE_INTERNAL_ATTR = re.compile("__.*__") @@ -56,9 +57,18 @@ -def memodict(fn):-    """ Fast memoization decorator for a function taking a single argument """-    class memodict(dict):-        def __missing__(self, key):-            ret = self[key] = fn(key)-            return ret-    return memodict().__getitem__+_T = TypeVar("_T")+_R = TypeVar("_R")+++def memodict(fn: Callable[[_T], _R]) -> Callable[[_T], _R]:+    """Fast memoization decorator for a function taking a single argument"""+    cache: Dict[_T, _R] = {}++    def memoized(arg: _T) -> _R:+        if arg in cache:+            return cache[arg]+        result = fn(arg)+        cache[arg] = result+        return result++    return memoized @@ -66,3 +76,3 @@ @memodict-def child_attrs_of(klass):+def child_attrs_of(klass: type[c_ast.Node]) -> Set[str]:     """@@ -77,10 +87,10 @@ -def to_dict(node):-    """ Recursively convert an ast into dict representation. """+def to_dict(node: c_ast.Node) -> Dict[str, Any]:+    """Recursively convert an ast into dict representation."""     klass = node.__class__ -    result = {}+    result: Dict[str, Any] = {}      # Metadata-    result['_nodetype'] = klass.__name__+    result["_nodetype"] = klass.__name__ @@ -92,5 +102,5 @@     if node.coord:-        result['coord'] = str(node.coord)+        result["coord"] = str(node.coord)     else:-        result['coord'] = None+        result["coord"] = None @@ -106,5 +116,8 @@             if array_index != len(result[array_name]):-                raise CJsonError('Internal ast error. Array {} out of order. '-                    'Expected index {}, got {}'.format(-                    array_name, len(result[array_name]), array_index))+                raise CJsonError(+                    "Internal ast error. Array {} out of order. "+                    "Expected index {}, got {}".format(+                        array_name, len(result[array_name]), array_index+                    )+                )             result[array_name].append(to_dict(child))@@ -121,4 +134,4 @@ -def to_json(node, **kwargs):-    """ Convert ast node to json string """+def to_json(node: c_ast.Node, **kwargs: Any) -> str:+    """Convert ast node to json string"""     return json.dumps(to_dict(node), **kwargs)@@ -126,4 +139,4 @@ -def file_to_dict(filename):-    """ Load C file into dict representation of ast """+def file_to_dict(filename: str) -> Dict[str, Any]:+    """Load C file into dict representation of ast"""     ast = parse_file(filename, use_cpp=True)@@ -132,4 +145,4 @@ -def file_to_json(filename, **kwargs):-    """ Load C file into json string representation of ast """+def file_to_json(filename: str, **kwargs: Any) -> str:+    """Load C file into json string representation of ast"""     ast = parse_file(filename, use_cpp=True)@@ -138,4 +151,4 @@ -def _parse_coord(coord_str):-    """ Parse coord string (file:line[:column]) into Coord object. """+def _parse_coord(coord_str: Optional[str]) -> Optional[Coord]:+    """Parse coord string (file:line[:column]) into Coord object."""     if coord_str is None:@@ -143,9 +156,11 @@ -    vals = coord_str.split(':')-    vals.extend([None] * 3)+    vals = coord_str.split(":")+    vals.extend(["", "", ""])     filename, line, column = vals[:3]-    return Coord(filename, line, column)---def _convert_to_obj(value):+    line_num = int(line) if line else 0+    column_num = int(column) if column else None+    return Coord(filename, line_num, column_num)+++def _convert_to_obj(value: Any) -> Any:     """@@ -155,15 +170,15 @@     """-    value_type = type(value)-    if value_type == dict:-        return from_dict(value)-    elif value_type == list:-        return [_convert_to_obj(item) for item in value]-    else:-        # String-        return value---def from_dict(node_dict):-    """ Recursively build an ast from dict representation """-    class_name = node_dict.pop('_nodetype')+    match value:+        case dict():+            return from_dict(value)+        case list():+            return [_convert_to_obj(item) for item in value]+        case _:+            # String+            return value+++def from_dict(node_dict: Dict[str, Any]) -> c_ast.Node:+    """Recursively build an ast from dict representation"""+    class_name = node_dict.pop("_nodetype") @@ -175,3 +190,3 @@     for key, value in node_dict.items():-        if key == 'coord':+        if key == "coord":             objs[key] = _parse_coord(value)@@ -185,4 +200,4 @@ -def from_json(ast_json):-    """ Build an ast from json string representation """+def from_json(ast_json: str) -> c_ast.Node:+    """Build an ast from json string representation"""     return from_dict(json.loads(ast_json))@@ -190,3 +205,3 @@ -#------------------------------------------------------------------------------+# ------------------------------------------------------------------------------ if __name__ == "__main__":
examples/cdecl.py +118 lines
--- +++ @@ -1,2 +1,2 @@-#-----------------------------------------------------------------+# ----------------------------------------------------------------- # pycparser: cdecl.py@@ -33,5 +33,6 @@ # License: BSD-#-----------------------------------------------------------------+# ----------------------------------------------------------------- import copy import sys+from typing import Optional @@ -39,3 +40,3 @@ # your site-packages/ with setup.py-sys.path.extend(['.', '..'])+sys.path.extend([".", ".."]) @@ -44,11 +45,13 @@ -def explain_c_declaration(c_decl, expand_struct=False, expand_typedef=False):-    """ Parses the declaration in c_decl and returns a text-        explanation as a string.--        The last external node of the string is used, to allow earlier typedefs-        for used types.--        expand_struct=True will spell out struct definitions recursively.-        expand_typedef=True will expand typedef'd types.+def explain_c_declaration(+    c_decl: str, expand_struct: bool = False, expand_typedef: bool = False+) -> str:+    """Parses the declaration in c_decl and returns a text+    explanation as a string.++    The last external node of the string is used, to allow earlier typedefs+    for used types.++    expand_struct=True will spell out struct definitions recursively.+    expand_typedef=True will expand typedef'd types.     """@@ -57,3 +60,3 @@     try:-        node = parser.parse(c_decl, filename='<stdin>')+        node = parser.parse(c_decl, filename="<stdin>")     except c_parser.ParseError:@@ -62,5 +65,3 @@ -    if (not isinstance(node, c_ast.FileAST) or-        not isinstance(node.ext[-1], c_ast.Decl)-        ):+    if not isinstance(node, c_ast.FileAST) or not isinstance(node.ext[-1], c_ast.Decl):         return "Not a valid declaration"@@ -68,5 +69,8 @@     try:-        expanded = expand_struct_typedef(node.ext[-1], node,-                                         expand_struct=expand_struct,-                                         expand_typedef=expand_typedef)+        expanded = expand_struct_typedef(+            node.ext[-1],+            node,+            expand_struct=expand_struct,+            expand_typedef=expand_typedef,+        )     except Exception as e:@@ -77,56 +81,52 @@ -def _explain_decl_node(decl_node):-    """ Receives a c_ast.Decl note and returns its explanation in-        English.+def _explain_decl_node(decl_node: c_ast.Decl) -> str:+    """Receives a c_ast.Decl note and returns its explanation in+    English.     """-    storage = ' '.join(decl_node.storage) + ' ' if decl_node.storage else ''--    return (decl_node.name +-            " is a " +-            storage +-            _explain_type(decl_node.type))---def _explain_type(decl):-    """ Recursively explains a type decl node-    """-    typ = type(decl)--    if typ == c_ast.TypeDecl:-        quals = ' '.join(decl.quals) + ' ' if decl.quals else ''-        return quals + _explain_type(decl.type)-    elif typ == c_ast.Typename or typ == c_ast.Decl:-        return _explain_type(decl.type)-    elif typ == c_ast.IdentifierType:-        return ' '.join(decl.names)-    elif typ == c_ast.PtrDecl:-        quals = ' '.join(decl.quals) + ' ' if decl.quals else ''-        return quals + 'pointer to ' + _explain_type(decl.type)-    elif typ == c_ast.ArrayDecl:-        arr = 'array'-        if decl.dim: arr += '[%s]' % decl.dim.value--        return arr + " of " + _explain_type(decl.type)--    elif typ == c_ast.FuncDecl:-        if decl.args:-            params = [_explain_type(param) for param in decl.args.params]-            args = ', '.join(params)-        else:-            args = ''--        return ('function(%s) returning ' % (args) +-                _explain_type(decl.type))--    elif typ == c_ast.Struct:-        decls = [_explain_decl_node(mem_decl) for mem_decl in decl.decls]-        members = ', '.join(decls)--        return ('struct%s ' % (' ' + decl.name if decl.name else '') +-                ('containing {%s}' % members if members else ''))---def expand_struct_typedef(cdecl, file_ast,-                          expand_struct=False,-                          expand_typedef=False):+    storage = " ".join(decl_node.storage) + " " if decl_node.storage else ""++    return decl_node.name + " is a " + storage + _explain_type(decl_node.type)+++def _explain_type(decl: c_ast.Node) -> str:+    """Recursively explains a type decl node"""+    match decl:+        case c_ast.TypeDecl():+            quals = " ".join(decl.quals) + " " if decl.quals else ""+            return quals + _explain_type(decl.type)+        case c_ast.Typename() | c_ast.Decl():+            return _explain_type(decl.type)+        case c_ast.IdentifierType():+            return " ".join(decl.names)+        case c_ast.PtrDecl():+            quals = " ".join(decl.quals) + " " if decl.quals else ""+            return quals + "pointer to " + _explain_type(decl.type)+        case c_ast.ArrayDecl():+            arr = "array"+            if decl.dim is not None:+                arr += f"[{decl.dim.value}]"+            return arr + " of " + _explain_type(decl.type)+        case c_ast.FuncDecl():+            if decl.args is not None:+                params = [_explain_type(param) for param in decl.args.params]+                args = ", ".join(params)+            else:+                args = ""+            return f"function({args}) returning " + _explain_type(decl.type)+        case c_ast.Struct():+            decls = [_explain_decl_node(mem_decl) for mem_decl in decl.decls]+            members = ", ".join(decls)+            struct_name = f" {decl.name}" if decl.name else ""+            contents = f"containing {{{members}}}" if members else ""+            return f"struct{struct_name} " + contents+        case _:+            return ""+++def expand_struct_typedef(+    cdecl: c_ast.Decl,+    file_ast: c_ast.FileAST,+    expand_struct: bool = False,+    expand_typedef: bool = False,+) -> c_ast.Decl:     """Expand struct & typedef and return a new expanded node."""@@ -137,33 +137,37 @@ -def _expand_in_place(decl, file_ast, expand_struct=False, expand_typedef=False):+def _expand_in_place(+    decl: c_ast.Node,+    file_ast: c_ast.FileAST,+    expand_struct: bool = False,+    expand_typedef: bool = False,+) -> c_ast.Node:     """Recursively expand struct & typedef in place, throw RuntimeError if-       undeclared struct or typedef are used+    undeclared struct or typedef are used     """-    typ = type(decl)--    if typ in (c_ast.Decl, c_ast.TypeDecl, c_ast.PtrDecl, c_ast.ArrayDecl):-        decl.type = _expand_in_place(decl.type, file_ast, expand_struct,-                                     expand_typedef)--    elif typ == c_ast.Struct:-        if not decl.decls:-            struct = _find_struct(decl.name, file_ast)-            if not struct:-                raise RuntimeError('using undeclared struct %s' % decl.name)-            decl.decls = struct.decls--        for i, mem_decl in enumerate(decl.decls):-            decl.decls[i] = _expand_in_place(mem_decl, file_ast, expand_struct,-                                             expand_typedef)-        if not expand_struct:-            decl.decls = []--    elif (typ == c_ast.IdentifierType and-          decl.names[0] not in ('int', 'char')):-        typedef = _find_typedef(decl.names[0], file_ast)-        if not typedef:-            raise RuntimeError('using undeclared type %s' % decl.names[0])--        if expand_typedef:-            return typedef.type+    match decl:+        case c_ast.Decl() | c_ast.TypeDecl() | c_ast.PtrDecl() | c_ast.ArrayDecl():+            decl.type = _expand_in_place(+                decl.type, file_ast, expand_struct, expand_typedef+            )+        case c_ast.Struct():+            if not decl.decls:+                struct = _find_struct(decl.name, file_ast)+                if struct is None:+                    raise RuntimeError(f"using undeclared struct {decl.name}")+                decl.decls = struct.decls++            for i, mem_decl in enumerate(decl.decls):+                decl.decls[i] = _expand_in_place(+                    mem_decl, file_ast, expand_struct, expand_typedef+                )+            if not expand_struct:+                decl.decls = []+        case c_ast.IdentifierType() if decl.names[0] not in ("int", "char"):+            typedef = _find_typedef(decl.names[0], file_ast)+            if typedef is None:+                raise RuntimeError(f"using undeclared type {decl.names[0]}")+            if expand_typedef:+                return typedef.type+        case _:+            pass @@ -172,18 +176,17 @@ -def _find_struct(name, file_ast):-    """Receives a struct name and return declared struct object in file_ast-    """+def _find_struct(name: str, file_ast: c_ast.FileAST) -> Optional[c_ast.Struct]:+    """Receives a struct name and return declared struct object in file_ast"""     for node in file_ast.ext:-        if (type(node) == c_ast.Decl and-           type(node.type) == c_ast.Struct and-           node.type.name == name):
… 25 more lines (truncated)
examples/construct_ast_from_scratch.py +23 lines
--- +++ @@ -12,3 +12,3 @@ # your site-packages/ with setup.py-sys.path.extend(['.', '..'])+sys.path.extend([".", ".."]) @@ -23,16 +23,23 @@ -def empty_main_function_ast():-    constant_zero = c_ast.Constant(type='int', value='0')+def empty_main_function_ast() -> c_ast.FuncDef:+    constant_zero = c_ast.Constant(type="int", value="0")     return_node = c_ast.Return(expr=constant_zero)     compound_node = c_ast.Compound(block_items=[return_node])-    type_decl_node = c_ast.TypeDecl(declname='main', quals=[],-                                    type=c_ast.IdentifierType(names=['int']),-                                    align=[])-    func_decl_node = c_ast.FuncDecl(args=c_ast.ParamList([]),-                                    type=type_decl_node)-    func_def_node = c_ast.Decl(name='main', quals=[], storage=[], funcspec=[],-                               type=func_decl_node, init=None,-                               bitsize=None, align=[])-    main_func_node = c_ast.FuncDef(decl=func_def_node, param_decls=None,-                                   body=compound_node)+    type_decl_node = c_ast.TypeDecl(+        declname="main", quals=[], type=c_ast.IdentifierType(names=["int"]), align=[]+    )+    func_decl_node = c_ast.FuncDecl(args=c_ast.ParamList([]), type=type_decl_node)+    func_def_node = c_ast.Decl(+        name="main",+        quals=[],+        storage=[],+        funcspec=[],+        type=func_decl_node,+        init=None,+        bitsize=None,+        align=[],+    )+    main_func_node = c_ast.FuncDef(+        decl=func_def_node, param_decls=None, body=compound_node+    ) @@ -41,3 +48,3 @@ -def generate_c_code(my_ast):+def generate_c_code(my_ast: c_ast.Node) -> str:     generator = c_generator.CGenerator()@@ -46,3 +53,3 @@ -if __name__ == '__main__':+if __name__ == "__main__":     main_function_ast = empty_main_function_ast()@@ -52,2 +59,2 @@     main_c_code = generate_c_code(main_function_ast)-    print("C code: \n%s" % main_c_code)+    print(f"C code: \n{main_c_code}")
examples/dump_ast.py +13 lines
--- +++ @@ -1,2 +1,2 @@-#-----------------------------------------------------------------+# ----------------------------------------------------------------- # pycparser: dump_ast.py@@ -7,3 +7,3 @@ # License: BSD-#-----------------------------------------------------------------+# ----------------------------------------------------------------- import argparse@@ -13,3 +13,3 @@ # your site-packages/ with setup.py-sys.path.extend(['.', '..'])+sys.path.extend([".", ".."]) @@ -18,9 +18,12 @@ if __name__ == "__main__":-    argparser = argparse.ArgumentParser('Dump AST')-    argparser.add_argument('filename',-                           default='examples/c_files/basic.c',-                           nargs='?',-                           help='name of file to parse')-    argparser.add_argument('--coord', help='show coordinates in the dump',-                           action='store_true')+    argparser = argparse.ArgumentParser("Dump AST")+    argparser.add_argument(+        "filename",+        default="examples/c_files/basic.c",+        nargs="?",+        help="name of file to parse",+    )+    argparser.add_argument(+        "--coord", help="show coordinates in the dump", action="store_true"+    )     args = argparser.parse_args()
examples/explore_ast.py +20 lines
--- +++ @@ -1,2 +1,2 @@-#-----------------------------------------------------------------+# ----------------------------------------------------------------- # pycparser: explore_ast.py@@ -13,3 +13,3 @@ # License: BSD-#-----------------------------------------------------------------+# ----------------------------------------------------------------- import sys@@ -18,3 +18,3 @@ # your site-packages/ with setup.py-sys.path.extend(['.', '..'])+sys.path.extend([".", ".."]) @@ -60,3 +60,3 @@ parser = c_parser.CParser()-ast = parser.parse(text, filename='<none>')+ast = parser.parse(text, filename="<none>") @@ -67,3 +67,3 @@ -#ast.show(showcoord=True)+# ast.show(showcoord=True) @@ -80,3 +80,3 @@ -#ast.ext[2].show()+# ast.ext[2].show() @@ -92,4 +92,4 @@ -#function_decl.type.show()-#function_decl.type.args.show()+# function_decl.type.show()+# function_decl.type.args.show() @@ -97,6 +97,6 @@ -#for param_decl in function_decl.type.args.params:-    #print('Arg name: %s' % param_decl.name)-    #print('Type:')-    #param_decl.type.show(offset=6)+# for param_decl in function_decl.type.args.params:+# print(f"Arg name: {param_decl.name}")+# print('Type:')+# param_decl.type.show(offset=6) @@ -112,4 +112,4 @@ -#for decl in function_body.block_items:-    #decl.show()+# for decl in function_body.block_items:+# decl.show() @@ -121,3 +121,3 @@ for_stmt = function_body.block_items[2]-#for_stmt.show()+# for_stmt.show() @@ -131,3 +131,3 @@ while_stmt = for_stmt.stmt.block_items[1]-#while_stmt.show()+# while_stmt.show() @@ -137,3 +137,3 @@ while_cond = while_stmt.cond-#while_cond.show()+# while_cond.show() @@ -144,5 +144,5 @@ -#print(while_cond.op)-#while_cond.left.show()-#while_cond.right.show()+# print(while_cond.op)+# while_cond.left.show()+# while_cond.right.show() 
examples/func_calls.py +12 lines
--- +++ @@ -1,2 +1,2 @@-#-----------------------------------------------------------------+# ----------------------------------------------------------------- # pycparser: func_calls.py@@ -8,3 +8,3 @@ # License: BSD-#-----------------------------------------------------------------+# ----------------------------------------------------------------- import sys@@ -13,3 +13,3 @@ # your site-packages/ with setup.py-sys.path.extend(['.', '..'])+sys.path.extend([".", ".."]) @@ -17,12 +17,13 @@ + # A visitor with some state information (the funcname it's looking for) class FuncCallVisitor(c_ast.NodeVisitor):-    def __init__(self, funcname):+    def __init__(self, funcname: str) -> None:         self.funcname = funcname -    def visit_FuncCall(self, node):-        if node.name.name == self.funcname:-            print('%s called at %s' % (self.funcname, node.name.coord))+    def visit_FuncCall(self, node: c_ast.FuncCall) -> None:+        if isinstance(node.name, c_ast.ID) and node.name.name == self.funcname:+            print(f"{self.funcname} called at {node.name.coord}")         # Visit args in case they contain more func calls.-        if node.args:+        if node.args is not None:             self.visit(node.args)@@ -30,3 +31,3 @@ -def show_func_calls(filename, funcname):+def show_func_calls(filename: str, funcname: str) -> None:     ast = parse_file(filename, use_cpp=True)@@ -41,4 +42,4 @@     else:-        filename = 'examples/c_files/basic.c'-        func = 'foo'+        filename = "examples/c_files/basic.c"+        func = "foo" 
examples/func_defs.py +9 lines
--- +++ @@ -1,2 +1,2 @@-#-----------------------------------------------------------------+# ----------------------------------------------------------------- # pycparser: func_defs.py@@ -11,3 +11,3 @@ # License: BSD-#-----------------------------------------------------------------+# ----------------------------------------------------------------- import sys@@ -16,3 +16,3 @@ # your site-packages/ with setup.py-sys.path.extend(['.', '..'])+sys.path.extend([".", ".."]) @@ -24,11 +24,10 @@ class FuncDefVisitor(c_ast.NodeVisitor):-    def visit_FuncDef(self, node):-        print('%s at %s' % (node.decl.name, node.decl.coord))+    def visit_FuncDef(self, node: c_ast.FuncDef) -> None:+        print(f"{node.decl.name} at {node.decl.coord}")  -def show_func_defs(filename):+def show_func_defs(filename: str) -> None:     # Note that cpp is used. Provide a path to your own cpp or     # make sure one exists in PATH.-    ast = parse_file(filename, use_cpp=True,-                     cpp_args=r'-Iutils/fake_libc_include')+    ast = parse_file(filename, use_cpp=True, cpp_args=r"-Iutils/fake_libc_include") @@ -40,5 +39,5 @@     if len(sys.argv) > 1:-        filename  = sys.argv[1]+        filename = sys.argv[1]     else:-        filename = 'examples/c_files/memmgr.c'+        filename = "examples/c_files/memmgr.c" 
examples/func_defs_add_param.py +20 lines
--- +++ @@ -1,2 +1,2 @@-#-----------------------------------------------------------------+# ----------------------------------------------------------------- # pycparser: func_defs_add_param.py@@ -8,5 +8,6 @@ # License: BSD-#-----------------------------------------------------------------+# ----------------------------------------------------------------- import sys-sys.path.extend(['.', '..'])++sys.path.extend([".", ".."]) @@ -24,18 +25,18 @@ class ParamAdder(c_ast.NodeVisitor):-    def visit_FuncDecl(self, node):-        ty = c_ast.TypeDecl(declname='_hidden',-                            quals=[],-                            align=[],-                            type=c_ast.IdentifierType(['int']))+    def visit_FuncDecl(self, node: c_ast.FuncDecl) -> None:+        ty = c_ast.TypeDecl(+            declname="_hidden", quals=[], align=[], type=c_ast.IdentifierType(["int"])+        )         newdecl = c_ast.Decl(-                    name='_hidden',-                    quals=[],-                    align=[],-                    storage=[],-                    funcspec=[],-                    type=ty,-                    init=None,-                    bitsize=None,-                    coord=node.coord)-        if node.args:+            name="_hidden",+            quals=[],+            align=[],+            storage=[],+            funcspec=[],+            type=ty,+            init=None,+            bitsize=None,+            coord=node.coord,+        )+        if node.args is not None:             node.args.params.append(newdecl)@@ -45,3 +46,3 @@ -if __name__ == '__main__':+if __name__ == "__main__":     parser = c_parser.CParser()
examples/rewrite_ast.py +4 lines
--- +++ @@ -1,2 +1,2 @@-#-----------------------------------------------------------------+# ----------------------------------------------------------------- # pycparser: rewrite_ast.py@@ -7,6 +7,6 @@ # License: BSD-#-----------------------------------------------------------------+# ----------------------------------------------------------------- import sys -sys.path.extend(['.', '..'])+sys.path.extend([".", ".."]) from pycparser import c_parser@@ -20,3 +20,3 @@ -if __name__ == '__main__':+if __name__ == "__main__":     parser = c_parser.CParser()
examples/serialize_ast.py +9 lines
--- +++ @@ -1,2 +1,2 @@-#-----------------------------------------------------------------+# ----------------------------------------------------------------- # pycparser: serialize_ast.py@@ -8,7 +8,8 @@ # License: BSD-#-----------------------------------------------------------------+# ----------------------------------------------------------------- import pickle import sys+import tempfile -sys.path.extend(['.', '..'])+sys.path.extend([".", ".."]) from pycparser import c_parser@@ -22,12 +23,12 @@ -if __name__ == '__main__':+if __name__ == "__main__":     parser = c_parser.CParser()     ast = parser.parse(text)-    dump_filename = 'ast.pickle'--    with open(dump_filename, 'wb') as f:+    with tempfile.NamedTemporaryFile(delete=False, suffix=".pickle") as f:+        dump_filename = f.name         pickle.dump(ast, f, protocol=pickle.HIGHEST_PROTOCOL)+        print(f"Dumped to {dump_filename}")      # Deserialize.-    with open(dump_filename, 'rb') as f:+    with open(dump_filename, "rb") as f:         ast = pickle.load(f)
examples/using_cpp_libc.py +8 lines
--- +++ @@ -1,2 +1,2 @@-#-----------------------------------------------------------------+# ----------------------------------------------------------------- # pycparser: using_cpp_libc.py@@ -8,3 +8,3 @@ # License: BSD-#-----------------------------------------------------------------+# ----------------------------------------------------------------- import sys@@ -13,3 +13,3 @@ # your site-packages/ with setup.py-sys.path.extend(['.', '..'])+sys.path.extend([".", ".."]) @@ -20,9 +20,9 @@     if len(sys.argv) > 1:-        filename  = sys.argv[1]+        filename = sys.argv[1]     else:-        filename = 'examples/c_files/year.c'+        filename = "examples/c_files/year.c" -    ast = parse_file(filename, use_cpp=True,-            cpp_path='cpp',-            cpp_args=r'-Iutils/fake_libc_include')+    ast = parse_file(+        filename, use_cpp=True, cpp_path="cpp", cpp_args=r"-Iutils/fake_libc_include"+    )     ast.show()
examples/using_gcc_E_libc.py +11 lines
--- +++ @@ -1,2 +1,2 @@-#-------------------------------------------------------------------------------+# ------------------------------------------------------------------------------- # pycparser: using_gcc_E_libc.py@@ -9,3 +9,3 @@ # License: BSD-#-------------------------------------------------------------------------------+# ------------------------------------------------------------------------------- import sys@@ -14,3 +14,3 @@ # your site-packages/ with setup.py-sys.path.extend(['.', '..'])+sys.path.extend([".", ".."]) @@ -21,9 +21,12 @@     if len(sys.argv) > 1:-        filename  = sys.argv[1]+        filename = sys.argv[1]     else:-        filename = 'examples/c_files/year.c'+        filename = "examples/c_files/year.c" -    ast = parse_file(filename, use_cpp=True,-            cpp_path='gcc',-            cpp_args=['-E', r'-Iutils/fake_libc_include'])+    ast = parse_file(+        filename,+        use_cpp=True,+        cpp_path="gcc",+        cpp_args=["-E", r"-Iutils/fake_libc_include"],+    )     ast.show()
pycparser/__init__.py +50 lines
--- +++ @@ -1,2 +1,2 @@-#-----------------------------------------------------------------+# ----------------------------------------------------------------- # pycparser: __init__.py@@ -8,5 +8,5 @@ # License: BSD-#------------------------------------------------------------------__all__ = ['c_lexer', 'c_parser', 'c_ast']-__version__ = '2.23'+# -----------------------------------------------------------------+__all__ = ["c_lexer", "c_parser", "c_ast"]+__version__ = "3.00" @@ -14,18 +14,21 @@ from subprocess import check_output-from .c_parser import CParser++from . import c_parser++CParser = c_parser.CParser  -def preprocess_file(filename, cpp_path='cpp', cpp_args=''):-    """ Preprocess a file using cpp.+def preprocess_file(filename, cpp_path="cpp", cpp_args=""):+    """Preprocess a file using cpp. -        filename:-            Name of the file you want to preprocess.+    filename:+        Name of the file you want to preprocess. -        cpp_path:-        cpp_args:-            Refer to the documentation of parse_file for the meaning of these-            arguments.+    cpp_path:+    cpp_args:+        Refer to the documentation of parse_file for the meaning of these+        arguments. -        When successful, returns the preprocessed file's contents.-        Errors from cpp will be printed out.+    When successful, returns the preprocessed file's contents.+    Errors from cpp will be printed out.     """@@ -34,3 +37,3 @@         path_list += cpp_args-    elif cpp_args != '':+    elif cpp_args != "":         path_list += [cpp_args]@@ -43,5 +46,7 @@     except OSError as e:-        raise RuntimeError("Unable to invoke 'cpp'.  " +-            'Make sure its path was passed correctly\n' +-            ('Original error: %s' % e))+        raise RuntimeError(+            "Unable to invoke 'cpp'.  "+            + "Make sure its path was passed correctly\n"+            + f"Original error: {e}"+        ) @@ -50,35 +55,36 @@ -def parse_file(filename, use_cpp=False, cpp_path='cpp', cpp_args='',-               parser=None, encoding=None):-    """ Parse a C file using pycparser.+def parse_file(+    filename, use_cpp=False, cpp_path="cpp", cpp_args="", parser=None, encoding=None+):+    """Parse a C file using pycparser. -        filename:-            Name of the file you want to parse.+    filename:+        Name of the file you want to parse. -        use_cpp:-            Set to True if you want to execute the C pre-processor-            on the file prior to parsing it.+    use_cpp:+        Set to True if you want to execute the C pre-processor+        on the file prior to parsing it. -        cpp_path:-            If use_cpp is True, this is the path to 'cpp' on your-            system. If no path is provided, it attempts to just-            execute 'cpp', so it must be in your PATH.+    cpp_path:+        If use_cpp is True, this is the path to 'cpp' on your+        system. If no path is provided, it attempts to just+        execute 'cpp', so it must be in your PATH. -        cpp_args:-            If use_cpp is True, set this to the command line arguments strings-            to cpp. Be careful with quotes - it's best to pass a raw string-            (r'') here. For example:-            r'-I../utils/fake_libc_include'-            If several arguments are required, pass a list of strings.+    cpp_args:+        If use_cpp is True, set this to the command line arguments strings+        to cpp. Be careful with quotes - it's best to pass a raw string+        (r'') here. For example:+        r'-I../utils/fake_libc_include'+        If several arguments are required, pass a list of strings. -        encoding:-            Encoding to use for the file to parse+    encoding:+        Encoding to use for the file to parse -        parser:-            Optional parser object to be used instead of the default CParser+    parser:+        Optional parser object to be used instead of the default CParser -        When successful, an AST is returned. ParseError can be-        thrown if the file doesn't parse successfully.+    When successful, an AST is returned. ParseError can be+    thrown if the file doesn't parse successfully. -        Errors from cpp will be printed out.+    Errors from cpp will be printed out.     """
pycparser/_ast_gen.py +116 lines
--- +++ @@ -1,2 +1,2 @@-#-----------------------------------------------------------------+# ----------------------------------------------------------------- # _ast_gen.py@@ -4,3 +4,6 @@ # Generates the AST Node classes from a specification given in-# a configuration file+# a configuration file. This module can also be run as a script to+# regenerate c_ast.py from _c_ast.cfg (from the repo root or the+# pycparser/ directory). Use 'make check' to reformat the generated+# file after running this script. #@@ -11,20 +14,22 @@ # License: BSD-#-----------------------------------------------------------------+# ----------------------------------------------------------------- from string import Template---class ASTCodeGenerator(object):-    def __init__(self, cfg_filename='_c_ast.cfg'):-        """ Initialize the code generator from a configuration-            file.+import os+from typing import IO+++class ASTCodeGenerator:+    def __init__(self, cfg_filename="_c_ast.cfg"):+        """Initialize the code generator from a configuration+        file.         """         self.cfg_filename = cfg_filename-        self.node_cfg = [NodeCfg(name, contents)-            for (name, contents) in self.parse_cfgfile(cfg_filename)]--    def generate(self, file=None):-        """ Generates the code into file, an open file buffer.-        """-        src = Template(_PROLOGUE_COMMENT).substitute(-            cfg_filename=self.cfg_filename)+        self.node_cfg = [+            NodeCfg(name, contents)+            for (name, contents) in self.parse_cfgfile(cfg_filename)+        ]++    def generate(self, file: IO[str]) -> None:+        """Generates the code into file, an open file buffer."""+        src = Template(_PROLOGUE_COMMENT).substitute(cfg_filename=self.cfg_filename) @@ -32,3 +37,3 @@         for node_cfg in self.node_cfg:-            src += node_cfg.generate_source() + '\n\n'+            src += node_cfg.generate_source() + "\n\n" @@ -37,4 +42,4 @@     def parse_cfgfile(self, filename):-        """ Parse the configuration file and yield pairs of-            (name, contents) for each node.+        """Parse the configuration file and yield pairs of+        (name, contents) for each node.         """@@ -43,13 +48,13 @@                 line = line.strip()-                if not line or line.startswith('#'):+                if not line or line.startswith("#"):                     continue-                colon_i = line.find(':')-                lbracket_i = line.find('[')-                rbracket_i = line.find(']')+                colon_i = line.find(":")+                lbracket_i = line.find("[")+                rbracket_i = line.find("]")                 if colon_i < 1 or lbracket_i <= colon_i or rbracket_i <= lbracket_i:-                    raise RuntimeError("Invalid line in %s:\n%s\n" % (filename, line))+                    raise RuntimeError(f"Invalid line in {filename}:\n{line}\n")                  name = line[:colon_i]-                val = line[lbracket_i + 1:rbracket_i]-                vallist = [v.strip() for v in val.split(',')] if val else []+                val = line[lbracket_i + 1 : rbracket_i]+                vallist = [v.strip() for v in val.split(",")] if val else []                 yield name, vallist@@ -57,8 +62,8 @@ -class NodeCfg(object):-    """ Node configuration.--        name: node name-        contents: a list of contents - attributes and child nodes-        See comment at the top of the configuration file for details.+class NodeCfg:+    """Node configuration.++    name: node name+    contents: a list of contents - attributes and child nodes+    See comment at the top of the configuration file for details.     """@@ -73,8 +78,8 @@         for entry in contents:-            clean_entry = entry.rstrip('*')+            clean_entry = entry.rstrip("*")             self.all_entries.append(clean_entry) -            if entry.endswith('**'):+            if entry.endswith("**"):                 self.seq_child.append(clean_entry)-            elif entry.endswith('*'):+            elif entry.endswith("*"):                 self.child.append(clean_entry)@@ -85,5 +90,5 @@         src = self._gen_init()-        src += '\n' + self._gen_children()-        src += '\n' + self._gen_iter()-        src += '\n' + self._gen_attr_names()+        src += "\n" + self._gen_children()+        src += "\n" + self._gen_iter()+        src += "\n" + self._gen_attr_names()         return src@@ -91,18 +96,18 @@     def _gen_init(self):-        src = "class %s(Node):\n" % self.name+        src = f"class {self.name}(Node):\n"          if self.all_entries:-            args = ', '.join(self.all_entries)-            slots = ', '.join("'{0}'".format(e) for e in self.all_entries)+            args = ", ".join(self.all_entries)+            slots = ", ".join(f"'{e}'" for e in self.all_entries)             slots += ", 'coord', '__weakref__'"-            arglist = '(self, %s, coord=None)' % args+            arglist = f"(self, {args}, coord=None)"         else:             slots = "'coord', '__weakref__'"-            arglist = '(self, coord=None)'--        src += "    __slots__ = (%s)\n" % slots-        src += "    def __init__%s:\n" % arglist--        for name in self.all_entries + ['coord']:-            src += "        self.%s = %s\n" % (name, name)+            arglist = "(self, coord=None)"++        src += f"    __slots__ = ({slots})\n"+        src += f"    def __init__{arglist}:\n"++        for name in self.all_entries + ["coord"]:+            src += f"        self.{name} = {name}\n" @@ -111,22 +116,18 @@     def _gen_children(self):-        src = '    def children(self):\n'+        src = "    def children(self):\n"          if self.all_entries:-            src += '        nodelist = []\n'+            src += "        nodelist = []\n"              for child in self.child:-                src += (-                    '        if self.%(child)s is not None:' +-                    ' nodelist.append(("%(child)s", self.%(child)s))\n') % (-                        dict(child=child))+                src += f"        if self.{child} is not None:\n"+                src += f'            nodelist.append(("{child}", self.{child}))\n'              for seq_child in self.seq_child:-                src += (-                    '        for i, child in enumerate(self.%(child)s or []):\n'-                    '            nodelist.append(("%(child)s[%%d]" %% i, child))\n') % (-                        dict(child=seq_child))--            src += '        return tuple(nodelist)\n'+                src += f"        for i, child in enumerate(self.{seq_child} or []):\n"+                src += f'            nodelist.append((f"{seq_child}[{{i}}]", child))\n'++            src += "        return tuple(nodelist)\n"         else:-            src += '        return ()\n'+            src += "        return ()\n" @@ -135,3 +136,3 @@     def _gen_iter(self):-        src = '    def __iter__(self):\n'+        src = "    def __iter__(self):\n" @@ -139,10 +140,8 @@             for child in self.child:-                src += (-                    '        if self.%(child)s is not None:\n' +-                    '            yield self.%(child)s\n') % (dict(child=child))+                src += f"        if self.{child} is not None:\n"+                src += f"            yield self.{child}\n"              for seq_child in self.seq_child:-                src += (-                    '        for child in (self.%(child)s or []):\n'-                    '            yield child\n') % (dict(child=seq_child))+                src += f"        for child in (self.{seq_child} or []):\n"+                src += "            yield child\n" @@ -150,10 +149,6 @@                 # Empty generator-                src += (-                    '        return\n' +-                    '        yield\n')+                src += "        return\n" + "        yield\n"         else:             # Empty generator-            src += (-                '        return\n' +-                '        yield\n')+            src += "        return\n" + "        yield\n" @@ -162,11 +157,9 @@     def _gen_attr_names(self):-        src = "    attr_names = (" + ''.join("%r, " % nm for nm in self.attr) + ')'-        return src---_PROLOGUE_COMMENT = \-r'''#-----------------------------------------------------------------+        src = "    attr_names = (" + "".join(f"{nm!r}, " for nm in self.attr) + ")"+        return src+++_PROLOGUE_COMMENT = r"""#----------------------------------------------------------------- # ** ATTENTION **-# This code was automatically generated from the file:-# $cfg_filename+# This code was automatically generated from _c_ast.cfg #@@ -184,6 +177,6 @@ -'''-+""" _PROLOGUE_CODE = r''' import sys+from typing import Any, ClassVar, IO, Optional @@ -198,3 +191,3 @@ -class Node(object):+class Node:     __slots__ = ()@@ -202,2 +195,4 @@     """
… 78 more lines (truncated)
pycparser/ast_transforms.py +82 lines
--- +++ @@ -1,2 +1,2 @@-#------------------------------------------------------------------------------+# ------------------------------------------------------------------------------ # pycparser: ast_transforms.py@@ -7,3 +7,5 @@ # License: BSD-#------------------------------------------------------------------------------+# ------------------------------------------------------------------------------++from typing import Any, List, Tuple, cast @@ -12,52 +14,52 @@ -def fix_switch_cases(switch_node):-    """ The 'case' statements in a 'switch' come out of parsing with one-        child node, so subsequent statements are just tucked to the parent-        Compound. Additionally, consecutive (fall-through) case statements-        come out messy. This is a peculiarity of the C grammar. The following:+def fix_switch_cases(switch_node: c_ast.Switch) -> c_ast.Switch:+    """The 'case' statements in a 'switch' come out of parsing with one+    child node, so subsequent statements are just tucked to the parent+    Compound. Additionally, consecutive (fall-through) case statements+    come out messy. This is a peculiarity of the C grammar. The following: -            switch (myvar) {-                case 10:-                    k = 10;-                    p = k + 1;-                    return 10;-                case 20:-                case 30:-                    return 20;-                default:-                    break;-            }+        switch (myvar) {+            case 10:+                k = 10;+                p = k + 1;+                return 10;+            case 20:+            case 30:+                return 20;+            default:+                break;+        } -        Creates this tree (pseudo-dump):+    Creates this tree (pseudo-dump): -            Switch-                ID: myvar-                Compound:-                    Case 10:-                        k = 10+        Switch+            ID: myvar+            Compound:+                Case 10:+                    k = 10+                p = k + 1+                return 10+                Case 20:+                    Case 30:+                        return 20+                Default:+                    break++    The goal of this transform is to fix this mess, turning it into the+    following:++        Switch+            ID: myvar+            Compound:+                Case 10:+                    k = 10                     p = k + 1                     return 10-                    Case 20:-                        Case 30:-                            return 20-                    Default:-                        break+                Case 20:+                Case 30:+                    return 20+                Default:+                    break -        The goal of this transform is to fix this mess, turning it into the-        following:--            Switch-                ID: myvar-                Compound:-                    Case 10:-                        k = 10-                        p = k + 1-                        return 10-                    Case 20:-                    Case 30:-                        return 20-                    Default:-                        break--        A fixed AST node is returned. The argument may be modified.+    A fixed AST node is returned. The argument may be modified.     """@@ -72,3 +74,3 @@     # The last Case/Default node-    last_case = None+    last_case: c_ast.Case | c_ast.Default | None = None @@ -77,3 +79,3 @@     # (for `switch(cond) {}`, block_items would have been None)-    for child in (switch_node.stmt.block_items or []):+    for child in switch_node.stmt.block_items or []:         if isinstance(child, (c_ast.Case, c_ast.Default)):@@ -98,18 +100,23 @@ -def _extract_nested_case(case_node, stmts_list):-    """ Recursively extract consecutive Case statements that are made nested-        by the parser and add them to the stmts_list.+def _extract_nested_case(+    case_node: c_ast.Case | c_ast.Default, stmts_list: List[c_ast.Node]+) -> None:+    """Recursively extract consecutive Case statements that are made nested+    by the parser and add them to the stmts_list.     """     if isinstance(case_node.stmts[0], (c_ast.Case, c_ast.Default)):-        stmts_list.append(case_node.stmts.pop())-        _extract_nested_case(stmts_list[-1], stmts_list)+        nested = case_node.stmts.pop()+        stmts_list.append(nested)+        _extract_nested_case(cast(Any, nested), stmts_list)  -def fix_atomic_specifiers(decl):-    """ Atomic specifiers like _Atomic(type) are unusually structured,-        conferring a qualifier upon the contained type.+def fix_atomic_specifiers(+    decl: c_ast.Decl | c_ast.Typedef,+) -> c_ast.Decl | c_ast.Typedef:+    """Atomic specifiers like _Atomic(type) are unusually structured,+    conferring a qualifier upon the contained type. -        This function fixes a decl with atomic specifiers to have a sane AST-        structure, by removing spurious Typename->TypeDecl pairs and attaching-        the _Atomic qualifier in the right place.+    This function fixes a decl with atomic specifiers to have a sane AST+    structure, by removing spurious Typename->TypeDecl pairs and attaching+    the _Atomic qualifier in the right place.     """@@ -125,3 +132,3 @@     # wrong place during construction).-    typ = decl+    typ: Any = decl     while not isinstance(typ, c_ast.TypeDecl):@@ -131,4 +138,4 @@             return decl-    if '_Atomic' in typ.quals and '_Atomic' not in decl.quals:-        decl.quals.append('_Atomic')+    if "_Atomic" in typ.quals and "_Atomic" not in decl.quals:+        decl.quals.append("_Atomic")     if typ.declname is None:@@ -139,11 +146,13 @@ -def _fix_atomic_specifiers_once(decl):-    """ Performs one 'fix' round of atomic specifiers.-        Returns (modified_decl, found) where found is True iff a fix was made.+def _fix_atomic_specifiers_once(+    decl: c_ast.Decl | c_ast.Typedef,+) -> Tuple[c_ast.Decl | c_ast.Typedef, bool]:+    """Performs one 'fix' round of atomic specifiers.+    Returns (modified_decl, found) where found is True iff a fix was made.     """-    parent = decl-    grandparent = None-    node = decl.type+    parent: Any = decl+    grandparent: Any = None+    node: Any = decl.type     while node is not None:-        if isinstance(node, c_ast.Typename) and '_Atomic' in node.quals:+        if isinstance(node, c_ast.Typename) and "_Atomic" in node.quals:             break@@ -160,5 +169,6 @@     assert isinstance(parent, c_ast.TypeDecl)-    grandparent.type = node.type-    if '_Atomic' not in node.type.quals:-        node.type.quals.append('_Atomic')+    assert grandparent is not None+    cast(Any, grandparent).type = node.type+    if "_Atomic" not in node.type.quals:+        node.type.quals.append("_Atomic")     return decl, True
pycparser/c_ast.py +493 lines
--- +++ @@ -1,5 +1,4 @@-#-----------------------------------------------------------------+# ----------------------------------------------------------------- # ** ATTENTION **-# This code was automatically generated from the file:-# _c_ast.cfg+# This code was automatically generated from _c_ast.cfg #@@ -15,3 +14,3 @@ # License: BSD-#-----------------------------------------------------------------+# ----------------------------------------------------------------- @@ -19,2 +18,4 @@ import sys+from typing import Any, ClassVar, IO, Optional+ @@ -25,3 +26,3 @@     if isinstance(obj, list):-        return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]'+        return "[" + (",\n ".join((_repr(e).replace("\n", "\n ") for e in obj))) + "\n]"     else:@@ -29,3 +30,4 @@ -class Node(object):++class Node:     __slots__ = ()@@ -33,9 +35,11 @@     """+    attr_names: ClassVar[tuple[str, ...]] = ()+    coord: Optional[Any]+     def __repr__(self):-        """ Generates a python representation of the current node-        """-        result = self.__class__.__name__ + '('--        indent = ''-        separator = ''+        """Generates a python representation of the current node"""+        result = self.__class__.__name__ + "("++        indent = ""+        separator = ""         for name in self.__slots__[:-2]:@@ -43,8 +47,17 @@             result += indent-            result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n  ' + (' ' * (len(name) + len(self.__class__.__name__)))))--            separator = ','-            indent = '\n ' + (' ' * len(self.__class__.__name__))--        result += indent + ')'+            result += (+                name+                + "="+                + (+                    _repr(getattr(self, name)).replace(+                        "\n",+                        "\n  " + (" " * (len(name) + len(self.__class__.__name__))),+                    )+                )+            )++            separator = ","+            indent = "\n " + (" " * len(self.__class__.__name__))++        result += indent + ")" @@ -53,41 +66,59 @@     def children(self):-        """ A sequence of all children that are Nodes+        """A sequence of all children that are Nodes"""+        pass++    def show(+        self,+        buf: IO[str] = sys.stdout,+        offset: int = 0,+        attrnames: bool = False,+        showemptyattrs: bool = True,+        nodenames: bool = False,+        showcoord: bool = False,+        _my_node_name: Optional[str] = None,+    ):+        """Pretty print the Node and all its attributes and+        children (recursively) to a buffer.++        buf:+            Open IO buffer into which the Node is printed.++        offset:+            Initial offset (amount of leading spaces)++        attrnames:+            True if you want to see the attribute names in+            name=value pairs. False to only see the values.++        showemptyattrs:+            False if you want to suppress printing empty attributes.++        nodenames:+            True if you want to see the actual node names+            within their parents.++        showcoord:+            Do you want the coordinates of each Node to be+            displayed.         """-        pass--    def show(self, buf=sys.stdout, offset=0, attrnames=False, nodenames=False, showcoord=False, _my_node_name=None):-        """ Pretty print the Node and all its attributes and-            children (recursively) to a buffer.--            buf:-                Open IO buffer into which the Node is printed.--            offset:-                Initial offset (amount of leading spaces)--            attrnames:-                True if you want to see the attribute names in-                name=value pairs. False to only see the values.--            nodenames:-                True if you want to see the actual node names-                within their parents.--            showcoord:-                Do you want the coordinates of each Node to be-                displayed.-        """-        lead = ' ' * offset+        lead = " " * offset         if nodenames and _my_node_name is not None:-            buf.write(lead + self.__class__.__name__+ ' <' + _my_node_name + '>: ')+            buf.write(lead + self.__class__.__name__ + " <" + _my_node_name + ">: ")         else:-            buf.write(lead + self.__class__.__name__+ ': ')+            buf.write(lead + self.__class__.__name__ + ": ")          if self.attr_names:++            def is_empty(v):+                v is None or (hasattr(v, "__len__") and len(v) == 0)++            nvlist = [+                (n, getattr(self, n))+                for n in self.attr_names+                if showemptyattrs or not is_empty(getattr(self, n))+            ]             if attrnames:-                nvlist = [(n, getattr(self,n)) for n in self.attr_names]-                attrstr = ', '.join('%s=%s' % nv for nv in nvlist)+                attrstr = ", ".join(f"{name}={value}" for name, value in nvlist)             else:-                vlist = [getattr(self, n) for n in self.attr_names]-                attrstr = ', '.join('%s' % v for v in vlist)+                attrstr = ", ".join(f"{value}" for _, value in nvlist)             buf.write(attrstr)@@ -95,6 +126,6 @@         if showcoord:-            buf.write(' (at %s)' % self.coord)-        buf.write('\n')--        for (child_name, child) in self.children():+            buf.write(f" (at {self.coord})")+        buf.write("\n")++        for child_name, child in self.children():             child.show(@@ -103,39 +134,41 @@                 attrnames=attrnames,+                showemptyattrs=showemptyattrs,                 nodenames=nodenames,                 showcoord=showcoord,-                _my_node_name=child_name)---class NodeVisitor(object):-    """ A base NodeVisitor class for visiting c_ast nodes.-        Subclass it and define your own visit_XXX methods, where-        XXX is the class name you want to visit with these-        methods.--        For example:--        class ConstantVisitor(NodeVisitor):-            def __init__(self):-                self.values = []--            def visit_Constant(self, node):-                self.values.append(node.value)--        Creates a list of values of all the constant nodes-        encountered below the given node. To use it:--        cv = ConstantVisitor()-        cv.visit(node)--        Notes:--        *   generic_visit() will be called for AST nodes for which-            no visit_XXX method was defined.-        *   The children of nodes for which a visit_XXX was-            defined will not be visited - if you need this, call-            generic_visit() on the node.-            You can use:-                NodeVisitor.generic_visit(self, node)-        *   Modeled after Python's own AST visiting facilities-            (the ast module of Python 3.0)+                _my_node_name=child_name,+            )+++class NodeVisitor:+    """A base NodeVisitor class for visiting c_ast nodes.+    Subclass it and define your own visit_XXX methods, where+    XXX is the class name you want to visit with these+    methods.++    For example:++    class ConstantVisitor(NodeVisitor):+        def __init__(self):+            self.values = []++        def visit_Constant(self, node):+            self.values.append(node.value)++    Creates a list of values of all the constant nodes+    encountered below the given node. To use it:++    cv = ConstantVisitor()+    cv.visit(node)++    Notes:++    *   generic_visit() will be called for AST nodes for which+        no visit_XXX method was defined.+    *   The children of nodes for which a visit_XXX was+        defined will not be visited - if you need this, call+        generic_visit() on the node.+        You can use:+            NodeVisitor.generic_visit(self, node)
… 918 more lines (truncated)
pycparser/c_generator.py +415 lines
--- +++ @@ -1,2 +1,2 @@-#------------------------------------------------------------------------------+# ------------------------------------------------------------------------------ # pycparser: c_generator.py@@ -7,3 +7,5 @@ # License: BSD-#------------------------------------------------------------------------------+# ------------------------------------------------------------------------------+from typing import Callable, List, Optional+ from . import c_ast@@ -11,12 +13,16 @@ -class CGenerator(object):-    """ Uses the same visitor pattern as c_ast.NodeVisitor, but modified to-        return a value from each visit method, using string accumulation in-        generic_visit.+class CGenerator:+    """Uses the same visitor pattern as c_ast.NodeVisitor, but modified to+    return a value from each visit method, using string accumulation in+    generic_visit.     """-    def __init__(self, reduce_parentheses=False):-        """ Constructs C-code generator--            reduce_parentheses:-                if True, eliminates needless parentheses on binary operators++    indent_level: int+    reduce_parentheses: bool++    def __init__(self, reduce_parentheses: bool = False) -> None:+        """Constructs C-code generator++        reduce_parentheses:+            if True, eliminates needless parentheses on binary operators         """@@ -27,32 +33,32 @@ -    def _make_indent(self):-        return ' ' * self.indent_level--    def visit(self, node):-        method = 'visit_' + node.__class__.__name__+    def _make_indent(self) -> str:+        return " " * self.indent_level++    def visit(self, node: c_ast.Node) -> str:+        method = "visit_" + node.__class__.__name__         return getattr(self, method, self.generic_visit)(node) -    def generic_visit(self, node):+    def generic_visit(self, node: Optional[c_ast.Node]) -> str:         if node is None:-            return ''+            return ""         else:-            return ''.join(self.visit(c) for c_name, c in node.children())--    def visit_Constant(self, n):+            return "".join(self.visit(c) for c_name, c in node.children())++    def visit_Constant(self, n: c_ast.Constant) -> str:         return n.value -    def visit_ID(self, n):+    def visit_ID(self, n: c_ast.ID) -> str:         return n.name -    def visit_Pragma(self, n):-        ret = '#pragma'+    def visit_Pragma(self, n: c_ast.Pragma) -> str:+        ret = "#pragma"         if n.string:-            ret += ' ' + n.string+            ret += " " + n.string         return ret -    def visit_ArrayRef(self, n):+    def visit_ArrayRef(self, n: c_ast.ArrayRef) -> str:         arrref = self._parenthesize_unless_simple(n.name)-        return arrref + '[' + self.visit(n.subscript) + ']'--    def visit_StructRef(self, n):+        return arrref + "[" + self.visit(n.subscript) + "]"++    def visit_StructRef(self, n: c_ast.StructRef) -> str:         sref = self._parenthesize_unless_simple(n.name)@@ -60,19 +66,22 @@ -    def visit_FuncCall(self, n):+    def visit_FuncCall(self, n: c_ast.FuncCall) -> str:         fref = self._parenthesize_unless_simple(n.name)-        return fref + '(' + self.visit(n.args) + ')'--    def visit_UnaryOp(self, n):-        if n.op == 'sizeof':-            # Always parenthesize the argument of sizeof since it can be-            # a name.-            return 'sizeof(%s)' % self.visit(n.expr)-        else:-            operand = self._parenthesize_unless_simple(n.expr)-            if n.op == 'p++':-                return '%s++' % operand-            elif n.op == 'p--':-                return '%s--' % operand-            else:-                return '%s%s' % (n.op, operand)+        args = self.visit(n.args) if n.args is not None else ""+        return fref + "(" + args + ")"++    def visit_UnaryOp(self, n: c_ast.UnaryOp) -> str:+        match n.op:+            case "sizeof":+                # Always parenthesize the argument of sizeof since it can be+                # a name.+                return f"sizeof({self.visit(n.expr)})"+            case "p++":+                operand = self._parenthesize_unless_simple(n.expr)+                return f"{operand}++"+            case "p--":+                operand = self._parenthesize_unless_simple(n.expr)+                return f"{operand}--"+            case _:+                operand = self._parenthesize_unless_simple(n.expr)+                return f"{n.op}{operand}" @@ -82,15 +91,23 @@         # Higher numbers are stronger binding-        '||': 0,  # weakest binding-        '&&': 1,-        '|': 2,-        '^': 3,-        '&': 4,-        '==': 5, '!=': 5,-        '>': 6, '>=': 6, '<': 6, '<=': 6,-        '>>': 7, '<<': 7,-        '+': 8, '-': 8,-        '*': 9, '/': 9, '%': 9  # strongest binding+        "||": 0,  # weakest binding+        "&&": 1,+        "|": 2,+        "^": 3,+        "&": 4,+        "==": 5,+        "!=": 5,+        ">": 6,+        ">=": 6,+        "<": 6,+        "<=": 6,+        ">>": 7,+        "<<": 7,+        "+": 8,+        "-": 8,+        "*": 9,+        "/": 9,+        "%": 9,  # strongest binding     } -    def visit_BinaryOp(self, n):+    def visit_BinaryOp(self, n: c_ast.BinaryOp) -> str:         # Note: all binary operators are left-to-right associative@@ -106,5 +123,9 @@             n.left,-            lambda d: not (self._is_simple_node(d) or-                      self.reduce_parentheses and isinstance(d, c_ast.BinaryOp) and-                      self.precedence_map[d.op] >= self.precedence_map[n.op]))+            lambda d: not (+                self._is_simple_node(d)+                or self.reduce_parentheses+                and isinstance(d, c_ast.BinaryOp)+                and self.precedence_map[d.op] >= self.precedence_map[n.op]+            ),+        )         # If `n.right.op` has a stronger -but not equal- binding precedence,@@ -118,25 +139,30 @@             n.right,-            lambda d: not (self._is_simple_node(d) or-                      self.reduce_parentheses and isinstance(d, c_ast.BinaryOp) and-                      self.precedence_map[d.op] > self.precedence_map[n.op]))-        return '%s %s %s' % (lval_str, n.op, rval_str)--    def visit_Assignment(self, n):+            lambda d: not (+                self._is_simple_node(d)+                or self.reduce_parentheses+                and isinstance(d, c_ast.BinaryOp)+                and self.precedence_map[d.op] > self.precedence_map[n.op]+            ),+        )+        return f"{lval_str} {n.op} {rval_str}"++    def visit_Assignment(self, n: c_ast.Assignment) -> str:         rval_str = self._parenthesize_if(-                            n.rvalue,-                            lambda n: isinstance(n, c_ast.Assignment))-        return '%s %s %s' % (self.visit(n.lvalue), n.op, rval_str)--    def visit_IdentifierType(self, n):-        return ' '.join(n.names)--    def _visit_expr(self, n):-        if isinstance(n, c_ast.InitList):-            return '{' + self.visit(n) + '}'-        elif isinstance(n, (c_ast.ExprList, c_ast.Compound)):-            return '(' + self.visit(n) + ')'-        else:-            return self.visit(n)--    def visit_Decl(self, n, no_type=False):+            n.rvalue, lambda n: isinstance(n, c_ast.Assignment)+        )+        return f"{self.visit(n.lvalue)} {n.op} {rval_str}"++    def visit_IdentifierType(self, n: c_ast.IdentifierType) -> str:+        return " ".join(n.names)++    def _visit_expr(self, n: c_ast.Node) -> str:+        match n:+            case c_ast.InitList():+                return "{" + self.visit(n) + "}"+            case c_ast.ExprList() | c_ast.Compound():+                return "(" + self.visit(n) + ")"+            case _:+                return self.visit(n)++    def visit_Decl(self, n: c_ast.Decl, no_type: bool = False) -> str:         # no_type is used when a Decl is part of a DeclList, where the type is@@ -145,17 +171,20 @@         s = n.name if no_type else self._generate_decl(n)-        if n.bitsize: s += ' : ' + self.visit(n.bitsize)+        if n.bitsize:+            s += " : " + self.visit(n.bitsize)         if n.init:-            s += ' = ' + self._visit_expr(n.init)-        return s--    def visit_DeclList(self, n):+            s += " = " + self._visit_expr(n.init)+        return s++    def visit_DeclList(self, n: c_ast.DeclList) -> str:         s = self.visit(n.decls[0])         if len(n.decls) > 1:-            s += ', ' + ', '.join(self.visit_Decl(decl, no_type=True)-                                    for decl in n.decls[1:])-        return s-
… 641 more lines (truncated)
pycparser/c_lexer.py +691 lines
--- +++ @@ -1,2 +1,2 @@-#------------------------------------------------------------------------------+# ------------------------------------------------------------------------------ # pycparser: c_lexer.py@@ -7,36 +7,42 @@ # License: BSD-#------------------------------------------------------------------------------+# ------------------------------------------------------------------------------ import re--from .ply import lex-from .ply.lex import TOKEN---class CLexer(object):-    """ A lexer for the C language. After building it, set the-        input text with input(), and call token() to get new-        tokens.--        The public attribute filename can be set to an initial-        filename, but the lexer will update it upon #line-        directives.+from dataclasses import dataclass+from enum import Enum+from typing import Callable, Dict, List, Optional, Tuple+++@dataclass(slots=True)+class _Token:+    type: str+    value: str+    lineno: int+    column: int+++class CLexer:+    """A standalone lexer for C.++    Parameters for construction:+        error_func:+            Called with (msg, line, column) on lexing errors.+        on_lbrace_func:+            Called when an LBRACE token is produced (used for scope tracking).+        on_rbrace_func:+            Called when an RBRACE token is produced (used for scope tracking).+        type_lookup_func:+            Called with an identifier name; expected to return True if it is+            a typedef name and should be tokenized as TYPEID.++    Call input(text) to initialize lexing, and then keep calling token() to+    get the next token, until it returns None (at end of input).     """-    def __init__(self, error_func, on_lbrace_func, on_rbrace_func,-                 type_lookup_func):-        """ Create a new Lexer.--            error_func:-                An error function. Will be called with an error-                message, line and column as arguments, in case of-                an error during lexing.--            on_lbrace_func, on_rbrace_func:-                Called when an LBRACE or RBRACE is encountered-                (likely to push/pop type_lookup_func's scope)--            type_lookup_func:-                A type lookup function. Given a string, it must-                return True IFF this string is a name of a type-                that was defined with a typedef earlier.-        """++    def __init__(+        self,+        error_func: Callable[[str, int, int], None],+        on_lbrace_func: Callable[[], None],+        on_rbrace_func: Callable[[], None],+        type_lookup_func: Callable[[str], bool],+    ) -> None:         self.error_func = error_func@@ -45,525 +51,656 @@         self.type_lookup_func = type_lookup_func-        self.filename = ''--        # Keeps track of the last token returned from self.token()-        self.last_token = None--        # Allow either "# line" or "# <num>" to support GCC's-        # cpp output-        #-        self.line_pattern = re.compile(r'([ \t]*line\W)|([ \t]*\d+)')-        self.pragma_pattern = re.compile(r'[ \t]*pragma\W')--    def build(self, **kwargs):-        """ Builds the lexer from the specification. Must be-            called after the lexer object is created.--            This method exists separately, because the PLY-            manual warns against calling lex.lex inside-            __init__+        self._init_state()++    def input(self, text: str, filename: str = "") -> None:+        """Initialize the lexer to the given input text.++        filename is an optional name identifying the file from which the input+        comes. The lexer can modify it if #line directives are encountered.         """-        self.lexer = lex.lex(object=self, **kwargs)--    def reset_lineno(self):-        """ Resets the internal line number counter of the lexer.+        self._init_state()+        self._lexdata = text+        self._filename = filename++    def _init_state(self) -> None:+        self._lexdata = ""+        self._filename = ""+        self._pos = 0+        self._line_start = 0+        self._pending_tok: Optional[_Token] = None+        self._lineno = 1++    @property+    def filename(self) -> str:+        return self._filename++    def token(self) -> Optional[_Token]:+        # Lexing strategy overview:+        #+        # - We maintain a current position (self._pos), line number, and the+        #   byte offset of the current line start. The lexer is a simple loop+        #   that skips whitespace/newlines and emits one token per call.+        # - A small amount of logic is handled manually before regex matching:+        #+        #   * Preprocessor-style directives: if we see '#', we check whether+        #     it's a #line or #pragma directive and consume it inline. #line+        #     updates lineno/filename and produces no tokens. #pragma can yield+        #     both PPPRAGMA and PPPRAGMASTR, but token() returns a single token,+        #     so we stash the PPPRAGMASTR as _pending_tok to return on the next+        #     token() call. Otherwise we return PPHASH.+        #   * Newlines update lineno/line-start tracking so tokens can record+        #     accurate columns.+        #+        # - The bulk of tokens are recognized in _match_token:+        #+        #   * _regex_rules: regex patterns for identifiers, literals, and other+        #     complex tokens (including error-producing patterns). The lexer+        #     uses a combined _regex_master to scan options at the same time.+        #   * _fixed_tokens: exact string matches for operators and punctuation,+        #     resolved by longest match.+        #+        # - Error patterns call the error callback and advance minimally, which+        #   keeps lexing resilient while reporting useful diagnostics.+        text = self._lexdata+        n = len(text)++        if self._pending_tok is not None:+            tok = self._pending_tok+            self._pending_tok = None+            return tok++        while self._pos < n:+            match text[self._pos]:+                case " " | "\t":+                    self._pos += 1+                case "\n":+                    self._lineno += 1+                    self._pos += 1+                    self._line_start = self._pos+                case "#":+                    if _line_pattern.match(text, self._pos + 1):+                        self._pos += 1+                        self._handle_ppline()+                        continue+                    if _pragma_pattern.match(text, self._pos + 1):+                        self._pos += 1+                        toks = self._handle_pppragma()+                        if len(toks) > 1:+                            self._pending_tok = toks[1]+                        if len(toks) > 0:+                            return toks[0]+                        continue+                    tok = self._make_token("PPHASH", "#", self._pos)+                    self._pos += 1+                    return tok+                case _:+                    if tok := self._match_token():+                        return tok+                    else:+                        continue++    def _match_token(self) -> Optional[_Token]:+        """Match one token at the current position.++        Returns a Token on success, or None if no token could be matched and+        an error was reported. This method always advances _pos by the matched+        length, or by 1 on error/no-match.         """-        self.lexer.lineno = 1--    def input(self, text):-        self.lexer.input(text)--    def token(self):-        self.last_token = self.lexer.token()-        return self.last_token--    def find_tok_column(self, token):-        """ Find the column of the token in its line.+        text = self._lexdata+        pos = self._pos+        # We pick the longest match between:+        # - the master regex (identifiers, literals, error patterns, etc.)+        # - fixed operator/punctuator literals from the bucket for text[pos]+        #+        # The longest match is required to ensure we properly lex something+        # like ".123" (a floating-point constant) as a single entity (with+        # FLOAT_CONST), rather than a PERIOD followed by a number.+        #+        # The fixed-literal buckets are already length-sorted, so within that+        # bucket we can take the first match. However, we still compare its+        # length to the regex match because the regex may have matched a longer+        # token that should take precedence.+        best = None++        if m := _regex_master.match(text, pos):+            tok_type = m.lastgroup+            # All master-regex alternatives are named; lastgroup shouldn't be None.+            assert tok_type is not None+            value = m.group(tok_type)+            length = len(value)+            action, msg = _regex_actions[tok_type]+            best = (length, tok_type, value, action, msg)++        if bucket := _fixed_tokens_by_first.get(text[pos]):+            for entry in bucket:+                if text.startswith(entry.literal, pos):+                    length = len(entry.literal)+                    if best is None or length > best[0]:+                        best = (+                            length,+                            entry.tok_type,+                            entry.literal,+                            _RegexAction.TOKEN,+                            None,+                        )+                    break
… 1009 more lines (truncated)
pycparser/c_parser.py +2162 lines
--- +++ @@ -1,5 +1,5 @@-#------------------------------------------------------------------------------+# ------------------------------------------------------------------------------ # pycparser: c_parser.py #-# CParser class: Parser and AST builder for the C language+# Recursive-descent parser for the C language. #@@ -7,8 +7,18 @@ # License: BSD-#-------------------------------------------------------------------------------from .ply import yacc+# ------------------------------------------------------------------------------+from dataclasses import dataclass+from typing import (+    Any,+    Dict,+    List,+    Literal,+    NoReturn,+    Optional,+    Tuple,+    TypedDict,+    cast,+)  from . import c_ast-from .c_lexer import CLexer-from .plyparser import PLYParser, ParseError, parameterized, template+from .c_lexer import CLexer, _Token from .ast_transforms import fix_switch_cases, fix_atomic_specifiers@@ -16,63 +26,48 @@ -@template-class CParser(PLYParser):+@dataclass+class Coord:+    """Coordinates of a syntactic element. Consists of:+    - File name+    - Line number+    - Column number+    """++    file: str+    line: int+    column: Optional[int] = None++    def __str__(self) -> str:+        text = f"{self.file}:{self.line}"+        if self.column:+            text += f":{self.column}"+        return text+++class ParseError(Exception):+    pass+++class CParser:+    """Recursive-descent C parser.++    Usage:+        parser = CParser()+        ast = parser.parse(text, filename)++    The `lexer` parameter lets you inject a lexer class (defaults to CLexer).+    The parameters after `lexer` are accepted for backward compatibility with+    the old PLY-based parser and are otherwise unused.+    """+     def __init__(-            self,-            lex_optimize=True,-            lexer=CLexer,-            lextab='pycparser.lextab',-            yacc_optimize=True,-            yacctab='pycparser.yacctab',-            yacc_debug=False,-            taboutputdir=''):-        """ Create a new CParser.--            Some arguments for controlling the debug/optimization-            level of the parser are provided. The defaults are-            tuned for release/performance mode.-            The simple rules for using them are:-            *) When tweaking CParser/CLexer, set these to False-            *) When releasing a stable parser, set to True--            lex_optimize:-                Set to False when you're modifying the lexer.-                Otherwise, changes in the lexer won't be used, if-                some lextab.py file exists.-                When releasing with a stable lexer, set to True-                to save the re-generation of the lexer table on-                each run.--            lexer:-                Set this parameter to define the lexer to use if-                you're not using the default CLexer.--            lextab:-                Points to the lex table that's used for optimized-                mode. Only if you're modifying the lexer and want-                some tests to avoid re-generating the table, make-                this point to a local lex table file (that's been-                earlier generated with lex_optimize=True)--            yacc_optimize:-                Set to False when you're modifying the parser.-                Otherwise, changes in the parser won't be used, if-                some parsetab.py file exists.-                When releasing with a stable parser, set to True-                to save the re-generation of the parser table on-                each run.--            yacctab:-                Points to the yacc table that's used for optimized-                mode. Only if you're modifying the parser, make-                this point to a local yacc table file--            yacc_debug:-                Generate a parser.out file that explains how yacc-                built the parsing table from the grammar.--            taboutputdir:-                Set this parameter to control the location of generated-                lextab and yacctab files.-        """-        self.clex = lexer(+        self,+        lex_optimize: bool = True,+        lexer: type[CLexer] = CLexer,+        lextab: str = "pycparser.lextab",+        yacc_optimize: bool = True,+        yacctab: str = "pycparser.yacctab",+        yacc_debug: bool = False,+        taboutputdir: str = "",+    ) -> None:+        self.clex: CLexer = lexer(             error_func=self._lex_error_func,@@ -80,37 +75,4 @@             on_rbrace_func=self._lex_on_rbrace_func,-            type_lookup_func=self._lex_type_lookup_func)--        self.clex.build(-            optimize=lex_optimize,-            lextab=lextab,-            outputdir=taboutputdir)-        self.tokens = self.clex.tokens--        rules_with_opt = [-            'abstract_declarator',-            'assignment_expression',-            'declaration_list',-            'declaration_specifiers_no_type',-            'designation',-            'expression',-            'identifier_list',-            'init_declarator_list',-            'id_init_declarator_list',-            'initializer_list',-            'parameter_type_list',-            'block_item_list',-            'type_qualifier_list',-            'struct_declarator_list'-        ]--        for rule in rules_with_opt:-            self._create_opt_rule(rule)--        self.cparser = yacc.yacc(-            module=self,-            start='translation_unit_or_empty',-            debug=yacc_debug,-            optimize=yacc_optimize,-            tabmodule=yacctab,-            outputdir=taboutputdir)+            type_lookup_func=self._lex_type_lookup_func,+        ) @@ -124,35 +86,43 @@         # in this scope at all.+        self._scope_stack: List[Dict[str, bool]] = [dict()]+        self._tokens: _TokenStream = _TokenStream(self.clex)++    def parse(+        self, text: str, filename: str = "", debug: bool = False+    ) -> c_ast.FileAST:+        """Parses C code and returns an AST.++        text:+            A string containing the C source code++        filename:+            Name of the file being parsed (for meaningful+            error messages)++        debug:+            Deprecated debug flag (unused); for backwards compatibility.+        """         self._scope_stack = [dict()]--        # Keeps track of the last token given to yacc (the lookahead token)-        self._last_yielded_token = None--    def parse(self, text, filename='', debug=False):-        """ Parses C code and returns an AST.--            text:-                A string containing the C source code--            filename:-                Name of the file being parsed (for meaningful-                error messages)--            debug:-                Debug flag to YACC-        """-        self.clex.filename = filename-        self.clex.reset_lineno()-        self._scope_stack = [dict()]-        self._last_yielded_token = None-        return self.cparser.parse(-                input=text,-                lexer=self.clex,-                debug=debug)--    ######################--   PRIVATE   --######################--    def _push_scope(self):+        self.clex.input(text, filename)+        self._tokens = _TokenStream(self.clex)++        ast = self._parse_translation_unit_or_empty()+        tok = self._peek()+        if tok is not None:+            self._parse_error(f"before: {tok.value}", self._tok_coord(tok))+        return ast++    # ------------------------------------------------------------------+    # Scope and declaration helpers+    # ------------------------------------------------------------------+    def _coord(self, lineno: int, column: Optional[int] = None) -> Coord:+        return Coord(file=self.clex.filename, line=lineno, column=column)++    def _parse_error(self, msg: str, coord: Coord | str | None) -> NoReturn:+        raise ParseError(f"{coord}: {msg}")+
… 3795 more lines (truncated)
pyproject.toml +38 lines
--- +++ @@ -0,0 +1,38 @@+[build-system]+requires = ["setuptools>=69", "wheel"]+build-backend = "setuptools.build_meta"++[project]+name = "pycparser"+version = "3.00"+description = "C parser in Python"+readme = "README.rst"+license = "BSD-3-Clause"+license-files = ["LICENSE"]+requires-python = ">=3.10"+authors = [{name = "Eli Bendersky", email = "[email protected]"}]+maintainers = [{name = "Eli Bendersky", email = "[email protected]"}]+classifiers = [+  "Development Status :: 5 - Production/Stable",+  "Programming Language :: Python :: 3",+  "Programming Language :: Python :: 3.10",+  "Programming Language :: Python :: 3.11",+  "Programming Language :: Python :: 3.12",+  "Programming Language :: Python :: 3.13",+  "Programming Language :: Python :: 3.14",+]++[project.urls]+Homepage = "https://github.com/eliben/pycparser"++[tool.setuptools]+packages = ["pycparser"]++[tool.setuptools.package-data]+pycparser = ["*.cfg"]++[tool.ruff.lint]+ignore = ["F403", "F405"]++[tool.ty.src]+exclude = ["setup.py", "utils/internal/memprofiling.py"]
tests/test_c_ast.py +69 lines
--- +++ @@ -4,5 +4,5 @@ -sys.path.insert(0, '..')+sys.path.insert(0, "..") import pycparser.c_ast as c_ast-import pycparser.plyparser as plyparser+from pycparser.c_parser import Coord @@ -12,18 +12,21 @@         b1 = c_ast.BinaryOp(-            op='+',-            left=c_ast.Constant(type='int', value='6'),-            right=c_ast.ID(name='joe'))+            op="+",+            left=c_ast.Constant(type="int", value="6"),+            right=c_ast.ID(name="joe"),+        )          self.assertIsInstance(b1.left, c_ast.Constant)-        self.assertEqual(b1.left.type, 'int')-        self.assertEqual(b1.left.value, '6')+        self.assertEqual(b1.left.type, "int")+        self.assertEqual(b1.left.value, "6")          self.assertIsInstance(b1.right, c_ast.ID)-        self.assertEqual(b1.right.name, 'joe')+        self.assertEqual(b1.right.name, "joe")      def test_weakref_works_on_nodes(self):-        c1 = c_ast.Constant(type='float', value='3.14')+        c1 = c_ast.Constant(type="float", value="3.14")         wr = weakref.ref(c1)         cref = wr()-        self.assertEqual(cref.type, 'float')+        self.assertIsNotNone(cref)+        assert cref is not None+        self.assertEqual(cref.type, "float")         self.assertEqual(weakref.getweakrefcount(c1), 1)@@ -31,5 +34,7 @@     def test_weakref_works_on_coord(self):-        coord = plyparser.Coord(file='a', line=2)+        coord = Coord(file="a", line=2)         wr = weakref.ref(coord)         cref = wr()+        self.assertIsNotNone(cref)+        assert cref is not None         self.assertEqual(cref.line, 2)@@ -48,5 +53,6 @@         b1 = c_ast.BinaryOp(-            op='+',-            left=c_ast.Constant(type='int', value='6'),-            right=c_ast.ID(name='joe'))+            op="+",+            left=c_ast.Constant(type="int", value="6"),+            right=c_ast.ID(name="joe"),+        ) @@ -55,13 +61,9 @@ -        self.assertEqual(cv.values, ['6'])+        self.assertEqual(cv.values, ["6"])          b2 = c_ast.BinaryOp(-            op='*',-            left=c_ast.Constant(type='int', value='111'),-            right=b1)+            op="*", left=c_ast.Constant(type="int", value="111"), right=b1+        ) -        b3 = c_ast.BinaryOp(-            op='^',-            left=b2,-            right=b1)+        b3 = c_ast.BinaryOp(op="^", left=b2, right=b1) @@ -70,20 +72,13 @@ -        self.assertEqual(cv.values, ['111', '6', '6'])+        self.assertEqual(cv.values, ["111", "6", "6"])      def tests_list_children(self):-        c1 = c_ast.Constant(type='float', value='5.6')-        c2 = c_ast.Constant(type='char', value='t')+        c1 = c_ast.Constant(type="float", value="5.6")+        c2 = c_ast.Constant(type="char", value="t") -        b1 = c_ast.BinaryOp(-            op='+',-            left=c1,-            right=c2)+        b1 = c_ast.BinaryOp(op="+", left=c1, right=c2) -        b2 = c_ast.BinaryOp(-            op='-',-            left=b1,-            right=c2)+        b2 = c_ast.BinaryOp(op="-", left=b1, right=c2) -        comp = c_ast.Compound(-            block_items=[b1, b2, c1, c2])+        comp = c_ast.Compound(block_items=[b1, b2, c1, c2]) @@ -92,57 +87,50 @@ -        self.assertEqual(cv.values,-                         ['5.6', 't', '5.6', 't', 't', '5.6', 't'])+        self.assertEqual(cv.values, ["5.6", "t", "5.6", "t", "t", "5.6", "t"])      def test_repr(self):-        c1 = c_ast.Constant(type='float', value='5.6')-        c2 = c_ast.Constant(type='char', value='t')+        c1 = c_ast.Constant(type="float", value="5.6")+        c2 = c_ast.Constant(type="char", value="t") -        b1 = c_ast.BinaryOp(-            op='+',-            left=c1,-            right=c2)+        b1 = c_ast.BinaryOp(op="+", left=c1, right=c2) -        b2 = c_ast.BinaryOp(-            op='-',-            left=b1,-            right=c2)+        b2 = c_ast.BinaryOp(op="-", left=b1, right=c2) -        comp = c_ast.Compound(-            block_items=[b1, b2, c1, c2])+        comp = c_ast.Compound(block_items=[b1, b2, c1, c2]) -        expected = ("Compound(block_items=[BinaryOp(op='+',\n"-                    "                               left=Constant(type='float',\n"-                    "                                             value='5.6'\n"-                    "                                             ),\n"-                    "                               right=Constant(type='char',\n"-                    "                                              value='t'\n"-                    "                                              )\n"-                    "                               ),\n"-                    "                      BinaryOp(op='-',\n"-                    "                               left=BinaryOp(op='+',\n"-                    "                                             left=Constant(type='float',\n"-                    "                                                           value='5.6'\n"-                    "                                                           ),\n"-                    "                                             right=Constant(type='char',\n"-                    "                                                            value='t'\n"-                    "                                                            )\n"-                    "                                             ),\n"-                    "                               right=Constant(type='char',\n"-                    "                                              value='t'\n"-                    "                                              )\n"-                    "                               ),\n"-                    "                      Constant(type='float',\n"-                    "                               value='5.6'\n"-                    "                               ),\n"-                    "                      Constant(type='char',\n"-                    "                               value='t'\n"-                    "                               )\n"-                    "                     ]\n"-                    "         )")+        expected = (+            "Compound(block_items=[BinaryOp(op='+',\n"+            "                               left=Constant(type='float',\n"+            "                                             value='5.6'\n"+            "                                             ),\n"+            "                               right=Constant(type='char',\n"+            "                                              value='t'\n"+            "                                              )\n"+            "                               ),\n"+            "                      BinaryOp(op='-',\n"+            "                               left=BinaryOp(op='+',\n"+            "                                             left=Constant(type='float',\n"+            "                                                           value='5.6'\n"+            "                                                           ),\n"+            "                                             right=Constant(type='char',\n"+            "                                                            value='t'\n"+            "                                                            )\n"+            "                                             ),\n"+            "                               right=Constant(type='char',\n"+            "                                              value='t'\n"+            "                                              )\n"+            "                               ),\n"+            "                      Constant(type='float',\n"+            "                               value='5.6'\n"+            "                               ),\n"+            "                      Constant(type='char',\n"+            "                               value='t'\n"+            "                               )\n"+            "                     ]\n"+            "         )"+        ) -        self.assertEqual(repr(comp),-                         expected)+        self.assertEqual(repr(comp), expected)  -if __name__ == '__main__':+if __name__ == "__main__":     unittest.main()
tests/test_c_generator.py +195 lines
--- +++ @@ -5,3 +5,3 @@ # Run from the root dir-sys.path.insert(0, '.')+sys.path.insert(0, ".") @@ -10,7 +10,3 @@ -_c_parser = c_parser.CParser(-                lex_optimize=False,-                yacc_debug=True,-                yacc_optimize=False,-                yacctab='yacctab')+_c_parser = c_parser.CParser() @@ -26,3 +22,3 @@     # ast1 and ast2 are the same.-    if type(ast1) != type(ast2):+    if type(ast1) is not type(ast2):         return False@@ -67,6 +63,6 @@     def test_partial_funcdecl_generation(self):-        src = r'''+        src = r"""             void noop(void);             void *something(void *thing);-            int add(int x, int y);'''+            int add(int x, int y);"""         ast = parse_to_ast(src)@@ -75,5 +71,5 @@         self.assertEqual(len(v.stubs), 3)-        self.assertTrue(r'void noop(void)' in v.stubs)-        self.assertTrue(r'void *something(void *thing)' in v.stubs)-        self.assertTrue(r'int add(int x, int y)' in v.stubs)+        self.assertTrue(r"void noop(void)" in v.stubs)+        self.assertTrue(r"void *something(void *thing)" in v.stubs)+        self.assertTrue(r"int add(int x, int y)" in v.stubs) @@ -87,11 +83,13 @@     def _assert_ctoc_correct(self, src, *args, **kwargs):-        """ Checks that the c2c translation was correct by parsing the code-            generated by c2c for src and comparing the AST with the original-            AST.--            Additional arguments are passed to CGenerator.__init__.+        """Checks that the c2c translation was correct by parsing the code+        generated by c2c for src and comparing the AST with the original+        AST.++        Additional arguments are passed to CGenerator.__init__.         """         src2 = self._run_c_to_c(src, *args, **kwargs)-        self.assertTrue(compare_asts(parse_to_ast(src), parse_to_ast(src2)),-                        "{!r} != {!r}".format(src, src2))+        self.assertTrue(+            compare_asts(parse_to_ast(src), parse_to_ast(src2)),+            "{!r} != {!r}".format(src, src2),+        )         return src2@@ -99,26 +97,26 @@     def test_trivial_decls(self):-        self._assert_ctoc_correct('int a;')-        self._assert_ctoc_correct('int b, a;')-        self._assert_ctoc_correct('int c, b, a;')-        self._assert_ctoc_correct('auto int a;')-        self._assert_ctoc_correct('register int a;')-        self._assert_ctoc_correct('_Thread_local int a;')+        self._assert_ctoc_correct("int a;")+        self._assert_ctoc_correct("int b, a;")+        self._assert_ctoc_correct("int c, b, a;")+        self._assert_ctoc_correct("auto int a;")+        self._assert_ctoc_correct("register int a;")+        self._assert_ctoc_correct("_Thread_local int a;")      def test_complex_decls(self):-        self._assert_ctoc_correct('int** (*a)(void);')-        self._assert_ctoc_correct('int** (*a)(void*, int);')-        self._assert_ctoc_correct('int (*b)(char * restrict k, float);')-        self._assert_ctoc_correct('int (*b)(char * _Atomic k, float);')-        self._assert_ctoc_correct('int (*b)(char * _Atomic volatile k, float);')-        self._assert_ctoc_correct('int test(const char* const* arg);')-        self._assert_ctoc_correct('int test(const char** const arg);')+        self._assert_ctoc_correct("int** (*a)(void);")+        self._assert_ctoc_correct("int** (*a)(void*, int);")+        self._assert_ctoc_correct("int (*b)(char * restrict k, float);")+        self._assert_ctoc_correct("int (*b)(char * _Atomic k, float);")+        self._assert_ctoc_correct("int (*b)(char * _Atomic volatile k, float);")+        self._assert_ctoc_correct("int test(const char* const* arg);")+        self._assert_ctoc_correct("int test(const char** const arg);")      def test_alignment(self):-        self._assert_ctoc_correct('_Alignas(32) int b;')-        self._assert_ctoc_correct('int _Alignas(32) a;')-        self._assert_ctoc_correct('_Alignas(32) _Atomic(int) b;')-        self._assert_ctoc_correct('_Atomic(int) _Alignas(32) b;')-        self._assert_ctoc_correct('_Alignas(long long) int a;')-        self._assert_ctoc_correct('int _Alignas(long long) a;')-        self._assert_ctoc_correct(r'''+        self._assert_ctoc_correct("_Alignas(32) int b;")+        self._assert_ctoc_correct("int _Alignas(32) a;")+        self._assert_ctoc_correct("_Alignas(32) _Atomic(int) b;")+        self._assert_ctoc_correct("_Atomic(int) _Alignas(32) b;")+        self._assert_ctoc_correct("_Alignas(long long) int a;")+        self._assert_ctoc_correct("int _Alignas(long long) a;")+        self._assert_ctoc_correct(r"""             typedef struct node_t {@@ -127,4 +125,4 @@             } node;-            ''')-        self._assert_ctoc_correct(r'''+            """)+        self._assert_ctoc_correct(r"""             typedef struct node_t {@@ -133,6 +131,6 @@             } node;-            ''')+            """)      def test_ternary(self):-        self._assert_ctoc_correct('''+        self._assert_ctoc_correct("""             int main(void)@@ -141,6 +139,6 @@                 (a == 0) ? (b = 1) : (b = 2);-            }''')+            }""")      def test_casts(self):-        self._assert_ctoc_correct(r'''+        self._assert_ctoc_correct(r"""             int main() {@@ -148,4 +146,4 @@                 int c = (int*) f;-            }''')-        self._assert_ctoc_correct(r'''+            }""")+        self._assert_ctoc_correct(r"""             int main() {@@ -154,9 +152,9 @@             }-        ''')+        """)      def test_initlist(self):-        self._assert_ctoc_correct('int arr[] = {1, 2, 3};')+        self._assert_ctoc_correct("int arr[] = {1, 2, 3};")      def test_exprs(self):-        self._assert_ctoc_correct('''+        self._assert_ctoc_correct("""             int main(void)@@ -168,3 +166,3 @@                 int e = --a;-            }''')+            }""") @@ -172,3 +170,3 @@         # note two minuses here-        self._assert_ctoc_correct(r'''+        self._assert_ctoc_correct(r"""             int main() {@@ -179,6 +177,6 @@                 return a;-            }''')+            }""")      def test_struct_decl(self):-        self._assert_ctoc_correct(r'''+        self._assert_ctoc_correct(r"""             typedef struct node_t {@@ -187,6 +185,6 @@             } node;-            ''')+            """)      def test_krstyle(self):-        self._assert_ctoc_correct(r'''+        self._assert_ctoc_correct(r"""             int main(argc, argv)@@ -197,6 +195,6 @@             }-        ''')+        """)      def test_switchcase(self):-        self._assert_ctoc_correct(r'''+        self._assert_ctoc_correct(r"""         int main() {@@ -216,6 +214,6 @@         }-        ''')+        """)      def test_nest_initializer_list(self):-        self._assert_ctoc_correct(r'''+        self._assert_ctoc_correct(r"""         int main()@@ -223,6 +221,6 @@            int i[1][1] = { { 1 } };-        }''')+        }""")      def test_nest_named_initializer(self):-        self._assert_ctoc_correct(r'''struct test+        self._assert_ctoc_correct(r"""struct test             {@@ -236,6 +234,6 @@             struct test test_var = {.i = 0, .test_i = {.k = 1}, .j = 2};-        ''')+        """)      def test_expr_list_in_initializer_list(self):-        self._assert_ctoc_correct(r'''+        self._assert_ctoc_correct(r"""         int main()@@ -243,11 +241,11 @@            int i[1] = { (1, 2) };-        }''')+        }""")      def test_issue36(self):-        self._assert_ctoc_correct(r'''+        self._assert_ctoc_correct(r"""             int main() {-            }''')+            }""")      def test_issue37(self):-        self._assert_ctoc_correct(r'''+        self._assert_ctoc_correct(r"""             int main(void)@@ -257,3 +255,3 @@               return 0;-            }''')+            }""") @@ -262,13 +260,13 @@         # (previous valid behavior, still working)-        self._assert_ctoc_correct(r'''+        self._assert_ctoc_correct(r"""             struct foo;-            ''')+            """)         # An empty body must be generated         # (added behavior)-        self._assert_ctoc_correct(r'''+        self._assert_ctoc_correct(r"""             struct foo {};-            ''')
… 369 more lines (truncated)
tests/test_c_lexer.py +372 lines
--- +++ @@ -3,5 +3,13 @@ import unittest--sys.path.insert(0, '..')-from pycparser.c_lexer import CLexer+from typing import Optional++sys.path.insert(0, "..")+from pycparser.c_lexer import CLexer, _Token+++def require_token(tok: Optional[_Token]) -> _Token:+    # In tests we know token() should produce a token here; this helper asserts+    # that and narrows Optional[_Token] to _Token, avoiding repeated casts/guards.+    assert tok is not None+    return tok @@ -17,6 +25,7 @@ class TestCLexerNoErrors(unittest.TestCase):-    """ Test lexing of strings that are not supposed to cause-        errors. Therefore, the error_func passed to the lexer-        raises an exception.+    """Test lexing of strings that are not supposed to cause+    errors. Therefore, the error_func passed to the lexer+    raises an exception.     """+     def error_func(self, msg, line, column):@@ -31,3 +40,3 @@     def type_lookup_func(self, typ):-        if typ.startswith('mytype'):+        if typ.startswith("mytype"):             return True@@ -37,5 +46,5 @@     def setUp(self):-        self.clex = CLexer(self.error_func, lambda: None, lambda: None,-                           self.type_lookup_func)-        self.clex.build(optimize=False)+        self.clex = CLexer(+            self.error_func, lambda: None, lambda: None, self.type_lookup_func+        ) @@ -46,91 +55,91 @@     def test_trivial_tokens(self):-        self.assertTokensTypes('1', ['INT_CONST_DEC'])-        self.assertTokensTypes('-', ['MINUS'])-        self.assertTokensTypes('volatile', ['VOLATILE'])-        self.assertTokensTypes('...', ['ELLIPSIS'])-        self.assertTokensTypes('++', ['PLUSPLUS'])-        self.assertTokensTypes('case int', ['CASE', 'INT'])-        self.assertTokensTypes('caseint', ['ID'])-        self.assertTokensTypes('$dollar cent$', ['ID', 'ID'])-        self.assertTokensTypes('i ^= 1;', ['ID', 'XOREQUAL', 'INT_CONST_DEC', 'SEMI'])+        self.assertTokensTypes("1", ["INT_CONST_DEC"])+        self.assertTokensTypes("-", ["MINUS"])+        self.assertTokensTypes("volatile", ["VOLATILE"])+        self.assertTokensTypes("...", ["ELLIPSIS"])+        self.assertTokensTypes("++", ["PLUSPLUS"])+        self.assertTokensTypes("case int", ["CASE", "INT"])+        self.assertTokensTypes("caseint", ["ID"])+        self.assertTokensTypes("$dollar cent$", ["ID", "ID"])+        self.assertTokensTypes("i ^= 1;", ["ID", "XOREQUAL", "INT_CONST_DEC", "SEMI"])      def test_id_typeid(self):-        self.assertTokensTypes('myt', ['ID'])-        self.assertTokensTypes('mytype', ['TYPEID'])-        self.assertTokensTypes('mytype6 var', ['TYPEID', 'ID'])+        self.assertTokensTypes("myt", ["ID"])+        self.assertTokensTypes("mytype", ["TYPEID"])+        self.assertTokensTypes("mytype6 var", ["TYPEID", "ID"])      def test_integer_constants(self):-        self.assertTokensTypes('12', ['INT_CONST_DEC'])-        self.assertTokensTypes('12u', ['INT_CONST_DEC'])-        self.assertTokensTypes('12l', ['INT_CONST_DEC'])-        self.assertTokensTypes('199872Ul', ['INT_CONST_DEC'])-        self.assertTokensTypes('199872lU', ['INT_CONST_DEC'])-        self.assertTokensTypes('199872LL', ['INT_CONST_DEC'])-        self.assertTokensTypes('199872ull', ['INT_CONST_DEC'])-        self.assertTokensTypes('199872llu', ['INT_CONST_DEC'])-        self.assertTokensTypes('1009843200000uLL', ['INT_CONST_DEC'])-        self.assertTokensTypes('1009843200000LLu', ['INT_CONST_DEC'])--        self.assertTokensTypes('077', ['INT_CONST_OCT'])-        self.assertTokensTypes('0123456L', ['INT_CONST_OCT'])--        self.assertTokensTypes('0xf7', ['INT_CONST_HEX'])-        self.assertTokensTypes('0b110', ['INT_CONST_BIN'])-        self.assertTokensTypes('0x01202AAbbf7Ul', ['INT_CONST_HEX'])-        self.assertTokensTypes("'12'", ['INT_CONST_CHAR'])-        self.assertTokensTypes("'123'", ['INT_CONST_CHAR'])-        self.assertTokensTypes("'1AB4'", ['INT_CONST_CHAR'])-        self.assertTokensTypes(r"'1A\n4'", ['INT_CONST_CHAR'])+        self.assertTokensTypes("12", ["INT_CONST_DEC"])+        self.assertTokensTypes("12u", ["INT_CONST_DEC"])+        self.assertTokensTypes("12l", ["INT_CONST_DEC"])+        self.assertTokensTypes("199872Ul", ["INT_CONST_DEC"])+        self.assertTokensTypes("199872lU", ["INT_CONST_DEC"])+        self.assertTokensTypes("199872LL", ["INT_CONST_DEC"])+        self.assertTokensTypes("199872ull", ["INT_CONST_DEC"])+        self.assertTokensTypes("199872llu", ["INT_CONST_DEC"])+        self.assertTokensTypes("1009843200000uLL", ["INT_CONST_DEC"])+        self.assertTokensTypes("1009843200000LLu", ["INT_CONST_DEC"])++        self.assertTokensTypes("077", ["INT_CONST_OCT"])+        self.assertTokensTypes("0123456L", ["INT_CONST_OCT"])++        self.assertTokensTypes("0xf7", ["INT_CONST_HEX"])+        self.assertTokensTypes("0b110", ["INT_CONST_BIN"])+        self.assertTokensTypes("0x01202AAbbf7Ul", ["INT_CONST_HEX"])+        self.assertTokensTypes("'12'", ["INT_CONST_CHAR"])+        self.assertTokensTypes("'123'", ["INT_CONST_CHAR"])+        self.assertTokensTypes("'1AB4'", ["INT_CONST_CHAR"])+        self.assertTokensTypes(r"'1A\n4'", ["INT_CONST_CHAR"])          # no 0 before x, so ID catches it-        self.assertTokensTypes('xf7', ['ID'])+        self.assertTokensTypes("xf7", ["ID"])          # - is MINUS, the rest a constnant-        self.assertTokensTypes('-1', ['MINUS', 'INT_CONST_DEC'])+        self.assertTokensTypes("-1", ["MINUS", "INT_CONST_DEC"])      def test_special_names(self):-        self.assertTokensTypes('sizeof offsetof', ['SIZEOF', 'OFFSETOF'])+        self.assertTokensTypes("sizeof offsetof", ["SIZEOF", "OFFSETOF"])      def test_new_keywords(self):-        self.assertTokensTypes('_Bool', ['_BOOL'])-        self.assertTokensTypes('_Atomic', ['_ATOMIC'])-        self.assertTokensTypes('_Alignas _Alignof', ['_ALIGNAS', '_ALIGNOF'])+        self.assertTokensTypes("_Bool", ["_BOOL"])+        self.assertTokensTypes("_Atomic", ["_ATOMIC"])+        self.assertTokensTypes("_Alignas _Alignof", ["_ALIGNAS", "_ALIGNOF"])      def test_floating_constants(self):-        self.assertTokensTypes('1.5f', ['FLOAT_CONST'])-        self.assertTokensTypes('01.5', ['FLOAT_CONST'])-        self.assertTokensTypes('.15L', ['FLOAT_CONST'])-        self.assertTokensTypes('0.', ['FLOAT_CONST'])+        self.assertTokensTypes("1.5f", ["FLOAT_CONST"])+        self.assertTokensTypes("01.5", ["FLOAT_CONST"])+        self.assertTokensTypes(".15L", ["FLOAT_CONST"])+        self.assertTokensTypes("0.", ["FLOAT_CONST"])          # but just a period is a period-        self.assertTokensTypes('.', ['PERIOD'])--        self.assertTokensTypes('3.3e-3', ['FLOAT_CONST'])-        self.assertTokensTypes('.7e25L', ['FLOAT_CONST'])-        self.assertTokensTypes('6.e+125f', ['FLOAT_CONST'])-        self.assertTokensTypes('666e666', ['FLOAT_CONST'])-        self.assertTokensTypes('00666e+3', ['FLOAT_CONST'])+        self.assertTokensTypes(".", ["PERIOD"])++        self.assertTokensTypes("3.3e-3", ["FLOAT_CONST"])+        self.assertTokensTypes(".7e25L", ["FLOAT_CONST"])+        self.assertTokensTypes("6.e+125f", ["FLOAT_CONST"])+        self.assertTokensTypes("666e666", ["FLOAT_CONST"])+        self.assertTokensTypes("00666e+3", ["FLOAT_CONST"])          # but this is a hex integer + 3-        self.assertTokensTypes('0x0666e+3', ['INT_CONST_HEX', 'PLUS', 'INT_CONST_DEC'])+        self.assertTokensTypes("0x0666e+3", ["INT_CONST_HEX", "PLUS", "INT_CONST_DEC"])      def test_hexadecimal_floating_constants(self):-        self.assertTokensTypes('0xDE.488641p0', ['HEX_FLOAT_CONST'])-        self.assertTokensTypes('0x.488641p0', ['HEX_FLOAT_CONST'])-        self.assertTokensTypes('0X12.P0', ['HEX_FLOAT_CONST'])+        self.assertTokensTypes("0xDE.488641p0", ["HEX_FLOAT_CONST"])+        self.assertTokensTypes("0x.488641p0", ["HEX_FLOAT_CONST"])+        self.assertTokensTypes("0X12.P0", ["HEX_FLOAT_CONST"])      def test_char_constants(self):-        self.assertTokensTypes(r"""'x'""", ['CHAR_CONST'])-        self.assertTokensTypes(r"""L'x'""", ['WCHAR_CONST'])-        self.assertTokensTypes(r"""u8'x'""", ['U8CHAR_CONST'])-        self.assertTokensTypes(r"""u'x'""", ['U16CHAR_CONST'])-        self.assertTokensTypes(r"""U'x'""", ['U32CHAR_CONST'])-        self.assertTokensTypes(r"""'\t'""", ['CHAR_CONST'])-        self.assertTokensTypes(r"""'\''""", ['CHAR_CONST'])-        self.assertTokensTypes(r"""'\?'""", ['CHAR_CONST'])-        self.assertTokensTypes(r"""'\0'""", ['CHAR_CONST'])-        self.assertTokensTypes(r"""'\012'""", ['CHAR_CONST'])-        self.assertTokensTypes(r"""'\x2f'""", ['CHAR_CONST'])-        self.assertTokensTypes(r"""'\x2f12'""", ['CHAR_CONST'])-        self.assertTokensTypes(r"""L'\xaf'""", ['WCHAR_CONST'])+        self.assertTokensTypes(r"""'x'""", ["CHAR_CONST"])+        self.assertTokensTypes(r"""L'x'""", ["WCHAR_CONST"])+        self.assertTokensTypes(r"""u8'x'""", ["U8CHAR_CONST"])+        self.assertTokensTypes(r"""u'x'""", ["U16CHAR_CONST"])+        self.assertTokensTypes(r"""U'x'""", ["U32CHAR_CONST"])+        self.assertTokensTypes(r"""'\t'""", ["CHAR_CONST"])+        self.assertTokensTypes(r"""'\''""", ["CHAR_CONST"])+        self.assertTokensTypes(r"""'\?'""", ["CHAR_CONST"])+        self.assertTokensTypes(r"""'\0'""", ["CHAR_CONST"])+        self.assertTokensTypes(r"""'\012'""", ["CHAR_CONST"])+        self.assertTokensTypes(r"""'\x2f'""", ["CHAR_CONST"])+        self.assertTokensTypes(r"""'\x2f12'""", ["CHAR_CONST"])+        self.assertTokensTypes(r"""L'\xaf'""", ["WCHAR_CONST"]) @@ -138,49 +147,42 @@         braces = []+         def on_lbrace():-            braces.append('{')+            braces.append("{")+         def on_rbrace():-            braces.append('}')-        clex = CLexer(self.error_func, on_lbrace, on_rbrace,-                      self.type_lookup_func)-        clex.build(optimize=False)-        clex.input('hello { there } } and again }}{')+            braces.append("}")++        clex = CLexer(self.error_func, on_lbrace, on_rbrace, self.type_lookup_func)+        clex.input("hello { there } } and again }}{")         token_list(clex)-        self.assertEqual(braces, ['{', '}', '}', '}', '}', '{'])+        self.assertEqual(braces, ["{", "}", "}", "}", "}", "{"])      def test_string_literal(self):-        self.assertTokensTypes('"a string"', ['STRING_LITERAL'])-        self.assertTokensTypes('L"ing"', ['WSTRING_LITERAL'])-        self.assertTokensTypes('u8"ing"', ['U8STRING_LITERAL'])-        self.assertTokensTypes('u"ing"', ['U16STRING_LITERAL'])-        self.assertTokensTypes('U"ing"', ['U32STRING_LITERAL'])-        self.assertTokensTypes(-            '"i am a string too \t"',-            ['STRING_LITERAL'])-        self.assertTokensTypes(-            r'''"esc\ape \"\'\? \0234 chars \rule"''',-            ['STRING_LITERAL'])-        self.assertTokensTypes(-            r'''"hello 'joe' wanna give it a \"go\"?"''',-            ['STRING_LITERAL'])+        self.assertTokensTypes('"a string"', ["STRING_LITERAL"])+        self.assertTokensTypes('L"ing"', ["WSTRING_LITERAL"])+        self.assertTokensTypes('u8"ing"', ["U8STRING_LITERAL"])+        self.assertTokensTypes('u"ing"', ["U16STRING_LITERAL"])+        self.assertTokensTypes('U"ing"', ["U32STRING_LITERAL"])+        self.assertTokensTypes('"i am a string too \t"', ["STRING_LITERAL"])+        self.assertTokensTypes(+            r'''"esc\ape \"\'\? \0234 chars \rule"''', ["STRING_LITERAL"]+        )+        self.assertTokensTypes(+            r'''"hello 'joe' wanna give it a \"go\"?"''', ["STRING_LITERAL"]
… 544 more lines (truncated)
pygments pypi
2.20.0 3mo ago nominal
no findings
latest 2.20.0 versions 68 maintainers 1
2.15.0
2.15.1
2.16.0
2.16.1
2.17.0
2.17.1
2.17.2
2.18.0
2.19.0
2.19.1
2.19.2
2.20.0
CLEAN
no findings — nominal
release diff 2.19.2 → 2.20.0
+29 added · -1 removed · ~420 modified
+358 more files not shown
doc/_static/demo-worker.js +7 lines
--- +++ @@ -9,3 +9,3 @@         {s: HtmlFormatter(style=s).get_style_defs('.demo-highlight') for s in STYLE_MAP}-    `).toJs();+    `).toJs({dict_converter: Object.fromEntries});     self.postMessage({loaded: {styles}})@@ -24,5 +24,8 @@ -            lexer = pygments.lexers.get_lexer_by_name(lexer_name)+            if hasattr(code, 'to_py'):+                code = code.to_py()             if type(code) == memoryview:                 code = bytes(code)++            lexer = pygments.lexers.get_lexer_by_name(lexer_name)             tokens = lexer.get_tokens(code)@@ -53,6 +56,2 @@         const lexer = self.pyodide.runPython(`-            import sys-            sys.setrecursionlimit(1000)-            # TODO: remove after upgrading to Pyodide 0.19-             import pygments.lexers@@ -60,2 +59,4 @@ +            if hasattr(code, 'to_py'):+                code = code.to_py()             if type(code) == memoryview:
doc/_static/demo.js +2 lines
--- +++ @@ -34,3 +34,3 @@         return;-    style.textContent = styles.get(styleSelect.value);+    style.textContent = styles[styleSelect.value];     updateCopyLink();@@ -94,3 +94,3 @@         loadingDiv.hidden = true;-        style.textContent = styles.get(styleSelect.value);+        style.textContent = styles[styleSelect.value];     } else if (msg.data.tokens) {
doc/conf.py +2 lines
--- +++ @@ -235,3 +235,4 @@ def pg_context(app, pagename, templatename, ctx, event_arg):-    ctx['demo_active'] = bool(os.environ.get('WEBSITE_BUILD'))+    # casting string to bool doesn't work, we'll use 0 to disable+    ctx['demo_active'] = os.environ.get('WEBSITE_BUILD')  != '0' 
doc/examples/example.py +3 lines
--- +++ @@ -1,2 +1,3 @@-from typing import Iterator+from collections.abc import Iterator+ @@ -12,2 +13,3 @@ + result = sum(Math.fib(42))
external/markdown-processor.py +1 lines
--- +++ @@ -23,3 +23,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
external/moin-parser.py +1 lines
--- +++ @@ -32,3 +32,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
pygments/__init__.py +2 lines
--- +++ @@ -23,3 +23,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.@@ -28,3 +28,3 @@ -__version__ = '2.19.2'+__version__ = '2.20.0' __docformat__ = 'restructuredtext'
pygments/__main__.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
pygments/cmdline.py +2 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.@@ -187,3 +187,3 @@     if argns.V:-        print(f'Pygments version {__version__}, (c) 2006-2024 by Georg Brandl, Matthäus '+        print(f'Pygments version {__version__}, (c) 2006-present by Georg Brandl, Matthäus '               'Chajdas and contributors.')
pygments/console.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
pygments/filter.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
pygments/filters/__init__.py +10 lines
--- +++ @@ -7,3 +7,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.@@ -97,4 +97,6 @@ class SymbolFilter(Filter):-    """Convert mathematical symbols such as \\<longrightarrow> in Isabelle-    or \\longrightarrow in LaTeX into Unicode characters.+    """Convert mathematical symbols into Unicode characters.++    Examples are ``\\<longrightarrow>`` in Isabelle or+    ``\\longrightarrow`` in LaTeX. @@ -687,4 +689,5 @@ class KeywordCaseFilter(Filter):-    """Convert keywords to lowercase or uppercase or capitalize them, which-    means first letter uppercase, rest lowercase.+    """Convert keywords to lowercase or uppercase or capitalize them.++    This means first letter uppercase, rest lowercase. @@ -868,3 +871,3 @@ class GobbleFilter(Filter):-    """Gobbles source code lines (eats initial characters).+    """Gobble source code lines (eats initial characters). @@ -907,4 +910,3 @@ class TokenMergeFilter(Filter):-    """Merges consecutive tokens with the same token type in the output-    stream of a lexer.+    """Merge consecutive tokens with the same token type in the output stream. 
pygments/formatter.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
pygments/formatters/__init__.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
pygments/formatters/bbcode.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
pygments/formatters/groff.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
pygments/formatters/html.py +11 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.@@ -19,2 +19,4 @@ from pygments.util import get_bool_opt, get_int_opt, get_list_opt++import html @@ -72,3 +74,3 @@ generated by Pygments <https://pygments.org/>-Copyright 2006-2025 by the Pygments team.+Copyright 2006-present by the Pygments team. Licensed under the BSD license, see LICENSE for details.@@ -83,3 +85,3 @@ generated by Pygments <https://pygments.org/>-Copyright 2006-2025 by the Pygments team.+Copyright 2006-present by the Pygments team. Licensed under the BSD license, see LICENSE for details.@@ -424,4 +426,4 @@         self.classprefix = options.get('classprefix', '')-        self.cssclass = self._decodeifneeded(options.get('cssclass', 'highlight'))-        self.cssstyles = self._decodeifneeded(options.get('cssstyles', ''))+        self.cssclass = html.escape(self._decodeifneeded(options.get('cssclass', 'highlight')))+        self.cssstyles = html.escape(self._decodeifneeded(options.get('cssstyles', '')))         self.prestyles = self._decodeifneeded(options.get('prestyles', ''))@@ -431,3 +433,3 @@         self.tagurlformat = self._decodeifneeded(options.get('tagurlformat', ''))-        self.filename = self._decodeifneeded(options.get('filename', ''))+        self.filename = html.escape(self._decodeifneeded(options.get('filename', '')))         self.wrapcode = get_bool_opt(options, 'wrapcode', False)@@ -454,5 +456,5 @@         self.nobackground = get_bool_opt(options, 'nobackground', False)-        self.lineseparator = options.get('lineseparator', '\n')-        self.lineanchors = options.get('lineanchors', '')-        self.linespans = options.get('linespans', '')+        self.lineseparator = html.escape(options.get('lineseparator', '\n'))+        self.lineanchors = html.escape(options.get('lineanchors', ''))+        self.linespans = html.escape(options.get('linespans', ''))         self.anchorlinenos = get_bool_opt(options, 'anchorlinenos', False)
pygments/formatters/img.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
pygments/formatters/irc.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.@@ -93,3 +93,2 @@     return add + text + sub-    return '<'+add+'>'+text+'</'+sub+'>' 
pygments/formatters/latex.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
pygments/formatters/other.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
pygments/formatters/pangomarkup.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
pygments/formatters/rtf.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
pygments/formatters/svg.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
pygments/formatters/terminal.py +1 lines
--- +++ @@ -6,3 +6,3 @@ -    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.+    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.     :license: BSD, see LICENSE for details.
python-dateutil pypi
2.9.0.post0 2y ago nominal
INSTALL-EXEC
latest 2.9.0.post0 versions 34 maintainers 1
2.6.0
2.6.1
2.7.0
2.7.1
2.7.2
2.7.3
2.7.4
2.7.5
2.8.0
2.8.1
2.8.2
2.9.0
INSTALL-EXEC
setup.py in sdist uses install-hook (runs at pip install)
warn · snapshot-derived
release diff 2.8.2 → 2.9.0
+43 added · -41 removed · ~20 modified
new files touching dangerous APIs: src/dateutil/zoneinfo/rebuild.py, tests/_common.py, tests/test_tz.py
+15 more files not shown
src/dateutil/zoneinfo/rebuild.py +75 lines · 1 flagged
--- +++ @@ -0,0 +1,75 @@+import logging+import os+import tempfile+import shutil+import json+from subprocess import check_call, check_output+from tarfile import TarFile++from dateutil.zoneinfo import METADATA_FN, ZONEFILENAME+++def rebuild(filename, tag=None, format="gz", zonegroups=[], metadata=None):+    """Rebuild the internal timezone info in dateutil/zoneinfo/zoneinfo*tar*++    filename is the timezone tarball from ``ftp.iana.org/tz``.++    """+    tmpdir = tempfile.mkdtemp()+    zonedir = os.path.join(tmpdir, "zoneinfo")+    moduledir = os.path.dirname(__file__)+    try:+        with TarFile.open(filename) as tf:+            for name in zonegroups:+                tf.extract(name, tmpdir)+            filepaths = [os.path.join(tmpdir, n) for n in zonegroups]++            _run_zic(zonedir, filepaths)++        # write metadata file+        with open(os.path.join(zonedir, METADATA_FN), 'w') as f:+            json.dump(metadata, f, indent=4, sort_keys=True)+        target = os.path.join(moduledir, ZONEFILENAME)+        with TarFile.open(target, "w:%s" % format) as tf:+            for entry in os.listdir(zonedir):+                entrypath = os.path.join(zonedir, entry)+                tf.add(entrypath, entry)+    finally:+        shutil.rmtree(tmpdir)+++def _run_zic(zonedir, filepaths):+    """Calls the ``zic`` compiler in a compatible way to get a "fat" binary.++    Recent versions of ``zic`` default to ``-b slim``, while older versions+    don't even have the ``-b`` option (but default to "fat" binaries). The+    current version of dateutil does not support Version 2+ TZif files, which+    causes problems when used in conjunction with "slim" binaries, so this+    function is used to ensure that we always get a "fat" binary.+    """++    try:+        help_text = check_output(["zic", "--help"])+    except OSError as e:+        _print_on_nosuchfile(e)+        raise++    if b"-b " in help_text:+        bloat_args = ["-b", "fat"]+    else:+        bloat_args = []++    check_call(["zic"] + bloat_args + ["-d", zonedir] + filepaths)+++def _print_on_nosuchfile(e):+    """Print helpful troubleshooting message++    e is an exception raised by subprocess.check_call()++    """+    if e.errno == 2:+        logging.error(+            "Could not find zic. Perhaps you need to install "+            "libc-bin or some other package that provides it, "+            "or it's not in your PATH?")
tests/_common.py +233 lines · 2 flagged
--- +++ @@ -0,0 +1,233 @@+from __future__ import unicode_literals+import os+import time+import subprocess+import warnings+import tempfile+import pickle++import pytest+++class PicklableMixin(object):+    def _get_nobj_bytes(self, obj, dump_kwargs, load_kwargs):+        """+        Pickle and unpickle an object using ``pickle.dumps`` / ``pickle.loads``+        """+        pkl = pickle.dumps(obj, **dump_kwargs)+        return pickle.loads(pkl, **load_kwargs)++    def _get_nobj_file(self, obj, dump_kwargs, load_kwargs):+        """+        Pickle and unpickle an object using ``pickle.dump`` / ``pickle.load`` on+        a temporary file.+        """+        with tempfile.TemporaryFile('w+b') as pkl:+            pickle.dump(obj, pkl, **dump_kwargs)+            pkl.seek(0)         # Reset the file to the beginning to read it+            nobj = pickle.load(pkl, **load_kwargs)++        return nobj++    def assertPicklable(self, obj, singleton=False, asfile=False,+                        dump_kwargs=None, load_kwargs=None):+        """+        Assert that an object can be pickled and unpickled. This assertion+        assumes that the desired behavior is that the unpickled object compares+        equal to the original object, but is not the same object.+        """+        get_nobj = self._get_nobj_file if asfile else self._get_nobj_bytes+        dump_kwargs = dump_kwargs or {}+        load_kwargs = load_kwargs or {}++        nobj = get_nobj(obj, dump_kwargs, load_kwargs)+        if not singleton:+            self.assertIsNot(obj, nobj)+        self.assertEqual(obj, nobj)+++class TZContextBase(object):+    """+    Base class for a context manager which allows changing of time zones.++    Subclasses may define a guard variable to either block or or allow time+    zone changes by redefining ``_guard_var_name`` and ``_guard_allows_change``.+    The default is that the guard variable must be affirmatively set.++    Subclasses must define ``get_current_tz`` and ``set_current_tz``.+    """+    _guard_var_name = "DATEUTIL_MAY_CHANGE_TZ"+    _guard_allows_change = True++    def __init__(self, tzval):+        self.tzval = tzval+        self._old_tz = None++    @classmethod+    def tz_change_allowed(cls):+        """+        Class method used to query whether or not this class allows time zone+        changes.+        """+        guard = bool(os.environ.get(cls._guard_var_name, False))++        # _guard_allows_change gives the "default" behavior - if True, the+        # guard is overcoming a block. If false, the guard is causing a block.+        # Whether tz_change is allowed is therefore the XNOR of the two.+        return guard == cls._guard_allows_change++    @classmethod+    def tz_change_disallowed_message(cls):+        """ Generate instructions on how to allow tz changes """+        msg = ('Changing time zone not allowed. Set {envar} to {gval} '+               'if you would like to allow this behavior')++        return msg.format(envar=cls._guard_var_name,+                          gval=cls._guard_allows_change)++    def __enter__(self):+        if not self.tz_change_allowed():+            msg = self.tz_change_disallowed_message()+            pytest.skip(msg)++            # If this is used outside of a test suite, we still want an error.+            raise ValueError(msg)  # pragma: no cover++        self._old_tz = self.get_current_tz()+        self.set_current_tz(self.tzval)++    def __exit__(self, type, value, traceback):+        if self._old_tz is not None:+            self.set_current_tz(self._old_tz)++        self._old_tz = None++    def get_current_tz(self):+        raise NotImplementedError++    def set_current_tz(self):+        raise NotImplementedError+++class TZEnvContext(TZContextBase):+    """+    Context manager that temporarily sets the `TZ` variable (for use on+    *nix-like systems). Because the effect is local to the shell anyway, this+    will apply *unless* a guard is set.++    If you do not want the TZ environment variable set, you may set the+    ``DATEUTIL_MAY_NOT_CHANGE_TZ_VAR`` variable to a truthy value.+    """+    _guard_var_name = "DATEUTIL_MAY_NOT_CHANGE_TZ_VAR"+    _guard_allows_change = False++    def get_current_tz(self):+        return os.environ.get('TZ', UnsetTz)++    def set_current_tz(self, tzval):+        if tzval is UnsetTz and 'TZ' in os.environ:+            del os.environ['TZ']+        else:+            os.environ['TZ'] = tzval++        time.tzset()+++class TZWinContext(TZContextBase):+    """+    Context manager for changing local time zone on Windows.++    Because the effect of this is system-wide and global, it may have+    unintended side effect. Set the ``DATEUTIL_MAY_CHANGE_TZ`` environment+    variable to a truthy value before using this context manager.+    """+    def get_current_tz(self):+        p = subprocess.Popen(['tzutil', '/g'], stdout=subprocess.PIPE)++        ctzname, err = p.communicate()+        ctzname = ctzname.decode()     # Popen returns++        if p.returncode:+            raise OSError('Failed to get current time zone: ' + err)++        return ctzname++    def set_current_tz(self, tzname):+        p = subprocess.Popen('tzutil /s "' + tzname + '"')++        out, err = p.communicate()++        if p.returncode:+            raise OSError('Failed to set current time zone: ' ++                          (err or 'Unknown error.'))+++###+# Utility classes+class NotAValueClass(object):+    """+    A class analogous to NaN that has operations defined for any type.+    """+    def _op(self, other):+        return self             # Operation with NotAValue returns NotAValue++    def _cmp(self, other):+        return False++    __add__ = __radd__ = _op+    __sub__ = __rsub__ = _op+    __mul__ = __rmul__ = _op+    __div__ = __rdiv__ = _op+    __truediv__ = __rtruediv__ = _op+    __floordiv__ = __rfloordiv__ = _op++    __lt__ = __rlt__ = _op+    __gt__ = __rgt__ = _op+    __eq__ = __req__ = _op+    __le__ = __rle__ = _op+    __ge__ = __rge__ = _op+++NotAValue = NotAValueClass()+++class ComparesEqualClass(object):+    """+    A class that is always equal to whatever you compare it to.+    """++    def __eq__(self, other):+        return True++    def __ne__(self, other):+        return False++    def __le__(self, other):+        return True++    def __ge__(self, other):+        return True++    def __lt__(self, other):+        return False++    def __gt__(self, other):+        return False++    __req__ = __eq__+    __rne__ = __ne__+    __rle__ = __le__+    __rge__ = __ge__+    __rlt__ = __lt__+    __rgt__ = __gt__+++ComparesEqual = ComparesEqualClass()+++class UnsetTzClass(object):+    """ Sentinel class for unset time zone variable """+    pass+++UnsetTz = UnsetTzClass()
tests/test_tz.py +2811 lines · 14 flagged
--- +++ @@ -0,0 +1,2811 @@+# -*- coding: utf-8 -*-+from __future__ import unicode_literals+from ._common import PicklableMixin+from ._common import TZEnvContext, TZWinContext+from ._common import ComparesEqual++from datetime import datetime, timedelta+from datetime import time as dt_time+from datetime import tzinfo+from six import PY2+from io import BytesIO, StringIO+import unittest++import sys+import base64+import copy+import gc+import weakref++from functools import partial++IS_WIN = sys.platform.startswith('win')++import pytest++# dateutil imports+from dateutil.relativedelta import relativedelta, SU, TH+from dateutil.parser import parse+from dateutil import tz as tz+from dateutil import zoneinfo++try:+    from dateutil import tzwin+except ImportError as e:+    if IS_WIN:+        raise e+    else:+        pass++MISSING_TARBALL = ("This test fails if you don't have the dateutil "+                   "timezone file installed. Please read the README")++TZFILE_EST5EDT = b"""+VFppZgAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAADrAAAABAAAABCeph5wn7rrYKCGAHCh+ms1gomXicKOD6eCkaq5wpTWnYKZTyvCnFYlgqDOs8Kj+peCqE47wqt6H4KvzcPCsvmngrdNS8K6e+S+CvszTwsH4t4LGcUXCyZ0pgs3wzcLRHLGC1XBVwticOYLc793C4BvBguRvZcLnm0mC7BPXwu8a0+YLzk1/C9r9DgvsS58L+PsuDApJvwwW+U4MKEffDDT3bgxGRf8MUvWODGTXxwxw864MgtXnDI+Fdg+yg1AcMrYOWDLiPBw0iP0cNJg++DTdeTw1EDd4NVVxvDWIL/g1zWo8NgAoeDZFYrw2eCD4Nr+p3Db+wGXg3N6JcN2pgmDevmtw34lkYOCeTXDhaUZg4n4vcONJKGDkXhFw5Vcu4OZHLfDnNxDg6CcP8OkW+8uDqBvHw6vbU4Ovm0/Ds1rbg7ca18O6/02Dvr9Jw8J+1YPGPtHDyf5dg82+WcPRfeWD1T3hw9j9b+YPcvWnD4KHfg+Q88cPoIWeD6+Fjw++g74PzYOvD9yB3g/rgc8P+n/+AAl/7wAYfh4AJ34PADcP5g+BGD9cAVQ4GAGQN9wBzDCYAeNGXAJEKRgCa2U8ArwhmAL4IVwDNmi4A3AZ3AOuYTgD6mD8BCZZuAR+iWXwEnlI4BNpR/AUWSrgFUkp8BY5DOAXKQvwGCIpYBkI7fAaAgtgGvIKcBvh7WAc0exwHcHPYB6x+znAfobFgIHYA8CGBk2AiVeLwI2qv4CQ1xPAlSpHgJhWm8Ccqc+An/sNwKQpV4CnepXAq6jfgK76H+cCzTVGAtnmlwLrM2YC9+S3AwkxhgMWdn8DJy+mAzR0nwNFLcYDUnK/A2Mr5gNwcN8Dgb2uA45u/w+Ofu84DrG0fA7257gPK/ucD27gOA+j9BwP5ti4EBvsnBBhH9gQk+UcENkYWBEL3ZwRURDYEYPWHBH+JCVgR/h08EkEB2BJ2FbwSuPpYEu4OPBMzQXgTZga8E6s5+BPd/zwUIzJ4FFhGXBSbKvgU0D7cFRM+jeBVIN1wVixv4FcAv3BYFYxgWOChcFn1bmBawINwW9VQYFypn/BdtTJgXomB8F+VFGBgaWPwYX4w+4GJJRfBjXhLgZCkn8GU99OBmEkRwZx3W4GfyJnBo/bjgadIIcGrdmuBrsepwbMa3YG2RzHBupplg+b3GucHCGe2BxWsrwcmZdYHM6rPB0Rj9gdRqO8HYvW+B2+nDweA894HjaUvB57x/gero08HvPAeB8+o1Fwfa7j4H6DM3B/jsXgAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAB+AAEAAQABAgMBAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAB+AAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA+AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAB+AAEAAQABAAEAAQABAAEAAQABAAEAAf//x8ABAP//ubAABP//x8ABCP//x8ABDEVEVABFU1QARVdU+AEVQVAAAAAABAAAAAQ==+"""++EUROPE_HELSINKI = b"""+VFppZgAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABQAAAAAAAAB1AAAABQAAAA2kc28Yy85RYMy/hdAV+I+uQFhPckBcDzZAX876QGOOvkBnToJAaw5GQG7y9EBysrhAdnJ8QHoyQEB98gRAgbHIQIVxjECJM+VBAjPEUQJCw2ECUcJxAmDBgQJwVDkCf1NJAo5SWQKdUWkCrFB5ArtPiQLKTpkC2U2pAuhMuQL3S8+kDBkrZAxXdkQMnK0EDM9uxA0UpYQNR2dEDYyeBA2/X8QOBuUkDjdYRA5+3aQOr1DEDvbWJA8pl+Q+Pbs6kD6GQZA/mxyQQGYjkEGEORBCRgWQQ2QbEEQl55BFQ/0QRgXJkEcj3xBH7uYQSQPBEEnOyBBK+46MQS66qEEzMv5BNjowQTqyhkE9ubhBQjIOQUVeKkFJsZZBTN2yQVExHkFUXTpBWLCmQVvcwkFgV+RhBY1xKQWfUoEFq29JBb1QoQXKAREF207BBef/MQX5TOEGBf1RBhfeqQYj+3EGNdzJBkH5kQZT2u+kGYItZBnHZCQZ+iXkGj9cpBpyHmQat1UkGuoW5BsxnEQbYg9kG6mUxBvaB+QcIY1EHFRPBByZhcQ+czEeEHRF+RB1EQAQdi8VkHbw4hB4DveQeNDEEHnu2ZB6sKYQe867kHyZwpB9rp2QfnmkkH+Of5AC+AQIDBAMEAwQDBAMEAwQDBAMEAwQDBAMEAwQDBAMEAwQDBAMEAwQDBAMEAwQDBAMEAwQDBAMEAwQD+BAMEAwQDBAMEAwQDBAMEAwQDBAMEAwQDBAMEAwQDBAMEAwQDBAMEAwQDBAMEAwQDBAMEAwQDBAME+AwQAABdoAAAAACowAQQAABwgAAkAACowAQQAABwgAAlITVQARUVTVABFRVQAAAAAAQEAAAABAQ==+"""++NEW_YORK = b"""+VFppZgAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAABcAAADrAAAABAAAABCeph5wn7rrYKCGAHCh+ms1gomXicKOD6eCkaq5wpTWnYKZTyvCnFYlgqDOs8Kj+peCqE47wqt6H4KvzcPCsvmngrdNS8K6e+S+CvszTwsH4t4LGcUXCyZ0pgs3wzcLRHLGC1XBVwticOYLc793C4BvBguRvZcLnm0mC7BPXwu8a0+YLzk1/C9r9DgvsS58L+PsuDApJvwwW+U4MKEffDDT3bgxGRf8MUvWODGTXxwxw864MgtXnDI+Fdg+yg1AcMrYOWDLiPBw0iP0cNJg++DTdeTw1EDd4NVVxvDWIL/g1zWo8NgAoeDZFYrw2eCD4Nr+p3Db+wGXg3N6JcN2pgmDevmtw34lkYOCeTXDhaUZg4n4vcONJKGDkXhFw5Vcu4OZHLfDnNxDg6CcP8OkW+8uDqBvHw6vbU4Ovm0/Ds1rbg7ca18O6/02Dvr9Jw8J+1YPGPtHDyf5dg82+WcPRfeWD1T3hw9j9b+YPcvWnD4KHfg+Q88cPoIWeD6+Fjw++g74PzYOvD9yB3g/rgc8P+n/+AAl/7wAYfh4AJ34PADcP5g+BGD9cAVQ4GEGQN9yBzDCYgeNGXMJEKRjCa2U9ArwhmQL4IV1DNmi5Q3AZ3YOuYTmD6mD9xCZZucR+iWX4EnlI6BNpR/kUWSrpFUkp+RY5DOoXKQv6GCIpaxkI7fsaAgtsGvIKfBvh7Wwc0ex8HcHPbR6x+zn0fobFtIHYA/SGBk20iVeL+I2qv7iQ1xP4lSpHuJhWm/ycqc+8n/sOAKQpV8CnepYAq6jfxK76H+gSzTVHItnmmCLrM2cy9+S4MwkxhzMWdoBDJy+nQzR0oENFLcdTUnLAU2Mr51NwcOBjgb2vY45vAG+Ofu89jrG0gY72572PK/uhj27gPY+j9CGP5ti9kBvsoZBhH92Qk+UhkNkYXZEL3aHRURDd0XzqQdH+LV/3R9OLB0kNQfdJs20HSu0j90uciYdM1kB3TXxrh062IndPXE2HUJYEd1E8L4dSdeZ3UxwRh1RV+yHdU+/OHVjWqd1blEAdYHsb3WMTyB1n+qPdapNQHW96K91yEtgddvmz3XmSYB1+eTvdgTbSHYYdr+d2ItlodjZ013ZA14h2VHL3dl7VqHZycRd2fNPIdpBvN3aa0eh2rm1XdrljsHbM/x9212HQdur9P3+b1X/B3CPtfdxNeEHcm+X93MVwwd0T3n3dP7fh3Y4lnd23sGHeBh4d3i+o4d5+Fp3ep6Fh3vYPHd8+fmeHfbged35eSYd/mAB3AAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAB+AAEAAQABAgMBAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAB+AAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA+AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAB+AAEAAQABAAEAAQABAAEAAQABAAEAAf//x8ABAP//ubAABP//x8ABCP//x8ABDEVEVABFU1QARVdU+AEVQVAAEslgAAAAAAQWk7AEAAAACB4YfggAAAAMJZ1MDAAAABAtIhoQAAAAFDSsLhQAAAAYPDD8G+AAAABxDtcocAAAAIEs6mCAAAAAkVn8qJAAAACheA/goAAAALGWIxiwAAAAwdJeoMAAAADSHa5Q0A+AAAOJZ6djgAAAA8nf9EPAAAAECpQ9ZAAAAARLDIpEQAAABIuE1ySAAAAEzDnJBMAAAAUM7hIlAAA+ABU2jBAVAAAAFkO3G5YAAAAXAAAAAQAAAAE=+"""++TZICAL_EST5EDT = """+BEGIN:VTIMEZONE+TZID:US-Eastern+LAST-MODIFIED:19870101T000000Z+TZURL:http://zones.stds_r_us.net/tz/US-Eastern+BEGIN:STANDARD+DTSTART:19671029T020000+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10+TZOFFSETFROM:-0400+TZOFFSETTO:-0500+TZNAME:EST+END:STANDARD+BEGIN:DAYLIGHT+DTSTART:19870405T020000+RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4+TZOFFSETFROM:-0500+TZOFFSETTO:-0400+TZNAME:EDT+END:DAYLIGHT+END:VTIMEZONE+"""++TZICAL_PST8PDT = """+BEGIN:VTIMEZONE+TZID:US-Pacific+LAST-MODIFIED:19870101T000000Z+BEGIN:STANDARD+DTSTART:19671029T020000+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10+TZOFFSETFROM:-0700+TZOFFSETTO:-0800+TZNAME:PST+END:STANDARD+BEGIN:DAYLIGHT+DTSTART:19870405T020000+RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4+TZOFFSETFROM:-0800+TZOFFSETTO:-0700+TZNAME:PDT+END:DAYLIGHT+END:VTIMEZONE+"""++EST_TUPLE = ('EST', timedelta(hours=-5), timedelta(hours=0))+EDT_TUPLE = ('EDT', timedelta(hours=-4), timedelta(hours=1))++SUPPORTS_SUB_MINUTE_OFFSETS = sys.version_info >= (3, 6)+++###+# Helper functions+def get_timezone_tuple(dt):+    """Retrieve a (tzname, utcoffset, dst) tuple for a given DST"""+    return dt.tzname(), dt.utcoffset(), dt.dst()+++###+# Mix-ins+class context_passthrough(object):+    def __init__(*args, **kwargs):+        pass++    def __enter__(*args, **kwargs):+        pass++    def __exit__(*args, **kwargs):+        pass+++class TzFoldMixin(object):+    """ Mix-in class for testing ambiguous times """+    def gettz(self, tzname):+        raise NotImplementedError++    def _get_tzname(self, tzname):+        return tzname++    def _gettz_context(self, tzname):+        return context_passthrough()++    def testFoldPositiveUTCOffset(self):+        # Test that we can resolve ambiguous times+        tzname = self._get_tzname('Australia/Sydney')++        with self._gettz_context(tzname):+            SYD = self.gettz(tzname)++            t0_u = datetime(2012, 3, 31, 15, 30, tzinfo=tz.UTC)  # AEST+            t1_u = datetime(2012, 3, 31, 16, 30, tzinfo=tz.UTC)  # AEDT++            t0_syd0 = t0_u.astimezone(SYD)+            t1_syd1 = t1_u.astimezone(SYD)++            self.assertEqual(t0_syd0.replace(tzinfo=None),+                             datetime(2012, 4, 1, 2, 30))++            self.assertEqual(t1_syd1.replace(tzinfo=None),+                             datetime(2012, 4, 1, 2, 30))++            self.assertEqual(t0_syd0.utcoffset(), timedelta(hours=11))+            self.assertEqual(t1_syd1.utcoffset(), timedelta(hours=10))++    def testGapPositiveUTCOffset(self):+        # Test that we don't have a problem around gaps.+        tzname = self._get_tzname('Australia/Sydney')++        with self._gettz_context(tzname):+            SYD = self.gettz(tzname)++            t0_u = datetime(2012, 10, 6, 15, 30, tzinfo=tz.UTC)  # AEST+            t1_u = datetime(2012, 10, 6, 16, 30, tzinfo=tz.UTC)  # AEDT++            t0 = t0_u.astimezone(SYD)+            t1 = t1_u.astimezone(SYD)++            self.assertEqual(t0.replace(tzinfo=None),+                             datetime(2012, 10, 7, 1, 30))++            self.assertEqual(t1.replace(tzinfo=None),+                             datetime(2012, 10, 7, 3, 30))++            self.assertEqual(t0.utcoffset(), timedelta(hours=10))+            self.assertEqual(t1.utcoffset(), timedelta(hours=11))++    def testFoldNegativeUTCOffset(self):+            # Test that we can resolve ambiguous times+            tzname = self._get_tzname('America/Toronto')++            with self._gettz_context(tzname):+                TOR = self.gettz(tzname)++                t0_u = datetime(2011, 11, 6, 5, 30, tzinfo=tz.UTC)+                t1_u = datetime(2011, 11, 6, 6, 30, tzinfo=tz.UTC)++                t0_tor = t0_u.astimezone(TOR)
… 2564 more lines (truncated)
ci_tools/run_tz_master_env.sh +2 lines
--- +++ @@ -13,3 +13,3 @@ -REPO_TARBALL=${REPO_DIR}/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz+REPO_TARBALL=${REPO_DIR}/src/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz TMP_TARBALL=${TMP_DIR}/dateutil-zoneinfo.tar.gz@@ -95,3 +95,3 @@ # Run the tests-python -m pytest ${REPO_DIR}/dateutil/test $EXTRA_TEST_ARGS+python -m pytest ${REPO_DIR}/tests $EXTRA_TEST_ARGS 
pyproject.toml +18 lines
--- +++ @@ -48 +48,19 @@ +[tool.black]+line-length = 80++[tool.isort]+atomic=true+force_grid_wrap=0+include_trailing_comma=true+known_first_party = ["dateutil"]+known_third_party=[+    "pytest",+    "hypothesis",+    "six",+    "freezegun",+    "mock",+]+multi_line_output=3+use_parentheses=true+
setup.cfg +6 lines
--- +++ @@ -33,2 +33,5 @@ 	Programming Language :: Python :: 3.9+	Programming Language :: Python :: 3.10+	Programming Language :: Python :: 3.11+	Programming Language :: Python :: 3.12 	Topic :: Software Development :: Libraries@@ -39,9 +42,9 @@ install_requires = six >= 1.5+package_dir = +	=src python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.* packages = find:-test_suite = dateutil.test  [options.packages.find]-exclude = -	dateutil.test+where = src 
setup.py +1 lines
--- +++ @@ -50,3 +50,3 @@       use_scm_version={-          'write_to': 'dateutil/_version.py',+          'write_to': 'src/dateutil/_version.py',       },
src/dateutil/__init__.py +24 lines
--- +++ @@ -0,0 +1,24 @@+# -*- coding: utf-8 -*-+import sys++try:+    from ._version import version as __version__+except ImportError:+    __version__ = 'unknown'++__all__ = ['easter', 'parser', 'relativedelta', 'rrule', 'tz',+           'utils', 'zoneinfo']++def __getattr__(name):+    import importlib++    if name in __all__:+        return importlib.import_module("." + name, __name__)+    raise AttributeError(+        "module {!r} has not attribute {!r}".format(__name__, name)+    )+++def __dir__():+    # __dir__ should include all the lazy-importable modules as well.+    return [x for x in globals() if x not in sys.modules] + __all__
src/dateutil/_common.py +43 lines
--- +++ @@ -0,0 +1,43 @@+"""+Common code used in multiple modules.+"""+++class weekday(object):+    __slots__ = ["weekday", "n"]++    def __init__(self, weekday, n=None):+        self.weekday = weekday+        self.n = n++    def __call__(self, n):+        if n == self.n:+            return self+        else:+            return self.__class__(self.weekday, n)++    def __eq__(self, other):+        try:+            if self.weekday != other.weekday or self.n != other.n:+                return False+        except AttributeError:+            return False+        return True++    def __hash__(self):+        return hash((+          self.weekday,+          self.n,+        ))++    def __ne__(self, other):+        return not (self == other)++    def __repr__(self):+        s = ("MO", "TU", "WE", "TH", "FR", "SA", "SU")[self.weekday]+        if not self.n:+            return s+        else:+            return "%s(%+d)" % (s, self.n)++# vim:ts=4:sw=4:et
src/dateutil/_version.py +16 lines
--- +++ @@ -0,0 +1,16 @@+# file generated by setuptools_scm+# don't change, don't track in version control+TYPE_CHECKING = False+if TYPE_CHECKING:+    from typing import Tuple, Union+    VERSION_TUPLE = Tuple[Union[int, str], ...]+else:+    VERSION_TUPLE = object++version: str+__version__: str+__version_tuple__: VERSION_TUPLE+version_tuple: VERSION_TUPLE++__version__ = version = '2.9.0'+__version_tuple__ = version_tuple = (2, 9, 0)
src/dateutil/easter.py +89 lines
--- +++ @@ -0,0 +1,89 @@+# -*- coding: utf-8 -*-+"""+This module offers a generic Easter computing method for any given year, using+Western, Orthodox or Julian algorithms.+"""++import datetime++__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]++EASTER_JULIAN = 1+EASTER_ORTHODOX = 2+EASTER_WESTERN = 3+++def easter(year, method=EASTER_WESTERN):+    """+    This method was ported from the work done by GM Arts,+    on top of the algorithm by Claus Tondering, which was+    based in part on the algorithm of Ouding (1940), as+    quoted in "Explanatory Supplement to the Astronomical+    Almanac", P.  Kenneth Seidelmann, editor.++    This algorithm implements three different Easter+    calculation methods:++    1. Original calculation in Julian calendar, valid in+       dates after 326 AD+    2. Original method, with date converted to Gregorian+       calendar, valid in years 1583 to 4099+    3. Revised method, in Gregorian calendar, valid in+       years 1583 to 4099 as well++    These methods are represented by the constants:++    * ``EASTER_JULIAN   = 1``+    * ``EASTER_ORTHODOX = 2``+    * ``EASTER_WESTERN  = 3``++    The default method is method 3.++    More about the algorithm may be found at:++    `GM Arts: Easter Algorithms <http://www.gmarts.org/index.php?go=415>`_++    and++    `The Calendar FAQ: Easter <https://www.tondering.dk/claus/cal/easter.php>`_++    """++    if not (1 <= method <= 3):+        raise ValueError("invalid method")++    # g - Golden year - 1+    # c - Century+    # h - (23 - Epact) mod 30+    # i - Number of days from March 21 to Paschal Full Moon+    # j - Weekday for PFM (0=Sunday, etc)+    # p - Number of days from March 21 to Sunday on or before PFM+    #     (-6 to 28 methods 1 & 3, to 56 for method 2)+    # e - Extra days to add for method 2 (converting Julian+    #     date to Gregorian date)++    y = year+    g = y % 19+    e = 0+    if method < 3:+        # Old method+        i = (19*g + 15) % 30+        j = (y + y//4 + i) % 7+        if method == 2:+            # Extra dates to convert Julian to Gregorian date+            e = 10+            if y > 1600:+                e = e + y//100 - 16 - (y//100 - 16)//4+    else:+        # New method+        c = y//100+        h = (c - c//4 - (8*c + 13)//25 + 19*g + 15) % 30+        i = h - (h//28)*(1 - (h//28)*(29//(h + 1))*((21 - g)//11))+        j = (y + y//4 + i + 2 - c + c//4) % 7++    # p can be from -6 to 56 corresponding to dates 22 March to 23 May+    # (later dates apply to method 2, although 23 May never actually occurs)+    p = i - j + e+    d = 1 + (p + 27 + (p + 6)//40) % 31+    m = 3 + (p + 26)//30+    return datetime.date(int(y), int(m), int(d))
src/dateutil/parser/__init__.py +61 lines
--- +++ @@ -0,0 +1,61 @@+# -*- coding: utf-8 -*-+from ._parser import parse, parser, parserinfo, ParserError+from ._parser import DEFAULTPARSER, DEFAULTTZPARSER+from ._parser import UnknownTimezoneWarning++from ._parser import __doc__++from .isoparser import isoparser, isoparse++__all__ = ['parse', 'parser', 'parserinfo',+           'isoparse', 'isoparser',+           'ParserError',+           'UnknownTimezoneWarning']+++###+# Deprecate portions of the private interface so that downstream code that+# is improperly relying on it is given *some* notice.+++def __deprecated_private_func(f):+    from functools import wraps+    import warnings++    msg = ('{name} is a private function and may break without warning, '+           'it will be moved and or renamed in future versions.')+    msg = msg.format(name=f.__name__)++    @wraps(f)+    def deprecated_func(*args, **kwargs):+        warnings.warn(msg, DeprecationWarning)+        return f(*args, **kwargs)++    return deprecated_func++def __deprecate_private_class(c):+    import warnings++    msg = ('{name} is a private class and may break without warning, '+           'it will be moved and or renamed in future versions.')+    msg = msg.format(name=c.__name__)++    class private_class(c):+        __doc__ = c.__doc__++        def __init__(self, *args, **kwargs):+            warnings.warn(msg, DeprecationWarning)+            super(private_class, self).__init__(*args, **kwargs)++    private_class.__name__ = c.__name__++    return private_class+++from ._parser import _timelex, _resultbase+from ._parser import _tzparser, _parsetz++_timelex = __deprecate_private_class(_timelex)+_tzparser = __deprecate_private_class(_tzparser)+_resultbase = __deprecate_private_class(_resultbase)+_parsetz = __deprecated_private_func(_parsetz)
src/dateutil/parser/_parser.py +1613 lines
--- +++ @@ -0,0 +1,1613 @@+# -*- coding: utf-8 -*-+"""+This module offers a generic date/time string parser which is able to parse+most known formats to represent a date and/or time.++This module attempts to be forgiving with regards to unlikely input formats,+returning a datetime object even for dates which are ambiguous. If an element+of a date/time stamp is omitted, the following rules are applied:++- If AM or PM is left unspecified, a 24-hour clock is assumed, however, an hour+  on a 12-hour clock (``0 <= hour <= 12``) *must* be specified if AM or PM is+  specified.+- If a time zone is omitted, a timezone-naive datetime is returned.++If any other elements are missing, they are taken from the+:class:`datetime.datetime` object passed to the parameter ``default``. If this+results in a day number exceeding the valid number of days per month, the+value falls back to the end of the month.++Additional resources about date/time string formats can be found below:++- `A summary of the international standard date and time notation+  <https://www.cl.cam.ac.uk/~mgk25/iso-time.html>`_+- `W3C Date and Time Formats <https://www.w3.org/TR/NOTE-datetime>`_+- `Time Formats (Planetary Rings Node) <https://pds-rings.seti.org:443/tools/time_formats.html>`_+- `CPAN ParseDate module+  <https://metacpan.org/pod/release/MUIR/Time-modules-2013.0912/lib/Time/ParseDate.pm>`_+- `Java SimpleDateFormat Class+  <https://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html>`_+"""+from __future__ import unicode_literals++import datetime+import re+import string+import time+import warnings++from calendar import monthrange+from io import StringIO++import six+from six import integer_types, text_type++from decimal import Decimal++from warnings import warn++from .. import relativedelta+from .. import tz++__all__ = ["parse", "parserinfo", "ParserError"]+++# TODO: pandas.core.tools.datetimes imports this explicitly.  Might be worth+# making public and/or figuring out if there is something we can+# take off their plate.+class _timelex(object):+    # Fractional seconds are sometimes split by a comma+    _split_decimal = re.compile("([.,])")++    def __init__(self, instream):+        if isinstance(instream, (bytes, bytearray)):+            instream = instream.decode()++        if isinstance(instream, text_type):+            instream = StringIO(instream)+        elif getattr(instream, 'read', None) is None:+            raise TypeError('Parser must be a string or character stream, not '+                            '{itype}'.format(itype=instream.__class__.__name__))++        self.instream = instream+        self.charstack = []+        self.tokenstack = []+        self.eof = False++    def get_token(self):+        """+        This function breaks the time string into lexical units (tokens), which+        can be parsed by the parser. Lexical units are demarcated by changes in+        the character set, so any continuous string of letters is considered+        one unit, any continuous string of numbers is considered one unit.++        The main complication arises from the fact that dots ('.') can be used+        both as separators (e.g. "Sep.20.2009") or decimal points (e.g.+        "4:30:21.447"). As such, it is necessary to read the full context of+        any dot-separated strings before breaking it into tokens; as such, this+        function maintains a "token stack", for when the ambiguous context+        demands that multiple tokens be parsed at once.+        """+        if self.tokenstack:+            return self.tokenstack.pop(0)++        seenletters = False+        token = None+        state = None++        while not self.eof:+            # We only realize that we've reached the end of a token when we+            # find a character that's not part of the current token - since+            # that character may be part of the next token, it's stored in the+            # charstack.+            if self.charstack:+                nextchar = self.charstack.pop(0)+            else:+                nextchar = self.instream.read(1)+                while nextchar == '\x00':+                    nextchar = self.instream.read(1)++            if not nextchar:+                self.eof = True+                break+            elif not state:+                # First character of the token - determines if we're starting+                # to parse a word, a number or something else.+                token = nextchar+                if self.isword(nextchar):+                    state = 'a'+                elif self.isnum(nextchar):+                    state = '0'+                elif self.isspace(nextchar):+                    token = ' '+                    break  # emit token+                else:+                    break  # emit token+            elif state == 'a':+                # If we've already started reading a word, we keep reading+                # letters until we find something that's not part of a word.+                seenletters = True+                if self.isword(nextchar):+                    token += nextchar+                elif nextchar == '.':+                    token += nextchar+                    state = 'a.'+                else:+                    self.charstack.append(nextchar)+                    break  # emit token+            elif state == '0':+                # If we've already started reading a number, we keep reading+                # numbers until we find something that doesn't fit.+                if self.isnum(nextchar):+                    token += nextchar+                elif nextchar == '.' or (nextchar == ',' and len(token) >= 2):+                    token += nextchar+                    state = '0.'+                else:+                    self.charstack.append(nextchar)+                    break  # emit token+            elif state == 'a.':+                # If we've seen some letters and a dot separator, continue+                # parsing, and the tokens will be broken up later.+                seenletters = True+                if nextchar == '.' or self.isword(nextchar):+                    token += nextchar+                elif self.isnum(nextchar) and token[-1] == '.':+                    token += nextchar+                    state = '0.'+                else:+                    self.charstack.append(nextchar)+                    break  # emit token+            elif state == '0.':+                # If we've seen at least one dot separator, keep going, we'll+                # break up the tokens later.+                if nextchar == '.' or self.isnum(nextchar):+                    token += nextchar+                elif self.isword(nextchar) and token[-1] == '.':+                    token += nextchar+                    state = 'a.'+                else:+                    self.charstack.append(nextchar)+                    break  # emit token++        if (state in ('a.', '0.') and (seenletters or token.count('.') > 1 or+                                       token[-1] in '.,')):+            l = self._split_decimal.split(token)+            token = l[0]+            for tok in l[1:]:+                if tok:+                    self.tokenstack.append(tok)++        if state == '0.' and token.count('.') == 0:+            token = token.replace(',', '.')++        return token++    def __iter__(self):+        return self++    def __next__(self):+        token = self.get_token()+        if token is None:+            raise StopIteration++        return token++    def next(self):+        return self.__next__()  # Python 2.x support++    @classmethod+    def split(cls, s):+        return list(cls(s))++    @classmethod+    def isword(cls, nextchar):+        """ Whether or not the next character is part of a word """+        return nextchar.isalpha()++    @classmethod+    def isnum(cls, nextchar):+        """ Whether the next character is part of a number """+        return nextchar.isdigit()++    @classmethod+    def isspace(cls, nextchar):+        """ Whether the next character is whitespace """+        return nextchar.isspace()+++class _resultbase(object):++    def __init__(self):+        for attr in self.__slots__:+            setattr(self, attr, None)++    def _repr(self, classname):+        l = []+        for attr in self.__slots__:+            value = getattr(self, attr)+            if value is not None:+                l.append("%s=%s" % (attr, repr(value)))+        return "%s(%s)" % (classname, ", ".join(l))++    def __len__(self):+        return (sum(getattr(self, attr) is not None+                    for attr in self.__slots__))++    def __repr__(self):+        return self._repr(self.__class__.__name__)+++class parserinfo(object):+    """+    Class which handles what inputs are accepted. Subclass this to customize+    the language and acceptable values for each parameter.++    :param dayfirst:+        Whether to interpret the first value in an ambiguous 3-integer date
… 1366 more lines (truncated)
src/dateutil/parser/isoparser.py +416 lines
--- +++ @@ -0,0 +1,416 @@+# -*- coding: utf-8 -*-+"""+This module offers a parser for ISO-8601 strings++It is intended to support all valid date, time and datetime formats per the+ISO-8601 specification.++..versionadded:: 2.7.0+"""+from datetime import datetime, timedelta, time, date+import calendar+from dateutil import tz++from functools import wraps++import re+import six++__all__ = ["isoparse", "isoparser"]+++def _takes_ascii(f):+    @wraps(f)+    def func(self, str_in, *args, **kwargs):+        # If it's a stream, read the whole thing+        str_in = getattr(str_in, 'read', lambda: str_in)()++        # If it's unicode, turn it into bytes, since ISO-8601 only covers ASCII+        if isinstance(str_in, six.text_type):+            # ASCII is the same in UTF-8+            try:+                str_in = str_in.encode('ascii')+            except UnicodeEncodeError as e:+                msg = 'ISO-8601 strings should contain only ASCII characters'+                six.raise_from(ValueError(msg), e)++        return f(self, str_in, *args, **kwargs)++    return func+++class isoparser(object):+    def __init__(self, sep=None):+        """+        :param sep:+            A single character that separates date and time portions. If+            ``None``, the parser will accept any single character.+            For strict ISO-8601 adherence, pass ``'T'``.+        """+        if sep is not None:+            if (len(sep) != 1 or ord(sep) >= 128 or sep in '0123456789'):+                raise ValueError('Separator must be a single, non-numeric ' ++                                 'ASCII character')++            sep = sep.encode('ascii')++        self._sep = sep++    @_takes_ascii+    def isoparse(self, dt_str):+        """+        Parse an ISO-8601 datetime string into a :class:`datetime.datetime`.++        An ISO-8601 datetime string consists of a date portion, followed+        optionally by a time portion - the date and time portions are separated+        by a single character separator, which is ``T`` in the official+        standard. Incomplete date formats (such as ``YYYY-MM``) may *not* be+        combined with a time portion.++        Supported date formats are:++        Common:++        - ``YYYY``+        - ``YYYY-MM``+        - ``YYYY-MM-DD`` or ``YYYYMMDD``++        Uncommon:++        - ``YYYY-Www`` or ``YYYYWww`` - ISO week (day defaults to 0)+        - ``YYYY-Www-D`` or ``YYYYWwwD`` - ISO week and day++        The ISO week and day numbering follows the same logic as+        :func:`datetime.date.isocalendar`.++        Supported time formats are:++        - ``hh``+        - ``hh:mm`` or ``hhmm``+        - ``hh:mm:ss`` or ``hhmmss``+        - ``hh:mm:ss.ssssss`` (Up to 6 sub-second digits)++        Midnight is a special case for `hh`, as the standard supports both+        00:00 and 24:00 as a representation. The decimal separator can be+        either a dot or a comma.+++        .. caution::++            Support for fractional components other than seconds is part of the+            ISO-8601 standard, but is not currently implemented in this parser.++        Supported time zone offset formats are:++        - `Z` (UTC)+        - `±HH:MM`+        - `±HHMM`+        - `±HH`++        Offsets will be represented as :class:`dateutil.tz.tzoffset` objects,+        with the exception of UTC, which will be represented as+        :class:`dateutil.tz.tzutc`. Time zone offsets equivalent to UTC (such+        as `+00:00`) will also be represented as :class:`dateutil.tz.tzutc`.++        :param dt_str:+            A string or stream containing only an ISO-8601 datetime string++        :return:+            Returns a :class:`datetime.datetime` representing the string.+            Unspecified components default to their lowest value.++        .. warning::++            As of version 2.7.0, the strictness of the parser should not be+            considered a stable part of the contract. Any valid ISO-8601 string+            that parses correctly with the default settings will continue to+            parse correctly in future versions, but invalid strings that+            currently fail (e.g. ``2017-01-01T00:00+00:00:00``) are not+            guaranteed to continue failing in future versions if they encode+            a valid date.++        .. versionadded:: 2.7.0+        """+        components, pos = self._parse_isodate(dt_str)++        if len(dt_str) > pos:+            if self._sep is None or dt_str[pos:pos + 1] == self._sep:+                components += self._parse_isotime(dt_str[pos + 1:])+            else:+                raise ValueError('String contains unknown ISO components')++        if len(components) > 3 and components[3] == 24:+            components[3] = 0+            return datetime(*components) + timedelta(days=1)++        return datetime(*components)++    @_takes_ascii+    def parse_isodate(self, datestr):+        """+        Parse the date portion of an ISO string.++        :param datestr:+            The string portion of an ISO string, without a separator++        :return:+            Returns a :class:`datetime.date` object+        """+        components, pos = self._parse_isodate(datestr)+        if pos < len(datestr):+            raise ValueError('String contains unknown ISO ' ++                             'components: {!r}'.format(datestr.decode('ascii')))+        return date(*components)++    @_takes_ascii+    def parse_isotime(self, timestr):+        """+        Parse the time portion of an ISO string.++        :param timestr:+            The time portion of an ISO string, without a separator++        :return:+            Returns a :class:`datetime.time` object+        """+        components = self._parse_isotime(timestr)+        if components[0] == 24:+            components[0] = 0+        return time(*components)++    @_takes_ascii+    def parse_tzstr(self, tzstr, zero_as_utc=True):+        """+        Parse a valid ISO time zone string.++        See :func:`isoparser.isoparse` for details on supported formats.++        :param tzstr:+            A string representing an ISO time zone offset++        :param zero_as_utc:+            Whether to return :class:`dateutil.tz.tzutc` for zero-offset zones++        :return:+            Returns :class:`dateutil.tz.tzoffset` for offsets and+            :class:`dateutil.tz.tzutc` for ``Z`` and (if ``zero_as_utc`` is+            specified) offsets equivalent to UTC.+        """+        return self._parse_tzstr(tzstr, zero_as_utc=zero_as_utc)++    # Constants+    _DATE_SEP = b'-'+    _TIME_SEP = b':'+    _FRACTION_REGEX = re.compile(b'[\\.,]([0-9]+)')++    def _parse_isodate(self, dt_str):+        try:+            return self._parse_isodate_common(dt_str)+        except ValueError:+            return self._parse_isodate_uncommon(dt_str)++    def _parse_isodate_common(self, dt_str):+        len_str = len(dt_str)+        components = [1, 1, 1]++        if len_str < 4:+            raise ValueError('ISO string too short')++        # Year+        components[0] = int(dt_str[0:4])+        pos = 4+        if pos >= len_str:+            return components, pos++        has_sep = dt_str[pos:pos + 1] == self._DATE_SEP+        if has_sep:+            pos += 1++        # Month+        if len_str - pos < 2:+            raise ValueError('Invalid common month')++        components[1] = int(dt_str[pos:pos + 2])+        pos += 2++        if pos >= len_str:+            if has_sep:+                return components, pos+            else:+                raise ValueError('Invalid ISO format')++        if has_sep:+            if dt_str[pos:pos + 1] != self._DATE_SEP:+                raise ValueError('Invalid separator in ISO string')+            pos += 1++        # Day
… 169 more lines (truncated)
src/dateutil/relativedelta.py +599 lines
--- +++ @@ -0,0 +1,599 @@+# -*- coding: utf-8 -*-+import datetime+import calendar++import operator+from math import copysign++from six import integer_types+from warnings import warn++from ._common import weekday++MO, TU, WE, TH, FR, SA, SU = weekdays = tuple(weekday(x) for x in range(7))++__all__ = ["relativedelta", "MO", "TU", "WE", "TH", "FR", "SA", "SU"]+++class relativedelta(object):+    """+    The relativedelta type is designed to be applied to an existing datetime and+    can replace specific components of that datetime, or represents an interval+    of time.++    It is based on the specification of the excellent work done by M.-A. Lemburg+    in his+    `mx.DateTime <https://www.egenix.com/products/python/mxBase/mxDateTime/>`_ extension.+    However, notice that this type does *NOT* implement the same algorithm as+    his work. Do *NOT* expect it to behave like mx.DateTime's counterpart.++    There are two different ways to build a relativedelta instance. The+    first one is passing it two date/datetime classes::++        relativedelta(datetime1, datetime2)++    The second one is passing it any number of the following keyword arguments::++        relativedelta(arg1=x,arg2=y,arg3=z...)++        year, month, day, hour, minute, second, microsecond:+            Absolute information (argument is singular); adding or subtracting a+            relativedelta with absolute information does not perform an arithmetic+            operation, but rather REPLACES the corresponding value in the+            original datetime with the value(s) in relativedelta.++        years, months, weeks, days, hours, minutes, seconds, microseconds:+            Relative information, may be negative (argument is plural); adding+            or subtracting a relativedelta with relative information performs+            the corresponding arithmetic operation on the original datetime value+            with the information in the relativedelta.++        weekday:+            One of the weekday instances (MO, TU, etc) available in the+            relativedelta module. These instances may receive a parameter N,+            specifying the Nth weekday, which could be positive or negative+            (like MO(+1) or MO(-2)). Not specifying it is the same as specifying+            +1. You can also use an integer, where 0=MO. This argument is always+            relative e.g. if the calculated date is already Monday, using MO(1)+            or MO(-1) won't change the day. To effectively make it absolute, use+            it in combination with the day argument (e.g. day=1, MO(1) for first+            Monday of the month).++        leapdays:+            Will add given days to the date found, if year is a leap+            year, and the date found is post 28 of february.++        yearday, nlyearday:+            Set the yearday or the non-leap year day (jump leap days).+            These are converted to day/month/leapdays information.++    There are relative and absolute forms of the keyword+    arguments. The plural is relative, and the singular is+    absolute. For each argument in the order below, the absolute form+    is applied first (by setting each attribute to that value) and+    then the relative form (by adding the value to the attribute).++    The order of attributes considered when this relativedelta is+    added to a datetime is:++    1. Year+    2. Month+    3. Day+    4. Hours+    5. Minutes+    6. Seconds+    7. Microseconds++    Finally, weekday is applied, using the rule described above.++    For example++    >>> from datetime import datetime+    >>> from dateutil.relativedelta import relativedelta, MO+    >>> dt = datetime(2018, 4, 9, 13, 37, 0)+    >>> delta = relativedelta(hours=25, day=1, weekday=MO(1))+    >>> dt + delta+    datetime.datetime(2018, 4, 2, 14, 37)++    First, the day is set to 1 (the first of the month), then 25 hours+    are added, to get to the 2nd day and 14th hour, finally the+    weekday is applied, but since the 2nd is already a Monday there is+    no effect.++    """++    def __init__(self, dt1=None, dt2=None,+                 years=0, months=0, days=0, leapdays=0, weeks=0,+                 hours=0, minutes=0, seconds=0, microseconds=0,+                 year=None, month=None, day=None, weekday=None,+                 yearday=None, nlyearday=None,+                 hour=None, minute=None, second=None, microsecond=None):++        if dt1 and dt2:+            # datetime is a subclass of date. So both must be date+            if not (isinstance(dt1, datetime.date) and+                    isinstance(dt2, datetime.date)):+                raise TypeError("relativedelta only diffs datetime/date")++            # We allow two dates, or two datetimes, so we coerce them to be+            # of the same type+            if (isinstance(dt1, datetime.datetime) !=+                    isinstance(dt2, datetime.datetime)):+                if not isinstance(dt1, datetime.datetime):+                    dt1 = datetime.datetime.fromordinal(dt1.toordinal())+                elif not isinstance(dt2, datetime.datetime):+                    dt2 = datetime.datetime.fromordinal(dt2.toordinal())++            self.years = 0+            self.months = 0+            self.days = 0+            self.leapdays = 0+            self.hours = 0+            self.minutes = 0+            self.seconds = 0+            self.microseconds = 0+            self.year = None+            self.month = None+            self.day = None+            self.weekday = None+            self.hour = None+            self.minute = None+            self.second = None+            self.microsecond = None+            self._has_time = 0++            # Get year / month delta between the two+            months = (dt1.year - dt2.year) * 12 + (dt1.month - dt2.month)+            self._set_months(months)++            # Remove the year/month delta so the timedelta is just well-defined+            # time units (seconds, days and microseconds)+            dtm = self.__radd__(dt2)++            # If we've overshot our target, make an adjustment+            if dt1 < dt2:+                compare = operator.gt+                increment = 1+            else:+                compare = operator.lt+                increment = -1++            while compare(dt1, dtm):+                months += increment+                self._set_months(months)+                dtm = self.__radd__(dt2)++            # Get the timedelta between the "months-adjusted" date and dt1+            delta = dt1 - dtm+            self.seconds = delta.seconds + delta.days * 86400+            self.microseconds = delta.microseconds+        else:+            # Check for non-integer values in integer-only quantities+            if any(x is not None and x != int(x) for x in (years, months)):+                raise ValueError("Non-integer years and months are "+                                 "ambiguous and not currently supported.")++            # Relative information+            self.years = int(years)+            self.months = int(months)+            self.days = days + weeks * 7+            self.leapdays = leapdays+            self.hours = hours+            self.minutes = minutes+            self.seconds = seconds+            self.microseconds = microseconds++            # Absolute information+            self.year = year+            self.month = month+            self.day = day+            self.hour = hour+            self.minute = minute+            self.second = second+            self.microsecond = microsecond++            if any(x is not None and int(x) != x+                   for x in (year, month, day, hour,+                             minute, second, microsecond)):+                # For now we'll deprecate floats - later it'll be an error.+                warn("Non-integer value passed as absolute information. " ++                     "This is not a well-defined condition and will raise " ++                     "errors in future versions.", DeprecationWarning)++            if isinstance(weekday, integer_types):+                self.weekday = weekdays[weekday]+            else:+                self.weekday = weekday++            yday = 0+            if nlyearday:+                yday = nlyearday+            elif yearday:+                yday = yearday+                if yearday > 59:+                    self.leapdays = -1+            if yday:+                ydayidx = [31, 59, 90, 120, 151, 181, 212,+                           243, 273, 304, 334, 366]+                for idx, ydays in enumerate(ydayidx):+                    if yday <= ydays:+                        self.month = idx+1+                        if idx == 0:+                            self.day = yday+                        else:+                            self.day = yday-ydayidx[idx-1]+                        break+                else:+                    raise ValueError("invalid year day (%d)" % yday)++        self._fix()++    def _fix(self):+        if abs(self.microseconds) > 999999:+            s = _sign(self.microseconds)+            div, mod = divmod(self.microseconds * s, 1000000)+            self.microseconds = mod * s+            self.seconds += div * s+        if abs(self.seconds) > 59:+            s = _sign(self.seconds)+            div, mod = divmod(self.seconds * s, 60)+            self.seconds = mod * s+            self.minutes += div * s+        if abs(self.minutes) > 59:+            s = _sign(self.minutes)+            div, mod = divmod(self.minutes * s, 60)+            self.minutes = mod * s+            self.hours += div * s+        if abs(self.hours) > 23:
… 352 more lines (truncated)
src/dateutil/rrule.py +1737 lines
--- +++ @@ -0,0 +1,1737 @@+# -*- coding: utf-8 -*-+"""+The rrule module offers a small, complete, and very fast, implementation of+the recurrence rules documented in the+`iCalendar RFC <https://tools.ietf.org/html/rfc5545>`_,+including support for caching of results.+"""+import calendar+import datetime+import heapq+import itertools+import re+import sys+from functools import wraps+# For warning about deprecation of until and count+from warnings import warn++from six import advance_iterator, integer_types++from six.moves import _thread, range++from ._common import weekday as weekdaybase++try:+    from math import gcd+except ImportError:+    from fractions import gcd++__all__ = ["rrule", "rruleset", "rrulestr",+           "YEARLY", "MONTHLY", "WEEKLY", "DAILY",+           "HOURLY", "MINUTELY", "SECONDLY",+           "MO", "TU", "WE", "TH", "FR", "SA", "SU"]++# Every mask is 7 days longer to handle cross-year weekly periods.+M366MASK = tuple([1]*31+[2]*29+[3]*31+[4]*30+[5]*31+[6]*30 ++                 [7]*31+[8]*31+[9]*30+[10]*31+[11]*30+[12]*31+[1]*7)+M365MASK = list(M366MASK)+M29, M30, M31 = list(range(1, 30)), list(range(1, 31)), list(range(1, 32))+MDAY366MASK = tuple(M31+M29+M31+M30+M31+M30+M31+M31+M30+M31+M30+M31+M31[:7])+MDAY365MASK = list(MDAY366MASK)+M29, M30, M31 = list(range(-29, 0)), list(range(-30, 0)), list(range(-31, 0))+NMDAY366MASK = tuple(M31+M29+M31+M30+M31+M30+M31+M31+M30+M31+M30+M31+M31[:7])+NMDAY365MASK = list(NMDAY366MASK)+M366RANGE = (0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366)+M365RANGE = (0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365)+WDAYMASK = [0, 1, 2, 3, 4, 5, 6]*55+del M29, M30, M31, M365MASK[59], MDAY365MASK[59], NMDAY365MASK[31]+MDAY365MASK = tuple(MDAY365MASK)+M365MASK = tuple(M365MASK)++FREQNAMES = ['YEARLY', 'MONTHLY', 'WEEKLY', 'DAILY', 'HOURLY', 'MINUTELY', 'SECONDLY']++(YEARLY,+ MONTHLY,+ WEEKLY,+ DAILY,+ HOURLY,+ MINUTELY,+ SECONDLY) = list(range(7))++# Imported on demand.+easter = None+parser = None+++class weekday(weekdaybase):+    """+    This version of weekday does not allow n = 0.+    """+    def __init__(self, wkday, n=None):+        if n == 0:+            raise ValueError("Can't create weekday with n==0")++        super(weekday, self).__init__(wkday, n)+++MO, TU, WE, TH, FR, SA, SU = weekdays = tuple(weekday(x) for x in range(7))+++def _invalidates_cache(f):+    """+    Decorator for rruleset methods which may invalidate the+    cached length.+    """+    @wraps(f)+    def inner_func(self, *args, **kwargs):+        rv = f(self, *args, **kwargs)+        self._invalidate_cache()+        return rv++    return inner_func+++class rrulebase(object):+    def __init__(self, cache=False):+        if cache:+            self._cache = []+            self._cache_lock = _thread.allocate_lock()+            self._invalidate_cache()+        else:+            self._cache = None+            self._cache_complete = False+            self._len = None++    def __iter__(self):+        if self._cache_complete:+            return iter(self._cache)+        elif self._cache is None:+            return self._iter()+        else:+            return self._iter_cached()++    def _invalidate_cache(self):+        if self._cache is not None:+            self._cache = []+            self._cache_complete = False+            self._cache_gen = self._iter()++            if self._cache_lock.locked():+                self._cache_lock.release()++        self._len = None++    def _iter_cached(self):+        i = 0+        gen = self._cache_gen+        cache = self._cache+        acquire = self._cache_lock.acquire+        release = self._cache_lock.release+        while gen:+            if i == len(cache):+                acquire()+                if self._cache_complete:+                    break+                try:+                    for j in range(10):+                        cache.append(advance_iterator(gen))+                except StopIteration:+                    self._cache_gen = gen = None+                    self._cache_complete = True+                    break+                release()+            yield cache[i]+            i += 1+        while i < self._len:+            yield cache[i]+            i += 1++    def __getitem__(self, item):+        if self._cache_complete:+            return self._cache[item]+        elif isinstance(item, slice):+            if item.step and item.step < 0:+                return list(iter(self))[item]+            else:+                return list(itertools.islice(self,+                                             item.start or 0,+                                             item.stop or sys.maxsize,+                                             item.step or 1))+        elif item >= 0:+            gen = iter(self)+            try:+                for i in range(item+1):+                    res = advance_iterator(gen)+            except StopIteration:+                raise IndexError+            return res+        else:+            return list(iter(self))[item]++    def __contains__(self, item):+        if self._cache_complete:+            return item in self._cache+        else:+            for i in self:+                if i == item:+                    return True+                elif i > item:+                    return False+        return False++    # __len__() introduces a large performance penalty.+    def count(self):+        """ Returns the number of recurrences in this set. It will have go+            through the whole recurrence, if this hasn't been done before. """+        if self._len is None:+            for x in self:+                pass+        return self._len++    def before(self, dt, inc=False):+        """ Returns the last recurrence before the given datetime instance. The+            inc keyword defines what happens if dt is an occurrence. With+            inc=True, if dt itself is an occurrence, it will be returned. """+        if self._cache_complete:+            gen = self._cache+        else:+            gen = self+        last = None+        if inc:+            for i in gen:+                if i > dt:+                    break+                last = i+        else:+            for i in gen:+                if i >= dt:+                    break+                last = i+        return last++    def after(self, dt, inc=False):+        """ Returns the first recurrence after the given datetime instance. The+            inc keyword defines what happens if dt is an occurrence. With+            inc=True, if dt itself is an occurrence, it will be returned.  """+        if self._cache_complete:+            gen = self._cache+        else:+            gen = self+        if inc:+            for i in gen:+                if i >= dt:+                    return i+        else:+            for i in gen:+                if i > dt:+                    return i+        return None++    def xafter(self, dt, count=None, inc=False):+        """+        Generator which yields up to `count` recurrences after the given+        datetime instance, equivalent to `after`.++        :param dt:+            The datetime at which to start generating recurrences.++        :param count:+            The maximum number of recurrences to generate. If `None` (default),+            dates are generated until the recurrence rule is exhausted.++        :param inc:+            If `dt` is an instance of the rule and `inc` is `True`, it is+            included in the output.++        :yields: Yields a sequence of `datetime` objects.+        """
… 1490 more lines (truncated)
src/dateutil/tz/__init__.py +12 lines
--- +++ @@ -0,0 +1,12 @@+# -*- coding: utf-8 -*-+from .tz import *+from .tz import __doc__++__all__ = ["tzutc", "tzoffset", "tzlocal", "tzfile", "tzrange",+           "tzstr", "tzical", "tzwin", "tzwinlocal", "gettz",+           "enfold", "datetime_ambiguous", "datetime_exists",+           "resolve_imaginary", "UTC", "DeprecatedTzFormatWarning"]+++class DeprecatedTzFormatWarning(Warning):+    """Warning raised when time zones are parsed from deprecated formats."""
src/dateutil/tz/_common.py +419 lines
--- +++ @@ -0,0 +1,419 @@+from six import PY2++from functools import wraps++from datetime import datetime, timedelta, tzinfo+++ZERO = timedelta(0)++__all__ = ['tzname_in_python2', 'enfold']+++def tzname_in_python2(namefunc):+    """Change unicode output into bytestrings in Python 2++    tzname() API changed in Python 3. It used to return bytes, but was changed+    to unicode strings+    """+    if PY2:+        @wraps(namefunc)+        def adjust_encoding(*args, **kwargs):+            name = namefunc(*args, **kwargs)+            if name is not None:+                name = name.encode()++            return name++        return adjust_encoding+    else:+        return namefunc+++# The following is adapted from Alexander Belopolsky's tz library+# https://github.com/abalkin/tz+if hasattr(datetime, 'fold'):+    # This is the pre-python 3.6 fold situation+    def enfold(dt, fold=1):+        """+        Provides a unified interface for assigning the ``fold`` attribute to+        datetimes both before and after the implementation of PEP-495.++        :param fold:+            The value for the ``fold`` attribute in the returned datetime. This+            should be either 0 or 1.++        :return:+            Returns an object for which ``getattr(dt, 'fold', 0)`` returns+            ``fold`` for all versions of Python. In versions prior to+            Python 3.6, this is a ``_DatetimeWithFold`` object, which is a+            subclass of :py:class:`datetime.datetime` with the ``fold``+            attribute added, if ``fold`` is 1.++        .. versionadded:: 2.6.0+        """+        return dt.replace(fold=fold)++else:+    class _DatetimeWithFold(datetime):+        """+        This is a class designed to provide a PEP 495-compliant interface for+        Python versions before 3.6. It is used only for dates in a fold, so+        the ``fold`` attribute is fixed at ``1``.++        .. versionadded:: 2.6.0+        """+        __slots__ = ()++        def replace(self, *args, **kwargs):+            """+            Return a datetime with the same attributes, except for those+            attributes given new values by whichever keyword arguments are+            specified. Note that tzinfo=None can be specified to create a naive+            datetime from an aware datetime with no conversion of date and time+            data.++            This is reimplemented in ``_DatetimeWithFold`` because pypy3 will+            return a ``datetime.datetime`` even if ``fold`` is unchanged.+            """+            argnames = (+                'year', 'month', 'day', 'hour', 'minute', 'second',+                'microsecond', 'tzinfo'+            )++            for arg, argname in zip(args, argnames):+                if argname in kwargs:+                    raise TypeError('Duplicate argument: {}'.format(argname))++                kwargs[argname] = arg++            for argname in argnames:+                if argname not in kwargs:+                    kwargs[argname] = getattr(self, argname)++            dt_class = self.__class__ if kwargs.get('fold', 1) else datetime++            return dt_class(**kwargs)++        @property+        def fold(self):+            return 1++    def enfold(dt, fold=1):+        """+        Provides a unified interface for assigning the ``fold`` attribute to+        datetimes both before and after the implementation of PEP-495.++        :param fold:+            The value for the ``fold`` attribute in the returned datetime. This+            should be either 0 or 1.++        :return:+            Returns an object for which ``getattr(dt, 'fold', 0)`` returns+            ``fold`` for all versions of Python. In versions prior to+            Python 3.6, this is a ``_DatetimeWithFold`` object, which is a+            subclass of :py:class:`datetime.datetime` with the ``fold``+            attribute added, if ``fold`` is 1.++        .. versionadded:: 2.6.0+        """+        if getattr(dt, 'fold', 0) == fold:+            return dt++        args = dt.timetuple()[:6]+        args += (dt.microsecond, dt.tzinfo)++        if fold:+            return _DatetimeWithFold(*args)+        else:+            return datetime(*args)+++def _validate_fromutc_inputs(f):+    """+    The CPython version of ``fromutc`` checks that the input is a ``datetime``+    object and that ``self`` is attached as its ``tzinfo``.+    """+    @wraps(f)+    def fromutc(self, dt):+        if not isinstance(dt, datetime):+            raise TypeError("fromutc() requires a datetime argument")+        if dt.tzinfo is not self:+            raise ValueError("dt.tzinfo is not self")++        return f(self, dt)++    return fromutc+++class _tzinfo(tzinfo):+    """+    Base class for all ``dateutil`` ``tzinfo`` objects.+    """++    def is_ambiguous(self, dt):+        """+        Whether or not the "wall time" of a given datetime is ambiguous in this+        zone.++        :param dt:+            A :py:class:`datetime.datetime`, naive or time zone aware.+++        :return:+            Returns ``True`` if ambiguous, ``False`` otherwise.++        .. versionadded:: 2.6.0+        """++        dt = dt.replace(tzinfo=self)++        wall_0 = enfold(dt, fold=0)+        wall_1 = enfold(dt, fold=1)++        same_offset = wall_0.utcoffset() == wall_1.utcoffset()+        same_dt = wall_0.replace(tzinfo=None) == wall_1.replace(tzinfo=None)++        return same_dt and not same_offset++    def _fold_status(self, dt_utc, dt_wall):+        """+        Determine the fold status of a "wall" datetime, given a representation+        of the same datetime as a (naive) UTC datetime. This is calculated based+        on the assumption that ``dt.utcoffset() - dt.dst()`` is constant for all+        datetimes, and that this offset is the actual number of hours separating+        ``dt_utc`` and ``dt_wall``.++        :param dt_utc:+            Representation of the datetime as UTC++        :param dt_wall:+            Representation of the datetime as "wall time". This parameter must+            either have a `fold` attribute or have a fold-naive+            :class:`datetime.tzinfo` attached, otherwise the calculation may+            fail.+        """+        if self.is_ambiguous(dt_wall):+            delta_wall = dt_wall - dt_utc+            _fold = int(delta_wall == (dt_utc.utcoffset() - dt_utc.dst()))+        else:+            _fold = 0++        return _fold++    def _fold(self, dt):+        return getattr(dt, 'fold', 0)++    def _fromutc(self, dt):+        """+        Given a timezone-aware datetime in a given timezone, calculates a+        timezone-aware datetime in a new timezone.++        Since this is the one time that we *know* we have an unambiguous+        datetime object, we take this opportunity to determine whether the+        datetime is ambiguous and in a "fold" state (e.g. if it's the first+        occurrence, chronologically, of the ambiguous datetime).++        :param dt:+            A timezone-aware :class:`datetime.datetime` object.+        """++        # Re-implement the algorithm from Python's datetime.py+        dtoff = dt.utcoffset()+        if dtoff is None:+            raise ValueError("fromutc() requires a non-None utcoffset() "+                             "result")++        # The original datetime.py code assumes that `dst()` defaults to+        # zero during ambiguous times. PEP 495 inverts this presumption, so+        # for pre-PEP 495 versions of python, we need to tweak the algorithm.+        dtdst = dt.dst()+        if dtdst is None:+            raise ValueError("fromutc() requires a non-None dst() result")+        delta = dtoff - dtdst++        dt += delta+        # Set fold=1 so we can default to being in the fold for+        # ambiguous dates.+        dtdst = enfold(dt, fold=1).dst()+        if dtdst is None:+            raise ValueError("fromutc(): dt.dst gave inconsistent "+                             "results; cannot convert")+        return dt + dtdst++    @_validate_fromutc_inputs+    def fromutc(self, dt):+        """+        Given a timezone-aware datetime in a given timezone, calculates a
… 172 more lines (truncated)
src/dateutil/tz/_factories.py +80 lines
--- +++ @@ -0,0 +1,80 @@+from datetime import timedelta+import weakref+from collections import OrderedDict++from six.moves import _thread+++class _TzSingleton(type):+    def __init__(cls, *args, **kwargs):+        cls.__instance = None+        super(_TzSingleton, cls).__init__(*args, **kwargs)++    def __call__(cls):+        if cls.__instance is None:+            cls.__instance = super(_TzSingleton, cls).__call__()+        return cls.__instance+++class _TzFactory(type):+    def instance(cls, *args, **kwargs):+        """Alternate constructor that returns a fresh instance"""+        return type.__call__(cls, *args, **kwargs)+++class _TzOffsetFactory(_TzFactory):+    def __init__(cls, *args, **kwargs):+        cls.__instances = weakref.WeakValueDictionary()+        cls.__strong_cache = OrderedDict()+        cls.__strong_cache_size = 8++        cls._cache_lock = _thread.allocate_lock()++    def __call__(cls, name, offset):+        if isinstance(offset, timedelta):+            key = (name, offset.total_seconds())+        else:+            key = (name, offset)++        instance = cls.__instances.get(key, None)+        if instance is None:+            instance = cls.__instances.setdefault(key,+                                                  cls.instance(name, offset))++        # This lock may not be necessary in Python 3. See GH issue #901+        with cls._cache_lock:+            cls.__strong_cache[key] = cls.__strong_cache.pop(key, instance)++            # Remove an item if the strong cache is overpopulated+            if len(cls.__strong_cache) > cls.__strong_cache_size:+                cls.__strong_cache.popitem(last=False)++        return instance+++class _TzStrFactory(_TzFactory):+    def __init__(cls, *args, **kwargs):+        cls.__instances = weakref.WeakValueDictionary()+        cls.__strong_cache = OrderedDict()+        cls.__strong_cache_size = 8++        cls.__cache_lock = _thread.allocate_lock()++    def __call__(cls, s, posix_offset=False):+        key = (s, posix_offset)+        instance = cls.__instances.get(key, None)++        if instance is None:+            instance = cls.__instances.setdefault(key,+                cls.instance(s, posix_offset))++        # This lock may not be necessary in Python 3. See GH issue #901+        with cls.__cache_lock:+            cls.__strong_cache[key] = cls.__strong_cache.pop(key, instance)++            # Remove an item if the strong cache is overpopulated+            if len(cls.__strong_cache) > cls.__strong_cache_size:+                cls.__strong_cache.popitem(last=False)++        return instance+
src/dateutil/tz/tz.py +1849 lines
--- +++ @@ -0,0 +1,1849 @@+# -*- coding: utf-8 -*-+"""+This module offers timezone implementations subclassing the abstract+:py:class:`datetime.tzinfo` type. There are classes to handle tzfile format+files (usually are in :file:`/etc/localtime`, :file:`/usr/share/zoneinfo`,+etc), TZ environment string (in all known formats), given ranges (with help+from relative deltas), local machine timezone, fixed offset timezone, and UTC+timezone.+"""+import datetime+import struct+import time+import sys+import os+import bisect+import weakref+from collections import OrderedDict++import six+from six import string_types+from six.moves import _thread+from ._common import tzname_in_python2, _tzinfo+from ._common import tzrangebase, enfold+from ._common import _validate_fromutc_inputs++from ._factories import _TzSingleton, _TzOffsetFactory+from ._factories import _TzStrFactory+try:+    from .win import tzwin, tzwinlocal+except ImportError:+    tzwin = tzwinlocal = None++# For warning about rounding tzinfo+from warnings import warn++ZERO = datetime.timedelta(0)+EPOCH = datetime.datetime(1970, 1, 1, 0, 0)+EPOCHORDINAL = EPOCH.toordinal()++[email protected]_metaclass(_TzSingleton)+class tzutc(datetime.tzinfo):+    """+    This is a tzinfo object that represents the UTC time zone.++    **Examples:**++    .. doctest::++        >>> from datetime import *+        >>> from dateutil.tz import *++        >>> datetime.now()+        datetime.datetime(2003, 9, 27, 9, 40, 1, 521290)++        >>> datetime.now(tzutc())+        datetime.datetime(2003, 9, 27, 12, 40, 12, 156379, tzinfo=tzutc())++        >>> datetime.now(tzutc()).tzname()+        'UTC'++    .. versionchanged:: 2.7.0+        ``tzutc()`` is now a singleton, so the result of ``tzutc()`` will+        always return the same object.++        .. doctest::++            >>> from dateutil.tz import tzutc, UTC+            >>> tzutc() is tzutc()+            True+            >>> tzutc() is UTC+            True+    """+    def utcoffset(self, dt):+        return ZERO++    def dst(self, dt):+        return ZERO++    @tzname_in_python2+    def tzname(self, dt):+        return "UTC"++    def is_ambiguous(self, dt):+        """+        Whether or not the "wall time" of a given datetime is ambiguous in this+        zone.++        :param dt:+            A :py:class:`datetime.datetime`, naive or time zone aware.+++        :return:+            Returns ``True`` if ambiguous, ``False`` otherwise.++        .. versionadded:: 2.6.0+        """+        return False++    @_validate_fromutc_inputs+    def fromutc(self, dt):+        """+        Fast track version of fromutc() returns the original ``dt`` object for+        any valid :py:class:`datetime.datetime` object.+        """+        return dt++    def __eq__(self, other):+        if not isinstance(other, (tzutc, tzoffset)):+            return NotImplemented++        return (isinstance(other, tzutc) or+                (isinstance(other, tzoffset) and other._offset == ZERO))++    __hash__ = None++    def __ne__(self, other):+        return not (self == other)++    def __repr__(self):+        return "%s()" % self.__class__.__name__++    __reduce__ = object.__reduce__+++#: Convenience constant providing a :class:`tzutc()` instance+#:+#: .. versionadded:: 2.7.0+UTC = tzutc()++[email protected]_metaclass(_TzOffsetFactory)+class tzoffset(datetime.tzinfo):+    """+    A simple class for representing a fixed offset from UTC.++    :param name:+        The timezone name, to be returned when ``tzname()`` is called.+    :param offset:+        The time zone offset in seconds, or (since version 2.6.0, represented+        as a :py:class:`datetime.timedelta` object).+    """+    def __init__(self, name, offset):+        self._name = name++        try:+            # Allow a timedelta+            offset = offset.total_seconds()+        except (TypeError, AttributeError):+            pass++        self._offset = datetime.timedelta(seconds=_get_supported_offset(offset))++    def utcoffset(self, dt):+        return self._offset++    def dst(self, dt):+        return ZERO++    @tzname_in_python2+    def tzname(self, dt):+        return self._name++    @_validate_fromutc_inputs+    def fromutc(self, dt):+        return dt + self._offset++    def is_ambiguous(self, dt):+        """+        Whether or not the "wall time" of a given datetime is ambiguous in this+        zone.++        :param dt:+            A :py:class:`datetime.datetime`, naive or time zone aware.+        :return:+            Returns ``True`` if ambiguous, ``False`` otherwise.++        .. versionadded:: 2.6.0+        """+        return False++    def __eq__(self, other):+        if not isinstance(other, tzoffset):+            return NotImplemented++        return self._offset == other._offset++    __hash__ = None++    def __ne__(self, other):+        return not (self == other)++    def __repr__(self):+        return "%s(%s, %s)" % (self.__class__.__name__,+                               repr(self._name),+                               int(self._offset.total_seconds()))++    __reduce__ = object.__reduce__+++class tzlocal(_tzinfo):+    """+    A :class:`tzinfo` subclass built around the ``time`` timezone functions.+    """+    def __init__(self):+        super(tzlocal, self).__init__()++        self._std_offset = datetime.timedelta(seconds=-time.timezone)+        if time.daylight:+            self._dst_offset = datetime.timedelta(seconds=-time.altzone)+        else:+            self._dst_offset = self._std_offset++        self._dst_saved = self._dst_offset - self._std_offset+        self._hasdst = bool(self._dst_saved)+        self._tznames = tuple(time.tzname)++    def utcoffset(self, dt):+        if dt is None and self._hasdst:+            return None++        if self._isdst(dt):+            return self._dst_offset+        else:+            return self._std_offset++    def dst(self, dt):+        if dt is None and self._hasdst:+            return None++        if self._isdst(dt):+            return self._dst_offset - self._std_offset+        else:+            return ZERO++    @tzname_in_python2+    def tzname(self, dt):+        return self._tznames[self._isdst(dt)]++    def is_ambiguous(self, dt):+        """+        Whether or not the "wall time" of a given datetime is ambiguous in this+        zone.++        :param dt:+            A :py:class:`datetime.datetime`, naive or time zone aware.+
… 1602 more lines (truncated)
src/dateutil/tz/win.py +370 lines
--- +++ @@ -0,0 +1,370 @@+# -*- coding: utf-8 -*-+"""+This module provides an interface to the native time zone data on Windows,+including :py:class:`datetime.tzinfo` implementations.++Attempting to import this module on a non-Windows platform will raise an+:py:obj:`ImportError`.+"""+# This code was originally contributed by Jeffrey Harris.+import datetime+import struct++from six.moves import winreg+from six import text_type++try:+    import ctypes+    from ctypes import wintypes+except ValueError:+    # ValueError is raised on non-Windows systems for some horrible reason.+    raise ImportError("Running tzwin on non-Windows system")++from ._common import tzrangebase++__all__ = ["tzwin", "tzwinlocal", "tzres"]++ONEWEEK = datetime.timedelta(7)++TZKEYNAMENT = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"+TZKEYNAME9X = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Time Zones"+TZLOCALKEYNAME = r"SYSTEM\CurrentControlSet\Control\TimeZoneInformation"+++def _settzkeyname():+    handle = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE)+    try:+        winreg.OpenKey(handle, TZKEYNAMENT).Close()+        TZKEYNAME = TZKEYNAMENT+    except WindowsError:+        TZKEYNAME = TZKEYNAME9X+    handle.Close()+    return TZKEYNAME+++TZKEYNAME = _settzkeyname()+++class tzres(object):+    """+    Class for accessing ``tzres.dll``, which contains timezone name related+    resources.++    .. versionadded:: 2.5.0+    """+    p_wchar = ctypes.POINTER(wintypes.WCHAR)        # Pointer to a wide char++    def __init__(self, tzres_loc='tzres.dll'):+        # Load the user32 DLL so we can load strings from tzres+        user32 = ctypes.WinDLL('user32')++        # Specify the LoadStringW function+        user32.LoadStringW.argtypes = (wintypes.HINSTANCE,+                                       wintypes.UINT,+                                       wintypes.LPWSTR,+                                       ctypes.c_int)++        self.LoadStringW = user32.LoadStringW+        self._tzres = ctypes.WinDLL(tzres_loc)+        self.tzres_loc = tzres_loc++    def load_name(self, offset):+        """+        Load a timezone name from a DLL offset (integer).++        >>> from dateutil.tzwin import tzres+        >>> tzr = tzres()+        >>> print(tzr.load_name(112))+        'Eastern Standard Time'++        :param offset:+            A positive integer value referring to a string from the tzres dll.++        .. note::++            Offsets found in the registry are generally of the form+            ``@tzres.dll,-114``. The offset in this case is 114, not -114.++        """+        resource = self.p_wchar()+        lpBuffer = ctypes.cast(ctypes.byref(resource), wintypes.LPWSTR)+        nchar = self.LoadStringW(self._tzres._handle, offset, lpBuffer, 0)+        return resource[:nchar]++    def name_from_string(self, tzname_str):+        """+        Parse strings as returned from the Windows registry into the time zone+        name as defined in the registry.++        >>> from dateutil.tzwin import tzres+        >>> tzr = tzres()+        >>> print(tzr.name_from_string('@tzres.dll,-251'))+        'Dateline Daylight Time'+        >>> print(tzr.name_from_string('Eastern Standard Time'))+        'Eastern Standard Time'++        :param tzname_str:+            A timezone name string as returned from a Windows registry key.++        :return:+            Returns the localized timezone string from tzres.dll if the string+            is of the form `@tzres.dll,-offset`, else returns the input string.+        """+        if not tzname_str.startswith('@'):+            return tzname_str++        name_splt = tzname_str.split(',-')+        try:+            offset = int(name_splt[1])+        except:+            raise ValueError("Malformed timezone string.")++        return self.load_name(offset)+++class tzwinbase(tzrangebase):+    """tzinfo class based on win32's timezones available in the registry."""+    def __init__(self):+        raise NotImplementedError('tzwinbase is an abstract base class')++    def __eq__(self, other):+        # Compare on all relevant dimensions, including name.+        if not isinstance(other, tzwinbase):+            return NotImplemented++        return  (self._std_offset == other._std_offset and+                 self._dst_offset == other._dst_offset and+                 self._stddayofweek == other._stddayofweek and+                 self._dstdayofweek == other._dstdayofweek and+                 self._stdweeknumber == other._stdweeknumber and+                 self._dstweeknumber == other._dstweeknumber and+                 self._stdhour == other._stdhour and+                 self._dsthour == other._dsthour and+                 self._stdminute == other._stdminute and+                 self._dstminute == other._dstminute and+                 self._std_abbr == other._std_abbr and+                 self._dst_abbr == other._dst_abbr)++    @staticmethod+    def list():+        """Return a list of all time zones known to the system."""+        with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as handle:+            with winreg.OpenKey(handle, TZKEYNAME) as tzkey:+                result = [winreg.EnumKey(tzkey, i)+                          for i in range(winreg.QueryInfoKey(tzkey)[0])]+        return result++    def display(self):+        """+        Return the display name of the time zone.+        """+        return self._display++    def transitions(self, year):+        """+        For a given year, get the DST on and off transition times, expressed+        always on the standard time side. For zones with no transitions, this+        function returns ``None``.++        :param year:+            The year whose transitions you would like to query.++        :return:+            Returns a :class:`tuple` of :class:`datetime.datetime` objects,+            ``(dston, dstoff)`` for zones with an annual DST transition, or+            ``None`` for fixed offset zones.+        """++        if not self.hasdst:+            return None++        dston = picknthweekday(year, self._dstmonth, self._dstdayofweek,+                               self._dsthour, self._dstminute,+                               self._dstweeknumber)++        dstoff = picknthweekday(year, self._stdmonth, self._stddayofweek,+                                self._stdhour, self._stdminute,+                                self._stdweeknumber)++        # Ambiguous dates default to the STD side+        dstoff -= self._dst_base_offset++        return dston, dstoff++    def _get_hasdst(self):+        return self._dstmonth != 0++    @property+    def _dst_base_offset(self):+        return self._dst_base_offset_+++class tzwin(tzwinbase):+    """+    Time zone object created from the zone info in the Windows registry++    These are similar to :py:class:`dateutil.tz.tzrange` objects in that+    the time zone data is provided in the format of a single offset rule+    for either 0 or 2 time zone transitions per year.++    :param: name+        The name of a Windows time zone key, e.g. "Eastern Standard Time".+        The full list of keys can be retrieved with :func:`tzwin.list`.+    """++    def __init__(self, name):+        self._name = name++        with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as handle:+            tzkeyname = text_type("{kn}\\{name}").format(kn=TZKEYNAME, name=name)+            with winreg.OpenKey(handle, tzkeyname) as tzkey:+                keydict = valuestodict(tzkey)++        self._std_abbr = keydict["Std"]+        self._dst_abbr = keydict["Dlt"]++        self._display = keydict["Display"]++        # See http://ww_winreg.jsiinc.com/SUBA/tip0300/rh0398.htm+        tup = struct.unpack("=3l16h", keydict["TZI"])+        stdoffset = -tup[0]-tup[1]          # Bias + StandardBias * -1+        dstoffset = stdoffset-tup[2]        # + DaylightBias * -1+        self._std_offset = datetime.timedelta(minutes=stdoffset)+        self._dst_offset = datetime.timedelta(minutes=dstoffset)++        # for the meaning see the win32 TIME_ZONE_INFORMATION structure docs+        # http://msdn.microsoft.com/en-us/library/windows/desktop/ms725481(v=vs.85).aspx+        (self._stdmonth,+         self._stddayofweek,   # Sunday = 0+         self._stdweeknumber,  # Last = 5+         self._stdhour,+         self._stdminute) = tup[4:9]++        (self._dstmonth,+         self._dstdayofweek,   # Sunday = 0+         self._dstweeknumber,  # Last = 5+         self._dsthour,+         self._dstminute) = tup[12:17]
… 123 more lines (truncated)
src/dateutil/tzwin.py +2 lines
--- +++ @@ -0,0 +1,2 @@+# tzwin has moved to dateutil.tz.win+from .tz.win import *
src/dateutil/utils.py +71 lines
--- +++ @@ -0,0 +1,71 @@+# -*- coding: utf-8 -*-+"""+This module offers general convenience and utility functions for dealing with+datetimes.++.. versionadded:: 2.7.0+"""+from __future__ import unicode_literals++from datetime import datetime, time+++def today(tzinfo=None):+    """+    Returns a :py:class:`datetime` representing the current day at midnight++    :param tzinfo:+        The time zone to attach (also used to determine the current day).++    :return:+        A :py:class:`datetime.datetime` object representing the current day+        at midnight.+    """++    dt = datetime.now(tzinfo)+    return datetime.combine(dt.date(), time(0, tzinfo=tzinfo))+++def default_tzinfo(dt, tzinfo):+    """+    Sets the ``tzinfo`` parameter on naive datetimes only++    This is useful for example when you are provided a datetime that may have+    either an implicit or explicit time zone, such as when parsing a time zone+    string.++    .. doctest::++        >>> from dateutil.tz import tzoffset+        >>> from dateutil.parser import parse+        >>> from dateutil.utils import default_tzinfo+        >>> dflt_tz = tzoffset("EST", -18000)+        >>> print(default_tzinfo(parse('2014-01-01 12:30 UTC'), dflt_tz))+        2014-01-01 12:30:00+00:00+        >>> print(default_tzinfo(parse('2014-01-01 12:30'), dflt_tz))+        2014-01-01 12:30:00-05:00++    :param dt:+        The datetime on which to replace the time zone++    :param tzinfo:+        The :py:class:`datetime.tzinfo` subclass instance to assign to+        ``dt`` if (and only if) it is naive.++    :return:+        Returns an aware :py:class:`datetime.datetime`.+    """+    if dt.tzinfo is not None:+        return dt+    else:+        return dt.replace(tzinfo=tzinfo)+++def within_delta(dt1, dt2, delta):+    """+    Useful for comparing two datetimes that may have a negligible difference+    to be considered equal.+    """+    delta = abs(delta)+    difference = dt1 - dt2+    return -delta <= difference <= delta
src/dateutil/zoneinfo/__init__.py +167 lines
--- +++ @@ -0,0 +1,167 @@+# -*- coding: utf-8 -*-+import warnings+import json++from tarfile import TarFile+from pkgutil import get_data+from io import BytesIO++from dateutil.tz import tzfile as _tzfile++__all__ = ["get_zonefile_instance", "gettz", "gettz_db_metadata"]++ZONEFILENAME = "dateutil-zoneinfo.tar.gz"+METADATA_FN = 'METADATA'+++class tzfile(_tzfile):+    def __reduce__(self):+        return (gettz, (self._filename,))+++def getzoneinfofile_stream():+    try:+        return BytesIO(get_data(__name__, ZONEFILENAME))+    except IOError as e:  # TODO  switch to FileNotFoundError?+        warnings.warn("I/O error({0}): {1}".format(e.errno, e.strerror))+        return None+++class ZoneInfoFile(object):+    def __init__(self, zonefile_stream=None):+        if zonefile_stream is not None:+            with TarFile.open(fileobj=zonefile_stream) as tf:+                self.zones = {zf.name: tzfile(tf.extractfile(zf), filename=zf.name)+                              for zf in tf.getmembers()+                              if zf.isfile() and zf.name != METADATA_FN}+                # deal with links: They'll point to their parent object. Less+                # waste of memory+                links = {zl.name: self.zones[zl.linkname]+                         for zl in tf.getmembers() if+                         zl.islnk() or zl.issym()}+                self.zones.update(links)+                try:+                    metadata_json = tf.extractfile(tf.getmember(METADATA_FN))+                    metadata_str = metadata_json.read().decode('UTF-8')+                    self.metadata = json.loads(metadata_str)+                except KeyError:+                    # no metadata in tar file+                    self.metadata = None+        else:+            self.zones = {}+            self.metadata = None++    def get(self, name, default=None):+        """+        Wrapper for :func:`ZoneInfoFile.zones.get`. This is a convenience method+        for retrieving zones from the zone dictionary.++        :param name:+            The name of the zone to retrieve. (Generally IANA zone names)++        :param default:+            The value to return in the event of a missing key.++        .. versionadded:: 2.6.0++        """+        return self.zones.get(name, default)+++# The current API has gettz as a module function, although in fact it taps into+# a stateful class. So as a workaround for now, without changing the API, we+# will create a new "global" class instance the first time a user requests a+# timezone. Ugly, but adheres to the api.+#+# TODO: Remove after deprecation period.+_CLASS_ZONE_INSTANCE = []+++def get_zonefile_instance(new_instance=False):+    """+    This is a convenience function which provides a :class:`ZoneInfoFile`+    instance using the data provided by the ``dateutil`` package. By default, it+    caches a single instance of the ZoneInfoFile object and returns that.++    :param new_instance:+        If ``True``, a new instance of :class:`ZoneInfoFile` is instantiated and+        used as the cached instance for the next call. Otherwise, new instances+        are created only as necessary.++    :return:+        Returns a :class:`ZoneInfoFile` object.++    .. versionadded:: 2.6+    """+    if new_instance:+        zif = None+    else:+        zif = getattr(get_zonefile_instance, '_cached_instance', None)++    if zif is None:+        zif = ZoneInfoFile(getzoneinfofile_stream())++        get_zonefile_instance._cached_instance = zif++    return zif+++def gettz(name):+    """+    This retrieves a time zone from the local zoneinfo tarball that is packaged+    with dateutil.++    :param name:+        An IANA-style time zone name, as found in the zoneinfo file.++    :return:+        Returns a :class:`dateutil.tz.tzfile` time zone object.++    .. warning::+        It is generally inadvisable to use this function, and it is only+        provided for API compatibility with earlier versions. This is *not*+        equivalent to ``dateutil.tz.gettz()``, which selects an appropriate+        time zone based on the inputs, favoring system zoneinfo. This is ONLY+        for accessing the dateutil-specific zoneinfo (which may be out of+        date compared to the system zoneinfo).++    .. deprecated:: 2.6+        If you need to use a specific zoneinfofile over the system zoneinfo,+        instantiate a :class:`dateutil.zoneinfo.ZoneInfoFile` object and call+        :func:`dateutil.zoneinfo.ZoneInfoFile.get(name)` instead.++        Use :func:`get_zonefile_instance` to retrieve an instance of the+        dateutil-provided zoneinfo.+    """+    warnings.warn("zoneinfo.gettz() will be removed in future versions, "+                  "to use the dateutil-provided zoneinfo files, instantiate a "+                  "ZoneInfoFile object and use ZoneInfoFile.zones.get() "+                  "instead. See the documentation for details.",+                  DeprecationWarning)++    if len(_CLASS_ZONE_INSTANCE) == 0:+        _CLASS_ZONE_INSTANCE.append(ZoneInfoFile(getzoneinfofile_stream()))+    return _CLASS_ZONE_INSTANCE[0].zones.get(name)+++def gettz_db_metadata():+    """ Get the zonefile metadata++    See `zonefile_metadata`_++    :returns:+        A dictionary with the database metadata++    .. deprecated:: 2.6+        See deprecation warning in :func:`zoneinfo.gettz`. To get metadata,+        query the attribute ``zoneinfo.ZoneInfoFile.metadata``.+    """+    warnings.warn("zoneinfo.gettz_db_metadata() will be removed in future "+                  "versions, to use the dateutil-provided zoneinfo files, "+                  "ZoneInfoFile object and query the 'metadata' attribute "+                  "instead. See the documentation for details.",+                  DeprecationWarning)++    if len(_CLASS_ZONE_INSTANCE) == 0:+        _CLASS_ZONE_INSTANCE.append(ZoneInfoFile(getzoneinfofile_stream()))+    return _CLASS_ZONE_INSTANCE[0].metadata
tests/__init__.py +0 lines
binary or empty diff
pyyaml pypi
6.0.3 9mo ago nominal
INSTALL-EXEC
latest 6.0.3 versions 40 maintainers 1
5.1
5.1.1
5.1.2
5.2
5.3
5.3.1
5.4
5.4.1
6.0
6.0.1
6.0.2
6.0.3
INSTALL-EXEC
setup.py in sdist uses install-hook (runs at pip install)
warn · snapshot-derived
release diff 6.0.2 → 6.0.3
+1 added · -1 removed · ~9 modified
lib/yaml/__init__.py +1 lines
--- +++ @@ -10,3 +10,3 @@ -__version__ = '6.0.2'+__version__ = '6.0.3' try:
packaging/build/libyaml.sh +15 lines
--- +++ @@ -3,2 +3,10 @@ set -eux++# build the requested version of libyaml locally+echo "::group::fetch libyaml ${LIBYAML_REF}"+git config --global advice.detachedHead false+git clone --branch "$LIBYAML_REF" "$LIBYAML_REPO" libyaml+pushd libyaml+git reset --hard "$LIBYAML_REF"+echo "::endgroup::" @@ -14,10 +22,10 @@ fi-echo "::endgroup::" -# build the requested version of libyaml locally-echo "::group::fetch libyaml ${LIBYAML_REF}"-git config --global advice.detachedHead false-git clone --branch "$LIBYAML_REF" "$LIBYAML_REPO" libyaml-pushd libyaml-git reset --hard "$LIBYAML_REF"+# hack to fix up locally musl1.2 libtool macros+if grep -m 1 alpine /etc/os-release; then+  if ! grep -E 'AC_CONFIG_MACRO_DIRS\(\[m4])' configure.ac; then+    echo 'AC_CONFIG_MACRO_DIRS([m4])' >> configure.ac+    ACLOCAL_PATH=/usr/local/share/libtool/ libtoolize+  fi+fi echo "::endgroup::"
pyproject.toml +0 lines
--- +++ @@ -3,3 +3,2 @@     "setuptools",  # FIXME: declare min/max setuptools versions?-    "wheel",     "Cython; python_version < '3.13'",
setup.py +2 lines
--- +++ @@ -2,3 +2,3 @@ NAME = 'PyYAML'-VERSION = '6.0.2'+VERSION = '6.0.3' DESCRIPTION = "YAML parser and emitter for Python"@@ -36,2 +36,3 @@     "Programming Language :: Python :: 3.13",+    "Programming Language :: Python :: 3.14",     "Programming Language :: Python :: Implementation :: CPython",
six pypi
1.17.0 1y ago nominal
BURST ×2
latest 1.17.0 versions 29 maintainers 1
1.7.2
1.7.3
1.8.0
1.9.0
1.10.0
1.11.0
1.12.0
1.13.0
1.14.0
1.15.0
1.16.0
1.17.0
BURST
2 releases in 28m: 1.6.0, 1.6.1
info · registry-verified · 2014-03-14 · 12y ago
BURST
2 releases in 18m: 1.7.1, 1.7.2
info · registry-verified · 2014-06-09 · 12y ago
release diff 1.16.0 → 1.17.0
+0 added · -0 removed · ~11 modified
six.py +10 lines · 3 flagged
--- +++ @@ -1,2 +1,2 @@-# Copyright (c) 2010-2020 Benjamin Peterson+# Copyright (c) 2010-2024 Benjamin Peterson #@@ -31,3 +31,3 @@ __author__ = "Benjamin Peterson <[email protected]>"-__version__ = "1.16.0"+__version__ = "1.17.0" @@ -265,3 +265,3 @@     MovedAttribute("StringIO", "StringIO", "io"),-    MovedAttribute("UserDict", "UserDict", "collections"),+    MovedAttribute("UserDict", "UserDict", "collections", "IterableUserDict", "UserDict"),     MovedAttribute("UserList", "UserList", "collections"),@@ -437,4 +437,2 @@     MovedAttribute("urlcleanup", "urllib", "urllib.request"),-    MovedAttribute("URLopener", "urllib", "urllib.request"),-    MovedAttribute("FancyURLopener", "urllib", "urllib.request"),     MovedAttribute("proxy_bypass", "urllib", "urllib.request"),@@ -443,2 +441,9 @@ ]+if sys.version_info[:2] < (3, 14):+    _urllib_request_moved_attributes.extend(+        [+            MovedAttribute("URLopener", "urllib", "urllib.request"),+            MovedAttribute("FancyURLopener", "urllib", "urllib.request"),+        ]+    ) for attr in _urllib_request_moved_attributes:
documentation/conf.py +1 lines
--- +++ @@ -35,3 +35,3 @@ project = u"six"-copyright = u"2010-2020, Benjamin Peterson"+copyright = u"2010-2024, Benjamin Peterson" 
setup.cfg +1 lines
--- +++ @@ -8,3 +8,3 @@ [metadata]-license_file = LICENSE+license_files = LICENSE @@ -12,9 +12,2 @@ minversion = 2.2.0-pep8ignore = -	documentation/*.py ALL-	test_six.py ALL-flakes-ignore = -	documentation/*.py ALL-	test_six.py ALL-	six.py UndefinedName 
setup.py +1 lines
--- +++ @@ -1,2 +1,2 @@-# Copyright (c) 2010-2020 Benjamin Peterson+# Copyright (c) 2010-2024 Benjamin Peterson #
test_six.py +17 lines
--- +++ @@ -1,2 +1,2 @@-# Copyright (c) 2010-2020 Benjamin Peterson+# Copyright (c) 2010-2024 Benjamin Peterson #@@ -115,2 +115,11 @@ +have_ndbm = True+try:+    import dbm+except ImportError:+    try:+        import dbm.ndbm+    except ImportError:+        have_ndbm = False+ @pytest.mark.parametrize("item_name",@@ -129,4 +138,8 @@                 pytest.skip("requires tkinter")-        if item_name.startswith("dbm_gnu") and not have_gdbm:+            if item_name == "tkinter_tix" and sys.version_info >= (3, 13):+                pytest.skip("tkinter.tix removed from Python 3.13")+        if item_name == "dbm_gnu" and not have_gdbm:             pytest.skip("requires gdbm")+        if item_name == "dbm_ndbm":+            pytest.skip("requires ndbm")         raise@@ -222,4 +235,4 @@     from six.moves import getoutput-    output = getoutput('echo "foo"')-    assert output == 'foo'+    output = getoutput('dir' if sys.platform.startswith('win') else 'echo foo')+    assert output != '' 
typing-extensions pypi
4.16.0 10d ago nominal
critical-tier no findings
latest 4.16.0 versions 52 maintainers 1 critical-tier (snapshotted)
4.10.0
4.11.0
4.12.0
4.12.1
4.12.2
4.13.0
4.13.1
4.13.2
4.14.0
4.14.1
4.15.0
4.16.0
CLEAN
no findings — nominal
release diff 4.15.0 → 4.16.0
+0 added · -0 removed · ~5 modified
src/test_typing_extensions.py +465 lines · 4 flagged
--- +++ @@ -12,2 +12,3 @@ import itertools+import os import pickle@@ -104,2 +105,3 @@     runtime_checkable,+    sentinel,     type_repr,@@ -133,2 +135,22 @@ TYPING_3_14_0 = sys.version_info[:3] >= (3, 14, 0)++TYPING_3_15_0 = sys.version_info[:3] >= (3, 15, 0)++TYPING_3_15_0_BETA_1 = sys.version_info[:5] == (3, 15, 0, 'beta', 1)++# We cannot control the repr of `TypeVarTuple` on versions of Python+# where `typing_extensions.TypeVarTuple()` does not return an instance+# of `typing_extensions.TypeVarTuple`. At time of writing, that's Python+# versions 3.11-3.14 inclusive (but not 3.10 or 3.15+). The exact version+# range has changed in the past and may do so again in the future.+#+# Note that we do not do an `isinstance()` check here because+# `typing_extensions.TypeVarTuple` does some trickery to pretend that+# instances of `typing.TypeVar` are also instances of+# `typing_extensions.TypeVarTuple` on Python 3.11-3.14.+# (Possibly we're being a little too clever for our own good there.)+GOOD_TYPEVARTUPLE_REPR_EXPECTED = (+    type(typing_extensions.TypeVarTuple("Ts"))+    is typing_extensions.TypeVarTuple+) @@ -533,2 +555,10 @@ +    @skipUnless(TYPING_3_10_0, "PEP 604 has yet to be")+    def test_or(self):+        self.assertEqual(self.bottom_type | int, Union[self.bottom_type, int])+        self.assertEqual(int | self.bottom_type, Union[int, self.bottom_type])++        self.assertEqual(get_args(self.bottom_type | int), (self.bottom_type, int))+        self.assertEqual(get_args(int | self.bottom_type), (int, self.bottom_type))+ @@ -806,2 +836,21 @@         self.assertEqual(D.inited, 3)++    def test_existing_init_subclass_in_sibling_base(self):+        @deprecated("A will go away soon")+        class A:+            pass+        class B:+            def __init_subclass__(cls, x):+                super().__init_subclass__()+                cls.inited = x++        with self.assertWarnsRegex(DeprecationWarning, "A will go away soon"):+            class C(A, B, x=42):+                pass+        self.assertEqual(C.inited, 42)++        with self.assertWarnsRegex(DeprecationWarning, "A will go away soon"):+            class D(B, A, x=42):+                pass+        self.assertEqual(D.inited, 42) @@ -1731,7 +1780,5 @@             Optional[List[str]]     : Optional[List[str]],-            Optional[annotation]     : Optional[annotation],+            Optional[annotation]    : Optional[annotation],             Union[str, None, str]   : Optional[str],             Unpack[Tuple[int, None]]: Unpack[Tuple[int, None]],-            # Note: A starred *Ts will use typing.Unpack in 3.11+ see Issue #485-            Unpack[Ts]              : Unpack[Ts],         }@@ -1751,3 +1798,11 @@             Annotated["annotation", "nested"]  : Annotated[Union[int, None], "data", "nested"],+            # Note: A starred *Ts will use typing.Unpack in 3.11+ see Issue #485+            Unpack[Ts]                         : Unpack[Ts],         }+        # Note: A starred *Ts will use typing.Unpack in 3.11+ see Issue #485+        if TYPING_3_15_0:+            # The repr is typing.Unpack[~Ts], which cannot be evaluated.+            do_not_stringify_cases[Unpack[Ts]] = Unpack[Ts]+        else:+            cases[Unpack[Ts]] = Unpack[Ts]         if TYPING_3_10_0:  # cannot construct UnionTypes before 3.10@@ -2212,2 +2267,35 @@ +    def test_setattr(self):+        origin = collections.abc.Generator+        alias = typing_extensions.Generator+        original_name = alias._name++        def cleanup():+            for obj in origin, alias:+                for attr in 'foo', '__dunder__':+                    try:+                        delattr(obj, attr)+                    except Exception:+                        pass+            try:+                alias._name = original_name+            except Exception:+                pass++        self.addCleanup(cleanup)++        # Attribute assignment on generic alias sets attribute on origin+        alias.foo = 1+        self.assertEqual(alias.foo, 1)+        self.assertEqual(origin.foo, 1)+        # Except for dunders...+        alias.__dunder__ = 2+        self.assertEqual(alias.__dunder__, 2)+        self.assertRaises(AttributeError, lambda: origin.__dunder__)++        # ...and certain known attributes+        alias._name = "NewName"+        self.assertEqual(alias._name, "NewName")+        self.assertRaises(AttributeError, lambda: origin._name)+ @@ -2380,2 +2468,12 @@                 ...++    def test_module_with_incomplete_sys(self):+        def does_not_exist(*args):+            raise AttributeError+        with (+            patch("sys._getframemodulename", does_not_exist, create=True),+            patch("sys._getframe", does_not_exist, create=True),+        ):+            X = NewType("X", int)+            self.assertEqual(X.__module__, None) @@ -3801,3 +3899,9 @@ +        class CustomPathLikeProtocol(os.PathLike, Protocol):+            pass+         class CustomContextManager(typing.ContextManager, Protocol):+            pass++        class CustomAsyncIterator(typing.AsyncIterator, Protocol):             pass@@ -4440,4 +4544,8 @@                     )-                    base_anno = typing.ForwardRef("int", module="builtins") if base_future else int-                    child_anno = typing.ForwardRef("int", module="builtins") if child_future else int+                    if sys.version_info >= (3, 14):+                        base_anno = typing.ForwardRef("int", module="builtins", owner=base) if base_future else int+                        child_anno = typing.ForwardRef("int", module="builtins", owner=child) if child_future else int+                    else:+                        base_anno = typing.ForwardRef("int", module="builtins") if base_future else int+                        child_anno = typing.ForwardRef("int", module="builtins") if child_future else int                     self.assertEqual(base.__annotations__, {'base': base_anno})@@ -4569,2 +4677,43 @@                         pass++    def test_keys_inheritance_with_same_name(self):+        class NotTotal(TypedDict, total=False):+            a: int++        class Total(NotTotal):+            a: int++        self.assertEqual(NotTotal.__required_keys__, frozenset())+        self.assertEqual(NotTotal.__optional_keys__, frozenset(['a']))+        self.assertEqual(Total.__required_keys__, frozenset(['a']))+        self.assertEqual(Total.__optional_keys__, frozenset())++        class Base(TypedDict):+            a: NotRequired[int]+            b: Required[int]++        class Child(Base):+            a: Required[int]+            b: NotRequired[int]++        self.assertEqual(Base.__required_keys__, frozenset(['b']))+        self.assertEqual(Base.__optional_keys__, frozenset(['a']))+        self.assertEqual(Child.__required_keys__, frozenset(['a']))+        self.assertEqual(Child.__optional_keys__, frozenset(['b']))++    def test_multiple_inheritance_with_same_key(self):+        class Base1(TypedDict):+            a: NotRequired[int]++        class Base2(TypedDict):+            a: Required[str]++        class Child(Base1, Base2):+            pass++        # Last base wins+        self.assertEqual(Child.__annotations__, {'a': Required[str]})+        self.assertEqual(Child.__required_keys__, frozenset(['a']))+        self.assertEqual(Child.__optional_keys__, frozenset())+ @@ -5299,2 +5448,13 @@ +    @skipUnless(TYPING_3_10_0, "PEP 604 has yet to be")+    def test_or(self):+        class TD(TypedDict):+            a: int++        self.assertEqual(TD | int, Union[TD, int])+        self.assertEqual(int | TD, Union[int, TD])++        self.assertEqual(get_args(TD | int), (TD, int))+        self.assertEqual(get_args(int | TD), (int, TD))+ class AnnotatedTests(BaseTestCase):@@ -5519,2 +5679,15 @@             BA2+        )++    @skipUnless(TYPING_3_11_0, "TODO: evaluate nested forward refs in Python < 3.11")+    def test_get_type_hints_genericalias(self):+        def foobar(x: list['X']): ...+        X = Annotated[int, (1, 10)]+        self.assertEqual(+            get_type_hints(foobar, globals(), locals()),+            {'x': list[int]}+        )+        self.assertEqual(+            get_type_hints(foobar, globals(), locals(), include_extras=True),+            {'x': list[Annotated[int, (1, 10)]]}         )@@ -5975,2 +6148,7 @@ +    def test_subclass(self):+        with self.assertRaises(TypeError):+            class MyParamSpec(ParamSpec):+                pass+ @@ -6133,2 +6311,43 @@ +    def test_isinstance_results_unaffected_by_presence_of_tracing_function(self):+        # See https://github.com/python/typing_extensions/issues/661++        code = textwrap.dedent(+            """\+            import sys, typing++            def trace_call(*args):+                return trace_call
… 410 more lines (truncated)
pyproject.toml +3 lines
--- +++ @@ -8,3 +8,3 @@ name = "typing_extensions"-version = "4.15.0"+version = "4.16.0" description = "Backported and Experimental Type Hints for Python 3.9+"@@ -42,2 +42,3 @@     "Programming Language :: Python :: 3.14",+    "Programming Language :: Python :: 3.15",     "Topic :: Software Development",@@ -92,3 +93,2 @@     "UP035",-    "UP038",     "UP045",  # X | None instead of Optional[X]@@ -125,2 +125,3 @@ fail_under = 96+precision = 2 show_missing = true
src/typing_extensions.py +232 lines
--- +++ @@ -93,2 +93,3 @@     'Protocol',+    'sentinel',     'Sentinel',@@ -150,3 +151,2 @@     'no_type_check',-    'no_type_check_decorator', ]@@ -162,13 +162,117 @@ ++def _caller(depth=1, default='__main__'):+    try:+        return sys._getframemodulename(depth + 1) or default+    except AttributeError:  # For platforms without _getframemodulename()+        pass+    try:+        return sys._getframe(depth + 1).f_globals.get('__name__', default)+    except (AttributeError, ValueError):  # For platforms without _getframe()+        pass+    return None+++# Placeholder for sentinel methods, because sentinels can not have their own sentinels+_sentinel_placeholder = object()++if hasattr(builtins, "sentinel"):  # 3.15++    sentinel = builtins.sentinel+else:+    class sentinel:+        """Create a unique sentinel object.++        *name* should be the name of the variable to which the return value+        shall be assigned.+        """++        def __init__(+            self,+            __name: str = _sentinel_placeholder,+            __repr: typing.Optional[str] = _sentinel_placeholder,+            /,+            *,+            repr: typing.Optional[str] = None,+            name: str = _sentinel_placeholder,+        ) -> None:+            if name is not _sentinel_placeholder:+                warnings.warn(+                    "Passing 'name' as a keyword argument is deprecated; "+                    "pass it positionally instead.",+                    DeprecationWarning,+                    stacklevel=2,+                )+                __name = name+            if __name is _sentinel_placeholder:+                raise TypeError("First parameter 'name' is required")+            if __repr is not _sentinel_placeholder:+                warnings.warn(+                    "Passing 'repr' as a positional argument is deprecated; "+                    "pass it by keyword instead.",+                    DeprecationWarning,+                    stacklevel=2,+                )+                repr = __repr++            self._name = __name+            self._repr = repr if repr is not None else __name++            # For pickling as a singleton:+            self.__module__ = _caller()++        def __init_subclass__(cls):+            warnings.warn(+                "Subclassing sentinel is deprecated "+                "and will be disallowed in Python 3.15",+                DeprecationWarning,+                stacklevel=2,+            )+            super().__init_subclass__()++        def __setattr__(self, attr: str, value: object) -> None:+            if attr not in {"_name", "_repr", "__module__"}:+                warnings.warn(+                    f"Setting attribute {attr!r} on sentinel objects is deprecated "+                    "and will be disallowed in Python 3.15.",+                    DeprecationWarning,+                    stacklevel=2,+                )+            super().__setattr__(attr, value)++        @property+        def __name__(self) -> str:+            return self._name++        @__name__.setter+        def __name__(self, value: str) -> None:+            self._name = value++        def __repr__(self) -> str:+            return self._repr++        if sys.version_info < (3, 11):+            # The presence of this method convinces typing._type_check+            # that Sentinels are types.+            def __call__(self, *args, **kwargs):+                raise TypeError(f"{type(self).__name__!r} object is not callable")++        # Breakpoint: https://github.com/python/cpython/pull/21515+        if sys.version_info >= (3, 10):+            def __or__(self, other):+                return typing.Union[self, other]++            def __ror__(self, other):+                return typing.Union[other, self]++        def __reduce__(self) -> str:+            """Reduce this sentinel to a singleton."""+            return self.__name__  # Module is taken from the __module__ attribute++Sentinel = sentinel++_marker = sentinel("sentinel")++ # The functions below are modified copies of typing internal helpers. # They are needed by _ProtocolMeta and they provide support for PEP 646.---class _Sentinel:-    def __repr__(self):-        return "<sentinel>"---_marker = _Sentinel()- @@ -526,3 +630,5 @@     class _SpecialGenericAlias(typing._SpecialGenericAlias, _root=True):-        def __init__(self, origin, nparams, *, inst=True, name=None, defaults=()):+        def __init__(self, origin, nparams, *, defaults, inst=True, name=None):+            assert nparams > 0, "`nparams` must be a positive integer"+            assert defaults, "Must always specify a non-empty sequence for `defaults`"             super().__init__(origin, nparams, inst=inst, name=name)@@ -544,4 +650,3 @@             if (-                self._defaults-                and len(params) < self._nparams+                len(params) < self._nparams                 and len(params) + len(self._defaults) >= self._nparams@@ -552,8 +657,3 @@             if actual_len != self._nparams:-                if self._defaults:-                    expected = f"at least {self._nparams - len(self._defaults)}"-                else:-                    expected = str(self._nparams)-                if not self._nparams:-                    raise TypeError(f"{self} is not a generic class")+                expected = f"at least {self._nparams - len(self._defaults)}"                 raise TypeError(@@ -589,6 +689,9 @@         'Callable', 'Awaitable', 'Iterable', 'Iterator', 'AsyncIterable',-        'Hashable', 'Sized', 'Container', 'Collection', 'Reversible', 'Buffer',+        'AsyncIterator', 'Hashable', 'Sized', 'Container', 'Collection',+        'Reversible', 'Buffer',     ],     'contextlib': ['AbstractContextManager', 'AbstractAsyncContextManager'],+    'io': ['Reader', 'Writer'],     'typing_extensions': ['Buffer'],+    'os': ['PathLike'], }@@ -614,18 +717,8 @@ -def _caller(depth=1, default='__main__'):-    try:-        return sys._getframemodulename(depth + 1) or default-    except AttributeError:  # For platforms without _getframemodulename()-        pass-    try:-        return sys._getframe(depth + 1).f_globals.get('__name__', default)-    except (AttributeError, ValueError):  # For platforms without _getframe()-        pass-    return None-- # `__match_args__` attribute was removed from protocol members in 3.13, # we want to backport this change to older Python versions.-# Breakpoint: https://github.com/python/cpython/pull/110683-if sys.version_info >= (3, 13):+# 3.14 additionally added `io.Reader`, `io.Writer` and `os.PathLike` to+# the list of allowed protocol allowlist.+# https://github.com/python/cpython/issues/127647+if sys.version_info >= (3, 14):     Protocol = typing.Protocol@@ -1040,6 +1133,6 @@ # Update this to something like >=3.13.0b1 if and when-# PEP 728 is implemented in CPython-_PEP_728_IMPLEMENTED = False--if _PEP_728_IMPLEMENTED:+# PEP 764 is implemented in CPython+_PEP_764_IMPLEMENTED = False++if _PEP_764_IMPLEMENTED:     # The standard library TypedDict in Python 3.9.0/1 does not honour the "total"@@ -1053,3 +1146,4 @@     # Also on 3.13, PEP 705 adds the ReadOnly[] qualifier.-    # PEP 728 (still pending) makes more changes.+    # PEP 728 (Python 3.15+) adds the `extra_items` and `closed` keywords.+    # PEP 764 (still pending) allows the `TypedDict` special form to be subscripted.     TypedDict = typing.TypedDict@@ -1157,4 +1251,10 @@                     annotations.update(base_dict.get('__annotations__', {}))-                required_keys.update(base_dict.get('__required_keys__', ()))-                optional_keys.update(base_dict.get('__optional_keys__', ()))+                base_required = base_dict.get('__required_keys__', set())+                required_keys |= base_required+                optional_keys -= base_required++                base_optional = base_dict.get('__optional_keys__', set())+                required_keys -= base_optional+                optional_keys |= base_optional+                 readonly_keys.update(base_dict.get('__readonly_keys__', ()))@@ -1186,9 +1286,15 @@                 if Required in qualifiers:+                    is_required = True+                elif NotRequired in qualifiers:+                    is_required = False+                else:+                    is_required = total++                if is_required:                     required_keys.add(annotation_key)-                elif NotRequired in qualifiers:-                    optional_keys.add(annotation_key)-                elif total:-                    required_keys.add(annotation_key)+                    optional_keys.discard(annotation_key)                 else:                     optional_keys.add(annotation_key)+                    required_keys.discard(annotation_key)+                 if ReadOnly in qualifiers:@@ -1800,3 +1906,3 @@                                              contravariant=contravariant)-                paramspec.__infer_variance__ = infer_variance+                paramspec.__infer_variance__ = bool(infer_variance) @@ -1896,6 +2002,3 @@
… 238 more lines (truncated)

No packages match — nothing recent right now. Clear the filters to see the full watchlist.

alert feed
1d ago · eslint — BURST ACTIVE registry-verified
2 releases in 41m: 9.39.5, 10.7.0
4d ago · @types/node — BURST ACTIVE registry-verified
4 releases in 0m: 26.1.1, 25.9.5, 24.13.3, 22.20.1
6d ago · charset-normalizer — YANK ACTIVE registry-verified
3.4.8 marked yanked (still downloadable)
6d ago · grpcio-status — YANK ACTIVE registry-verified
1.82.0 marked yanked (still downloadable)
13d ago · prettier — BURST ACTIVE registry-verified
2 releases in 9m: 3.9.2, 3.9.3
23d ago · @types/node — BURST ACTIVE registry-verified
2 releases in 0m: 26.0.0, 25.9.4
28d ago · axios — BURST ACTIVE registry-verified
2 releases in 0m: 0.33.0, 1.18.0
1mo ago · @types/node — BURST ACTIVE registry-verified
4 releases in 0m: 25.9.3, 24.13.2, 22.19.21, 20.19.43
1mo ago · @types/node — BURST ACTIVE registry-verified
4 releases in 0m: 25.9.2, 24.13.1, 22.19.20, 20.19.42
1mo ago · @types/react — BURST ACTIVE registry-verified
2 releases in 0m: 19.2.17, 18.3.31
1mo ago · @types/react — BURST ACTIVE registry-verified
3 releases in 0m: 19.2.16, 18.3.30, 17.0.93
1mo ago · react-dom — BURST ACTIVE registry-verified
3 releases in 4m: 19.0.7, 19.1.8, 19.2.7
1mo ago · react — BURST ACTIVE registry-verified
3 releases in 4m: 19.0.7, 19.1.8, 19.2.7
1mo ago · @babel/core — BURST ACTIVE registry-verified
2 releases in 22m: 7.29.6, 7.29.7
1mo ago · @types/react — BURST ACTIVE registry-verified
5 releases in 0m: 19.2.15, 18.3.29, 17.0.92, 16.14.70, 15.7.37
2mo ago · @types/node — BURST ACTIVE registry-verified
3 releases in 0m: 24.12.4, 22.19.19, 20.19.41
2mo ago · @types/node — BURST ACTIVE registry-verified
4 releases in 0m: 25.6.2, 24.12.3, 22.19.18, 20.19.40
2mo ago · react-dom — BURST ACTIVE registry-verified
3 releases in 1m: 19.2.6, 19.1.7, 19.0.6
2mo ago · react — BURST ACTIVE registry-verified
3 releases in 1m: 19.2.6, 19.1.7, 19.0.6
2mo ago · axios — BURST ACTIVE registry-verified
2 releases in 4m: 1.15.1, 0.31.1
3mo ago · react-dom — BURST historic registry-verified
3 releases in 1m: 19.2.5, 19.1.6, 19.0.5
3mo ago · react — BURST historic registry-verified
3 releases in 1m: 19.2.5, 19.1.6, 19.0.5
3mo ago · @types/node — BURST historic registry-verified
4 releases in 0m: 25.5.2, 24.12.2, 22.19.17, 20.19.39
3mo ago · @types/node — BURST historic registry-verified
4 releases in 0m: 25.5.1, 24.12.1, 22.19.16, 20.19.38
3mo ago · ts-jest — BURST historic registry-verified
3 releases in 49m: 29.4.7, 29.4.8, 29.4.9
3mo ago · axios — DELETION historic registry-verified
0.30.4 published then removed
3mo ago · axios — DELETION historic registry-verified
1.14.1 published then removed
3mo ago · axios — BURST historic registry-verified
2 releases in 39m: 1.14.1, 0.30.4
3mo ago · pydantic-core — YANK historic registry-verified
2.44.0 marked yanked (still downloadable)
3mo ago · pydantic-core — YANK historic registry-verified
2.43.0 marked yanked (still downloadable)
4mo ago · @types/node — BURST historic registry-verified
4 releases in 1m: 25.3.5, 24.11.2, 22.19.15, 20.19.37
4mo ago · @types/node — BURST historic registry-verified
4 releases in 1m: 25.3.4, 24.11.1, 22.19.14, 20.19.36
4mo ago · @types/node — BURST historic registry-verified
4 releases in 1m: 25.3.2, 24.10.15, 22.19.13, 20.19.35
4mo ago · @types/node — BURST historic registry-verified
4 releases in 1m: 25.3.1, 24.10.14, 22.19.12, 20.19.34
4mo ago · rollup — BURST historic registry-verified
2 releases in 34m: 2.80.0, 3.30.0
4mo ago · grpcio-status — YANK historic registry-verified
1.78.1 marked yanked (still downloadable)
5mo ago · @types/node — BURST historic registry-verified
3 releases in 0m: 25.2.3, 24.10.13, 22.19.11
5mo ago · setuptools — BURST historic registry-verified
2 releases in 56m: 75.3.4, 82.0.0
5mo ago · @types/node — BURST historic registry-verified
4 releases in 1m: 25.2.2, 24.10.12, 22.19.10, 20.19.33
5mo ago · @types/node — BURST historic registry-verified
4 releases in 0m: 25.2.1, 24.10.11, 22.19.9, 20.19.32