From 7d80bd570d5caf21c63d36bfe30f87da58da5a63 Mon Sep 17 00:00:00 2001 From: "Tahir H. Butt" Date: Sat, 12 Aug 2023 01:15:45 -0400 Subject: [PATCH] chore: migrate prechecks from riot (#6640) ## Checklist - [x] Change(s) are motivated and described in the PR description. - [x] Testing strategy is described if automated tests are not included in the PR. - [x] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed. If no release note is required, add label `changelog/no-changelog`. - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Title is accurate. - [x] No unnecessary changes are introduced. - [x] Description motivates each change. - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [x] Testing strategy adequately addresses listed risk(s). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] Release note makes sense to a user of the library. - [x] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment. - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) Co-authored-by: Emmett Butler <723615+emmettbutler@users.noreply.github.com> --- .circleci/config.templ.yml | 1 - hatch.toml | 27 +++++++++++++++++++++++++++ riotfile.py | 10 ---------- scripts/gen_circleci_config.py | 4 ++-- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/.circleci/config.templ.yml b/.circleci/config.templ.yml index 760b4967bf4..8322a0b9d89 100644 --- a/.circleci/config.templ.yml +++ b/.circleci/config.templ.yml @@ -243,7 +243,6 @@ jobs: executor: python310 steps: - checkout - - setup_riot - setup_hatch - run: name: "Spelling" diff --git a/hatch.toml b/hatch.toml index d1a730b7202..cd8f1b23fb1 100644 --- a/hatch.toml +++ b/hatch.toml @@ -83,3 +83,30 @@ build = [ env.CIRCLECI.type = [ { value = "virtual", if = ["true"] }, ] + + +[envs.slotscheck] +template = "slotscheck" +python = "3.10" +features = ["opentracing"] +extra-dependencies = [ + "slotscheck==0.17.0", +] + +[envs.slotscheck.scripts] +_ = [ + "python -m slotscheck -v ddtrace/", +] + + +[envs.scripts] +detached = true +python = "3.10" +extra-dependencies = [ + "packaging==23.1", +] + +[envs.scripts.scripts] +test = [ + "python -m doctest {args} scripts/get-target-milestone.py scripts/needs_testrun.py tests/suitespec.py", +] diff --git a/riotfile.py b/riotfile.py index aaec36f334e..763b066b944 100644 --- a/riotfile.py +++ b/riotfile.py @@ -103,16 +103,6 @@ def select_pys(min_version=MIN_PYTHON_VERSION, max_version=MAX_PYTHON_VERSION): "DD_CIVISIBILITY_ITR_ENABLED": "1", }, venvs=[ - Venv( - pys=["3"], - pkgs={"slotscheck": latest}, - venvs=[ - Venv( - name="slotscheck", - command="python -m slotscheck -v ddtrace/", - ), - ], - ), Venv( pys=["3"], name="scripts", diff --git a/scripts/gen_circleci_config.py b/scripts/gen_circleci_config.py index b39aab62327..b825cee55e9 100644 --- a/scripts/gen_circleci_config.py +++ b/scripts/gen_circleci_config.py @@ -71,12 +71,12 @@ def check(name: str, command: str, paths: t.Set[str]) -> None: ) check( name="Slots check", - command="riot -v run slotscheck", + command="hatch run slotscheck:_", paths={"ddtrace/*.py", "hatch.toml"}, ) check( name="Run scripts/*.py tests", - command="riot -v run -s scripts", + command="hatch run scripts:test", paths={"scripts/*.py"}, ) check(