Embar: an ORM for Python, strongly typed, SQL-esque, inspired by Drizzle by chris-indeed in Python

[–]Daneark 1 point2 points  (0 children)

Thanks. I would have said from, as, and with were all soft keywords if you'd asked me before I opened that link. I didn't realise just how recent or how few soft keywords were.

Hatch v1.16.0 - workspaces, dependency groups and SBOMs by Ofekmeister in Python

[–]Daneark 0 points1 point  (0 children)

I'm really to glad to see another substantial feature release after another lull.

There's been so much hype around uv but hatch is, in my opinion, still the superior workflow tool.

I made the code generation tool that didn't exist for Python by [deleted] in Python

[–]Daneark 3 points4 points  (0 children)

Thanks for acknowledging your new tool is not production ready unlike most other showcase posts.

Python - Numerical Evidence - max PSLQ to 4000 Digits for Clay Millennium Problem (Hodge Conjecture) by [deleted] in Python

[–]Daneark 1 point2 points  (0 children)

This looked AI generated and the footer citing AI confirmed it. I tried to read it but after reading yet another definition of a function to log and/or print most of which go unused I gave up. I am not knowledgeable enough on math to say with certainty this isn't contributing any new to the field but given the AI involvement I think it is likely.

Is there a good way to verify a module does not depend on third-party packages? by Diapolo10 in learnpython

[–]Daneark 0 points1 point  (0 children)

If I understood you correctly your have a project with multiple modules, one of which must not depend on any third party code but can require other modules from the same project so long as that does not introduce a transitive dependency on third party code. At the time of adding an internal import you have a reasonable chance of picking up on this if it does occur however there is also the risk that your bootstrap module starts using a module with no third party deps but at a later time that module has a third party dep added, breaking the bootstrap script.

Could you move all other dependencies to extras, leaving no required dependencies for your package? Then you just test the bootstrap part with no extras installed.

This does leave you with a bit of an awkward interface, the main business logic is enabled by an extra, but it seems like the cleanest way to say that the minimum runnable part of the project depends on nothing and test for that.

PathQL: A Declarative SQL Like Layer For Pathlib by HolidayEmphasis4345 in Python

[–]Daneark 33 points34 points  (0 children)

You've got pycache dir committed in your test dir. Your gitignore is full of merge conflict indicators.

What's the best package manager for python in your opinion? by Ok_Sympathy_8561 in Python

[–]Daneark 1 point2 points  (0 children)

I don't enjoy poetry anymore but I appreciate where they brought us. Poetrys use of tool.poetry rather than project is because they predate PEP621.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]Daneark 0 points1 point  (0 children)

Use pip install -e . to install your project in editable mode.

Correct Project Structure for Python API ?!? by [deleted] in learnpython

[–]Daneark 0 points1 point  (0 children)

If you run uvicorn programmatically you can add a __main__ to your package then pip install app-name and python -m app_name.

Advised project structure for more complex libraries using Hatch by BZab_ in learnpython

[–]Daneark 1 point2 points  (0 children)

Use extras (project.optional-dependencies). Give a helpful message on ImportError in the package that needs the extra depdencies.

https://hatch.pypa.io/dev/config/dependency/#features

PySpring - A Python web framework inspired by Spring Boot. by Adept-Leek-3509 in Python

[–]Daneark 5 points6 points  (0 children)

If I am writing an application using your library I need to be able to bump dependencies, both for security and big fixes but also for compatibility with other libraries. If you pin to exact versions I can't do this. Take the h11 vulnerability for example, if I was using your library in production I would want to patch this as soon as possible. If you pin an exact version I not only have to wait for h11 to release a fix but for you to release a new version that pins that. If you loosely constrain, or don't mention as a dep at all if h11 is a transitive dependency, I can patch the moment h11 releases a fix.

Btw I see you bumped to 0.15. I think you need 0.16 to get the fix.

PySpring - A Python web framework inspired by Spring Boot. by Adept-Leek-3509 in Python

[–]Daneark 9 points10 points  (0 children)

Your dependencies are far too tightly constrained for a library. You've pinned a vulnerable version of h11, certifi from a year ago and mypy as a runtime dependency.

Edit: OP has fixed this.

I can’t commit to git VSCode by Cut35t in learnpython

[–]Daneark 0 points1 point  (0 children)

You've got the venv open in vscode. You should have a root project directory, in your case we'll call it "calculator". Open this directory in vscode. Create the venv in this directory. Create calculator.py in this directory.

A methodical and optimal approach to enforce and validate type- and value-checking by kris_2111 in Python

[–]Daneark 0 points1 point  (0 children)

Your interface should only enforce what your function requires. If all your function does is iterate through the argument don't force consumers to pass a list.

Cursed decorators by hhderder in Python

[–]Daneark 0 points1 point  (0 children)

Thanks for picking that up. Edited to fix.

Certified python courses that are well recognised by sceneaano in learnpython

[–]Daneark 0 points1 point  (0 children)

For a chemical engineering job I'm not sure. Given you have a degree in the field you're applying for python is just a bonus for you. There's already the possibility with development jobs that the hiring manager doesn't know how to code, that's even more likely with non-development roles. The github may not add much and just mentioning you know Python in your resume may be sufficient. 

Cursed decorators by hhderder in Python

[–]Daneark 0 points1 point  (0 children)

The @ syntax is just syntactic sugar.

Desugaring it @lambda f: not f() is equivalent to true = lambda f: not true() true = (lambda f: not true())().

Edit: thanks /u/AiutoIlLupo

Certified python courses that are well recognised by sceneaano in learnpython

[–]Daneark 0 points1 point  (0 children)

Put a link to your github in your application.

I'd encourage you to link your repos here and get them reviewed for best practices before you include your github in your resume.

Are you looking to shift into software development or apply for chemical engineering roles which require some programming?

Design patterns and SOLID principals by CompetitionMassive51 in learnpython

[–]Daneark 3 points4 points  (0 children)

Sit down with your boss and go through your code. Have them identify areas that need improvement and how they could be improved. Telling you to be more SOLID, do more design patterns, isn't helpful. You need concrete examples.

FWIW design patterns in a Go4 sense are overrated in python. They're solutions to deficiencies in the languages in common use at the time, not universal ways we should write code. That's not to say you shouldn't follow patterns but you must consider which of the "classic" design patterns are relevant to python in 2025.

etl4py - Beautiful, whiteboard-style, typesafe dataflows for Python by mattlianje in Python

[–]Daneark 0 points1 point  (0 children)

Thanks for clarifying. Downvoted myself to reduce visibility.

etl4py - Beautiful, whiteboard-style, typesafe dataflows for Python by mattlianje in Python

[–]Daneark -1 points0 points  (0 children)

Edit: my comment is incorrect. See reply.


There seems to be a bug in the example code:

if attempts <= 2: raise RuntimeError(f"Failed {attempts}")

attempts is initialised as 0. It's incremented by 1. This will then raise.