Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Jul 11, 2024
1 parent 774e1e9 commit 197e0b5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
from configparser import ConfigParser
from sys import argv
from os.path import join
from pathlib import Path
from re import compile as re_compile
from jinja2 import Environment, FileSystemLoader
from pathlib import Path
from tox.config.cli.parse import get_options
from tox.session.state import State
from tox.config.sets import CoreConfigSet
from tox.config.source.tox_ini import ToxIni
from collections import defaultdict


long_test_env_regex = re_compile(
Expand All @@ -28,16 +33,36 @@ def _get_python_version_alias(python_version):

def get_tox_envs(tox_ini_path: Path) -> list:

config_parser = ConfigParser()
config_parser.read(tox_ini_path)
tox_ini = ToxIni(tox_ini_path)

envs = {}
conf = State(get_options(), []).conf

tox_section = next(tox_ini.sections())

core_config_set = (
CoreConfigSet(conf, tox_section, tox_ini_path.parent, tox_ini_path)
)

(
core_config_set.
loaders.
extend(
tox_ini.
get_loaders(
tox_section,
base=[],
override_map=defaultdict(list, {}),
conf=core_config_set
)
)
)

return core_config_set.load("env_list")


def get_test_tox_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:
Expand Down
File renamed without changes.

0 comments on commit 197e0b5

Please sign in to comment.