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

Support config defaults using .pip-tools.toml or pyproject.toml #1863

Merged
merged 27 commits into from
Jun 13, 2023

Commits on Jun 13, 2023

  1. Set config defaults using pyproject.toml

    j00bar authored and webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    1204f72 View commit details
    Browse the repository at this point in the history
  2. PR review feedback. Updated README.

    j00bar authored and webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    04af2a5 View commit details
    Browse the repository at this point in the history
  3. Switch the toml fallback library to tomli

    This implementation is the de-facto go-to choice nowadays. It is also API-compatible with the stdlib's `tomllib`.
    webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    06fb793 View commit details
    Browse the repository at this point in the history
  4. Use pathlib.Path objects internally

    It is the best practice nowadays. Paths are only converted to strings for text representation, like when logging.
    webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    9ef5f8f View commit details
    Browse the repository at this point in the history
  5. [pre-commit.ci] auto fixes from pre-commit.com hooks

    for more information, see https://pre-commit.ci
    pre-commit-ci[bot] authored and webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    0098ee5 View commit details
    Browse the repository at this point in the history
  6. Update the config defaults in CLI ctx in place

    This patch is supposed to improve the readability of said block of code and optimize it a bit.
    webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    fc4b8f5 View commit details
    Browse the repository at this point in the history
  7. 🎨 Separate updating CLI context with the config

    This is a refactoring patch aimed at improving readability.
    webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    cc28f42 View commit details
    Browse the repository at this point in the history
  8. 🎨Mv parsing error processing->parse_config_file

    This helper is a better location since it already contains similar
    processing code that converts problems into process-interrupting
    exceptions. It is also rather weird to process low-level exceptions
    on the higher level when the context is lost.
    webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    5dab95d View commit details
    Browse the repository at this point in the history
  9. 🎨 Couple config parsing-n-ctx-assigning w/ walrus

    This change demonstrates a rather indivisible relation between getting
    the config contents into the CLI context making it a perfect target for
    the future refactoring.
    webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    92e455f View commit details
    Browse the repository at this point in the history
  10. [pre-commit.ci] auto fixes from pre-commit.com hooks

    for more information, see https://pre-commit.ci
    pre-commit-ci[bot] authored and webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    2e86931 View commit details
    Browse the repository at this point in the history
  11. 🐛 Compare pathlib objects @ precedence test

    This was missing from a previous commit, could be used to fix it up.
    webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    f4692a7 View commit details
    Browse the repository at this point in the history
  12. 🎨 Rename config option callback to determine_config_file

    This improves the readability and follows common function naming practices of using verbs to describe actions they perform.
    webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    c8298e0 View commit details
    Browse the repository at this point in the history
  13. [pre-commit.ci] auto fixes from pre-commit.com hooks

    for more information, see https://pre-commit.ci
    pre-commit-ci[bot] authored and webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    fe16e26 View commit details
    Browse the repository at this point in the history
  14. Unwalrus piptools.utils

    We'll be able to revert this commit in about 1.5 months, once Python 3.7 is no longer supported.
    webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    cc4a91f View commit details
    Browse the repository at this point in the history
  15. Simplify config file lookup @ select_config_file

    This makes it easier to follow that's happening in the helper function
    step-by-step.
    webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    c3c4795 View commit details
    Browse the repository at this point in the history
  16. Iterate over config lookup dirs lazily

    The change converts list comprehensions into generator expressions.
    This helps save memory and reduce unnecessary syscalls.
    webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    64e3a2a View commit details
    Browse the repository at this point in the history
  17. [pre-commit.ci] auto fixes from pre-commit.com hooks

    for more information, see https://pre-commit.ci
    pre-commit-ci[bot] authored and webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    050e278 View commit details
    Browse the repository at this point in the history
  18. Drop unnecessary parens from lru_cache

    This is a tiny cosmetic change, making the code cleaner.
    webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    a111641 View commit details
    Browse the repository at this point in the history
  19. Reuse working dir in select_config_file

    This makes sure there's no unnecessary syscalls.
    webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    ca76900 View commit details
    Browse the repository at this point in the history
  20. Revert "Drop unnecessary parens from lru_cache

    "
    
    This reverts commit 75f2729.
    
    That patch was incompatible with Python 3.7.
    webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    8627df8 View commit details
    Browse the repository at this point in the history
  21. PR review feedback.

    j00bar authored and webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    db2f30b View commit details
    Browse the repository at this point in the history
  22. [pre-commit.ci] auto fixes from pre-commit.com hooks

    for more information, see https://pre-commit.ci
    pre-commit-ci[bot] authored and webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    bb015ad View commit details
    Browse the repository at this point in the history
  23. Improve test value for non-existant TOML file.

    Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
    j00bar and webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    d01af78 View commit details
    Browse the repository at this point in the history
  24. Docstring RST fixes; Py3.7 compat fix.

    j00bar authored and webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    97d30bc View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    228f2a7 View commit details
    Browse the repository at this point in the history
  26. [pre-commit.ci] auto fixes from pre-commit.com hooks

    for more information, see https://pre-commit.ci
    pre-commit-ci[bot] authored and webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    8d9dd8a View commit details
    Browse the repository at this point in the history
  27. [pre-commit.ci] auto fixes from pre-commit.com hooks

    for more information, see https://pre-commit.ci
    pre-commit-ci[bot] authored and webknjaz committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    8de18db View commit details
    Browse the repository at this point in the history