Skip to content

Commit

Permalink
ci: add 3.13 (#690)
Browse files Browse the repository at this point in the history
* ci: add 3.13

Signed-off-by: Henry Schreiner <[email protected]>

* ci: add attestations

Signed-off-by: Henry Schreiner <[email protected]>

* chore: fix lints

Signed-off-by: Henry Schreiner <[email protected]>

---------

Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii authored Oct 5, 2024
1 parent 9ad5112 commit 440fdaa
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 13 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
jobs:
dist:
name: Dist
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -22,17 +22,27 @@ 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
with:
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 4 additions & 2 deletions plumbum/colorlib/styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"
Expand Down
12 changes: 8 additions & 4 deletions plumbum/commands/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down Expand Up @@ -124,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 = [
Expand Down Expand Up @@ -161,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
Expand Down

0 comments on commit 440fdaa

Please sign in to comment.