Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tox requires not exposed in the config object #1918

Closed
hroncok opened this issue Feb 15, 2021 · 2 comments · Fixed by #1919
Closed

tox requires not exposed in the config object #1918

hroncok opened this issue Feb 15, 2021 · 2 comments · Fixed by #1919
Labels
feature:new something does not exist yet, but should

Comments

@hroncok
Copy link
Contributor

hroncok commented Feb 15, 2021

I cannot find tox requires on the config object. The minversion is there, but the requires are not. They appear to be parsed, used and forgotten.

tox/src/tox/config/__init__.py

Lines 1297 to 1302 in 555f3f1

def handle_provision(self, config, reader):
requires_list = reader.getlist("requires")
config.minversion = reader.getstring("minversion", None)
config.provision_tox_env = name = reader.getstring("provision_tox_env", ".tox")
min_version = "tox >= {}".format(config.minversion or Version(tox.__version__).public)
deps = self.ensure_requires_satisfied(config, requires_list, min_version)

I'd like to be able to read them from a plugin.

I can send a PR, if this would be accepted.

@hroncok hroncok added the feature:new something does not exist yet, but should label Feb 15, 2021
@gaborbernat
Copy link
Member

Sure 👍🏻

@hroncok
Copy link
Contributor Author

hroncok commented Feb 15, 2021

Side note: It seems that this expects the value to be there:

tox/src/tox/exception.py

Lines 98 to 99 in 555f3f1

def __str__(self):
return " ".join(pipes.quote(i) for i in self.config.requires)

hroncok added a commit to hroncok/tox that referenced this issue Feb 15, 2021
Fixes tox-dev#1918

This also fixes broken __str__ of MissingRequirement,
which is never actually used but is helpful when debugging.
hroncok added a commit to hroncok/tox that referenced this issue Feb 15, 2021
Fixes tox-dev#1918

This also fixes broken __str__ of MissingRequirement,
which is never actually used but is helpful when debugging.
hroncok added a commit to hroncok/tox-current-env that referenced this issue Feb 15, 2021
gaborbernat pushed a commit that referenced this issue Feb 16, 2021
Fixes #1918

This also fixes broken __str__ of MissingRequirement,
which is never actually used but is helpful when debugging.
ssbarnea pushed a commit to ssbarnea/tox that referenced this issue Apr 19, 2021
Fixes tox-dev#1918

This also fixes broken __str__ of MissingRequirement,
which is never actually used but is helpful when debugging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:new something does not exist yet, but should
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants