From ba4e47c61def5a0e8e99b951218b8d04658df7ae Mon Sep 17 00:00:00 2001 From: Jack Lloyd-Walters Date: Tue, 5 Sep 2023 15:23:25 +0100 Subject: [PATCH 1/5] workflow --- .github/workflows/release.yml | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cf3b0d7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,52 @@ +name: Release version + +on: + workflow_dispatch: + inputs: + newversion: + description: 'New version' + required: true + +jobs: + release-version: + runs-on: ubuntu-latest + steps: + - name: Repository checkout + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.6" + + - name: Install dependencies + run: | + pip install --upgrade pip tox bump2version + + - name: Test latest version + run: | + tox -e py3 + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: 'Get Previous version tag' + id: previousversion + uses: "WyriHaximus/github-action-get-previous-tag@v1" + + - name: Bump setup.py version + run: | + bump2version --current-version ${previousversion} --new-version ${newversion} setup.py + + - name: Tag latest version + uses: EndBug/latest-tag@latest + with: + tag-name: ${newversion} + + - name: Update docs + run: / + make docs-to-github + + - name: Upload to pypi + run: / + make upload \ No newline at end of file From f4b4d7045c42440d8c7b62d581b7e5e0f4b072e4 Mon Sep 17 00:00:00 2001 From: Jack Lloyd-Walters Date: Tue, 5 Sep 2023 17:30:03 +0100 Subject: [PATCH 2/5] workflow update --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cf3b0d7..99eba9b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: - name: Test latest version run: | - tox -e py3 + make test - uses: actions/checkout@v3 with: From 1bc794552e5db18d33325613506099384219d662 Mon Sep 17 00:00:00 2001 From: Jack Lloyd-Walters Date: Fri, 22 Sep 2023 09:18:38 +0100 Subject: [PATCH 3/5] Update release.yml add newline --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 99eba9b..fa95dc2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,4 +49,4 @@ jobs: - name: Upload to pypi run: / - make upload \ No newline at end of file + make upload From 29378e3e4bdc6748e5ac32c9c34c8e72fb8554f6 Mon Sep 17 00:00:00 2001 From: Jack Lloyd-Walters Date: Fri, 22 Sep 2023 11:44:18 +0100 Subject: [PATCH 4/5] linting --- maas/client/flesh/tables.py | 4 ---- maas/client/flesh/tabular.py | 1 - maas/client/utils/tests/test_async.py | 1 - maas/client/viscera/__init__.py | 1 - maas/client/viscera/boot_resources.py | 1 - maas/client/viscera/maas.py | 1 - maas/client/viscera/spaces.py | 1 - maas/client/viscera/tests/test.py | 1 - maas/client/viscera/tests/test_machines.py | 1 - pyvenv.cfg | 8 ++++++++ setup.py | 5 +++-- tox.ini | 1 + 12 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 pyvenv.cfg diff --git a/maas/client/flesh/tables.py b/maas/client/flesh/tables.py index 7004759..bad1203 100644 --- a/maas/client/flesh/tables.py +++ b/maas/client/flesh/tables.py @@ -11,7 +11,6 @@ class NodeTypeColumn(Column): - nice_names = { NodeType.MACHINE: "Machine", NodeType.DEVICE: "Device", @@ -68,7 +67,6 @@ def render(self, target, memory): class NodeStatusNameColumn(Column): - colours = { # "New": "", # White. "Commissioning": "autoyellow", @@ -100,7 +98,6 @@ def render(self, target, datum): class NodePowerColumn(Column): - colours = { PowerState.ON: "autogreen", # PowerState.OFF: "", # White. @@ -387,7 +384,6 @@ def get_rows(self, target, files): class UserIsAdminColumn(Column): - yes, no = "Yes", "Np" yes_pretty = Color("{autogreen}Yes{/autogreen}") diff --git a/maas/client/flesh/tabular.py b/maas/client/flesh/tabular.py index a59c097..4b1ca89 100644 --- a/maas/client/flesh/tabular.py +++ b/maas/client/flesh/tabular.py @@ -17,7 +17,6 @@ class RenderTarget(enum.Enum): - # Human-readable tabluar output. plain = "plain" pretty = "pretty" diff --git a/maas/client/utils/tests/test_async.py b/maas/client/utils/tests/test_async.py index 6bf464e..c50a25f 100644 --- a/maas/client/utils/tests/test_async.py +++ b/maas/client/utils/tests/test_async.py @@ -73,7 +73,6 @@ def test_callable_attributes_are_wrapped(self): # `Asynchronous` groks class- and static-methods. class Class(metaclass=maas_async.Asynchronous): - attribute = 123 def imethod(self): diff --git a/maas/client/viscera/__init__.py b/maas/client/viscera/__init__.py index 40edd6f..0c7967d 100644 --- a/maas/client/viscera/__init__.py +++ b/maas/client/viscera/__init__.py @@ -158,7 +158,6 @@ def bind(cls, origin, handler, handlers, *, name=None): class ObjectBasics: - __slots__ = () def __dir__(self): diff --git a/maas/client/viscera/boot_resources.py b/maas/client/viscera/boot_resources.py index 2ab51c4..9ff72b9 100644 --- a/maas/client/viscera/boot_resources.py +++ b/maas/client/viscera/boot_resources.py @@ -38,7 +38,6 @@ def calc_size_and_sha265(content: io.IOBase, chunk_size: int): class BootResourceFileType(enum.Enum): - TGZ = "tgz" DDTGZ = "ddtgz" diff --git a/maas/client/viscera/maas.py b/maas/client/viscera/maas.py index e960433..9a1e6cf 100644 --- a/maas/client/viscera/maas.py +++ b/maas/client/viscera/maas.py @@ -252,7 +252,6 @@ async def set_ntp_server(cls, server: str): await cls.set_config("ntp_server", server) class StorageLayout(DescriptiveEnum): - FLAT = "flat", "Flat layout" LVM = "lvm", "LVM layout" BCACHE = "bcache", "Bcache layout" diff --git a/maas/client/viscera/spaces.py b/maas/client/viscera/spaces.py index bfb2794..0eba188 100644 --- a/maas/client/viscera/spaces.py +++ b/maas/client/viscera/spaces.py @@ -37,7 +37,6 @@ class Spaces(ObjectSet, metaclass=SpacesType): class SpaceType(ObjectType): - _default_space_id = 0 async def get_default(cls): diff --git a/maas/client/viscera/tests/test.py b/maas/client/viscera/tests/test.py index 6261172..e8140ba 100644 --- a/maas/client/viscera/tests/test.py +++ b/maas/client/viscera/tests/test.py @@ -1051,7 +1051,6 @@ def test__overrides_value_to_daturm(self): self.assertThat(field.value_to_datum(None, 1), Equals(2)) def test__works_in_place(self): - # Deltas to apply to datums and values. datum_to_value_delta = 2 value_to_datum_delta = 3 diff --git a/maas/client/viscera/tests/test_machines.py b/maas/client/viscera/tests/test_machines.py index 3748774..082c907 100644 --- a/maas/client/viscera/tests/test_machines.py +++ b/maas/client/viscera/tests/test_machines.py @@ -866,7 +866,6 @@ def test__unlock(self): class TestMachine_APIVersion(TestCase): - scenarios = tuple( (name, dict(version=version, description=description)) for name, version, description in api_descriptions diff --git a/pyvenv.cfg b/pyvenv.cfg new file mode 100644 index 0000000..aa89793 --- /dev/null +++ b/pyvenv.cfg @@ -0,0 +1,8 @@ +home = /usr/bin +implementation = CPython +version_info = 3.11.4.final.0 +virtualenv = 20.19.0+ds +include-system-site-packages = false +base-prefix = /usr +base-exec-prefix = /usr +base-executable = /usr/bin/python3 diff --git a/setup.py b/setup.py index 7078483..00a21f9 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ def read(filename): 'Programming Language :: Python :: 3.9', 'Topic :: Software Development :: Libraries', ], - namespace_packages=['maas'], + # namespace_packages=['maas'], packages=find_packages( include={"maas", "maas.*"}, exclude={"*.tests", "*.testing"}, @@ -58,13 +58,14 @@ def read(filename): "pymongo >= 3.5.1", # for bson "pytz >= 2014.10", "PyYAML >= 3.11", + "setuptools >= 58.2.0", "terminaltables >= 2.1.0", ], test_suite="maas.client", tests_require=[ "django >= 2.2.4, < 3.0", "fixtures >= 1.0.0", - "setuptools", + "setuptools >= 58.2.0", "testscenarios", "testtools", "Twisted<23.0.0", diff --git a/tox.ini b/tox.ini index 485859e..c19d5f5 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,7 @@ skip_install = True deps = black [testenv:imports] +allowlist_externals = {toxinidir}/scripts/check-imports commands = {toxinidir}/scripts/check-imports setenv = PYTHONPATH={toxinidir} sitepackages = False From 9baee4978241dadb8039b48cdc106566321cec7c Mon Sep 17 00:00:00 2001 From: Jack Lloyd-Walters Date: Fri, 22 Sep 2023 11:56:44 +0100 Subject: [PATCH 5/5] remove empty --- pyvenv.cfg | 8 -------- setup.py | 1 - 2 files changed, 9 deletions(-) delete mode 100644 pyvenv.cfg diff --git a/pyvenv.cfg b/pyvenv.cfg deleted file mode 100644 index aa89793..0000000 --- a/pyvenv.cfg +++ /dev/null @@ -1,8 +0,0 @@ -home = /usr/bin -implementation = CPython -version_info = 3.11.4.final.0 -virtualenv = 20.19.0+ds -include-system-site-packages = false -base-prefix = /usr -base-exec-prefix = /usr -base-executable = /usr/bin/python3 diff --git a/setup.py b/setup.py index 00a21f9..e535d67 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,6 @@ def read(filename): 'Programming Language :: Python :: 3.9', 'Topic :: Software Development :: Libraries', ], - # namespace_packages=['maas'], packages=find_packages( include={"maas", "maas.*"}, exclude={"*.tests", "*.testing"},