From 2066bad0bd5eae89cdfb447778bf3b22b1e41ca9 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Tue, 8 Feb 2022 09:47:06 +0100 Subject: [PATCH] Revert "Add `pyproject.toml` file (#11305)" This reverts commit 882a70d2d66c0932e67d74c93e9a8f8414933c24. --- datadog_checks_downloader/pyproject.toml | 62 ----------------------- datadog_checks_downloader/requirements.in | 13 +++++ datadog_checks_downloader/setup.py | 17 +------ datadog_checks_downloader/tox.ini | 2 +- 4 files changed, 15 insertions(+), 79 deletions(-) delete mode 100644 datadog_checks_downloader/pyproject.toml create mode 100644 datadog_checks_downloader/requirements.in diff --git a/datadog_checks_downloader/pyproject.toml b/datadog_checks_downloader/pyproject.toml deleted file mode 100644 index 720364772e9f2..0000000000000 --- a/datadog_checks_downloader/pyproject.toml +++ /dev/null @@ -1,62 +0,0 @@ -[build-system] -requires = [ - "hatchling>=0.11.2", - "setuptools; python_version < '3.0'", -] -build-backend = "hatchling.build" - -[project] -name = "datadog-checks-downloader" -description = "The Datadog Checks Downloader" -readme = "README.md" -license = "BSD-3-Clause" -keywords = [ - "datadog", - "datadog agent", - "datadog check", -] -authors = [ - { name = "Datadog", email = "packages@datadoghq.com" }, -] -classifiers = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "Intended Audience :: System Administrators", - "License :: OSI Approved :: BSD License", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3.8", - "Topic :: System :: Monitoring", -] -dynamic = [ - "version", -] - -[project.optional-dependencies] -deps = [ - "in-toto==1.0.1", - "securesystemslib[crypto,pynacl]==0.20.1", - "tuf==0.17.0; python_version < '3.0'", - "tuf==0.19.0; python_version > '3.0'", -] - -[project.urls] -Source = "https://github.com/DataDog/integrations-core" - -[tool.hatch.version] -path = "datadog_checks/downloader/__about__.py" - -[tool.hatch.build.targets.sdist] -include = [ - "/datadog_checks", - "/tests", - "/requirements-dev.txt", - "/tox.ini", -] - -[tool.hatch.build.targets.wheel] -include = [ - "/datadog_checks", -] -dev-mode-dirs = [ - ".", -] diff --git a/datadog_checks_downloader/requirements.in b/datadog_checks_downloader/requirements.in new file mode 100644 index 0000000000000..52b6a00f8b197 --- /dev/null +++ b/datadog_checks_downloader/requirements.in @@ -0,0 +1,13 @@ +# +# At the time of writing (Jan 30 2020), this was the latest version of these +# libraries. +# +tuf==0.17.0; python_version < "3.0" +tuf==0.19.0; python_version > "3.0" +in-toto==1.0.1 +# +# Make sure TUF and in-toto use the same version of this library, which they +# both use in common. At the time of writing (Jan 30 2020), this was the latest +# version of the library. +# +securesystemslib[crypto,pynacl]==0.20.1 diff --git a/datadog_checks_downloader/setup.py b/datadog_checks_downloader/setup.py index d82f95e2cb6ac..73e2dbeb9e218 100644 --- a/datadog_checks_downloader/setup.py +++ b/datadog_checks_downloader/setup.py @@ -27,21 +27,6 @@ def get_dependencies(): return f.readlines() -def parse_pyproject_array(name): - import os - import re - from ast import literal_eval - - pattern = r'^{} = (\[.+?\])$'.format(name) - - with open(os.path.join(HERE, 'pyproject.toml'), 'r', encoding='utf-8') as f: - # Windows \r\n prevents match - contents = '\n'.join(line.rstrip() for line in f.readlines()) - - array = re.search(pattern, contents, flags=re.MULTILINE | re.DOTALL).group(1) - return literal_eval(array) - - setup( # Version should always match one from an agent release version=ABOUT["__version__"], @@ -67,7 +52,7 @@ def parse_pyproject_array(name): ], packages=['datadog_checks.downloader'], # Run-time dependencies - extras_require={'deps': parse_pyproject_array('deps')}, + extras_require={'deps': get_dependencies()}, # NOTE: Copy over TUF directories, and root metadata. package_data={ 'datadog_checks.downloader': [ diff --git a/datadog_checks_downloader/tox.ini b/datadog_checks_downloader/tox.ini index 2cba513fba9aa..d7b6d1559fac4 100644 --- a/datadog_checks_downloader/tox.ini +++ b/datadog_checks_downloader/tox.ini @@ -11,9 +11,9 @@ envdir = py38: {toxworkdir}/py38 dd_check_style = true usedevelop = true -extras = deps deps = -e../datadog_checks_base[deps] -rrequirements-dev.txt commands = + pip install -r requirements.in pytest -v {posargs} --capture=no --log-cli-level=debug