diff options
author | Sharlatan Hellseher <[email protected]> | 2025-01-19 11:49:40 +0000 |
---|---|---|
committer | Ricardo Wurmus <[email protected]> | 2025-01-20 21:38:04 +0100 |
commit | 746590357dc874b28d9eaaaf35723807b3b78056 (patch) | |
tree | ccbb43c6b62dea2f480334fad51f9cf9ea47a19c /gnu/packages/python-web.scm | |
parent | 94eca566b08976621d6557a283e4af19dda76f54 (diff) |
gnu: Add python-url-normalize.
* gnu/packages/python-web.scm (python-url-normalize): New variable.
Change-Id: Ic86b7d27451ef994b980efc1fb7faa2a813f4e0a
Diffstat (limited to 'gnu/packages/python-web.scm')
-rw-r--r-- | gnu/packages/python-web.scm | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index 6796e931d4..417c33d4d5 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -2618,6 +2618,57 @@ high-speed transfers via libcurl and frequently outperforms alternatives.") ;; under the terms of LGPLv2.1+ or Expat. (license (list license:lgpl2.1+ license:expat)))) +(define-public python-url-normalize + (package + (name "python-url-normalize") + (version "1.4.3") + (source + (origin + (method git-fetch) ; no tests in PyPI release + (uri (git-reference + (url "https://github.com/niksite/url-normalize") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "09nac5nh94x0n4bfazjfxk96b20mfsx6r1fnvqv85gkzs0rwqkaq")))) + (build-system pyproject-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'use-poetry-core + (lambda _ + ;; Patch to use the core poetry API. + (substitute* "pyproject.toml" + (("poetry.masonry.api") "poetry.core.masonry.api"))))))) + (native-inputs + (list python-poetry-core + python-pytest + python-pytest-flakes + python-pytest-cov + python-pytest-socket)) + (home-page "https://github.com/niksite/url-normalize") + (synopsis "URL normalization for Python") + (description + "This package provides a URI Normalization function with following +features: +@itemize +@item take care of IDN domains +@item always provide the URI scheme in lowercase characters +@item always provide the host, if any, in lowercase characters +@item only perform percent-encoding where it is essential +@item always use uppercase A-through-F characters when percent-encoding +@item prevent dot-segments appearing in non-relative URI paths +@item for schemes that define a default authority, use an empty authority if +the default is desired +@item for schemes that define an empty path to be equivalent to a path of +@code{/}, use @code{/} +@item for schemes that define a port, use an empty port if the default is +desired +@item all portions of the URI must be utf-8 encoded NFC from Unicode strings +@end itemize") + (license license:expat))) + (define-public python-webencodings (package (name "python-webencodings") |