Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-tldextract for 
openSUSE:Factory checked in at 2024-03-29 13:10:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-tldextract (Old)
 and      /work/SRC/openSUSE:Factory/.python-tldextract.new.1905 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-tldextract"

Fri Mar 29 13:10:05 2024 rev:24 rq:1163368 version:5.1.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-tldextract/python-tldextract.changes      
2023-12-08 22:34:30.753428837 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-tldextract.new.1905/python-tldextract.changes
    2024-03-29 13:11:14.911771688 +0100
@@ -1,0 +2,10 @@
+Thu Mar 28 16:29:56 UTC 2024 - Mia Herkt <m...@0x0.st>
+
+- Update to 5.1.2:
+  * Remove socket.inet_pton, to fix platform-dependent IP parsing
+    #gh/john-kurkowski/tldextract#318
+  * Use non-capturing groups for IPv4 address detection, for a
+    slight speed boost
+    #gh/john-kurkowski/tldextract#323
+
+-------------------------------------------------------------------

Old:
----
  tldextract-5.1.1.tar.gz

New:
----
  tldextract-5.1.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-tldextract.spec ++++++
--- /var/tmp/diff_new_pack.qX88x5/_old  2024-03-29 13:11:15.363788302 +0100
+++ /var/tmp/diff_new_pack.qX88x5/_new  2024-03-29 13:11:15.363788302 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-tldextract
 #
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %define oldpython python
 %{?sle15_python_module_pythons}
 Name:           python-tldextract
-Version:        5.1.1
+Version:        5.1.2
 Release:        0
 Summary:        Python module to separate the TLD of a URL
 License:        BSD-3-Clause
@@ -38,6 +38,7 @@
 BuildRequires:  %{python_module setuptools_scm}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module six}
+BuildRequires:  %{python_module syrupy}
 BuildRequires:  %{python_module wheel}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
@@ -46,10 +47,9 @@
 Requires:       python-requests >= 2.1.0
 Requires:       python-requests-file >= 1.4
 Requires(post): update-alternatives
-Requires(postun):update-alternatives
+Requires(postun): update-alternatives
 Obsoletes:      %{oldpython}-tldextract <= 2.0.1
 BuildArch:      noarch
-
 %python_subpackages
 
 %description

++++++ tldextract-5.1.1.tar.gz -> tldextract-5.1.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/.github/workflows/ci.yml 
new/tldextract-5.1.2/.github/workflows/ci.yml
--- old/tldextract-5.1.1/.github/workflows/ci.yml       2023-11-13 
21:07:39.000000000 +0100
+++ new/tldextract-5.1.2/.github/workflows/ci.yml       2024-03-16 
01:08:14.000000000 +0100
@@ -1,5 +1,11 @@
 name: build
-on: [push, pull_request]
+on:
+  pull_request: {}
+  push:
+    branches:
+      - "master"
+    tags-ignore:
+      - "**"
 jobs:
   test:
     strategy:
@@ -14,6 +20,8 @@
             {python-version: "3.11", toxenv: "py311"},
             {python-version: "3.12", toxenv: "py312"},
             {python-version: "pypy3.8", toxenv: "pypy38"},
+            {python-version: "pypy3.9", toxenv: "pypy39"},
+            {python-version: "pypy3.10", toxenv: "pypy310"},
           ]
         include:
           - os: ubuntu-latest
@@ -27,13 +35,13 @@
       - name: Check out repository
         uses: actions/checkout@v4
       - name: Setup Python
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: ${{ matrix.language.python-version }}
+          check-latest: true
       - name: Install Python requirements
         run: |
-          pip install --upgrade pip
-          pip install --upgrade --editable '.[testing]'
+          pip install --upgrade tox
       - name: Test
         run: tox
         env:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/CHANGELOG.md 
new/tldextract-5.1.2/CHANGELOG.md
--- old/tldextract-5.1.1/CHANGELOG.md   2023-11-17 04:39:20.000000000 +0100
+++ new/tldextract-5.1.2/CHANGELOG.md   2024-03-19 04:59:18.000000000 +0100
@@ -3,6 +3,16 @@
 After upgrading, update your cache file by deleting it or via `tldextract
 --update`.
 
+## 5.1.2 (2024-03-18)
+
+* Bugfixes
+  * Remove `socket.inet_pton`, to fix platform-dependent IP parsing 
([#318](https://github.com/john-kurkowski/tldextract/issues/318))
+  * Use non-capturing groups for IPv4 address detection, for a slight speed 
boost ([#323](https://github.com/john-kurkowski/tldextract/issues/323))
+* Misc.
+  * Add CI for PyPy3.9 and PyPy3.10 
([#316](https://github.com/john-kurkowski/tldextract/issues/316))
+  * Add script to automate package release process 
([#325](https://github.com/john-kurkowski/tldextract/issues/325))
+  * Update LICENSE copyright years
+
 ## 5.1.1 (2023-11-16)
 
 * Bugfixes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/LICENSE new/tldextract-5.1.2/LICENSE
--- old/tldextract-5.1.1/LICENSE        2022-05-03 21:53:33.000000000 +0200
+++ new/tldextract-5.1.2/LICENSE        2024-03-19 04:42:37.000000000 +0100
@@ -1,6 +1,6 @@
 BSD 3-Clause License
 
-Copyright (c) 2020, John Kurkowski
+Copyright (c) 2013-2024, John Kurkowski
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/PKG-INFO 
new/tldextract-5.1.2/PKG-INFO
--- old/tldextract-5.1.1/PKG-INFO       2023-11-17 04:43:35.332430400 +0100
+++ new/tldextract-5.1.2/PKG-INFO       2024-03-19 05:07:53.174141200 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: tldextract
-Version: 5.1.1
+Version: 5.1.2
 Summary: Accurately separates a URL's subdomain, domain, and public suffix, 
using the Public Suffix List (PSL). By default, this includes the public ICANN 
TLDs and their exceptions. You can optionally support the Public Suffix List's 
private domains as well.
 Author-email: John Kurkowski <john.kurkow...@gmail.com>
 License: BSD-3-Clause
@@ -22,6 +22,9 @@
 Requires-Dist: requests>=2.1.0
 Requires-Dist: requests-file>=1.4
 Requires-Dist: filelock>=3.0.8
+Provides-Extra: release
+Requires-Dist: build; extra == "release"
+Requires-Dist: twine; extra == "release"
 Provides-Extra: testing
 Requires-Dist: black; extra == "testing"
 Requires-Dist: mypy; extra == "testing"
@@ -30,6 +33,7 @@
 Requires-Dist: pytest-mock; extra == "testing"
 Requires-Dist: responses; extra == "testing"
 Requires-Dist: ruff; extra == "testing"
+Requires-Dist: syrupy; extra == "testing"
 Requires-Dist: tox; extra == "testing"
 Requires-Dist: types-filelock; extra == "testing"
 Requires-Dist: types-requests; extra == "testing"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/pyproject.toml 
new/tldextract-5.1.2/pyproject.toml
--- old/tldextract-5.1.1/pyproject.toml 2023-11-13 21:07:39.000000000 +0100
+++ new/tldextract-5.1.2/pyproject.toml 2024-03-16 01:08:12.000000000 +0100
@@ -41,6 +41,10 @@
 ]
 
 [project.optional-dependencies]
+release = [
+    "build",
+    "twine",
+]
 testing = [
     "black",
     "mypy",
@@ -49,6 +53,7 @@
     "pytest-mock",
     "responses",
     "ruff",
+    "syrupy",
     "tox",
     "types-filelock",
     "types-requests",
@@ -79,12 +84,13 @@
 version = {attr = "setuptools_scm.get_version"}
 
 [tool.mypy]
+explicit_package_bases = true
 strict = true
 
 [tool.pytest.ini_options]
 addopts = "--doctest-modules"
 
-[tool.ruff]
+[tool.ruff.lint]
 select = [
   "A",
   "B",
@@ -101,5 +107,5 @@
   "E501", # line too long; if Black does its job, not worried about the rare 
long line
 ]
 
-[tool.ruff.pydocstyle]
+[tool.ruff.lint.pydocstyle]
 convention = "pep257"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/scripts/release.py 
new/tldextract-5.1.2/scripts/release.py
--- old/tldextract-5.1.1/scripts/release.py     1970-01-01 01:00:00.000000000 
+0100
+++ new/tldextract-5.1.2/scripts/release.py     2024-03-16 01:07:21.000000000 
+0100
@@ -0,0 +1,238 @@
+"""
+This script automates the release process for a Python package.
+
+It will:
+- Add a git tag for the given version.
+- Remove the previous dist folder.
+- Create a build.
+- Ask the user to verify the build.
+- Upload the build to PyPI.
+- Push all git tags to the remote.
+- Create a draft release on GitHub using the version notes in CHANGELOG.md.
+
+Prerequisites:
+    - This must be run from the root of the repository.
+    - The repo must have a clean git working tree.
+    - The user must have the GITHUB_TOKEN environment variable set to a valid 
GitHub personal access token.
+    - The user will need credentials for the PyPI repository, which the user 
will be prompted for during the upload step. The user will need to paste the 
token manually from a password manager or similar.
+    - The CHANGELOG.md file must already contain an entry for the version 
being released.
+    - Install requirements with: pip install --upgrade --editable '.[release]'
+
+"""
+
+from __future__ import annotations
+
+import os
+import re
+import subprocess
+import sys
+from pathlib import Path
+
+import requests
+
+
+def add_git_tag_for_version(version: str) -> None:
+    """Add a git tag for the given version."""
+    subprocess.run(["git", "tag", "-a", version, "-m", version], check=True)
+    print(f"Version {version} tag added successfully.")
+
+
+def remove_previous_dist() -> None:
+    """Check for dist folder, and if it exists, remove it."""
+    subprocess.run(["rm", "-rf", Path("dist")], check=True)
+    print("Previous dist folder removed successfully.")
+
+
+def create_build() -> None:
+    """Create a build."""
+    subprocess.run(["python", "-m", "build"], check=True)
+    print("Build created successfully.")
+
+
+def verify_build(is_test: str) -> None:
+    """Verify the build.
+
+    Print the archives in dist/ and ask the user to manually inspect and
+    confirm they contain the expected files, e.g. source files and test files.
+    """
+    build_files = os.listdir("dist")
+    if len(build_files) != 2:
+        print(
+            "WARNING: dist folder contains incorrect number of files.", 
file=sys.stderr
+        )
+    print("Contents of dist folder:")
+    subprocess.run(["ls", "-l", Path("dist")], check=True)
+    print("Contents of tar files in dist folder:")
+    for build_file in build_files:
+        subprocess.run(["tar", "tvf", Path("dist") / build_file], check=True)
+    confirmation = input("Does the build look correct? (y/n): ")
+    if confirmation == "y":
+        print("Build verified successfully.")
+        upload_build_to_pypi(is_test)
+        push_git_tags()
+    else:
+        raise Exception("Could not verify. Build was not uploaded.")
+
+
+def generate_github_release_notes_body(token: str, version: str) -> str:
+    """Generate and grab release notes URL from Github."""
+    response = requests.post(
+        
"https://api.github.com/repos/john-kurkowski/tldextract/releases/generate-notes";,
+        headers={
+            "Accept": "application/vnd.github+json",
+            "Authorization": f"Bearer {token}",
+            "X-GitHub-Api-Version": "2022-11-28",
+        },
+        json={"tag_name": version},
+    )
+
+    try:
+        response.raise_for_status()
+    except requests.exceptions.HTTPError as err:
+        print(
+            f"WARNING: Failed to generate release notes from Github: {err}",
+            file=sys.stderr,
+        )
+        return ""
+    return str(response.json()["body"])
+
+
+def get_release_notes_url(body: str) -> str:
+    """Parse the release notes content to get the changelog URL."""
+    url_pattern = re.compile(r"\*\*Full Changelog\*\*: (.*)$")
+    match = url_pattern.search(body)
+    if match:
+        return match.group(1)
+    else:
+        print(
+            "WARNING: Failed to parse release notes URL from GitHub response.",
+            file=sys.stderr,
+        )
+        return ""
+
+
+def get_changelog_release_notes(release_notes_url: str, version: str) -> str:
+    """Get the changelog release notes.
+
+    Uses a regex starting on a heading beginning with the version number
+    literal, and matching until the next heading. Using regex to match markup
+    is brittle. Consider a Markdown-parsing library instead.
+    """
+    with open("CHANGELOG.md") as file:
+        changelog_text = file.read()
+    pattern = re.compile(rf"## {re.escape(version)}[^\n]*(.*?)## ", re.DOTALL)
+    match = pattern.search(changelog_text)
+    if match:
+        return str(match.group(1)).strip()
+    else:
+        print(
+            f"WARNING: Failed to parse changelog release notes. Manually copy 
this version's notes from the CHANGELOG.md file to {release_notes_url}.",
+            file=sys.stderr,
+        )
+        return ""
+
+
+def create_release_notes_body(token: str, version: str) -> str:
+    """Compile the release notes."""
+    github_release_body = generate_github_release_notes_body(token, version)
+    release_notes_url = get_release_notes_url(github_release_body)
+    changelog_notes = get_changelog_release_notes(release_notes_url, version)
+    full_release_notes = f"{changelog_notes}\n\n**Full Changelog**: 
{release_notes_url}"
+    return full_release_notes
+
+
+def create_github_release_draft(token: str, version: str) -> None:
+    """Create a release on GitHub."""
+    release_body = create_release_notes_body(token, version)
+    response = requests.post(
+        "https://api.github.com/repos/john-kurkowski/tldextract/releases";,
+        headers={
+            "Accept": "application/vnd.github+json",
+            "Authorization": f"Bearer {token}",
+            "X-GitHub-Api-Version": "2022-11-28",
+        },
+        json={
+            "tag_name": version,
+            "name": version,
+            "body": release_body,
+            "draft": True,
+            "prerelease": False,
+        },
+    )
+
+    try:
+        response.raise_for_status()
+    except requests.exceptions.HTTPError as err:
+        print(
+            f"WARNING: Failed to create release on Github: {err}",
+            file=sys.stderr,
+        )
+        return
+    print(f'Release created successfully: {response.json()["html_url"]}')
+
+
+def upload_build_to_pypi(is_test: str) -> None:
+    """Upload the build to PyPI."""
+    repository: list[str | Path] = (
+        [] if is_test == "n" else ["--repository", "testpypi"]
+    )
+    upload_command = ["twine", "upload", *repository, Path("dist") / "*"]
+    subprocess.run(
+        upload_command,
+        check=True,
+    )
+
+
+def push_git_tags() -> None:
+    """Push all git tags to the remote."""
+    subprocess.run(["git", "push", "--tags", "origin", "master"], check=True)
+
+
+def check_for_clean_working_tree() -> None:
+    """Check for a clean git working tree."""
+    git_status = subprocess.run(
+        ["git", "status", "--porcelain"], capture_output=True, text=True
+    )
+    if git_status.stdout:
+        print(
+            "Git working tree is not clean. Please commit or stash changes.",
+            file=sys.stderr,
+        )
+        sys.exit(1)
+
+
+def get_env_github_token() -> str:
+    """Check for the GITHUB_TOKEN environment variable."""
+    github_token = os.environ.get("GITHUB_TOKEN")
+    if not github_token:
+        print("GITHUB_TOKEN environment variable not set.", file=sys.stderr)
+        sys.exit(1)
+    return github_token
+
+
+def get_is_test_response() -> str:
+    """Ask the user if this is a test release."""
+    while True:
+        is_test = input("Is this a test release? (y/n): ")
+        if is_test in ["y", "n"]:
+            return is_test
+        else:
+            print("Invalid input. Please enter 'y' or 'n.'")
+
+
+def main() -> None:
+    """Run the main program."""
+    check_for_clean_working_tree()
+    github_token = get_env_github_token()
+    is_test = get_is_test_response()
+    version_number = input("Enter the version number: ")
+
+    add_git_tag_for_version(version_number)
+    remove_previous_dist()
+    create_build()
+    verify_build(is_test)
+    create_github_release_draft(github_token, version_number)
+
+
+if __name__ == "__main__":
+    main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/tldextract-5.1.1/tests/__snapshots__/test_release.ambr 
new/tldextract-5.1.2/tests/__snapshots__/test_release.ambr
--- old/tldextract-5.1.1/tests/__snapshots__/test_release.ambr  1970-01-01 
01:00:00.000000000 +0100
+++ new/tldextract-5.1.2/tests/__snapshots__/test_release.ambr  2024-03-16 
01:07:21.000000000 +0100
@@ -0,0 +1,244 @@
+# serializer version: 1
+# name: test_happy_path
+  dict({
+    'input': _CallList([
+      _Call(
+        '',
+        tuple(
+          'Is this a test release? (y/n): ',
+        ),
+        dict({
+        }),
+      ),
+      _Call(
+        '',
+        tuple(
+          'Enter the version number: ',
+        ),
+        dict({
+        }),
+      ),
+      _Call(
+        '',
+        tuple(
+          'Does the build look correct? (y/n): ',
+        ),
+        dict({
+        }),
+      ),
+    ]),
+    'listdir': _CallList([
+      _Call(
+        '',
+        tuple(
+          'dist',
+        ),
+        dict({
+        }),
+      ),
+    ]),
+    'requests': _CallList([
+      _Call(
+        '',
+        tuple(
+          
'https://api.github.com/repos/john-kurkowski/tldextract/releases/generate-notes',
+        ),
+        dict({
+          'headers': dict({
+            'Accept': 'application/vnd.github+json',
+            'Authorization': 'Bearer fake-token',
+            'X-GitHub-Api-Version': '2022-11-28',
+          }),
+          'json': dict({
+            'tag_name': '5.0.1',
+          }),
+        }),
+      ),
+      _Call(
+        '',
+        tuple(
+          'https://api.github.com/repos/john-kurkowski/tldextract/releases',
+        ),
+        dict({
+          'headers': dict({
+            'Accept': 'application/vnd.github+json',
+            'Authorization': 'Bearer fake-token',
+            'X-GitHub-Api-Version': '2022-11-28',
+          }),
+          'json': dict({
+            'body': '''
+              * Bugfixes
+                  * Indicate MD5 not used in a security context (FIPS 
compliance) ([#309](https://github.com/john-kurkowski/tldextract/issues/309))
+              * Misc.
+                  * Increase typecheck aggression
+              
+              **Full Changelog**: fake-body
+            ''',
+            'draft': True,
+            'name': '5.0.1',
+            'prerelease': False,
+            'tag_name': '5.0.1',
+          }),
+        }),
+      ),
+    ]),
+    'subprocess': _CallList([
+      _Call(
+        '',
+        tuple(
+          list([
+            'git',
+            'status',
+            '--porcelain',
+          ]),
+        ),
+        dict({
+          'capture_output': True,
+          'text': True,
+        }),
+      ),
+      _Call(
+        '',
+        tuple(
+          list([
+            'git',
+            'tag',
+            '-a',
+            '5.0.1',
+            '-m',
+            '5.0.1',
+          ]),
+        ),
+        dict({
+          'check': True,
+        }),
+      ),
+      _Call(
+        '',
+        tuple(
+          list([
+            'rm',
+            '-rf',
+            PosixPath('dist'),
+          ]),
+        ),
+        dict({
+          'check': True,
+        }),
+      ),
+      _Call(
+        '',
+        tuple(
+          list([
+            'python',
+            '-m',
+            'build',
+          ]),
+        ),
+        dict({
+          'check': True,
+        }),
+      ),
+      _Call(
+        '',
+        tuple(
+          list([
+            'ls',
+            '-l',
+            PosixPath('dist'),
+          ]),
+        ),
+        dict({
+          'check': True,
+        }),
+      ),
+      _Call(
+        '',
+        tuple(
+          list([
+            'tar',
+            'tvf',
+            PosixPath('dist/archive1'),
+          ]),
+        ),
+        dict({
+          'check': True,
+        }),
+      ),
+      _Call(
+        '',
+        tuple(
+          list([
+            'tar',
+            'tvf',
+            PosixPath('dist/archive2'),
+          ]),
+        ),
+        dict({
+          'check': True,
+        }),
+      ),
+      _Call(
+        '',
+        tuple(
+          list([
+            'tar',
+            'tvf',
+            PosixPath('dist/archive3'),
+          ]),
+        ),
+        dict({
+          'check': True,
+        }),
+      ),
+      _Call(
+        '',
+        tuple(
+          list([
+            'twine',
+            'upload',
+            '--repository',
+            'testpypi',
+            PosixPath('dist/*'),
+          ]),
+        ),
+        dict({
+          'check': True,
+        }),
+      ),
+      _Call(
+        '',
+        tuple(
+          list([
+            'git',
+            'push',
+            '--tags',
+            'origin',
+            'master',
+          ]),
+        ),
+        dict({
+          'check': True,
+        }),
+      ),
+    ]),
+  })
+# ---
+# name: test_happy_path.1
+  '''
+  Version 5.0.1 tag added successfully.
+  Previous dist folder removed successfully.
+  Build created successfully.
+  Contents of dist folder:
+  Contents of tar files in dist folder:
+  Build verified successfully.
+  Release created successfully: https://github.com/path/to/release
+  
+  '''
+# ---
+# name: test_happy_path.2
+  '''
+  WARNING: dist folder contains incorrect number of files.
+  
+  '''
+# ---
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/tests/main_test.py 
new/tldextract-5.1.2/tests/main_test.py
--- old/tldextract-5.1.1/tests/main_test.py     2023-10-28 20:47:14.000000000 
+0200
+++ new/tldextract-5.1.2/tests/main_test.py     2024-03-08 22:53:51.000000000 
+0100
@@ -4,6 +4,7 @@
 
 import logging
 import os
+import sys
 import tempfile
 from collections.abc import Sequence
 from pathlib import Path
@@ -17,7 +18,7 @@
 import tldextract
 import tldextract.suffix_list
 from tldextract.cache import DiskCache
-from tldextract.remote import inet_pton, lenient_netloc, looks_like_ip
+from tldextract.remote import lenient_netloc, looks_like_ip, looks_like_ipv6
 from tldextract.suffix_list import SuffixListNotFound
 from tldextract.tldextract import ExtractResult
 
@@ -152,21 +153,24 @@
     )
 
 
-@pytest.mark.skipif(not inet_pton, reason="inet_pton unavailable")
-def test_looks_like_ip_with_inet_pton() -> None:
-    """Test preferred function to check if a string looks like an IP 
address."""
-    assert looks_like_ip("1.1.1.1", inet_pton) is True
-    assert looks_like_ip("a.1.1.1", inet_pton) is False
-    assert looks_like_ip("1.1.1.1\n", inet_pton) is False
-    assert looks_like_ip("256.256.256.256", inet_pton) is False
-
-
-def test_looks_like_ip_without_inet_pton() -> None:
-    """Test fallback function to check if a string looks like an IP address."""
-    assert looks_like_ip("1.1.1.1", None) is True
-    assert looks_like_ip("a.1.1.1", None) is False
-    assert looks_like_ip("1.1.1.1\n", None) is False
-    assert looks_like_ip("256.256.256.256", None) is False
+def test_looks_like_ip() -> None:
+    """Test function to check if a string looks like an IPv4 address."""
+    assert looks_like_ip("1.1.1.1") is True
+    assert looks_like_ip("1.1.1.01") is False
+    assert looks_like_ip("a.1.1.1") is False
+    assert looks_like_ip("1.1.1.1\n") is False
+    assert looks_like_ip("256.256.256.256") is False
+
+
+def test_looks_like_ipv6() -> None:
+    """Test function to check if a string looks like an IPv6 address."""
+    assert looks_like_ipv6("::") is True
+    assert looks_like_ipv6("aBcD:ef01:2345:6789:aBcD:ef01:aaaa:2288") is True
+    assert looks_like_ipv6("aBcD:ef01:2345:6789:aBcD:ef01:127.0.0.1") is True
+    assert looks_like_ipv6("ZBcD:ef01:2345:6789:aBcD:ef01:127.0.0.1") is False
+    if sys.version_info >= (3, 8, 12):  # noqa: UP036
+        assert looks_like_ipv6("aBcD:ef01:2345:6789:aBcD:ef01:127.0.0.01") is 
False
+    assert looks_like_ipv6("aBcD:ef01:2345:6789:aBcD:") is False
 
 
 def test_similar_to_ip() -> None:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/tests/test_cache.py 
new/tldextract-5.1.2/tests/test_cache.py
--- old/tldextract-5.1.1/tests/test_cache.py    2023-11-13 21:07:39.000000000 
+0100
+++ new/tldextract-5.1.2/tests/test_cache.py    2024-03-08 22:53:51.000000000 
+0100
@@ -1,4 +1,5 @@
 """Test the caching functionality."""
+
 from __future__ import annotations
 
 import sys
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/tests/test_release.py 
new/tldextract-5.1.2/tests/test_release.py
--- old/tldextract-5.1.1/tests/test_release.py  1970-01-01 01:00:00.000000000 
+0100
+++ new/tldextract-5.1.2/tests/test_release.py  2024-03-19 04:36:52.000000000 
+0100
@@ -0,0 +1,95 @@
+"""Test the library maintainer release script."""
+
+from __future__ import annotations
+
+import dataclasses
+import sys
+from collections.abc import Iterator
+from typing import Any
+from unittest import mock
+
+import pytest
+from syrupy.assertion import SnapshotAssertion
+
+from scripts import release
+
+
+@dataclasses.dataclass
+class Mocks:
+    """Collection of all mocked objects used in the release script."""
+
+    input: mock.Mock
+    listdir: mock.Mock
+    requests: mock.Mock
+    subprocess: mock.Mock
+
+    @property
+    def mock_calls(self) -> dict[str, Any]:
+        """A dict of _all_ calls to this class's mock objects."""
+        return {
+            k.name: getattr(self, k.name).mock_calls for k in 
dataclasses.fields(self)
+        }
+
+
+@pytest.fixture
+def mocks() -> Iterator[Mocks]:
+    """Stub network and subprocesses."""
+    with mock.patch("builtins.input") as mock_input, mock.patch(
+        "os.listdir"
+    ) as mock_listdir, mock.patch("requests.post") as mock_requests, 
mock.patch(
+        "subprocess.run"
+    ) as mock_subprocess:
+        yield Mocks(
+            input=mock_input,
+            listdir=mock_listdir,
+            requests=mock_requests,
+            subprocess=mock_subprocess,
+        )
+
+
+@pytest.mark.skipif(
+    sys.platform == "win32", reason="Snapshot paths are different on Windows"
+)
+def test_happy_path(
+    capsys: pytest.CaptureFixture[str],
+    mocks: Mocks,
+    monkeypatch: pytest.MonkeyPatch,
+    snapshot: SnapshotAssertion,
+) -> None:
+    """Test the release script happy path.
+
+    Simulate user input for a typical, existing release.
+
+    This one test case covers most lines of the release script, without
+    actually making network requests or running subprocesses. For an
+    infrequently used script, this coverage is useful without being too brittle
+    to change.
+    """
+    monkeypatch.setenv("GITHUB_TOKEN", "fake-token")
+
+    mocks.input.side_effect = ["y", "5.0.1", "y"]
+
+    mocks.listdir.return_value = ["archive1", "archive2", "archive3"]
+
+    def mock_post(*args: Any, **kwargs: Any) -> mock.Mock:
+        """Return _one_ response JSON that happens to match expectations for 
multiple requests."""
+        return mock.Mock(
+            json=mock.Mock(
+                return_value={
+                    "body": "Body start **Full Changelog**: fake-body",
+                    "html_url": "https://github.com/path/to/release";,
+                }
+            ),
+        )
+
+    mocks.requests.side_effect = mock_post
+
+    mocks.subprocess.return_value.stdout = ""
+
+    release.main()
+
+    out, err = capsys.readouterr()
+
+    assert mocks.mock_calls == snapshot
+    assert out == snapshot
+    assert err == snapshot
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/tests/test_trie.py 
new/tldextract-5.1.2/tests/test_trie.py
--- old/tldextract-5.1.1/tests/test_trie.py     2023-10-11 10:28:34.000000000 
+0200
+++ new/tldextract-5.1.2/tests/test_trie.py     2024-03-08 22:53:51.000000000 
+0100
@@ -1,4 +1,5 @@
 """Trie tests."""
+
 from itertools import permutations
 
 from tldextract.tldextract import Trie
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/tldextract/__main__.py 
new/tldextract-5.1.2/tldextract/__main__.py
--- old/tldextract-5.1.1/tldextract/__main__.py 2022-06-06 01:36:58.000000000 
+0200
+++ new/tldextract-5.1.2/tldextract/__main__.py 2024-03-08 22:53:51.000000000 
+0100
@@ -1,6 +1,5 @@
 """tldextract __main__."""
 
-
 from .cli import main
 
 if __name__ == "__main__":
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/tldextract/_version.py 
new/tldextract-5.1.2/tldextract/_version.py
--- old/tldextract-5.1.1/tldextract/_version.py 2023-11-17 04:43:35.000000000 
+0100
+++ new/tldextract-5.1.2/tldextract/_version.py 2024-03-19 05:07:52.000000000 
+0100
@@ -12,5 +12,5 @@
 __version_tuple__: VERSION_TUPLE
 version_tuple: VERSION_TUPLE
 
-__version__ = version = '5.1.1'
-__version_tuple__ = version_tuple = (5, 1, 1)
+__version__ = version = '5.1.2'
+__version_tuple__ = version_tuple = (5, 1, 2)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/tldextract/cache.py 
new/tldextract-5.1.2/tldextract/cache.py
--- old/tldextract-5.1.1/tldextract/cache.py    2023-11-13 21:07:39.000000000 
+0100
+++ new/tldextract-5.1.2/tldextract/cache.py    2024-03-08 22:53:51.000000000 
+0100
@@ -1,4 +1,5 @@
 """Helpers."""
+
 from __future__ import annotations
 
 import errno
@@ -37,8 +38,7 @@
 
 
 def get_pkg_unique_identifier() -> str:
-    """
-    Generate an identifier unique to the python version, tldextract version, 
and python instance.
+    """Generate an identifier unique to the python version, tldextract 
version, and python instance.
 
     This will prevent interference between virtualenvs and issues that might 
arise when installing
     a new version of tldextract
@@ -65,8 +65,7 @@
 
 
 def get_cache_dir() -> str:
-    """
-    Get a cache dir that we have permission to write to.
+    """Get a cache dir that we have permission to write to.
 
     Try to follow the XDG standard, but if that doesn't work fallback to the 
package directory
     http://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/tldextract/remote.py 
new/tldextract-5.1.2/tldextract/remote.py
--- old/tldextract-5.1.1/tldextract/remote.py   2023-10-11 21:15:35.000000000 
+0200
+++ new/tldextract-5.1.2/tldextract/remote.py   2024-03-08 23:02:00.000000000 
+0100
@@ -3,19 +3,13 @@
 from __future__ import annotations
 
 import re
-from collections.abc import Callable
 from ipaddress import AddressValueError, IPv6Address
 from urllib.parse import scheme_chars
 
-inet_pton: Callable[[int, str], bytes] | None
-try:
-    from socket import AF_INET, AF_INET6, inet_pton  # Availability: Unix, 
Windows.
-except ImportError:
-    inet_pton = None
-
 IP_RE = re.compile(
-    r"^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.)"
-    r"{3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
+    r"^(?:(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.)"
+    r"{3}(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$",
+    re.ASCII,
 )
 
 scheme_chars_set = set(scheme_chars)
@@ -59,32 +53,16 @@
     return url[double_slashes_start + 2 :]
 
 
-def looks_like_ip(
-    maybe_ip: str, pton: Callable[[int, str], bytes] | None = inet_pton
-) -> bool:
-    """Check whether the given str looks like an IP address."""
+def looks_like_ip(maybe_ip: str) -> bool:
+    """Check whether the given str looks like an IPv4 address."""
     if not maybe_ip[0].isdigit():
         return False
 
-    if pton is not None:
-        try:
-            pton(AF_INET, maybe_ip)
-            return True
-        except OSError:
-            return False
     return IP_RE.fullmatch(maybe_ip) is not None
 
 
-def looks_like_ipv6(
-    maybe_ip: str, pton: Callable[[int, str], bytes] | None = inet_pton
-) -> bool:
+def looks_like_ipv6(maybe_ip: str) -> bool:
     """Check whether the given str looks like an IPv6 address."""
-    if pton is not None:
-        try:
-            pton(AF_INET6, maybe_ip)
-            return True
-        except OSError:
-            return False
     try:
         IPv6Address(maybe_ip)
     except AddressValueError:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/tldextract/tldextract.py 
new/tldextract-5.1.2/tldextract/tldextract.py
--- old/tldextract-5.1.1/tldextract/tldextract.py       2023-10-28 
20:47:14.000000000 +0200
+++ new/tldextract-5.1.2/tldextract/tldextract.py       2024-03-08 
22:59:46.000000000 +0100
@@ -75,8 +75,7 @@
 
     @property
     def registered_domain(self) -> str:
-        """
-        Joins the domain and suffix fields with a dot, if they're both set.
+        """Joins the domain and suffix fields with a dot, if they're both set.
 
         >>> extract('http://forums.bbc.co.uk').registered_domain
         'bbc.co.uk'
@@ -89,8 +88,7 @@
 
     @property
     def fqdn(self) -> str:
-        """
-        Returns a Fully Qualified Domain Name, if there is a proper 
domain/suffix.
+        """Returns a Fully Qualified Domain Name, if there is a proper 
domain/suffix.
 
         >>> extract('http://forums.bbc.co.uk/path/to/file').fqdn
         'forums.bbc.co.uk'
@@ -103,8 +101,7 @@
 
     @property
     def ipv4(self) -> str:
-        """
-        Returns the ipv4 if that is what the presented domain/url is.
+        """Returns the ipv4 if that is what the presented domain/url is.
 
         >>> extract('http://127.0.0.1/path/to/file').ipv4
         '127.0.0.1'
@@ -123,8 +120,7 @@
 
     @property
     def ipv6(self) -> str:
-        """
-        Returns the ipv6 if that is what the presented domain/url is.
+        """Returns the ipv6 if that is what the presented domain/url is.
 
         >>> 
extract('http://[aBcD:ef01:2345:6789:aBcD:ef01:127.0.0.1]/path/to/file').ipv6
         'aBcD:ef01:2345:6789:aBcD:ef01:127.0.0.1'
@@ -334,8 +330,7 @@
 
     @property
     def tlds(self, session: requests.Session | None = None) -> list[str]:
-        """
-        Returns the list of tld's used by default.
+        """Returns the list of tld's used by default.
 
         This will vary based on `include_psl_private_domains` and 
`extra_suffixes`
         """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/tldextract.egg-info/PKG-INFO 
new/tldextract-5.1.2/tldextract.egg-info/PKG-INFO
--- old/tldextract-5.1.1/tldextract.egg-info/PKG-INFO   2023-11-17 
04:43:35.000000000 +0100
+++ new/tldextract-5.1.2/tldextract.egg-info/PKG-INFO   2024-03-19 
05:07:53.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: tldextract
-Version: 5.1.1
+Version: 5.1.2
 Summary: Accurately separates a URL's subdomain, domain, and public suffix, 
using the Public Suffix List (PSL). By default, this includes the public ICANN 
TLDs and their exceptions. You can optionally support the Public Suffix List's 
private domains as well.
 Author-email: John Kurkowski <john.kurkow...@gmail.com>
 License: BSD-3-Clause
@@ -22,6 +22,9 @@
 Requires-Dist: requests>=2.1.0
 Requires-Dist: requests-file>=1.4
 Requires-Dist: filelock>=3.0.8
+Provides-Extra: release
+Requires-Dist: build; extra == "release"
+Requires-Dist: twine; extra == "release"
 Provides-Extra: testing
 Requires-Dist: black; extra == "testing"
 Requires-Dist: mypy; extra == "testing"
@@ -30,6 +33,7 @@
 Requires-Dist: pytest-mock; extra == "testing"
 Requires-Dist: responses; extra == "testing"
 Requires-Dist: ruff; extra == "testing"
+Requires-Dist: syrupy; extra == "testing"
 Requires-Dist: tox; extra == "testing"
 Requires-Dist: types-filelock; extra == "testing"
 Requires-Dist: types-requests; extra == "testing"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/tldextract.egg-info/SOURCES.txt 
new/tldextract-5.1.2/tldextract.egg-info/SOURCES.txt
--- old/tldextract-5.1.1/tldextract.egg-info/SOURCES.txt        2023-11-17 
04:43:35.000000000 +0100
+++ new/tldextract-5.1.2/tldextract.egg-info/SOURCES.txt        2024-03-19 
05:07:53.000000000 +0100
@@ -6,6 +6,7 @@
 tox.ini
 .github/FUNDING.yml
 .github/workflows/ci.yml
+scripts/release.py
 tests/__init__.py
 tests/cli_test.py
 tests/conftest.py
@@ -14,7 +15,9 @@
 tests/main_test.py
 tests/test_cache.py
 tests/test_parallel.py
+tests/test_release.py
 tests/test_trie.py
+tests/__snapshots__/test_release.ambr
 tests/fixtures/fake_suffix_list_fixture.dat
 tldextract/.tld_set_snapshot
 tldextract/__init__.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/tldextract.egg-info/requires.txt 
new/tldextract-5.1.2/tldextract.egg-info/requires.txt
--- old/tldextract-5.1.1/tldextract.egg-info/requires.txt       2023-11-17 
04:43:35.000000000 +0100
+++ new/tldextract-5.1.2/tldextract.egg-info/requires.txt       2024-03-19 
05:07:53.000000000 +0100
@@ -3,6 +3,10 @@
 requests-file>=1.4
 filelock>=3.0.8
 
+[release]
+build
+twine
+
 [testing]
 black
 mypy
@@ -11,6 +15,7 @@
 pytest-mock
 responses
 ruff
+syrupy
 tox
 types-filelock
 types-requests
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tldextract-5.1.1/tox.ini new/tldextract-5.1.2/tox.ini
--- old/tldextract-5.1.1/tox.ini        2023-11-13 21:07:39.000000000 +0100
+++ new/tldextract-5.1.2/tox.ini        2024-03-16 01:07:21.000000000 +0100
@@ -1,5 +1,5 @@
 [tox]
-envlist = py{38,39,310,311,312,py38},codestyle,lint,typecheck
+envlist = py{38,39,310,311,312,py38,py39,py310},codestyle,lint,typecheck
 
 [testenv]
 commands = pytest {posargs}
@@ -18,5 +18,5 @@
 
 [testenv:typecheck]
 basepython = python3.8
-commands = mypy --show-error-codes tldextract tests
+commands = mypy --show-error-codes scripts tldextract tests
 extras = testing

Reply via email to