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

Use pyproject.toml, add juju-bin to apps.pluto.plugs, use adopt-info in snapcraft.yaml #4

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ to install pluto:
sudo snap install pluto
```

Connect the snap interfaces needed by `pluto` to complete the installation.

```shell
sudo snap connect pluto:ssh-public-keys
sudo snap connect pluto:dot-local-share-juju
sudo snap connect pluto:juju-bin juju:juju-bin
```

Now use the following command to bootstrap your HPC cluster:

```shell
Expand Down
1,125 changes: 1,125 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

56 changes: 51 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.
[tool.poetry]
name = "pluto"
version = "0.1.0"
description = "A swiss-army knife for managing HPC clusters built with Ubuntu."
authors = [
"Jason C. Nucciarone",
]
maintainers = [
"Jason C. Nucciarone <[email protected]>",
]
license = "GPL-3.0"
readme = "README.md"
repository = "https://github.com/NucciTheBoss/pluto"
packages = [{ include = "pluto", from = "src/" }]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Intended Audience :: System Administrators",
"Intended Audience :: Information Technology",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Environment :: Console",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
keywords = [
"hpc",
]

[tool.poetry.urls]
"Bug Tracker" = "https://github.com/NucciTheBoss/pluto/issues"
"Changelog" = "https://github.com/NucciTheBoss/pluto/blob/main/pluto/CHANGELOG.rst"

[tool.poetry.dependencies]
python = "^3.8.1"
craft-cli = "^1.2.0"
juju = "^3.1.0.1"

[tool.poetry.scripts]
pluto = "pluto.main:main"

# Testing tools configuration
[tool.coverage.run]
Expand All @@ -20,8 +62,8 @@ target-version = ["py38"]
# Linting tools configuration
[tool.ruff]
line-length = 99
select = ["E", "W", "F", "C", "N", "D", "I001"]
extend-ignore = [
lint.select = ["E", "W", "F", "C", "N", "D", "I001"]
lint.extend-ignore = [
"D203",
"D204",
"D213",
Expand All @@ -35,9 +77,13 @@ extend-ignore = [
"D409",
"D413",
]
ignore = ["E501", "D107"]
lint.ignore = ["E501", "D107"]
extend-exclude = ["__pycache__", "*.egg_info", "__init__.py"]
per-file-ignores = {"tests/*" = ["D100","D101","D102","D103","D104"]}
lint.per-file-ignores = {"tests/*" = ["D100","D101","D102","D103","D104"]}

[tool.ruff.mccabe]
[tool.ruff.lint.mccabe]
max-complexity = 15

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

42 changes: 0 additions & 42 deletions setup.py

This file was deleted.

8 changes: 5 additions & 3 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See LICENSE file for licensing details.

name: pluto
version: 0.1.0
adopt-info: pluto
license: GPL-3.0
summary: A swiss-army knife for managing HPC clusters built with Ubuntu
description: |
Expand Down Expand Up @@ -88,10 +88,11 @@ parts:
pluto:
plugin: python
source: .
python-requirements:
- requirements.txt
stage-packages:
- openssh-client
override-pull: |
snapcraftctl pull
snapcraftctl set-version "$(grep -m 1 version pyproject.toml | tr -s ' ' | tr -d '"' | tr -d "'" | cut -d' ' -f3)"

apps:
pluto:
Expand All @@ -101,6 +102,7 @@ apps:
- network-bind
- ssh-public-keys
- dot-local-share-juju
- juju-bin
environment:
PATH: $PATH:$SNAP/juju/bin
JUJU_DATA: $SNAP_REAL_HOME/.local/share/juju
Expand Down
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ envlist = fmt, lint

[vars]
src_path = {toxinidir}/src
tst_path = {toxinidir}/tests
all_path = {[vars]src_path} {[vars]tst_path}
all_path = {[vars]src_path}

[testenv]
basepython = python3
Expand Down Expand Up @@ -38,4 +37,4 @@ deps =
commands =
codespell {[vars]all_path} {toxinidir}/README.md
ruff {[vars]all_path}
black --check --diff {[vars]all_path}
black --check --diff {[vars]all_path}
Loading