-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Cannot setup log_format
in setup.cfg, because of
InterpolationMissingOptionError`
#3062
Comments
GitMate.io thinks the contributors most likely able to help are @nicoddemus, and @RonnyPfannschmidt. |
According to https://bugs.python.org/issue20754l#msg299292 the distutils "bug", which causes "pip install ..." to fail, will not be fixed in cpython 2.x.
We could add support for both single |
I suppose, this will solve the original issue. |
Thanks. @Thisch should we still consider this a bug or is this an improvement? |
What would be the difference? If we mark it as a bug we could fix it in 3.3.x, if not we would have to wait till 3.4, right? |
Correct, but we also should consider if existing suites might break after fixing this; this could warrant releasing it into 3.4 even if it is a bug fix. |
well, this is mainly another example of why it is bad to naively hook into configfiles of other tools that aren't meant to be used that way - i propose documenting |
How is that possible?
I must disagree. In our projects we put all the relevant settings into |
@prokher feel free to disagree,however different tools disagree on how to parse what configfile and bam there is a massive mess while it may feel natural, tecnically its strictly wrong and works mostly by accident, this issue simply shows that there are cases where that "happy it works" breaks down for all the right reasons |
@RonnyPfannschmidt It is not necessary wrong. For instance it will not be wrong if PyTest would use I do not want to induce (or participate in) philosophical discussions about what is good and what is wrong, but currently many tools use sections of |
@prokher then py.test would have different config syntaxes with different behaviours for different files - i'm not quite sure how that makes anything better |
from my pov it was a mistake to ever allow the parsing of setup.cfg since it uses a different semantics than pytest.ini |
So is there a workaround for 3.6? I've hit this issue and I'm confused as how to fix it. For the record we use a setup.cfg file where we put all our configs (for pytest and other tools). |
it is impossible to fix as of now - we shoudl start deprecating using setup.cfg |
@RonnyPfannschmidt So what I'm hearing is that in order to fix this, I'll need to move out the pytest-specific stuff from our |
@BeyondEvil correct |
I wish it could go in setup.cfg, but that's impossible due to the string interpolation (see pytest-dev/pytest#3062 for a similar problem) I don't like it being in tox.ini because it becomes confusing where things are.
My related issue over on pip pypa/pip#5182 |
im closing this one as "wontfix" |
Don't move pytest settings into setup.cfg pytest-dev/pytest#3062
* Add pre-commit * Fix pre-commit check error * Replace pytest.ini with setup.cfg * Remove MANIFEST.in * Fix .travis.yml error * Fix .travis.yml error .travis.yml currently not support merging multi maps * Fix setup.cfg error Don't move pytest settings into setup.cfg pytest-dev/pytest#3062
- Running flake8 via tox, e.g., `tox -e flake8` crashes. Setuptools uses configparser to read the config, which throws configparser.InterpolationMissingOptionError because of the percent (%) symbols in the format string. - Ref: pytest-dev/pytest#3062 pypa/pip#5182
- Running flake8 via tox, e.g., `tox -e flake8` crashes. Setuptools uses configparser to read the config, which throws configparser.InterpolationMissingOptionError because of the percent (%) symbols in the format string. - Ref: pytest-dev/pytest#3062 pypa/pip#5182
- Running flake8 via tox, e.g., `tox -e flake8` crashes. Setuptools uses configparser to read the config, which throws configparser.InterpolationMissingOptionError because of the percent (%) symbols in the format string. - Ref: pytest-dev/pytest#3062 pypa/pip#5182
- Running flake8 via tox, e.g., `tox -e flake8` crashes. Setuptools uses configparser to read the config, which throws configparser.InterpolationMissingOptionError because of the percent (%) symbols in the format string. - Ref: pytest-dev/pytest#3062 pypa/pip#5182
- Running flake8 via tox, e.g., `tox -e flake8` crashes. Setuptools uses configparser to read the config, which throws configparser.InterpolationMissingOptionError because of the percent (%) symbols in the format string. - Ref: pytest-dev/pytest#3062 pypa/pip#5182
- Running flake8 via tox, e.g., `tox -e flake8` crashes. Setuptools uses configparser to read the config, which throws configparser.InterpolationMissingOptionError because of the percent (%) symbols in the format string. - Ref: pytest-dev/pytest#3062 pypa/pip#5182
- Running flake8 via tox, e.g., `tox -e flake8` crashes. Setuptools uses configparser to read the config, which throws configparser.InterpolationMissingOptionError because of the percent (%) symbols in the format string. - Ref: pytest-dev/pytest#3062 pypa/pip#5182
- Running flake8 via tox, e.g., `tox -e flake8` crashes. Setuptools uses configparser to read the config, which throws configparser.InterpolationMissingOptionError because of the percent (%) symbols in the format string. - Ref: pytest-dev/pytest#3062 pypa/pip#5182
- Running flake8 via tox, e.g., `tox -e flake8` crashes. Setuptools uses configparser to read the config, which throws configparser.InterpolationMissingOptionError because of the percent (%) symbols in the format string. - Ref: pytest-dev/pytest#3062 pypa/pip#5182
Turns out Pytest doesn't support log-format specification in setup.cfg declarations. See pytest-dev/pytest#3062.
Turns out Pytest doesn't support log-format specification in setup.cfg declarations. See pytest-dev/pytest#3062.
Turns out Pytest doesn't support log-format specification in setup.cfg declarations. See pytest-dev/pytest#3062.
Turns out Pytest doesn't support log-format specification in setup.cfg declarations. See pytest-dev/pytest#3062.
Turns out Pytest doesn't support log-format specification in setup.cfg declarations. See pytest-dev/pytest#3062.
Turns out Pytest doesn't support log-format specification in setup.cfg declarations. See pytest-dev/pytest#3062.
Turns out Pytest doesn't support log-format specification in setup.cfg declarations. See pytest-dev/pytest#3062.
Turns out Pytest doesn't support log-format specification in setup.cfg declarations. See pytest-dev/pytest#3062.
pytest was using config from `tox.ini` preferentially and ignoring config from `setup.cfg`, as a side-effect doctests were not running on code/docstrings in `rdflib/`. The reason why some pytest config was in `tox.ini` instead of `setup.cfg` was because of these issues: - pypa/pip#5182 - pytest-dev/pytest#3062 As a compromise to fix this I have opted for moving all pytest config to `pyproject.toml`: - https://docs.pytest.org/en/stable/reference/customize.html#pyproject-toml This seems sensible as `pyproject.toml` is standarized by PEPs and eventually most things from `setup.cfg` will end up in there anyway. Also: - remove the pytest ignore on `test/translate_algebra` as tests in there have been running and passing for some time. - fixed path to test data in `rdflib/plugins/parsers/nquads.py`.
Additional details below: * pytest-dev/pytest#3062 * pypa/pip#5182
Additional details below: * pytest-dev/pytest#3062 * pypa/pip#5182
I would like to setup
log_format
in the project-wise configuration filesetup.cfg
. I do it like this:Given this, any invocation of some
setup.py
or simplypip install -r requirements.txt
in the directory wheresetup.cfg
resides, gives me a error:As far as I understand, the reason is that %-formatting is used in config files for string interpolation. It is recommended to screen
%
with another%
to avoid interpolation. Well, if I do this thenpytest-catchlog
stops interpreting this string as format and simply output it as is.It looks like,
pytest-catchlog
shall adopt the rules of writingsetup.cfg
files. If there is another solution or workaround, please let me know.Bug was originally posted to the
pytest-catchlog
issue tracker here , but once this plugin was merged into PyTest I have to report the bug is still here.P.S. Sorry for ignoring all the steps listed in the contributing guidelines, but this bug was reproduced and confirmed successfully in the original bug report.
The text was updated successfully, but these errors were encountered: