diff --git a/Makefile b/Makefile index 48e4cc6..bb4b715 100644 --- a/Makefile +++ b/Makefile @@ -32,3 +32,4 @@ watch: develop ${PROJECT}.egg-info/PKG-INFO: pyproject.toml @mkdir -p ${VIRTUAL_ENV}/lib/pip-cache pip install --cache-dir "${VIRTUAL_ENV}/lib/pip-cache" -Ue ".[${USE}]" + diff --git a/pyproject.toml b/pyproject.toml index c089a25..1ec0376 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,41 +38,43 @@ Repository = "https://github.com/marrow/uri.git" http = ['requests'] # Support for the http:// and https:// protocols. test = [ 'pytest', # Test collector and extensible runner. + 'pytest-black', # Syntax linting. 'pytest-cov[toml]', # Coverage reporting. 'pytest-flakes', # Syntax validation. 'pytest-isort', # Import ordering. 'pytest-mypy', # Static type validation. - 'pytest-black', # Syntax linting. + 'requests', # Support for the http:// and https:// protocols. 'types-setuptools', # Typing stubs. 'webob', # Request WSGI environment mocking. - 'requests', # Support for the http:// and https:// protocols. ] development = [ # Development-time dependencies. + 'bandit', # Automated security analysis. + 'black', # Syntax linting. + 'build[virtualenv]', # Python packaging build tool. + 'cibuildwheel', # Build automation. + 'e', # Try: python3 -me + 'mypy', # Type hinting analysis. + 'pre-commit', # Commit hooks for code quality. + 'ptipython', # Enhanced interactive REPL shell. 'pytest', # Test collector and extensible runner. + 'pytest-black', # Syntax linting. 'pytest-cov[toml]', # Coverage reporting. 'pytest-flakes', # Syntax validation. 'pytest-isort', # Import ordering. 'pytest-mypy', # Static type validation. - 'pytest-black', # Syntax linting. - 'types-setuptools', # Typing stubs. - 'webob', # Request WSGI environment mocking. 'requests', # Support for the http:// and https:// protocols. - 'pre-commit', # Commit hooks for code quality. - 'mypy', # Type hinting analysis. 'rope', # Project symbols collection. - 'bandit', # Automated security analysis. - 'black', # Syntax linting. - 'ptipython', # Enhanced interactive REPL shell. - 'e', # Try: python3 -me - 'build[virtualenv]', # Python packaging build tool. - 'wheel', # "Wheel" package format support. - 'cibuildwheel', # Build automation. 'twine', # Python package release tool. + 'types-setuptools', # Typing stubs. + 'webob', # Request WSGI environment mocking. + 'wheel', # "Wheel" package format support. ] [project.entry-points."uri.scheme"] # https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml # https://www.w3.org/wiki/UriSchemes +# https://github.com/APSL/uri/commit/709b4b73daae7b8651b92fd4fa63af41c4db2986 +# https://docs.mongodb.com/manual/reference/connection-string file = 'uri.scheme:URLScheme' ftp = 'uri.scheme:URLScheme' http = 'uri.scheme:URLScheme' @@ -81,12 +83,11 @@ irc = 'uri.scheme:URLScheme' ldap = 'uri.scheme:URLScheme' telnet = 'uri.scheme:URLScheme' sftp = 'uri.scheme:URLScheme' -# Care of https://github.com/APSL/uri/commit/709b4b73daae7b8651b92fd4fa63af41c4db2986 mysql = 'uri.scheme:URLScheme' redis = 'uri.scheme:URLScheme' postgres = 'uri.scheme:URLScheme' postgresql = 'uri.scheme:URLScheme' -mongodb = 'uri.scheme:URLScheme' # https://docs.mongodb.com/manual/reference/connection-string +mongodb = 'uri.scheme:URLScheme' [tool.setuptools_scm] diff --git a/uri/bucket.py b/uri/bucket.py index c1c9af1..7322020 100644 --- a/uri/bucket.py +++ b/uri/bucket.py @@ -58,5 +58,7 @@ def __len__(self): def __str__(self): # Certain symbols are explicitly allowed, ref: http://pretty-rfc.herokuapp.com/RFC3986#query - iterator = (quote_plus(i.encode('utf8')).replace('%3F', '?').replace('%2F', '/') for i in self) if self.valid else self + # XXX: __import__('wdb').set_trace() + iterator = (quote_plus(i.encode('utf8')).replace(b'%3F', b'?').replace(b'%2F', b'/') for i in self) if self.valid else self return self.sep.join(iterator) + diff --git a/uri/part/base.py b/uri/part/base.py index 2c1df31..1db2a07 100644 --- a/uri/part/base.py +++ b/uri/part/base.py @@ -3,7 +3,7 @@ class Part: - """Descriptor protocol objects for combantorial string parts with validation.""" + """Descriptor protocol objects for combinatorial string parts with validation.""" __slots__ = () diff --git a/uri/uri.py b/uri/uri.py index 59afcf6..2eed9ab 100644 --- a/uri/uri.py +++ b/uri/uri.py @@ -54,7 +54,7 @@ class URI: # Additional Compound Interfaces uri = URIPart(__parts__) # Whole-URI retrieval or storage as string. - safe_uri = URIPart(__safe_parts__, False) # URI retrieval without password component, useful for logging. + safe = safe_uri = URIPart(__safe_parts__, False) # URI retrieval without password component, useful for logging. base = BasePart() summary = URIPart(('host', 'path'), False) resource = URIPart(('path', 'query', 'fragment'), False)