From ac60149d1f4f5ea71e6b2a3c1c554f2a8d2779fe Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 2 Oct 2024 13:57:47 -0400 Subject: [PATCH 1/3] ci: add 3.13 Signed-off-by: Henry Schreiner --- .github/workflows/ci.yml | 2 +- pyproject.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 044778dd..fff293f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.10", "3.12"] + python-version: ["3.8", "3.10", "3.13"] os: [ubuntu-latest, windows-latest, macos-13] include: - python-version: 'pypy-3.8' diff --git a/pyproject.toml b/pyproject.toml index a2d98be8..772b81d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Software Development :: Build Tools", "Topic :: System :: Systems Administration", ] From c35ec6682e3990c3ef97b8e551c1368ef4db53b4 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 2 Oct 2024 14:00:18 -0400 Subject: [PATCH 2/3] ci: add attestations Signed-off-by: Henry Schreiner --- .github/workflows/cd.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 692add3a..42917d06 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -12,7 +12,7 @@ env: jobs: dist: name: Dist - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: @@ -22,12 +22,15 @@ jobs: deploy: name: Deploy - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest needs: [dist] if: github.event_name == 'release' && github.event.action == 'published' - environment: pypi + environment: + name: pypi + url: https://pypi.org/p/plumbum permissions: id-token: write + attestations: write steps: - uses: actions/download-artifact@v4 @@ -35,4 +38,11 @@ jobs: name: Packages path: dist + - name: Generate artifact attestation for sdist and wheel + uses: actions/attest-build-provenance@v1 + with: + subject-path: "dist/*" + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + attestations: true From 290f163b55427234da93173ed47aff01df682dd1 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 2 Oct 2024 14:10:51 -0400 Subject: [PATCH 3/3] chore: fix lints Signed-off-by: Henry Schreiner --- plumbum/colorlib/styles.py | 6 ++++-- plumbum/commands/base.py | 12 ++++++++---- pyproject.toml | 7 ++++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/plumbum/colorlib/styles.py b/plumbum/colorlib/styles.py index 4aec1bf9..a2605334 100644 --- a/plumbum/colorlib/styles.py +++ b/plumbum/colorlib/styles.py @@ -16,7 +16,7 @@ import sys from abc import ABCMeta, abstractmethod from copy import copy -from typing import IO +from typing import IO, ClassVar from .names import ( FindNearest, @@ -343,7 +343,9 @@ class Style(metaclass=ABCMeta): """The class of color to use. Never hardcode ``Color`` call when writing a Style method.""" - attribute_names: dict[str, str] | dict[str, int] + # These must be defined by subclasses + # pylint: disable-next=declare-non-slot + attribute_names: ClassVar[dict[str, str] | dict[str, int]] _stdout: IO | None = None end = "\n" diff --git a/plumbum/commands/base.py b/plumbum/commands/base.py index 29638ce1..8511ec33 100644 --- a/plumbum/commands/base.py +++ b/plumbum/commands/base.py @@ -437,9 +437,11 @@ def verify(proc, retcode, timeout, stdout, stderr): class BaseRedirection(BaseCommand): __slots__ = ("cmd", "file") - SYM: ClassVar[str] - KWARG: ClassVar[str] - MODE: ClassVar[str] + + # These must be defined by subclasses + SYM: ClassVar[str] # pylint: disable=declare-non-slot + KWARG: ClassVar[str] # pylint: disable=declare-non-slot + MODE: ClassVar[str] # pylint: disable=declare-non-slot def __init__(self, cmd, file): self.cmd = cmd @@ -563,9 +565,11 @@ def popen(self, args=(), **kwargs): class ConcreteCommand(BaseCommand): - QUOTE_LEVEL: ClassVar[int] __slots__ = ("executable",) + # These must be defined by subclasses + QUOTE_LEVEL: ClassVar[int] # pylint: disable=declare-non-slot + def __init__(self, executable, encoding): self.executable = executable self.custom_encoding = encoding diff --git a/pyproject.toml b/pyproject.toml index 772b81d5..306a175a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -125,9 +125,9 @@ optional_tests = """ [tool.pylint] -master.py-version = "3.8" -master.jobs = "0" -master.load-plugins = ["pylint.extensions.no_self_use"] +py-version = "3.8" +jobs = "0" +load-plugins = ["pylint.extensions.no_self_use"] reports.output-format = "colorized" similarities.ignore-imports = "yes" messages_control.enable = [ @@ -162,6 +162,7 @@ messages_control.disable = [ "too-many-public-methods", "too-many-return-statements", "too-many-statements", + "too-many-positional-arguments", "unidiomatic-typecheck", # TODO: might be able to remove "unnecessary-lambda-assignment", # TODO: 4 instances "unused-import", # identical to flake8 but has typing false positives