Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't run chmod on cos-tool #116

Merged
merged 3 commits into from
Jan 16, 2025
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "cosl"
version = "0.0.50"
version = "0.0.51"
authors = [
{ name = "sed-i", email = "[email protected]" },
]
Expand Down
7 changes: 2 additions & 5 deletions src/cosl/cos_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,9 @@ def _get_tool_path(self) -> Optional[Path]:
arch = "amd64" if arch == "x86_64" else arch
res = "cos-tool-{}".format(arch)
try:
path = Path(res).resolve()
path.chmod(0o777)
path = Path(res).resolve(strict=True)
return path
except NotImplementedError:
logger.debug("System lacks support for chmod")
except FileNotFoundError:
except (FileNotFoundError, OSError):
logger.debug('Could not locate cos-tool at: "{}"'.format(res))
return None

Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib
commands =
python -m doctest {[vars]src_path}/cosl/mandatory_relation_pairs.py
/usr/bin/env sh -c 'stat cos-tool-amd64 > /dev/null 2>&1 || curl -L -O https://github.com/canonical/cos-tool/releases/latest/download/cos-tool-amd64'
/usr/bin/env sh -c 'stat cos-tool-amd64 > /dev/null 2>&1 || \
curl -L -O https://github.com/canonical/cos-tool/releases/latest/download/cos-tool-amd64'
/usr/bin/env sh -c 'chmod 755 cos-tool-amd64'
pytest {tty:--color=yes} --cov={[vars]src_path} --cov-config={tox_root}/pyproject.toml \
; for us
--cov-report=html:{tox_root}/results/html-cov/ \
Expand Down
Loading