Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 8 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ jobs:
python3-requests
python3-semantic_version
python3-specfile
task: lint
task: PATH=${PATH}:/github/home/.local/bin make -f Makefile lint
- dependencies: >
black
python3-isort
shfmt
task: fmt-travis
task: make -f Makefile fmt-travis
- dependencies: >
yamllint
task: yamllint
task: make -f Makefile yamllint
- dependencies: >
findutils
ShellCheck
task: shellcheck
task: make -f Makefile shellcheck
runs-on: ubuntu-latest
container: fedora:41 # CURRENT DEVELOPMENT ENVIRONMENT
steps:
Expand All @@ -48,6 +48,9 @@ jobs:
run: >
dnf install -y
make
pip
${{ matrix.dependencies }}
- name: Install pyright
run: pip install --user pyright
- name: Run test
run: make -f Makefile ${{ matrix.task }}
run: ${{ matrix.task }}
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ lint:
pylint ./dependency_management/* --disable=R0801
pylint ./misc_scripts/*.py --disable=R0801
pylint ./release_management/*.py --disable=R0801
pyright

.PHONY: fmt
fmt:
Expand Down
51 changes: 0 additions & 51 deletions misc_scripts/batch_cancel.py

This file was deleted.

22 changes: 18 additions & 4 deletions misc_scripts/thin_metadata_size_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def gen_parser():
return parser


def build_arrays(block_size, values):
def build_arrays(block_size, values): # pylint: disable=too-many-locals
"""
Build three matrices of values where the z_values are the result of
running thin_metadata_size on the x and y values.
Expand All @@ -73,8 +73,20 @@ def build_arrays(block_size, values):
f"--max-thins={num_thins}",
"-n",
]
with subprocess.Popen(command, stdout=subprocess.PIPE) as proc:
result = int(proc.stdout.readline().decode("utf-8").strip())
with subprocess.Popen(
command, stdout=subprocess.PIPE, stderr=subprocess.PIPE
) as proc:
try:
result = int(
proc.stdout.readline() # pyright: ignore [ reportOptionalMemberAccess ]
.decode("utf-8")
.strip()
)
except ValueError as err:
error_message = (
proc.stderr.readline() # pyright: ignore [ reportOptionalMemberAccess ]
)
raise RuntimeError(error_message.decode("utf-8")) from err
x_row.append(pool_size)
y_row.append(num_thins)
z_row.append(result)
Expand All @@ -100,7 +112,9 @@ def plot_figure(x_inputs, y_inputs, z_inputs):
ylabel="Number of thin devices",
zlabel="Metadata size",
)
axes.plot_wireframe(x_inputs, y_inputs, z_inputs)
axes.plot_wireframe( # pyright: ignore [ reportAttributeAccessIssue ]
x_inputs, y_inputs, z_inputs
)
return fig


Expand Down
33 changes: 27 additions & 6 deletions release_management/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ def calc_release_suffix():
"""
command = ["git", "rev-parse", "--short=8", "HEAD"]
with subprocess.Popen(command, stdout=subprocess.PIPE) as proc:
commit_hash = proc.stdout.readline().strip().decode("utf-8")
commit_hash = (
proc.stdout.readline() # pyright: ignore [ reportOptionalMemberAccess ]
.strip()
.decode("utf-8")
)
return f"{datetime.today():%Y%m%d%H%M}git{commit_hash}"


Expand Down Expand Up @@ -95,15 +99,28 @@ def get_python_package_info(name):
"""
command = ["python3", "setup.py", "--name"]
with subprocess.Popen(command, stdout=subprocess.PIPE) as proc:
assert proc.stdout.readline().strip().decode("utf-8") == name
assert (
proc.stdout.readline() # pyright: ignore [ reportOptionalMemberAccess ]
.strip()
.decode("utf-8")
== name
)

command = ["python3", "setup.py", "--version"]
with subprocess.Popen(command, stdout=subprocess.PIPE) as proc:
release_version = proc.stdout.readline().strip().decode("utf-8")
release_version = (
proc.stdout.readline() # pyright: ignore [ reportOptionalMemberAccess ]
.strip()
.decode("utf-8")
)

command = ["python3", "setup.py", "--url"]
with subprocess.Popen(command, stdout=subprocess.PIPE) as proc:
github_url = proc.stdout.readline().strip().decode("utf-8")
github_url = (
proc.stdout.readline() # pyright: ignore [ reportOptionalMemberAccess ]
.strip()
.decode("utf-8")
)

github_repo = urlparse(github_url)
assert github_repo.netloc == "github.com", "specified repo is not on GitHub"
Expand Down Expand Up @@ -144,7 +161,9 @@ def verify_tag(tag):
"""
command = ["git", "tag", "--points-at"]
with subprocess.Popen(command, stdout=subprocess.PIPE) as proc:
tag_str = proc.stdout.readline()
tag_str = (
proc.stdout.readline() # pyright: ignore [ reportOptionalMemberAccess ]
)
return tag_str.decode("utf-8").rstrip() == tag


Expand All @@ -171,7 +190,9 @@ def get_branch():
"""
command = ["git", "branch", "--show-current"]
with subprocess.Popen(command, stdout=subprocess.PIPE) as proc:
branch_str = proc.stdout.readline()
branch_str = (
proc.stdout.readline() # pyright: ignore [ reportOptionalMemberAccess ]
)
return branch_str.decode("utf-8").rstrip()


Expand Down