From 684631a1811e538824ba8c0953be937b3f6a2b53 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 10 Jul 2024 19:51:21 -0600 Subject: [PATCH] Rename package --- .../pyproject.toml | 9 +++---- .../generate_contrib_workflows/__init__.py | 14 ++++++++++ .../src/generate_contrib_workflows/version.py | 0 .github/workflows/try_parser.py | 26 +++++++++++++++++++ 4 files changed, 43 insertions(+), 6 deletions(-) rename .github/workflows/{generate_contrib_workflows => generate_workflows}/pyproject.toml (75%) rename .github/workflows/{generate_contrib_workflows => generate_workflows}/src/generate_contrib_workflows/__init__.py (95%) rename .github/workflows/{generate_contrib_workflows => generate_workflows}/src/generate_contrib_workflows/version.py (100%) create mode 100644 .github/workflows/try_parser.py diff --git a/.github/workflows/generate_contrib_workflows/pyproject.toml b/.github/workflows/generate_workflows/pyproject.toml similarity index 75% rename from .github/workflows/generate_contrib_workflows/pyproject.toml rename to .github/workflows/generate_workflows/pyproject.toml index 9bd869b7e4..4f9ecc24b2 100644 --- a/.github/workflows/generate_contrib_workflows/pyproject.toml +++ b/.github/workflows/generate_workflows/pyproject.toml @@ -3,9 +3,9 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "generate_contrib_workflows" +name = "generate_workflows" dynamic = ["version"] -description = "A package to generate contrib workflows" +description = "A package to generate workflows" license = "Apache-2.0" requires-python = ">=3.8" authors = [ @@ -26,8 +26,5 @@ classifiers = [ ] dependencies = ["Jinja2"] -[project.scripts] -generate_contrib_workflows = "generate_contrib_workflows:generate_contrib_workflows" - [tool.hatch.version] -path = "src/generate_contrib_workflows/version.py" +path = "src/generate_workflows/version.py" diff --git a/.github/workflows/generate_contrib_workflows/src/generate_contrib_workflows/__init__.py b/.github/workflows/generate_workflows/src/generate_contrib_workflows/__init__.py similarity index 95% rename from .github/workflows/generate_contrib_workflows/src/generate_contrib_workflows/__init__.py rename to .github/workflows/generate_workflows/src/generate_contrib_workflows/__init__.py index 710914c323..02ee4f9a3c 100644 --- a/.github/workflows/generate_contrib_workflows/src/generate_contrib_workflows/__init__.py +++ b/.github/workflows/generate_workflows/src/generate_contrib_workflows/__init__.py @@ -26,6 +26,20 @@ def _get_python_version_alias(python_version): return f"3.{python_version.replace('3', '')}" +def get_tox_envs(tox_ini_path: Path) -> list: + + config_parser = ConfigParser() + config_parser.read(tox_ini_path) + + envs = {} + + for env in config_parser["tox"]["envlist"].split(): + env = env.strip() + + if env.startswith(";"): + continue + + def get_test_jobs(tox_ini_path: Path) -> list: config_parser = ConfigParser() diff --git a/.github/workflows/generate_contrib_workflows/src/generate_contrib_workflows/version.py b/.github/workflows/generate_workflows/src/generate_contrib_workflows/version.py similarity index 100% rename from .github/workflows/generate_contrib_workflows/src/generate_contrib_workflows/version.py rename to .github/workflows/generate_workflows/src/generate_contrib_workflows/version.py diff --git a/.github/workflows/try_parser.py b/.github/workflows/try_parser.py new file mode 100644 index 0000000000..9f528d5070 --- /dev/null +++ b/.github/workflows/try_parser.py @@ -0,0 +1,26 @@ +from tox.config.source.ini import IniSource +from tox.config.types import EnvList +from pathlib import Path +from ipdb import set_trace +from tox.config.cli.parse import get_options +from tox.session.state import State + +ini_source = IniSource( + Path("/home/tigre/github/ocelotl/opentelemetry-python-contrib/tox.ini") +) + +state = State(get_options(), []) + +conf = state.conf +set_trace() + +tox_section = [section for section in ini_source.sections()][0] + +tox_section_loader = ini_source.get_loader(tox_section, {}) + +# converted = tox_section_loader.load("envlist", EnvList, None, conf, raw, args) + + +raw = tox_section_loader.load_raw("envlist", conf, None) + +set_trace()