-
-
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
[WIP] Add support for toml config #3686
Conversation
FYI for some reason I couldn't run tests in py27 - got
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't even pretending to try to support a config file format with completely different semantics correctly
what where you even thinking
now that i finished my first coffee in the morning i'd like to apologize for being overbearingly harsh in my review as is we cannot accent this pr as the semantics of the as such we can't just use a |
Whoa, you're right. I'm actually not so sure what I was thinking -- saw an easy way to fix this and a simple case of |
@tadeoos the toml format supports nested structures, arrays, date types, and various ways to structure data better, so supporting it by merely using it like ini files would set things up for worse but in future we really should take a look at taking advantage of the additional capabilities - which means we would need a new api to set up how we use data/configuration keys from the toml file this is something that will need an actual design document and a few iterations of discussion |
@RonnyPfannschmidt, I see.
What do you think about adding a [tools.pytest]
[tools.pytest.ini]
# old school inilike configuration opts go here...
Is there any procedure on creating such a document? |
we dont have a procedure in place for that which is unfortunate, i propose writing usage documentation as a starting point |
@RonnyPfannschmidt, I'm reading our docs as well as TOML specification and from what I gather, what we need, considering TOML types, is a support for arrays, so this: [pytest]
filterwarnings =
error
ignore::DeprecationWarning could become: [tool.pytest]
filterwarnings = [
'error',
'ignore::DeprecationWarning'
] Other then multiple value ones, options mentioned in the docs have values of either The other thing that TOML brings and we could use is, as you mentioned, data structuring, so for example it seems it'd be nice to have something like the following: [tool.pytest] # general options go here
maxfail = 3
strict = true
[tool.pytest.reporting] # and afterward we have sections analogous to the `--help` output
tb = 'long'
showlocals = true
[tool.pytest.coverage] # plugins could also have their own sections
cov = ['my_package'] How do you feel about this? Is this good enough? Is it a good direction? Am I missing some obvious feature here? |
@tadeoos those are good points at getting started and developing a initial impression of the file format another tricky layer will be how to express what types and how to deal with them in the config file - and also the interaction with the ini config handling as we currently do not have a clear idea for a unified api to move torwards |
Could you elaborate on that? I'm reading the code base but haven't yet managed to grok the whole flow of config initialisation process...
I think I get what you are menaing here... For one the semantic problem in the code I see is that file configs are conceptualised as ini objects ( |
i only managed to do some intial tinkering, i was going to focus on refactoring first (currently the initialization of the config object is fundamentally broken and it creates unfixable issues for xdist) im currently not sure how to explain the details myself |
@RonnyPfannschmidt could you elaborate on (or point to) issues for xdist? If we're going to refactor it'd be wise to take then into accout. @nicoddemus -- do you have any thougths/opinions on the direction this should take? |
#1743 captures part of the issue |
oh, https://github.com/pytest-dev/pytest/projects/2#card-10815850 has quite many issues related to it |
4fb3b5a
to
51b3e66
Compare
Hi @tadeoos, It has been a long time since it has last seen activity, plus we have made sweeping changes on In order to clear up our queue and let us focus on the active PRs, I'm closing this PR for now. Please don't consider this a rejection of your PR, we just want to get this out of sight until you have the time to tackle this again. If you get around to work on this in the future, please don't hesitate in re-opening this! Thanks for your work, the team definitely appreciates it! |
Resolves #1556