Skip Navigation
PEP 735 does dependency group solve anything?
  • strict schema and a spec are not the same. package pyproject-validate can check if a pyproject.toml follows the spec, but not be using a strict schema.

    A schema is similar to using Rust. Every element is strictly typed. Is that an int or a str is not enforced by a spec

    If there was a strict schema, package pyproject-validate would be unnecessary

  • PEP 735 does dependency group solve anything?
  • The strictyaml schema holds a pinch of nuance.

    The value argument is automagically coersed to a str. Which is nice; since the field value can be either integer or str. And i want a str, not an int.

    A Rust solution would be superior, but the Python API is reasonable; not bad at all.

  • PEP 735 does dependency group solve anything?
  • parsing lock files

    There's a few edge cases on parsing dependency urls. So it's not completely black and white.

    just have to read over to pip-compile-multi to see that. (i have high praise for that project don't get me wrong)

  • PEP 735 does dependency group solve anything?
  • then i'm misunderstanding what data dependencies groups are supposed to be storing. Just the equivalent of requirements.in files and mapping that to a target? And no -c (constraints) support?!

    Feels like tying one of hands behind our back.

  • PEP 735 does dependency group solve anything?
  • You are not wrong, yaml can be confusing.

    Recently got tripped up on sequence of mapping of mapping. Which is just a simple list of records.

    But for the life of me, couldn't get a simple example working.

    Ended up reversed the logic.

    Instead of parsing a yaml str. Created the sample list of dict and asked strictyaml to produce the yaml str.

    Turns out the record is indented four spaces, not two.

    - file: "great_file_name_0.yml"
        key_0: "value 0"
    - file: "great_file_name_1.yml"
        key_0: "value 0"
    

    Something like ^^. That is a yaml database. It has records, a schema, and can be safely validated!

    The strictyaml documentation covers ridiculously simple cases. There are no practical examples. So it was no help.

    Parser kept complaining about duplicate keys.

  • PEP 735 does dependency group solve anything?
  • In this super specific case, the data that is being worked with is a many list of dict. A schema-less table. There would be frequent updates to this data. As package versions are upgraded, fixes are made, and security patches are added.

  • PEP 735 does dependency group solve anything?
  • Highly suggest reading the strictyaml docs

    The author lays out both

    Should be required reading for anyone dealing with config files, especially those encountering yaml.

    Warning: After reading these, and confirming the examples yourself, seeing packages using pyyaml will come off as lessor

  • PEP 735 does dependency group solve anything?
  • Yeah, but should it be (rw)?

    If it's rw, it's a database, not a config file.

    No software designer thinks ... postgreSQL, sqlite, mariadb, duckdb, .... nah TOML

    Or at least yaml turns out to be not a strange suggestion

  • PEP 735 does dependency group solve anything?
  • Throwing out an alternative. Not making the assumption that more TOML is better. Cuz the contents of those requirements.txt files are rw, not ro. I see pyproject.toml as a ro configuration file.

    Do you agree or should pyproject.toml be rw?

    Another option, strictly validated YAML.

    For the configuration section, before parsing occurs, strict validation occurs against a schema.

    TOML vs strictyaml -- https://hitchdev.com/strictyaml/why-not/toml/

  • PEP 735 does dependency group solve anything?
  • Limitations of requirements.txt files

    -- https://peps.python.org/pep-0735/#limitations-of-requirements-txt-files

    The only benefit i can see, is to attempt to bring requirements files into pyproject.toml and an additional layer to abstract away from pip.

    ^^ this does not keep me awake at night nor is it a substitute for porn

    The PEP author's intentions are good, puts focus on a little discussed topic.

    The outcome ... questionable

    If this is all it's doing, that's not enough. Ignores the elephant in the room.

    Which are

    • fixing dependency conflicts

    • mutual compatibility

    Fixing dependency conflicts would be easier if can work with existing proven tooling. Which acts upon r/w files rather than pyproject.toml, a config file; shouldn't constantly be updated.

  • PEP 735 does dependency group solve anything?
    peps.python.org PEP 735 – Dependency Groups in pyproject.toml | peps.python.org

    This PEP specifies a mechanism for storing package requirements in pyproject.toml files such that they are not included in any built distribution of the project.

    PEP 735 – Dependency Groups in pyproject.toml | peps.python.org

    PEP 735 what is it's goal? Does it solve our dependency hell issue?

    A deep dive and out comes this limitation

    The mutual compatibility of Dependency Groups is not guaranteed.

    -- https://peps.python.org/pep-0735/#lockfile-generation

    Huh?! Why not?

    mutual compatibility or go pound sand!

    pip install -r requirements/dev.lock pip install -r requirements/kit.lock -r requirements/manage.lock

    The above code, purposefully, does not afford pip a fighting chance. If there are incompatibilities, it'll come out when trying randomized combinations.

    Without a means to test for and guarantee mutual compatibility, end users will always find themselves in dependency hell.

    Any combination of requirement files (or dependency groups), intended for the same venv, MUST always work!

    What if this is scaled further, instead of one package, a chain of packages?!

    26
    Yes, you should use a Python venv in a container like docker
  • Would the coke and blow happen for that guy?

    Makes sense if i'm that guy

    This question is about Python package funding. If world+dog no longer stresses over pip dependency resolution isn't this not extremely valuable? So how to go about getting that package permanently funded. No bs dangling a tiny carrot and insisting on strict justice (reporting milestones ...). Then funding only happens for large projects.

    Question on package funding is very legitimate. Have a list of packages that are no longer maintained cuz funding never happened.

    Can subsist on crocodile tears. It's a guilty pleasure.

    Meaning, if package funding never ever happens, and all that ever happens is never ending articles/threads on Python devs whining about dependency resolution, i'm going to feed that.

    Personally not suffering from dependency resolution stress. Everyone else does.

    If the available solutions were sufficient there would be no more articles with comment sections filled with war stories, tales of carnage, and loss.

    ... always comes down to that one guy.

    Solve the Python author maintainer funding issue!

    Then and only then will i market the package that specifically targeted towards resolving pip dependency resolution issues for package (and app) maintainers.

  • Yes, you should use a Python venv in a container like docker
  • then they come after our guns, but spoons are always magically safe

    To all the fat slob system wide installation cock blocking PR submitters, i say,

    Ban spoons!

    Shooting ourselves in the foot is a G'd given right! /nosarc

  • Yes, you should use a Python venv in a container like docker
  • We need AA meetings

    Hello!

    My name is Billy Joe Jim Bob

    Hello Billy!

    I haven't had a dependency conflict for the past 3 hours. The sleeping problems haven't gone away. As i feel my eye lids drupe, keep thinking about each of my packages and imagining where will the next unresolvable dependency conflicts emerge.

    Then i wake up covered in sweat.

    Can't keep going on like this. Thank you for listening

    Thank you for sharing Billy!

  • constraint vs requirement. What's the difference?

    In a requirements-*.in file, at the top of the file, are lines with -c and -r flags followed by a requirements-*.in file. Uses relative paths (ignoring URLs).

    Say have docs/requirements-pip-tools.in

    ``` -r ../requirements/requirements-prod.in -c ../requirements/requirements-pins-base.in -c ../requirements/requirements-pins-cffi.in

    ... ```

    The intent is compiling this would produce docs/requirements-pip-tool.txt

    But there is confusion as to which flag to use. It's non-obvious.

    constraint

    Subset of requirements features. Intended to restrict package versions. Does not necessarily (might not) install the package!

    Does not support:

    • editable mode (-e)

    • extras (e.g. coverage[toml])

    Personal preference

    • always organize requirements files in folder(s)

    • don't prefix requirements files with requirements-, just doing it here

    • DRY principle applies; split out constraints which are shared.

    27
    InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)LO
    logging_strict @programming.dev
    Posts 2
    Comments 65