From 504edc9c73cb082add544b125db0af0567bf67ca Mon Sep 17 00:00:00 2001 From: jelleas Date: Wed, 3 Sep 2025 14:34:25 +0200 Subject: [PATCH 1/5] replace attr with dataclasses --- lib50/authentication.py | 20 +++++++++++--------- setup.py | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib50/authentication.py b/lib50/authentication.py index cc98ab0..fdb46fd 100644 --- a/lib50/authentication.py +++ b/lib50/authentication.py @@ -1,5 +1,5 @@ -import attr import contextlib +import dataclasses import enum import os import pexpect @@ -20,16 +20,18 @@ _CREDENTIAL_SOCKET = Path("~/.git-credential-cache/lib50").expanduser() -@attr.s(slots=True) +@dataclasses.dataclass(slots=True) class User: """An authenticated GitHub user that has write access to org/repo.""" - name = attr.ib() - repo = attr.ib() - org = attr.ib() - passphrase = attr.ib(default=str) - email = attr.ib(default=attr.Factory(lambda self: f"{self.name}@users.noreply.github.com", - takes_self=True), - init=False) + name: str + repo: str + org: str + passphrase: str = "" + email: str = dataclasses.field(init=False) + + def __post_init__(self): + self.email = f"{self.name}@users.noreply.github.com" + @contextlib.contextmanager def authenticate(org, repo=None, auth_method=None): diff --git a/setup.py b/setup.py index 1ca5d1c..e5835be 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ license="GPLv3", description="This is lib50, CS50's own internal library used in many of its tools.", long_description="This is lib50, CS50's own internal library used in many of its tools.", - install_requires=["attrs>=18.1,<21", "packaging", "pexpect>=4.6,<5", "pyyaml<7", "requests>=2.13,<3", "setuptools", "termcolor>=1.1,<2", "jellyfish>=1,<2", "cryptography>=2.7"], + install_requires=["packaging", "pexpect>=4.6,<5", "pyyaml<7", "requests>=2.13,<3", "setuptools", "termcolor>=1.1,<2", "jellyfish>=1,<2", "cryptography>=2.7"], extras_require = { "develop": ["sphinx", "sphinx-autobuild", "sphinx_rtd_theme"] }, From e6b885c061a3501333b4fd315ab9c80a107f6d24 Mon Sep 17 00:00:00 2001 From: jelleas Date: Wed, 3 Sep 2025 14:36:39 +0200 Subject: [PATCH 2/5] rm slots=true, requires Python >= 3.10 --- lib50/authentication.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib50/authentication.py b/lib50/authentication.py index fdb46fd..d97a550 100644 --- a/lib50/authentication.py +++ b/lib50/authentication.py @@ -20,7 +20,7 @@ _CREDENTIAL_SOCKET = Path("~/.git-credential-cache/lib50").expanduser() -@dataclasses.dataclass(slots=True) +@dataclasses.dataclass class User: """An authenticated GitHub user that has write access to org/repo.""" name: str From 463b70e26015af96d3fd360b000a8ed5848185ff Mon Sep 17 00:00:00 2001 From: Joshua Lane Date: Mon, 17 Nov 2025 13:42:43 +1100 Subject: [PATCH 3/5] change setup.py python_requires to >=3.10 given match statements in authentication.py (introduced in 3.10) --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1ca5d1c..20f7e57 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ }, keywords=["lib50"], name="lib50", - python_requires=">= 3.8", + python_requires=">= 3.10", packages=["lib50"], url="https://github.com/cs50/lib50", version="3.1.4", From 0944b2bdacec9576b893b8b40577ff2d5e39ff2e Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Sun, 4 Jan 2026 13:20:23 -0500 Subject: [PATCH 4/5] update GitHub Actions to use latest checkout and Python versions --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 578e0de..dc2b0ed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,10 +3,10 @@ jobs: test-and-deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: - python-version: "3.13" + python-version: "3.14" - name: Run tests run: | pip install babel From 5493ab4a1bbcf343f815126f776e0e3a567562f0 Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Sun, 4 Jan 2026 13:40:52 -0500 Subject: [PATCH 5/5] bump version to 3.2.0 in setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2b278a2..78c5370 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,6 @@ python_requires=">= 3.10", packages=["lib50"], url="https://github.com/cs50/lib50", - version="3.1.4", + version="3.2.0", include_package_data=True )