diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 00000000..00cd7bd1 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +#ECCN:Open Source diff --git a/pyproject.toml b/pyproject.toml index 3bdce842..107a7e89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["build", "setuptools>=62", "wheel", "setuptools_scm>=6.2"] +requires = ["build", "setuptools", "setuptools_scm"] build-backend = "setuptools.build_meta" [tool.setuptools_scm] local_scheme = "no-local-version" # require pypi supported versions always @@ -29,7 +29,8 @@ name="tabcmd" dynamic = ["version"] description="A command line client for working with Tableau Server." authors = [{name="Tableau", email="github@tableau.com"}] -license = {file = "LICENSE"} +license = "MIT" +license-files = ["LICENSE"] readme = "res/README.md" requires-python = ">=3.9" # https://devguide.python.org/versions/ classifiers = [ @@ -43,17 +44,10 @@ classifiers = [ ] dependencies = [ "appdirs", - "doit", - "ftfy", - "pyinstaller_versionfile", - "pytest-order", "requests>=2.25,<3.0", - "setuptools_scm", - "types-appdirs", - "types-mock", - "types-requests", - "types-setuptools", - "tableauserverclient==0.37", + # pinned to 81 so the license_checker can use pkg_resources + "setuptools<81; python_version >= '3.12'", + "tableauserverclient==0.40", "urllib3", ] [project.optional-dependencies] @@ -65,9 +59,18 @@ test = [ "pytest-cov", "pytest-order", "pytest-runner", - "requests-mock>=1.0,<2.0"] + "requests-mock>=1.0,<2.0", + "types-appdirs", + "types-mock", + "types-requests", + "types-setuptools", + # these last three are required for the versioning step + "doit", + "pyinstaller_versionfile", + "setuptools_scm" +] localize = ["doit", "ftfy"] -package = ["pyinstaller==5.13", "doit"] +package = ["doit", "pyinstaller==5.13"] [project.urls] repository = "https://github.com/tableau/tabcmd" [project.scripts] diff --git a/tabcmd/execution/localize.py b/tabcmd/execution/localize.py index 1a8d3d2d..cc8baf1c 100644 --- a/tabcmd/execution/localize.py +++ b/tabcmd/execution/localize.py @@ -83,13 +83,7 @@ def _load_language(current_locale, domain, logger): def _get_default_locale(): - # c:\dev\tabcmd\tabcmd\execution\localize.py:85: DeprecationWarning 'locale.getdefaultlocale' is deprecated - # see test_localize for details - import logging - - logging.captureWarnings(True) - current_locale, encoding = locale.getdefaultlocale() - logging.captureWarnings(False) + current_locale = locale.setlocale(locale.LC_CTYPE, None) current_locale = _validate_lang(current_locale) return current_locale diff --git a/tabcmd/version.py b/tabcmd/version.py index e6e2d0f1..f7c977ca 100644 --- a/tabcmd/version.py +++ b/tabcmd/version.py @@ -1,9 +1,7 @@ -# when we drop python 3.8, this could be replaced with this lighter weight option -# from importlib.metadata import version, PackageNotFoundError -from pkg_resources import get_distribution, DistributionNotFound +from importlib.metadata import version as get_version, PackageNotFoundError try: - version = get_distribution("tabcmd").version -except DistributionNotFound: + version = get_version("tabcmd") +except PackageNotFoundError: version = "2.0.0" pass