- 
                Notifications
    
You must be signed in to change notification settings  - Fork 188
 
Use tomllib/tomli for reading .toml configs #608
Conversation
| 
           Rebased on top of poetry.  | 
    
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.
I think this depend on #612 to be really tested, could you rebase on it ?
The Python 3.11 change was merged in and this PR is being properly tested now.
| 
           Thanks for this PR!  | 
    
| 
           Thanks!  | 
    
| 
           This was a breaking change for our team, btw -- we're on Python 3.10 and have had  Now that I understand what changed, it's a simple fix, but wanted to let y'all know that this wasn't 100% backward-compatible. Either way, thanks for the improvement -- I'm increasingly excited to join the Python 3.11 gang.  | 
    
| 
           @christianbundy how were you installing pydocstyle with toml support? Were you using   | 
    
| 
           We're using pre-commit, here's the config we were using:   - repo: https://github.com/pycqa/pydocstyle
    rev: 6.2.3 # previously using 6.1.1, upgrading caused errors
    hooks:
      - id: pydocstyle
        args:
          - --config=pyproject.toml
        additional_dependencies:
          - toml~=0.10.2Should we have been doing this differently? I think maybe we could add   | 
    
| 
           @christianbundy you want the following -  | 
    
| 
           Oh, nice! Thank you.  | 
    
          
 Could someone ask upstream to include that in the official documentation? It's not the most predictable way of sorting this particular problem. Unfortunately, I can't do that since upstream likes banning people for no apparent reason.  | 
    
| 
           Just to spell it out for any others, it took me a few tries to connect the comment above to what we need here. My .pre-commit.yaml now has   - repo: https://github.com/PyCQA/pydocstyle
    rev: "6.3.0"
    hooks:
      - id: pydocstyle
        additional_dependencies: ['.[toml]']and it made the   | 
    
Use the built-in
tomllibmodule in Python 3.11 and the moderntomlipackage in older Python versions to read .toml configs instead of the unmaintained and brokentomlpackage.Fixes #599
Fixes #600
Thanks for submitting a PR!
Please make sure to check for the following items:
If you've added an error code or changed an error code behavior,
you should probably add or change a test case file under
tests/test_cases/and addit to the list under
tests/test_definitions.py.If you've added or changed a command line option,
you should probably add or change a test in
tests/test_integration.py.Make sure to include the PR number after you open and get one.
Please don't get discouraged as it may take a while to get a review.