Skip to content

Commit

Permalink
Merge pull request #832 from andrew-glenn/main
Browse files Browse the repository at this point in the history
Fixing poetry configs, removing reliance on pkg_resources
  • Loading branch information
andrew-glenn authored Aug 23, 2024
2 parents 6f9f0a2 + 673c499 commit 4266fec
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 71 deletions.
7 changes: 7 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ version = "0.9.51"
authors = ["Andrew Glenn", "Jay McConnell", "Shivansh Singh", "Tony Vattathil"]
description = "An OpenSource Cloudformation Deployment Framework"
name = "taskcat"

[tool.poetry.scripts]
taskcat = "taskcat._cli:main"

[tool.portray.mkdocs.theme]
favicon = "https://raw.githubusercontent.com/aws-ia/taskcat/main/assets/docs/images/tcat.png"
logo = "https://raw.githubusercontent.com/aws-ia/taskcat/main/assets/docs/images/tcat.png"
name = "material"
palette = {primary = "black", accent = "orange"}



[tool.portray.mkdocs]
extra_css = ['docs/custom.css']

Expand Down
57 changes: 0 additions & 57 deletions setup.py

This file was deleted.

7 changes: 2 additions & 5 deletions taskcat/_cli.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import importlib.metadata
import signal
import sys

import requests

from pkg_resources import get_distribution
from taskcat._cli_core import GLOBAL_ARGS, CliCore, _get_log_level
from taskcat._common_utils import exit_with_code
from taskcat._logger import PrintMsg, init_taskcat_cli_logger
Expand Down Expand Up @@ -116,10 +116,7 @@ def get_pip_version(url):


def get_installed_version():
try:
return get_distribution(NAME).version
except Exception: # pylint: disable=broad-except
return "[local source] no pip module installed"
return importlib.metadata.version(__package__ or __name__)


def _sigint_handler(signum, frame):
Expand Down
9 changes: 0 additions & 9 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,6 @@ def test_setup_logging(self, m_exit, m_setLevel):
_setup_logging(["-d", "-q"], exit_func=m_exit)
self.assertEqual(True, m_exit.called)

@mock.patch("taskcat._cli.get_distribution", autospec=True)
def test_check_for_update(self, mock_get_distribution):
mock_get_distribution.return_value.version = "0.1.0"
check_for_update()
self.assertEqual(mock_get_distribution.call_count, 1)
mock_get_distribution.side_effect = TypeError("test")
check_for_update()
self.assertEqual(mock_get_distribution.call_count, 2)

@mock.patch("taskcat._cli.LOG", autospec=True)
def test__print_upgrade_msg(self, mock_log):
_print_upgrade_msg("0.1.0", "0.0.1")
Expand Down

0 comments on commit 4266fec

Please sign in to comment.