• 4 Posts
  • 115 Comments
Joined 2 years ago
cake
Cake day: March 1st, 2024

help-circle

  • Similarly to how test coverage measures how much of a library’s source code is hit by its tests, type coverage measures what percentage of a library’s typables have type annotations.

    Errrr no!

    type coverage should be how much of the typing has corresponding tests. This is particularly important for stub packages. Which are focused on confirming the advertised typing accurately reflects actual typing.

    Hope they didn’t cyber squat the package name.

    Listen to Yoda, “Try? Either do or do not! No try there is.”

    The correct answer to percentage of a libraries typables having type annotations is either zero or all. This is advertised by the py.typed file. There is no middle ground.

    Wtf is wrong with pyrefly authors?



  • Tools i recommend:

    • rebuff – finds places in code to replace with better algorithms. Wanted a tool to recommend itertools and itertools-more usage, but achieve that. Chosen cuz it’s not Rust.

    • typos – fixes typos in both code and docs

    • mypy+pyright+stubtest – need all of them. pyright phones home. mypy isn’t enough it misses way too much.

    • pretty format YAML

    • cyclonedx-bom – create software bill of materials

    • pip-licenses – NOTICE.txt and licenses.json Answers question does my toolchain include virus licensed packages?

    • interrogate – Any code documentation missing? Does not enforce documentation quality.

    • wreck – sync requirements files; otherwise it’s tedious (i’m the author)


    • uv and ruff

    If it can be helped, don’t want Rust nor nodejs in my toolchain. Recommending to Python coders who are very likely not Rust or node.js experts is malpractice or unethical (call it what you may). If you had a problem with any non-Python packages would be at the mercy of non-Python communities. i’m struggling just with Python community black issue 2514 now you want us to broaden that struggle?

    And if people are too dumb or lazy to learn how requirement file hierarchies work, perhaps they shouldn’t be Python coders.

    Disclosure: author of wreck



  • The OP mentioned dealing with user input via pydantic. Which acts schema-like. strictyaml does the same for YAML config files where runtime validated against a schema.

    And here is why all the other config file formats are dodgy, why-not written by author of strictyaml (not me).

    Disclosure: Author of types-strictyaml, logging-strict, pytest-logging-strict, and sphinx-external-toc-strict. So yes i drank the kool-aid, but welcome challenges to preference for YAML config file format over others.






  • Reply to /u/onlinepersona SQLAlchemy crocodile tears.

    Really need a layer between SQLAlchemy and FastAPI (or litestar, …). Otherwise would be messing around with SQLAlchemy/alembic internals for years. SQLAlchemy is an incredible time sink without that additional layer.

    Created just such a package just never got around to publishing it:

    • static type checking throughout
    • sync and async support throughout
    • alembic support (both async and sync)
    • multiple databases. One per config file!
    • model built from dotted path of (sqlmodel and sqla mixins) components module
    • UDF (user defined functions)
    • database settings (PRAGMA, SHOW, SET, …)
    • sqlite-[pysqlite|sqlcipher|aiosqlite] and postgresql-[psycopg2|asyncpg] supported
    • config does not store the password

    Issues:

    • retire sqlite-sqlcipher PRAGMA rekey and key. Password in config unsafe
    • authentication by pulling from a password manager not implemented
    • strict validation of postgresql SHOW/SET keys incomplete






  • Also way to go not taking the side of:

    • an active member of this community

    • someone understanding and in a position to increase browser support for selenium webdrivers

    • a coder who’d care and doesn’t suck at coding

    So what do you get for the Captain Obvious comment besides being right? A clock is right twice a day. But no dopamine hit from a clock.

    A better strategy, would be to ask about how to go about increasing selenium web driver browser support and whether a more flexible package is in the works. Not to defend a hopeless package in dire need of a rewrite. Or to provide the info i ask for about how to go about responsibly disclosing security issues.

    Understand your heart is in the right place. Hope you can understand that alone isn’t the only consideration or way to look at this. You can press the issue and still come away with nothing.

    rinse wash repeat and still the reflex reaction will remain the same. I’m suggesting trying something else.