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

Mass testing fixes #199

Merged
merged 6 commits into from
Nov 26, 2022

Conversation

isidentical
Copy link
Collaborator

CC: @pablogsal @lysnikolaou

Kept each commit as a single fix, there are a couple more incoming.

@isidentical
Copy link
Collaborator Author

This is the list of files (you can find the exact file on GitHub/PyPI) that I've found, will report back with a better list once I have a few common fixes ready: https://gist.github.com/isidentical/1762ae58c6ff41b29fc2ae970df63108

@isidentical
Copy link
Collaborator Author

isidentical commented Nov 26, 2022

Seems like we are close to full roundtripping. Two cases that hit my eye (I also need to test my latest changes to ensure they don't break anything extra :D) that I don't have time today to fix (will take a look at them tomorrow if it is not fixed by then)

# This seems like a bug with escaping

--- /tmp/ast-of/pypi/yt-dlp-2022.11.11/yt_dlp/extractor/common.py
+++ /tmp/ast-of/pypi/yt-dlp-2022.11.11/yt_dlp/extractor/common.py
@@ -2576,7 +2576,7 @@
             Name(id='filename', ctx=Store())],
            value=JoinedStr(
             values=[
-             Constant(value='\\\\?\\'),
+             Constant(value='\\?\\'),
              FormattedValue(
               value=Name(id='absfilepath', ctx=Load()),
               conversion=-1)]))],
# A lot of occurences, we should be able to eliminate these quite eazily since there is no real bug

--- /tmp/ast-of/pypi/docformatter-1.5.0/docformatter.py
+++ /tmp/ast-of/pypi/docformatter-1.5.0/docformatter.py
@@ -2622,6 +2622,7 @@
       Return(
        value=JoinedStr(
         values=[
+         Constant(value=''),
          FormattedValue(
           value=Name(id='open_quote', ctx=Load()),
           conversion=-1),
Trees differ: pypi/docformatter-1.5.0/docformatter.py
Trees differ: pypi/poetry-1.2.2/tests/console/commands/cache/test_list.py
Trees differ: pypi/statsmodels-0.13.5/statsmodels/tsa/ardl/model.py
Trees differ: pypi/apache-beam-2.43.0/apache_beam/dataframe/io.py
Trees differ: pypi/polars-0.14.29/polars/internals/lazyframe/frame.py
Trees differ: pypi/pyflakes-2.5.0/pyflakes/test/test_api.py
Trees differ: pypi/great_expectations-0.15.34/scripts/build_api_docs.py
Trees differ: pypi/great_expectations-0.15.34/tests/data_context/store/test_validations_store.py
Trees differ: pypi/great_expectations-0.15.34/tests/data_context/store/test_html_site_store.py
Trees differ: pypi/great_expectations-0.15.34/tests/data_context/store/test_expectations_store.py
Trees differ: pypi/great_expectations-0.15.34/tests/data_context/store/test_store_backends.py
Trees differ: pypi/yt-dlp-2022.11.11/yt_dlp/extractor/common.py
Trees differ: pypi/docutils-0.19/docutils/core.py
Trees differ: pypi/hatch-1.6.3/tests/cli/project/test_metadata.py
Trees differ: pypi/west-0.14.0/src/west/app/project.py

@isidentical isidentical marked this pull request as ready for review November 26, 2022 00:09
Parser/tokenizer.c Outdated Show resolved Hide resolved
Copy link

@pablogsal pablogsal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes LGTM. Is there any reason why there is still a WIP in the title?

@@ -43,6 +43,10 @@ enum tokenizer_mode_kind_t {
typedef struct _tokenizer_mode {
enum tokenizer_mode_kind_t kind;

// TODO: we probably can infer this without storing it
// from the other information available here.
int format_spec;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also add a new tokenizer mode kind for this. I don't know what would simplify this more

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was thinking about a mode, but since each mode currently maps to a single get function I thought it wasn't that necessary and this flag can kept in the mode level (and even removed in the future if we can leverage the other meta information here)

@pablogsal
Copy link

Thanks a lot for doing this check and fixing the errors @isidentical! We are so close! 🚀

Co-authored-by: Pablo Galindo Salgado <[email protected]>
@isidentical
Copy link
Collaborator Author

These changes LGTM. Is there any reason why there is still a WIP in the title?

I need to fix a final bug (the first example in here: #199 (comment)), but then we should be able to land this (which would mean we can roundtrip pretty much everything)

@isidentical
Copy link
Collaborator Author

Landing this now, will take care of the weird backslashes in the subsequent one.

@isidentical isidentical changed the title [WIP] Mass testing fixes Mass testing fixes Nov 26, 2022
@isidentical isidentical merged commit 6d95439 into fstring-grammar-rebased-after-sprint Nov 26, 2022
@isidentical isidentical deleted the batuhan-fstring-fix branch November 26, 2022 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants