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 diff --git a/lib50/authentication.py b/lib50/authentication.py index cc98ab0..d97a550 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 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..78c5370 100644 --- a/setup.py +++ b/setup.py @@ -18,15 +18,15 @@ 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"] }, keywords=["lib50"], name="lib50", - python_requires=">= 3.8", + python_requires=">= 3.10", packages=["lib50"], url="https://github.com/cs50/lib50", - version="3.1.4", + version="3.2.0", include_package_data=True )