-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
pyproject.toml 'include' directive parsing bug. #7094
Comments
Please follow the issue template -- provide a complete report with versions, a reproducing pyproject.toml, and a step-by-step explanation of what you expect, what you get, and the commands you ran. |
Again, this is unlikely to be looked at if you don't follow the issue template. The template is there to avoid wasting reporters and contributors time; please fill it out so that people trying to reproduce clearly understand what versions and platform you are testing on. Similarly, the complete verbose output of the commands you are experiencing exceptions with is important, as it lets contributors ensure that they are indeed looking at the same symptom and cause as you. I understand you think this is a trivial case, but again, we have the template for a reason, and it avoids wasting your time (because you've reported a non-bug, a fixed issue, or simply have provided a poor quality report no one is interested in looking at) as well. |
@neersighted done |
what command are you running to provoke this error? the stack that you've given doesn't appear to involve poetry at all, it's not clear why you've raised this bug against poetry rather than, say, pytest? |
indeed this looks like a duplicate of uiri/toml#270 (which would have been the appropriate place to raise this) |
I'm just a member of the bit herd of software engineers working globally who find poetry useful but occasionally vexing. Maybe just fix the bug? The "old" bug report dates to Nov 30, 2019. That seems kind of ancient...You wouldn't be getting my bug report now if it had been fixed 3 years ago... |
Let's slow down a second -- there's no need to get heated. Following the issue template has revealed that this is in fact, not a Poetry issue. The pyproject.toml file is not exclusively Poetry's domain, and the issue you are hitting does not involve any Poetry code. What you are encountering is a bug in the uiri/toml library, which does not like what is otherwise a valid construct (a list with mixed strings and tables). Poetry supports such a thing, and well-behaved TOML implementations will not object to it. Another tool you are using (I see pytest in the stack trace, so I'd start looking there) is using uiri/toml, which fails to parse a valid TOML document. While Poetry is involved in the sense that you are editing a Poetry section of the pyproject.toml, it is not involved in the sense that the stack trace you have provided clearly shows no Poetry code is involved, and there is nothing that can be done in the Poetry project itself to resolve this. You are correct that we still have too many issues, and that they often are unaddressed for longer than we would like. However, I would like to point out that we had 1500 issues as little as two months ago, and a very large effort is being put in to improve the signal-to-noise ratio of this tracker. Having high-quality reports that follow the template is a key part of that effort; we can see that exhibited in this issue, where a well-formed issue report quickly revealed that this was confusion over where certain code lived, and was in fact an external issue. Anyone interested in this issue now knows where it needs to be fixed and where they can follow progress, and contributors are not spending time trying to chase down an issue without a stack trace (indeed, I was unable to reproduce with your pyproject.toml as no Poetry code is involved in your issue, and that was not obvious before the full report). In any case, I'd finally like to remind you that both Poetry and uiri/toml are open-source, volunteer-led projects. I understand you're frustrated that an issue over there has gone unresolved for three years, but please keep in mind that these projects are worked on by individuals for no compensation in their free time, because they enjoy creating something others find useful. There is no warranty or contractual relationship -- you're free to report issues, or offer up code for others to use, but the project is under no obligation to do anything. Please follow up with the project in question, but also remember to be understanding, and patient. If you are able and willing to contribute technical work like code towards a fix, it's often the fastest way to solve these issues -- though I will admit that the parser internals are likely complex enough that a regular contributor is a much more likely source for a fix. |
@neersighted, I deeply appreciated your frank reply. I sincerely apologize for the consternation my own comments inspired on your part. As a good colleague of mine remarked when I was once on the other (receiving) side of such comments: "...maybe so..and..so is just having a bad day on their (software engineering) side...". I hope that you can make such allowances for me today. I was obviously mistaken in considering the error within the remit of poetry: the pyproject.toml file in my project was only created when I migrated the project to Poetry.. in fact, poetry created the initial file and I simply added to it following poetry documented additions. I guess I'd be forgiven for incorrectly assuming it was a poetry bug... I was inadvertently - not so blissfully - unaware that poetry and pytest share the same name for a configuration file. What an eye opener! Talk about (admirable!) standards reuse I furthermore now also understand the point that there are multiple diverse implementations of TOML parsing, some more compliant than others with the expected constructs.... and that Poetry and Pytest each use different libraries to parse their TOML file! Talk about lack of reuse of standards, in terms of libraries! On the issue of open source, I've long been a fan of, and contributor to, many such projects, so I do understand your angst with my harsh comments. Again, please accept my apologies... and also, my gratitude for your thoughtful reply. For now, I'll just avoid the offending construct in the TOML file in question since I don't actually enough professional or personal degrees of freedom at the moment to jump into the fray of uiri/toml to fix this bug... although all of the information gleaned here about the coding landscape for this was very helpful (I'm truly sorry that I didn't pick up on any of this earlier...) |
uiri/toml is stagnant and gradually being eased out of the ecosystem - you wouldn't want to make fixes there even if you had the time and inclination to do so. recent versions of pytest have moved to using tomli - pytest-dev/pytest#8857. (And what's more, recent versions of python have brought tomli into the standard library - as tomllib) So the general situation with respect to toml-parsing libraries is improving. Probably you could avoid your original problem by upgrading to a recent pytest. |
@dimbleby thank you for the head's up on this! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Highlighting here but elaborated a bit in #6094 (comment)
include
doc is missing thetype
key #6094 (comment)).-vvv
option) and have included the output below.Issue
I added the following directive to a pyproject.toml file:
Using my library, e.g. just running PyTests, triggers a
IndexError: list index out of range
exception reading in deep in thetoml
decoder.py module here:but this error is not triggered either by
alone, nor by
alone.
I guess I'll remove one or the other components of the include, but it would be helpful to know what's happening (and fix it!) or, at least, document the constraints of
include
usage accordingly.The text was updated successfully, but these errors were encountered: