diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..fa95dc2a --- /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: | + make test + + - 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 diff --git a/maas/client/flesh/tables.py b/maas/client/flesh/tables.py index 70047590..bad12037 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 a59c097d..4b1ca89c 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 6bf464ee..c50a25f7 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 40edd6fc..0c7967dc 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 2ab51c40..9ff72b94 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 e9604333..9a1e6cfd 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 bfb27943..0eba1881 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 62611720..e8140bab 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 37487741..082c907a 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/setup.py b/setup.py index 70784830..e535d67d 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"}, @@ -58,13 +57,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 485859e4..c19d5f54 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