authcaptureproxy 1.3.6__tar.gz → 1.3.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,51 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v1.3.7 (2026-02-17)
5
+
6
+ ### Bug Fixes
7
+
8
+ * fix: `home-page` key error in metadata (#45)
9
+
10
+ * Update __init__.py
11
+
12
+ Replace:
13
+ ```
14
+ __uri__ = metadata["home-page"]
15
+ ```
16
+ with:
17
+ ```__uri__ = metadata.get("home-page") or metadata.get("Home-Page", "")
18
+ ```
19
+
20
+ * Address nitpick comment
21
+
22
+ * fix: typing fails: PackageMetadata has no attribute "get" [attr-defined]
23
+
24
+ Use Message semantics (.get() is typed)
25
+
26
+ * Address netpick comments
27
+
28
+ * fix: ERROR collecting tests/test_cli.py in build 3.11
29
+
30
+ * fix: build 3.10 error: Incompatible types in assignment (expression has type "PackageMetadata", variable has type "Optional[Message]") [assignment]
31
+
32
+ * Fix typing: stop calling .get() on PackageMetadata (for mypy)
33
+
34
+ * chore: bump pre-commit to >=3.2 for hook stage compatibility ([`6da3ced`](https://github.com/alandtse/auth_capture_proxy/commit/6da3cedac5f75d0ca635472c5e2ea85958d3f306))
35
+
36
+ ### Build System
37
+
38
+ * build: fix tox ([`e6410bb`](https://github.com/alandtse/auth_capture_proxy/commit/e6410bb11cb4d7ee400b59feb995a741c8990a6e))
39
+
40
+ ### Chores
41
+
42
+ * chore: fix config version ([`e6d48c6`](https://github.com/alandtse/auth_capture_proxy/commit/e6d48c6887d070c7f170d3494af2d13fdbb3a58f))
43
+
44
+ ### Refactoring
45
+
46
+ * refactor: migrate to pep621 ([`bd2f8a8`](https://github.com/alandtse/auth_capture_proxy/commit/bd2f8a88b74e113a748bf173a30c45bcd5d02ff9))
47
+
48
+
4
49
  ## v1.3.6 (2026-02-08)
5
50
 
6
51
  ### Bug Fixes
@@ -1,40 +1,35 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: authcaptureproxy
3
- Version: 1.3.6
3
+ Version: 1.3.8
4
4
  Summary: A Python project to create a proxy to capture authentication information from a webpage. This is useful to capture oauth login details without access to a third-party oauth.
5
- License: Apache-2.0
5
+ License-Expression: Apache-2.0
6
6
  License-File: LICENSE.txt
7
7
  Author: Alan D. Tse
8
+ Author-email: alandtse@gmail.com
8
9
  Maintainer: Alan D. Tse
9
- Requires-Python: >=3.10,<4.0
10
+ Maintainer-email: alandtse@gmail.com
11
+ Requires-Python: >=3.11
10
12
  Classifier: Development Status :: 3 - Alpha
11
- Classifier: Environment :: Console
12
- Classifier: Intended Audience :: Developers
13
- Classifier: License :: OSI Approved :: Apache Software License
14
13
  Classifier: Natural Language :: English
15
- Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3 :: Only
18
15
  Classifier: Programming Language :: Python :: 3.11
19
16
  Classifier: Programming Language :: Python :: 3.12
20
17
  Classifier: Programming Language :: Python :: 3.13
21
18
  Classifier: Programming Language :: Python :: 3.14
22
- Classifier: Programming Language :: Python :: 3 :: Only
23
- Classifier: Programming Language :: Python :: 3.8
24
- Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Intended Audience :: Developers
20
+ Classifier: Operating System :: OS Independent
21
+ Classifier: Environment :: Console
25
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
- Provides-Extra: all
27
- Requires-Dist: aiohttp (>=3,<4)
28
- Requires-Dist: beautifulsoup4 (>=4,<5)
23
+ Requires-Dist: aiohttp (>=3.0.0,<4.0.0)
24
+ Requires-Dist: beautifulsoup4 (>=4.0.0,<5.0.0)
29
25
  Requires-Dist: httpx
30
- Requires-Dist: multidict (>=6,<7)
26
+ Requires-Dist: multidict (>=6.0.0,<7.0.0)
31
27
  Requires-Dist: typer (>=0.3,<1.0)
32
- Requires-Dist: yarl (>=1,<2)
33
- Project-URL: CI, https://github.com/alandtse/auth_capture_proxy/actions
28
+ Requires-Dist: yarl (>=1.0.0,<2.0.0)
29
+ Project-URL: Bug Tracker, https://github.com/alandtse/auth_capture_proxy/issues
34
30
  Project-URL: Documentation, https://auth_capture_proxy.readthedocs.io
35
31
  Project-URL: Download, https://pypi.org/project/authcaptureproxy/
36
32
  Project-URL: Homepage, https://github.com/alandtse/auth_capture_proxy
37
- Project-URL: Issues, https://github.com/alandtse/auth_capture_proxy/issues
38
33
  Project-URL: Repository, https://github.com/alandtse/auth_capture_proxy
39
34
  Description-Content-Type: text/markdown
40
35
 
@@ -0,0 +1,70 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ """Metadata for this auth_capture_proxy."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import logging
7
+ from email.message import Message
8
+ from importlib.metadata import PackageNotFoundError
9
+ from importlib.metadata import metadata as __load
10
+ from pathlib import Path
11
+ from typing import cast
12
+
13
+ from authcaptureproxy import const
14
+ from authcaptureproxy.auth_capture_proxy import AuthCaptureProxy
15
+ from authcaptureproxy.examples.modifiers import find_regex_urls
16
+ from authcaptureproxy.helper import prepend_url, swap_url
17
+ from authcaptureproxy.interceptor import BaseInterceptor, InterceptContext
18
+ from authcaptureproxy.stackoverflow import return_timer_countdown_refresh_html
19
+
20
+ pkg = Path(__file__).absolute().parent.name
21
+ logger = logging.getLogger(pkg)
22
+
23
+ __status__ = "Development"
24
+ __copyright__ = "Copyright 2021"
25
+ __date__ = "2021-02-03"
26
+
27
+ __uri__ = ""
28
+ __title__ = ""
29
+ __summary__ = ""
30
+ __license__ = ""
31
+ __version__ = ""
32
+ __author__ = ""
33
+ __maintainer__ = ""
34
+ __contact__ = ""
35
+
36
+ metadata: Message | None = None
37
+
38
+ try:
39
+ md = cast(Message, __load(pkg)) # typed as Message so .get() is valid
40
+ metadata = md # keep public handle for cli.py
41
+
42
+ __uri__ = md.get("Home-page") or md.get("Home-Page") or ""
43
+ __title__ = md.get("Name") or ""
44
+ __summary__ = md.get("Summary") or ""
45
+ __license__ = md.get("License") or ""
46
+ __version__ = md.get("Version") or ""
47
+ __author__ = md.get("Author") or ""
48
+ __maintainer__ = md.get("Maintainer") or ""
49
+ __contact__ = md.get("Author-email") or md.get("Maintainer-email") or md.get("Maintainer") or ""
50
+
51
+ except PackageNotFoundError: # pragma: no cover
52
+ logger.error("Could not load package metadata for %s. Is it installed?", pkg)
53
+
54
+ if __name__ == "__main__": # pragma: no cover
55
+ if metadata is not None:
56
+ print(f"{pkg} (v{__version__})")
57
+ else:
58
+ print(f"Unknown project info for {pkg}")
59
+
60
+ __all__ = [
61
+ "AuthCaptureProxy",
62
+ "BaseInterceptor",
63
+ "InterceptContext",
64
+ "const",
65
+ "return_timer_countdown_refresh_html",
66
+ "find_regex_urls",
67
+ "prepend_url",
68
+ "swap_url",
69
+ "metadata",
70
+ ]
@@ -1,12 +1,13 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  """Python Package for auth capture proxy."""
3
+
3
4
  import asyncio
4
5
  import logging
5
6
  import posixpath
6
7
  import re
7
8
  from functools import partial
8
9
  from json import JSONDecodeError
9
- from ssl import SSLContext, create_default_context
10
+ from ssl import SSLContext
10
11
  from typing import Any, Callable, Dict, List, Optional, Set, Text, Tuple, Union
11
12
 
12
13
  import httpx
@@ -31,9 +32,6 @@ from authcaptureproxy.helper import (
31
32
  from authcaptureproxy.interceptor import BaseInterceptor, InterceptContext
32
33
  from authcaptureproxy.stackoverflow import get_open_port
33
34
 
34
- # Pre-configure SSL context
35
- ssl_context = create_default_context()
36
-
37
35
  _LOGGER = logging.getLogger(__name__)
38
36
 
39
37
 
@@ -62,7 +60,7 @@ class AuthCaptureProxy:
62
60
  """
63
61
  self._preserve_headers = preserve_headers
64
62
  self.session_factory: Callable[[], httpx.AsyncClient] = session_factory or (
65
- lambda: httpx.AsyncClient(verify=ssl_context)
63
+ lambda: httpx.AsyncClient(verify=True)
66
64
  )
67
65
  self.session: httpx.AsyncClient = session if session else self.session_factory()
68
66
  self._proxy_url: URL = proxy_url
@@ -754,9 +752,11 @@ class AuthCaptureProxy:
754
752
  # pass through non parsed content
755
753
  _LOGGER.debug(
756
754
  "Passing through %s as %s",
757
- URL(str(request.url)).name
758
- if URL(str(request.url)).name
759
- else URL(str(request.url)).path,
755
+ (
756
+ URL(str(request.url)).name
757
+ if URL(str(request.url)).name
758
+ else URL(str(request.url)).path
759
+ ),
760
760
  content_type,
761
761
  )
762
762
  return await self._build_response(resp, body=resp.content, content_type=content_type)
@@ -119,7 +119,7 @@ async def proxy_example(
119
119
  "autofill": partial(
120
120
  autofill,
121
121
  {
122
- "password": "CHANGEME",
122
+ "password": "CHANGEME", # nosec B105: Example autofill placeholder.
123
123
  },
124
124
  )
125
125
  }
@@ -4,4 +4,5 @@ Python Package for auth capture proxy.
4
4
 
5
5
  Constants
6
6
  """
7
+
7
8
  SKIP_AUTO_HEADERS = "_skip_auto_headers_"
@@ -10,6 +10,7 @@ This interceptor handles:
10
10
  - P shim and jQuery shim injection for Amazon's A-framework in AJAX responses
11
11
  - Submit blocker and AJAX proxy injection for CVF full-page navigations
12
12
  """
13
+
13
14
  import base64
14
15
  import json as _json
15
16
  import logging
@@ -4,10 +4,11 @@ Python Package for auth capture proxy.
4
4
 
5
5
  Example modifiers.
6
6
  """
7
+
7
8
  import logging
8
9
  import re
9
10
  from functools import partial
10
- from typing import Callable, Dict, List, Optional, Text
11
+ from typing import Callable, Dict, List, Optional, Text, cast
11
12
 
12
13
  from bs4 import BeautifulSoup # type: ignore[import]
13
14
  from yarl import URL
@@ -207,7 +208,7 @@ async def find_urls_bs4(
207
208
  # this currently only handles background-image as the first attribute
208
209
  # TODO: Rewrite regex to handle general case
209
210
  pattern = r"(?<=style=[\"']background-image:url\([\"']).*(?=[\"']\))"
210
- attribute_value = html_tag.get(attribute)
211
+ attribute_value = cast(str, html_tag.get(attribute))
211
212
  url: Optional[URL] = URL(str(re.search(pattern, attribute_value)))
212
213
  if url is not None and url not in exceptions.get(tag, []):
213
214
  new_value = re.sub(
@@ -224,7 +225,11 @@ async def find_urls_bs4(
224
225
  html_tag[attribute],
225
226
  )
226
227
  else:
227
- url = URL(html_tag.get(attribute)) if html_tag.get(attribute) is not None else None
228
+ url = (
229
+ URL(cast(str, html_tag.get(attribute)))
230
+ if html_tag.get(attribute) is not None
231
+ else None
232
+ )
228
233
  if (
229
234
  url is not None
230
235
  and not str(url).startswith("data:")
@@ -4,6 +4,7 @@ Python Package for auth capture proxy.
4
4
 
5
5
  Helper files.
6
6
  """
7
+
7
8
  import ast
8
9
  import json
9
10
  import logging
@@ -150,7 +151,7 @@ def swap_url(
150
151
  url = URL(url)
151
152
  old_url_string: Text = str(old_url.with_query({}))
152
153
  new_url_string: Text = str(new_url.with_query({}))
153
- old_query: MultiDict = url.query
154
+ old_query: MultiDictProxy = url.query
154
155
  url_string = str(url.with_query({}))
155
156
  # ensure both paths end with "/" if one of them does
156
157
  if (
@@ -220,7 +221,7 @@ def replace_empty_url(new_url: URL, url: URL) -> URL:
220
221
 
221
222
 
222
223
  def get_nested_dict_keys(
223
- nested_dict: Mapping[Text, Union[Callable, Dict[Text, Callable]]]
224
+ nested_dict: Mapping[Text, Union[Callable, Dict[Text, Callable]]],
224
225
  ) -> List[Text]:
225
226
  """Get list of nested dict keys.
226
227
 
@@ -4,6 +4,7 @@ Python Package for auth capture proxy.
4
4
 
5
5
  Interceptor base classes for extending the proxy pipeline.
6
6
  """
7
+
7
8
  from dataclasses import dataclass
8
9
  from typing import Any, Dict, Optional, Text
9
10
 
@@ -4,6 +4,7 @@ Python Package auth capture proxy.
4
4
 
5
5
  This is code borrowed from stack overflow.
6
6
  """
7
+
7
8
  import socket
8
9
  from typing import Text
9
10
 
@@ -0,0 +1,188 @@
1
+ [build-system]
2
+ requires = ["poetry-core>=1.0.0"]
3
+ build-backend = "poetry.core.masonry.api"
4
+
5
+ [project]
6
+ name = "authcaptureproxy"
7
+ version = "1.3.8"
8
+ description = "A Python project to create a proxy to capture authentication information from a webpage. This is useful to capture oauth login details without access to a third-party oauth."
9
+ readme = "README.md"
10
+ authors = [
11
+ { name = "Alan D. Tse", email = "alandtse@gmail.com" }
12
+ ]
13
+ maintainers = [
14
+ { name = "Alan D. Tse", email = "alandtse@gmail.com" }
15
+ ]
16
+ license = "Apache-2.0"
17
+ classifiers = [
18
+ "Development Status :: 3 - Alpha",
19
+ "Natural Language :: English",
20
+ "Programming Language :: Python :: 3 :: Only",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Programming Language :: Python :: 3.14",
25
+ "Intended Audience :: Developers",
26
+ "Operating System :: OS Independent",
27
+ "Environment :: Console",
28
+ "Topic :: Software Development :: Libraries :: Python Modules",
29
+ ]
30
+ keywords = [""]
31
+ requires-python = ">=3.11"
32
+ dependencies = [
33
+ "typer>=0.3, <1.0",
34
+ "aiohttp>=3.0.0, <4.0.0",
35
+ "multidict>=6.0.0, <7.0.0",
36
+ "yarl>=1.0.0, <2.0.0",
37
+ "beautifulsoup4>=4.0.0, <5.0.0",
38
+ "httpx",
39
+ ]
40
+
41
+ [project.urls]
42
+ Homepage = "https://github.com/alandtse/auth_capture_proxy"
43
+ Repository = "https://github.com/alandtse/auth_capture_proxy"
44
+ Documentation = "https://auth_capture_proxy.readthedocs.io"
45
+ "Bug Tracker" = "https://github.com/alandtse/auth_capture_proxy/issues"
46
+ Download = "https://pypi.org/project/authcaptureproxy/"
47
+
48
+ [project.scripts]
49
+ auth_capture_proxy = "authcaptureproxy.cli:cli"
50
+
51
+ [tool.poetry]
52
+ # Legacy poetry config kept for compatibility where needed, but most should be in [project] now
53
+ # Poetry will implicitly use [project] for most things.
54
+ include = ["README.md", "LICENSE.txt", "CHANGELOG.md"]
55
+
56
+ [tool.poetry.group.dev.dependencies]
57
+ bandit = ">=1.7, <2.0"
58
+ black = ">=20.8b1"
59
+ coverage = { extras = ["toml"], version = "^5" }
60
+ flake8 = ">=3.9, <8.0"
61
+ flake8-bugbear = ">=20.11, <25.0"
62
+ flake8-docstrings = "^1"
63
+ pre-commit = ">=3.5.0"
64
+ pre-commit-hooks = ">=3.4, <4.0"
65
+ pytest = "^7"
66
+ pytest-cov = "^2"
67
+ sphinx = ">=4"
68
+ sphinx-autoapi = ">=1"
69
+ sphinx-copybutton = ">=0.3.1"
70
+ sphinx-rtd-theme = ">=0.5"
71
+ tomlkit = ">=0.7"
72
+ mypy = ">=0.790, <1.0"
73
+ hypothesis = "^6"
74
+ xdoctest = ">=0.15, <1.0"
75
+ python-semantic-release = "^9"
76
+ coveralls = "^3"
77
+ pytest-asyncio = ">=0.14.0, <1"
78
+ tox-gh-actions = ">=2.4.0, <3"
79
+ tox-poetry = ">=0.3.0, <1"
80
+ isort = "^5"
81
+
82
+ [tool.poetry.extras]
83
+ all = []
84
+
85
+ # Tyrannosaurus settings updated to point to new project table locations where possible
86
+ [tool.tyrannosaurus.options]
87
+ sort = false
88
+ align = true
89
+
90
+ [tool.tyrannosaurus.sources]
91
+ pycompatversions = "project.dependencies"
92
+ pytoxversions = "project.dependencies"
93
+ pymetaversion = "'3.11'"
94
+ metavm = "'ubuntu-latest'"
95
+ devdeps = "tool.poetry.group.dev.dependencies"
96
+ status = "'Development'"
97
+ date = "'2021-02-03'"
98
+ copyright = "'Copyright 2021'"
99
+ version = "project.version"
100
+ release = "project.version"
101
+ long_description = "project.description"
102
+ authors = ["Alan D. Tse <github:alandtse>"]
103
+ contributors = [
104
+ "Alan D. Tse <github:alandtse>",
105
+ "Parker Wahle <github:regulad>",
106
+ ]
107
+ maintainers = "tool.tyrannosaurus.sources.authors"
108
+ linelength = "tool.black.line-length"
109
+ importorderstyle = "'google'"
110
+ docstringstyle = "'google'"
111
+
112
+ [tool.tyrannosaurus.sources.flake8skip]
113
+ all = "'W503,E203,E225,E301,E302,E501,D107,D200,D205,D400,D403,D409,D410,D411,D212,W391,W293'"
114
+ test = "'D100,D101,D102,D103,D104,S101,W503,E203,E225,E301,E302,E501,D107,D200,D205,D400,D403,D409,D410,D411,D212,W391,W293'"
115
+
116
+ [tool.tyrannosaurus.targets]
117
+ pyproject = true
118
+ init = true
119
+ tox = true
120
+ precommit = true
121
+ docs = true
122
+ recipes = true
123
+ license = true
124
+ authors = true
125
+ github = true
126
+ travis = true
127
+ dockerfile = true
128
+ readme = true
129
+ changelog = true
130
+ citation = true
131
+ codemeta = true
132
+ environment = false
133
+
134
+ [tool.pytest.ini_options]
135
+ log_cli = true
136
+ log_cli_level = "INFO"
137
+ log_cli_format = "%(asctime)s [%(levelname)8s] %(name)s: %(message)s (%(filename)s:%(lineno)s)"
138
+ log_cli_date_format = "%Y-%m-%d %H:%M:%S"
139
+ asyncio_mode = "strict"
140
+
141
+ [tool.commitizen]
142
+ name = "cz_conventional_commits"
143
+
144
+ [tool.towncrier]
145
+ filename = "NEWS.md"
146
+
147
+ [tool.semantic_release]
148
+ version_toml = ["pyproject.toml:project.version"]
149
+ major_on_zero = true
150
+ assets = ["poetry.lock"]
151
+ build_command = "pip install poetry && poetry lock && poetry build"
152
+
153
+ [tool.semantic_release.publish]
154
+ upload_to_vcs_release = true
155
+
156
+ [tool.semantic_release.branches.main]
157
+ match = "(main|master)"
158
+ prerelease_token = "rc"
159
+ prerelease = false
160
+
161
+ [tool.coverage.paths]
162
+ source = ["authcaptureproxy"]
163
+
164
+ [tool.coverage.run]
165
+ source = ["authcaptureproxy"]
166
+ relative_files = true
167
+
168
+ [tool.coverage.report]
169
+ show_missing = true
170
+
171
+ [tool.black]
172
+ line-length = 100
173
+ target-version = ["py311"]
174
+
175
+ [tool.isort]
176
+ line_length = 100
177
+
178
+ [tool.bandit]
179
+
180
+ [tool.pycodestyle]
181
+ max-line-length = 100
182
+ statistics = true
183
+
184
+ [tool.pydocstyle]
185
+
186
+ [mypy]
187
+ check_untyped_defs = true
188
+ strict_optional = true
@@ -1,58 +0,0 @@
1
- # SPDX-License-Identifier: Apache-2.0
2
- """Metadata for this auth_capture_proxy."""
3
- import logging
4
-
5
- try:
6
- from importlib_metadata import PackageNotFoundError
7
- from importlib_metadata import metadata as __load
8
- except ModuleNotFoundError:
9
- from importlib.metadata import PackageNotFoundError # type: ignore
10
- from importlib.metadata import metadata as __load # type: ignore
11
-
12
- # If you need to support Python 3.7, change to importlib_metadata (underscore, not dot)
13
- # and then list importlib_metadata to [tool.poetry.dependencies] and docs/requirements.txt
14
- from pathlib import Path
15
-
16
- from authcaptureproxy import const
17
- from authcaptureproxy.auth_capture_proxy import AuthCaptureProxy
18
- from authcaptureproxy.examples.modifiers import find_regex_urls
19
- from authcaptureproxy.helper import prepend_url, swap_url
20
- from authcaptureproxy.interceptor import BaseInterceptor, InterceptContext
21
- from authcaptureproxy.stackoverflow import return_timer_countdown_refresh_html
22
-
23
- pkg = Path(__file__).absolute().parent.name
24
- logger = logging.getLogger(pkg)
25
- metadata = None
26
- try:
27
- metadata = __load(pkg)
28
- __status__ = "Development"
29
- __copyright__ = "Copyright 2021"
30
- __date__ = "2021-02-03"
31
- __uri__ = metadata["home-page"]
32
- __title__ = metadata["name"]
33
- __summary__ = metadata["summary"]
34
- __license__ = metadata["license"]
35
- __version__ = metadata["version"]
36
- __author__ = metadata["author"]
37
- __maintainer__ = metadata["maintainer"]
38
- __contact__ = metadata["maintainer"]
39
- except PackageNotFoundError: # pragma: no cover
40
- logger.error(f"Could not load package metadata for {pkg}. Is it installed?")
41
-
42
- if __name__ == "__main__": # pragma: no cover
43
- if metadata is not None:
44
- print(f"{pkg} (v{metadata['version']})")
45
- else:
46
- print(f"Unknown project info for {pkg}")
47
-
48
-
49
- __all__ = [
50
- "AuthCaptureProxy",
51
- "BaseInterceptor",
52
- "InterceptContext",
53
- "const",
54
- "return_timer_countdown_refresh_html",
55
- "find_regex_urls",
56
- "prepend_url",
57
- "swap_url",
58
- ]
@@ -1,380 +0,0 @@
1
- [metadata]
2
- description-file = "README.md"
3
-
4
- [build-system]
5
- # https://github.com/python-poetry/poetry-core#usage
6
- requires = ["poetry-core"]
7
- build-backend = "poetry.core.masonry.api"
8
-
9
-
10
- #########################################################################################
11
- # Poetry metadata
12
- #########################################################################################
13
-
14
- # This is all metadata that Poetry uses directly.
15
- # TODO: You will want to modify this section.
16
- # Hopefully the defaults are good, so you only need to change the individual TODOs.
17
- # Note that some of these can be filled in with arguments to `tyrannosaurus new` (e.g. --keywords).
18
-
19
- [tool.poetry]
20
-
21
- name = "authcaptureproxy"
22
- # This is the version of your project. Keep it up-to-date and follow semantic versioning.
23
- # It's used in the PyPi, wheels, Docker, and Github packages.
24
- # Also make sure to use exactly this version when creating a Github release,
25
- # but prefix a "v" to the Github release.
26
- # E.g. This might be "1.2.13", and the Github release will be "v1.2.13".
27
- # Although semantic versioning allows for build tags (metadata),
28
- # not all tools are compatible with it, so avoid it if you can.
29
- version = "1.3.6"
30
-
31
- description = "A Python project to create a proxy to capture authentication information from a webpage. This is useful to capture oauth login details without access to a third-party oauth."
32
- keywords = [""]
33
- authors = ["Alan D. Tse"]
34
- maintainers = ["Alan D. Tse"]
35
- license = "Apache-2.0"
36
- readme = "README.md"
37
- homepage = "https://github.com/alandtse/auth_capture_proxy"
38
- repository = "https://github.com/alandtse/auth_capture_proxy"
39
- documentation = "https://auth_capture_proxy.readthedocs.io"
40
- # Note: Poetry adds the license to the classifiers automatically
41
- # Development Status, license, and Python versions are kept consistent
42
- # by `tyrannosaurus sync`, if you choose to use that.
43
- # The language, intended audience, OS, environment, and topics are not.
44
- classifiers = [
45
- "Development Status :: 3 - Alpha",
46
- "Natural Language :: English",
47
- "Programming Language :: Python :: 3 :: Only",
48
- "Programming Language :: Python :: 3.8",
49
- "Programming Language :: Python :: 3.9",
50
- "Intended Audience :: Developers",
51
- "Operating System :: OS Independent",
52
- "Environment :: Console",
53
- "Topic :: Software Development :: Libraries :: Python Modules",
54
- ]
55
- # These get packaged into the wheels
56
- # There are uncommon needs to read the readme, license, and/or changelog
57
- # in your code. For example, to read and display a "what's new" section
58
- # if you detect that the user is running a newer version than they were using before.
59
- # If you don't need this, you can remove these entries.
60
- # (You might also be able to package this pyproject.toml file and read metadata from it.)
61
- include = ["README.md", "LICENSE.txt", "CHANGELOG.md"]
62
-
63
- [tool.poetry.urls]
64
- # 'CI', 'Issues', and 'Download' seem to have special meanings
65
- # These all get icons on PyPi
66
- CI = "https://github.com/alandtse/auth_capture_proxy/actions"
67
- Issues = "https://github.com/alandtse/auth_capture_proxy/issues"
68
- Download = "https://pypi.org/project/authcaptureproxy/"
69
-
70
-
71
- #########################################################################################
72
- # Poetry build & dependencies
73
- #########################################################################################
74
-
75
- # TODO: You will want to modify this section.
76
-
77
- [tool.poetry.scripts]
78
- # TODO Is your code a script?
79
- # Set the name of the Python module followed by a colon, followed by the name of the function
80
- auth_capture_proxy = "authcaptureproxy.cli:cli"
81
-
82
- [tool.poetry.dependencies]
83
- # TODO Add and remove dependencies here
84
- # These are dependencies that are included in the main package
85
- python = "^3.10"
86
- typer = ">=0.3, <1.0"
87
- aiohttp = "^3"
88
- multidict = "^6"
89
- yarl = "^1"
90
- beautifulsoup4 = "^4"
91
- httpx = "*"
92
- #homeassistant = { git = "https://github.com/home-assistant/core.git", branch = "dev" }
93
-
94
-
95
- [tool.poetry.dev-dependencies]
96
- # TODO Remove build dependencies you don't want (like xdoctest, perhaps)
97
- # These are dependencies that Poetry uses only when testing
98
- # They all are included as dependencies in tox.ini
99
- # Where `dev` is from `[tool.poetry.extras]` below
100
-
101
- # All of the dependencies in this "paragraph" are needed by the default `tox.ini`
102
- # and Github workflows (under `.github/workflows`) that Tyrannosaurus generated.
103
- # If you remove them, builds will always fail unless you also modify the build pipeline.
104
- # Note: We don't use flake8-bandit because it appears to be unmaintained
105
- bandit = ">=1.7, <2.0"
106
- black = ">=20.8b1"
107
- coverage = { extras = ["toml"], version = "^5" }
108
- flake8 = ">=3.9, <8.0"
109
- flake8-bugbear = ">=20.11, <25.0"
110
- flake8-docstrings = "^1"
111
- pre-commit = ">=2.9, <3.0"
112
- pre-commit-hooks = ">=3.4, <4.0"
113
- pytest = "^7"
114
- pytest-cov = "^2"
115
- sphinx = ">=4"
116
- sphinx-autoapi = ">=1"
117
- sphinx-copybutton = ">=0.3.1"
118
- sphinx-rtd-theme = ">=0.5"
119
- tomlkit = ">=0.7"
120
-
121
- # These are used directly in the default build pipeline
122
- # ... but they're generally optional, and the build won't fail if you remove them
123
- # For example, `mypy` is called in `tox.ini`, but if it's removed then the line
124
- # will fail without causing the build to fail.
125
- mypy = ">=0.790, <1.0"
126
-
127
- # These are useful but are not used directly in the default build pipeline
128
- # that Tyrannosaurus set up for your project
129
- hypothesis = "^6"
130
- xdoctest = ">=0.15, <1.0"
131
- python-semantic-release = "^9"
132
- coveralls = "^3"
133
- pytest-asyncio = ">=0.14.0, <1"
134
- tox-gh-actions = ">=2.4.0, <3"
135
- tox-poetry = ">=0.3.0, <1"
136
- isort = "^5"
137
-
138
- [tool.poetry.extras]
139
- # These are referenced in the tox.ini with `extras = dev`
140
- # These are auto-filled from dev-deps when you run tyrannosaurus sync
141
- # List additional extras sets like this:
142
- # optimization = ["numpy", "scikit-learn"]
143
- # You MUST also list any extras that you want for testing here
144
- # These will be installed by tox to be used for testing
145
- # (The dev dependencies will be installed already however)
146
- # Of course, you can remove the ` --extras "all"` line from tox.ini
147
- # to avoid this
148
- all = []
149
-
150
-
151
- #########################################################################################
152
- # Tyrannosaurus
153
- #########################################################################################
154
-
155
- # == NOTE ==
156
- # These ONLY configure the behavior of `tyrannosaurus sync` (and tyrannosaurus build).
157
- # These commands are not run inside the build pipeline; they're only run if you run them
158
- # specifically. You would only modify them to change this behavior.
159
- # You can safely remove this whole section if you don't want to use these commands at all.
160
-
161
-
162
- [tool.tyrannosaurus.options]
163
- # This tells Tyrannosaurus to sort lines for things like dependencies
164
- # For example, it will sort dependencies in `[tool.poetry.dependencies]` alphabetically
165
- sort = false
166
- # This tells Tyrannosaurus to align the columns in TOML files surrounding = signs
167
- # For example, see how `[tool.tyrannosaurus.targets]` is sorted in this file
168
- align = true
169
-
170
- [tool.tyrannosaurus.sources]
171
- # These tell Tyrannosaurus where to get information to copy
172
- # If a value is not listed here, it won't be copied
173
- # Everything is either:
174
- # 1. A literal value, surrounded with single quotes (e.g. 'py38')
175
- # 2. A literal list, comma-separated (e.g. '[py38,py39]')
176
- # 3. A reference to a pyproject setting (e.g. tool.poetry.version)
177
- # 4. A value or list containing a special variable (e.g. 'Project J, copyright 2021')
178
-
179
- # --- VERSIONS ---
180
- # These control different aspects of Python versions
181
- # pycompatversions says what Python versions are compatible
182
- # tool.poetry.dependencies is almost definitely the best source for this
183
- # pytoxversions dictates what's actually used to test
184
- # tool.poetry.dependencies will choose all of the compatible major versions
185
- # You can alternatively specify exact versions, like '[3.8]' or '[3.8.5,3.9.1]'
186
- # (Don't forget the single quote marks in that example.)
187
- # pymetaversion is only used when building; e.g. in readthedocs, Docker, and Github workflows
188
- # (Note that this last one is not a list -- use single quotes but not brackets.)
189
- pycompatversions = "tool.poetry.dependencies"
190
- pytoxversions = "tool.poetry.dependencies"
191
- pymetaversion = "'3.9'"
192
-
193
- # --- DEVELOPMENT PARAMS ---
194
- # virtual machine info used in Dockerfile and Github workflows
195
- metavm = "'ubuntu-latest'"
196
- # Development dependencies
197
- devdeps = "tool.poetry.dev-dependencies"
198
- # Pick the latest versions compatible with the version ranges:
199
- #precommitvr = "tool.poetry.dev-dependencies"
200
- #precommitconfigvr = "tool.poetry.dev-dependencies"
201
-
202
- # --- PROJECT INFO ---
203
- # These are used in dunders like __copyright__, docs/conf.py, and PyPi classifiers (like Development Status)
204
- # 2021-02-03 is the date you run it at, and 2021-02-03 16-44-50 -08:00 is the datetime
205
- status = "'Development'"
206
- date = "'2021-02-03'"
207
- copyright = "'Copyright 2021'"
208
- version = "tool.poetry.version"
209
- release = "tool.poetry.version"
210
- long_description = "tool.poetry.description"
211
- # These describe the license for your documentation text
212
- # By default no license is mentioned;
213
- # uncomment these to display the license in the docs
214
- #doc_license = "'CC BY 4.0'"
215
- #doc_license_url = "'https://creativecommons.org/licenses/by/4.0'"
216
- # or you can add this (and skip the license URL):
217
- #doc_license = "'all rights reserved'"
218
-
219
- # --- AUTHOR INFO ---
220
- # TODO Fill in authors, contributors, and maintainers
221
- # Use this syntax: "Person Name <id:value,[id:value, [...]]>"
222
- # Specifying github usernames is recommended
223
- # ORCID IDs can also be referenced
224
- #authors = [
225
- # "<<Author Name>> <github:<<username>>,orcid:<<id>>>"
226
- #]
227
- authors = ["Alan D. Tse <github:alandtse>"]
228
- contributors = [
229
- "Alan D. Tse <github:alandtse>",
230
- "Parker Wahle <github:regulad>",
231
- ]
232
- # Turn this into a literal list if it is different than the authors
233
- maintainers = "tool.tyrannosaurus.sources.authors"
234
-
235
- # --- CODING STYLE ---
236
- linelength = "tool.black.line-length"
237
- importorderstyle = "'google'"
238
- docstringstyle = "'google'"
239
-
240
-
241
- # --- CODING STYLE IN PEP8 ---
242
- [tool.tyrannosaurus.sources.flake8skip]
243
- # These affect flake8 commands as directed in tox.ini
244
- # 'all' is copied to tox.ini [flake8.ignore]; these are always ignored
245
- # Any other keys refer to the directory that flake8 is called on
246
- # Ex, `authcaptureproxy = "'D100'"` adds D100 in `poetry run flake8 authcaptureproxy --ignore=D100`
247
- # (Note 1: flake8's --ignore overrides the [flake8.ignore], so Tyrannosaurus appends the "all" values.)
248
- # (Note 2: Keys referring to directory names that tox.ini doesn't call flake8 on are ignored.)
249
- # (Note 3: [tool.pycodestyle] and [tool.pydocstyle] don't need these values because flake8 handles it.)
250
- # You probably want some choices in 'all'
251
- # Then add some more to 'test' if you're less concerned with your test file conventions
252
- # 212 and 213 contradict; 203 and 204 contradict; D302 is not relevant in Py3;
253
- # D107 isn't needed sometimes; and the rest just seem too picky
254
- all = "'W503,E203,E225,E301,E302,E501,D107,D200,D205,D400,D403,D409,D410,D411,D212,W391,W293'"
255
- #authcaptureproxy = ""
256
- #doc = ""
257
- test = "'D100,D101,D102,D103,D104,S101,W503,E203,E225,E301,E302,E501,D107,D200,D205,D400,D403,D409,D410,D411,D212,W391,W293'"
258
-
259
-
260
- [tool.tyrannosaurus.targets]
261
- # This section tells Tyrannosaurus what to sync to.
262
- # These are file and directory names, without filename extensions.
263
- # Removing a line is the same as setting it to false
264
- # They will only be synced if they exist; never created
265
- # To get a recipe and anaconda env, run 'tyrannosaurus recipe' and 'tyrannosaurus env'
266
- # Choices are only true or false
267
- pyproject = true
268
- init = true
269
- tox = true
270
- precommit = true
271
- docs = true
272
- recipes = true
273
- license = true
274
- authors = true
275
- github = true
276
- travis = true
277
- dockerfile = true
278
- readme = true
279
- changelog = true
280
- citation = true
281
- codemeta = true
282
- environment = false
283
-
284
-
285
- #########################################################################################
286
- # Testing
287
- #########################################################################################
288
-
289
- # This will be used in a future version of pytest:
290
- #[tool.pytest]
291
-
292
- [tool.tyrannosuarus.paths]
293
- # These specify where to put certain files
294
- # If they're left blank, the defaults will be used
295
- # The syntax is the same as for tool.tyrannosaurus.sources
296
- #recipe = "'recipes/auth_capture_proxy/meta.yaml'"
297
- #environment = "'environment.yml'"
298
-
299
- [tool.pytest.ini_options]
300
- # Really useful -- output logg statements
301
- log_cli = true
302
- log_cli_level = "INFO"
303
- log_cli_format = "%(asctime)s [%(levelname)8s] %(name)s: %(message)s (%(filename)s:%(lineno)s)"
304
- log_cli_date_format = "%Y-%m-%d %H:%M:%S"
305
- asyncio_mode = "strict"
306
-
307
- #########################################################################################
308
- # Commits & changelog generation
309
- #########################################################################################
310
-
311
- # Commitizen (https://github.com/commitizen-tools/commitizen/)
312
- # is a great tool to generate changelogs from commit messages
313
- # It doesn't directly map to keep-a-changelog change types (e.g. Added)
314
- [tool.commitizen]
315
- name = "cz_conventional_commits"
316
- # I recommend NOT including version and tag_format
317
- # See the docs ("guide" section) how to integrate `cz bump`
318
-
319
- # not used by default, but you could run it
320
- # in tox.ini or .github/workflows/publish.yml (with a commit)
321
- [tool.towncrier]
322
- # Alternatively, you could replace CHANGELOG.md
323
- # In my experience, commit logs make mediocre changelogs
324
- filename = "NEWS.md"
325
-
326
- [tool.semantic_release]
327
- version_toml = ["pyproject.toml:tool.poetry.version"]
328
- major_on_zero = true
329
- branch = "main"
330
- upload_to_pypi = true
331
- upload_to_release = true
332
- build_command = "pip install poetry && poetry build"
333
-
334
- #########################################################################################
335
- # Style checking
336
- #########################################################################################
337
-
338
- # You probably don't need to modify any of this.
339
- # A few you might want to change are:
340
- # [tool.black.line-length] and [tool.isort.line_length]
341
- # (Note that isort is not used by default, and that tyrannosaurus sync will handle them.)
342
- # [mypy.check_untyped_defs] (this is fairly aggressive)
343
- # [tool.towncrier] (if you want to set up towncrier)
344
-
345
- [tool.coverage.paths]
346
- source = ["authcaptureproxy"]
347
-
348
- [tool.coverage.run]
349
- source = ["authcaptureproxy"]
350
- relative_files = true
351
-
352
- [tool.coverage.report]
353
- show_missing = true
354
-
355
- [tool.black]
356
- line-length = 100
357
- # As of December 2020, black doesn't accept py39
358
- target-version = ["py38"]
359
-
360
- [tool.isort]
361
- line_length = 100
362
-
363
- [tool.bandit]
364
-
365
- [tool.pycodestyle]
366
- max-line-length = 100
367
- statistics = true
368
-
369
- [tool.pydocstyle]
370
- [mypy]
371
- check_untyped_defs = true
372
- strict_optional = true
373
-
374
-
375
- # ------- THE FOLLOWING ARE NOT USED BY THEIR RESPECTIVE TOOLS --------
376
- # --- There are open discussions about supporting pyproject for each ---
377
- # https://github.com/python/mypy/issues/5205
378
- # https://github.com/PyCQA/bandit/issues/606
379
- # https://github.com/PyCQA/pycodestyle/issues/813
380
- # https://github.com/PyCQA/pydocstyle/issues/447