Skip to content

Commit

Permalink
remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Nov 13, 2024
1 parent 687695c commit 66892b2
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
PIP_BREAK_SYSTEM_PACKAGES=1 make install-sysdeps install-pydeps-test install print-sysinfo test test-memleaks
netbsd:
# if: false
if: false # XXX: disabled
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,6 @@ def has_label(issue, label):
return label in assigned


def has_os_label(issue):
labels = set([x.name for x in issue.labels])
return any(x in labels for x in OS_LABELS)


def get_repo():
repo = os.environ['GITHUB_REPOSITORY']
token = os.environ['GITHUB_TOKEN']
Expand Down
2 changes: 1 addition & 1 deletion psutil/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def FileExistsError(inst):
"CacheInfo", ["hits", "misses", "maxsize", "currsize"]
)

class _HashedSeq(list):
class _HashedSeq(list): # noqa: FURB189
__slots__ = ('hashvalue',)

def __init__(self, tup, hash=hash):
Expand Down
39 changes: 33 additions & 6 deletions psutil/tests/test_aix.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ class AIXSpecificTestCase(PsutilTestCase):
def test_virtual_memory(self):
out = sh('/usr/bin/svmon -O unit=KB')
re_pattern = r"memory\s*"
for field in ("size inuse free pin virtual available mmode").split():
for field in [
"size",
"inuse",
"free",
"pin",
"virtual",
"available",
"mmode",
]:
re_pattern += r"(?P<%s>\S+)\s+" % (field,)
matchobj = re.search(re_pattern, out)

Expand Down Expand Up @@ -72,11 +80,30 @@ def test_cpu_stats(self):
out = sh('/usr/bin/mpstat -a')

re_pattern = r"ALL\s*"
for field in (
"min maj mpcs mpcr dev soft dec ph cs ics bound rq "
"push S3pull S3grd S0rd S1rd S2rd S3rd S4rd S5rd "
"sysc"
).split():
for field in [
"min",
"maj",
"mpcs",
"mpcr",
"dev",
"soft",
"dec",
"ph",
"cs",
"ics",
"bound",
"rq",
"push",
"S3pull",
"S3grd",
"S0rd",
"S1rd",
"S2rd",
"S3rd",
"S4rd",
"S5rd",
"sysc",
]:
re_pattern += r"(?P<%s>\S+)\s+" % (field,)
matchobj = re.search(re_pattern, out)

Expand Down
5 changes: 0 additions & 5 deletions psutil/tests/test_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import collections
import contextlib
import errno
import glob
import io
import os
import re
Expand Down Expand Up @@ -61,15 +60,11 @@

HERE = os.path.abspath(os.path.dirname(__file__))
SIOCGIFADDR = 0x8915
SIOCGIFCONF = 0x8912
SIOCGIFHWADDR = 0x8927
SIOCGIFNETMASK = 0x891B
SIOCGIFBRDADDR = 0x8919
if LINUX:
SECTOR_SIZE = 512
EMPTY_TEMPERATURES = not glob.glob('/sys/class/hwmon/hwmon*')


# =====================================================================
# --- utils
# =====================================================================
Expand Down
4 changes: 0 additions & 4 deletions scripts/internal/bench_oneshot_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ def call_oneshot():
fun()


def add_cmdline_args(cmd, args):
cmd.append(args.benchmark)


def main():
runner = pyperf.Runner()

Expand Down
2 changes: 0 additions & 2 deletions scripts/internal/download_wheels_appveyor.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,10 @@ def download_file(url):
local_fname = os.path.join('dist', local_fname)
os.makedirs('dist', exist_ok=True)
r = requests.get(url, stream=True, timeout=TIMEOUT)
tot_bytes = 0
with open(local_fname, 'wb') as f:
for chunk in r.iter_content(chunk_size=16384):
if chunk: # filter out keep-alive new chunks
f.write(chunk)
tot_bytes += len(chunk)
return local_fname


Expand Down
1 change: 0 additions & 1 deletion scripts/internal/git_pre_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

PYTHON = sys.executable
PY3 = sys.version_info[0] >= 3
THIS_SCRIPT = os.path.realpath(__file__)


def term_supports_colors():
Expand Down

0 comments on commit 66892b2

Please sign in to comment.