Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
26d4fcd
redo PR and force push
aixtools Nov 29, 2019
730016e
modify import to work better with monkeypatch in tests
aixtools Nov 29, 2019
ce9e721
Add extra monkeypatch setting
aixtools Nov 29, 2019
89a7b23
More changes to get past Windows CI tests...
aixtools Nov 29, 2019
e3ce54e
CI module `black` says double quotes `"` needed
aixtools Nov 29, 2019
b46efe0
Changes made in accordance of peer review of CPyhton PR #17303
aixtools Dec 8, 2019
ac25b81
Specify `#pragma no cover` for Windows - that does not have os.uname()
aixtools Dec 8, 2019
9c999bb
Remove "too many spaces" in pragma (comment)
aixtools Dec 8, 2019
f06f81a
Non-posix systems (i.e., no `os.uname()`) fail coverage tests, use co…
aixtools Dec 8, 2019
c8d5d79
Sync code with CPython 3.9: `Lib/_aix_support.py`
aixtools Dec 17, 2019
8677561
typo corrections to pass lint
aixtools Dec 17, 2019
1dc7248
Merge branch 'master' into AIX-platform-tag
di Jan 2, 2020
5c9166b
Merge branch 'master' into AIX-platform-tag
aixtools Feb 3, 2020
2f9fc76
Merge branch 'master' into AIX-platform-tag
aixtools Mar 17, 2020
f9019b2
rename _AIX_platform to _aix_support - same as in CPython
aixtools Apr 3, 2020
5572136
Merge branch 'master' into AIX-platform-tag
aixtools Apr 3, 2020
91412e8
Sync _aix_support.py with CPython `Lib/_aix_support.py`
aixtools Apr 3, 2020
81ebe3c
Fix file to pass flake8 tests
aixtools Apr 3, 2020
27ebbb1
import subprocess no longer needed to support monkeypatch
aixtools Apr 3, 2020
cf52688
Shorten variable names to pass flake8 line-length tests
aixtools Apr 20, 2020
68e9c80
Add a NewType for normalized names (#292)
pradyunsg Apr 8, 2020
880edc3
Merge branch 'master' into AIX-platform-tag
aixtools Apr 20, 2020
48dab36
typo
aixtools Apr 20, 2020
5088c8c
Merge branch 'master' into AIX-platform-tag by removing the conflicts
aixtools Nov 1, 2020
ae6ee5f
Restored the lines removed - in order to restart work.
aixtools Nov 1, 2020
56aee30
Fix paste error; add a new-line
aixtools Nov 3, 2020
c9544b6
Fix blank line with spaces
aixtools Nov 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Shorten variable names to pass flake8 line-length tests
  • Loading branch information
aixtools committed Apr 20, 2020
commit cf52688e3ca2466a425a8869d90f207dcc61063b
22 changes: 11 additions & 11 deletions packaging/_aix_support.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Shared AIX support functions."""

import sys
import sysconfig
from sysconfig import get_config_var

try:
from subprocess import check_output
Expand All @@ -12,18 +12,18 @@
# substitures are necessary for bootstrap and CI coverage tests
_have_subprocess = False

from ._typing import MYPY_CHECK_RUNNING
from ._typing import TYPE_CHECKING

if MYPY_CHECK_RUNNING: # pragma: no cover
from typing import List, Tuple


def _aix_tag(vrtl, bd):
def _aix_tag(tl, bd):
# type: (List[int], int) -> str
# Infer the ABI bitwidth from maxsize (assuming 64 bit as the default)
sz = 32 if sys.maxsize == (2 ** 31 - 1) else 64
# vrtl[version, release, technology_level]
return "aix-{:1x}{:1d}{:02d}-{:04d}-{}".format(vrtl[0], vrtl[1], vrtl[2], bd, sz)
# tl[version, release, technology_level]
return "aix-{:1x}{:1d}{:02d}-{:04d}-{}".format(tl[0], tl[1], tl[2], bd, sz)


# extract version, release and technology level from a VRMF string
Expand Down Expand Up @@ -80,10 +80,10 @@ def aix_platform():
def _aix_bgt():
# type: () -> List[int]
if _have_subprocess:
bgt = sysconfig.get_config_var("BUILD_GNU_TYPE")
bgt = get_config_var("BUILD_GNU_TYPE")
else:
bgt = "powerpc-ibm-aix6.1.7.0"
return _aix_vrtl(vrmf=bgt)
return _aix_vrtl(vrmf=str(bgt))


def aix_buildtag():
Expand All @@ -94,10 +94,10 @@ def aix_buildtag():
# To permit packaging to be used when the variable "AIX_BUILDDATE"
# is not defined - return an impossible value rather than
# raise ValueError() as Cpython Lib/_aix_support does
bd = sysconfig.get_config_var("AIX_BUILDDATE") if _have_subprocess else "9898"
bd = get_config_var("AIX_BUILDDATE") if _have_subprocess else "9898"
try:
bd = int(str(bd))
bd = str(bd)
except (TypeError, ValueError):
bd = 9898
bd = "9898"

return _aix_tag(_aix_bgt(), bd)
return _aix_tag(_aix_bgt(), int(bd))
3 changes: 1 addition & 2 deletions tests/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,8 +1234,7 @@ def test_aix_bgt(monkeypatch):
result = _aix_support._aix_bgt()
assert result == [5, 3, 7]


# def test_aix_buildtag(monkeypatch):
# def test_aix_buildtag(monkeypatch):
monkeypatch.setattr(_aix_support, "_have_subprocess", False)
monkeypatch.setattr(sys, "maxsize", 2 ** 31 - 1)
result = _aix_support.aix_buildtag()
Expand Down