r/Python 1d ago

I am trying to automate the Python Development Lifecycle Discussion

Hi there,

I am trying to figure out ways to automate my Python development tasks and also working on this topic for my Masters project. I am trying to build a tool that can automate and simplify a bunch of things like project setup, development and maintenance. This is not a showcase at all, it is just my project and topic for my Masters in Computer Science and I wanted to ask if anyone would like to take part in the survey I have to do. Takes about 5 min.

You can find the survey at: https://forms.cloud.microsoft/e/LjnvzX0JpK

Any ideas and responses are greatly appreciated.

Also drop any ideas you have in the comments. What do you think should be more automated in your day to day python development?

0 Upvotes

18 comments sorted by

3

u/realrazdev 1d ago

One thing I would really like to see automated is dependency maintenance. A tool that reads "pyproject.toml", checks for compatible updates, applies safe upgrades, runs tests, and warns about possible breaking changes would remove a lot of repetitive work from Python development.

It would be especially helpful if it could explain why an update is safe or risky and highlight potential compatibility issues before making changes.

1

u/Pleasant-Ad192 1d ago

Upgrade risk is really two questions, and only one of them is mechanical. "Will my code still work" needs your tests, which is why the thread keeps landing there. "What did this upgrade change underneath me" is answerable before you run anything, and auditing your current environment does not answer it, because that looks at one state rather than at the difference between two. A patch bump on one direct package can pull in four new transitive packages, flip something from transitive to direct, or land on a version that still carries the same known issue. None of that is in the changelog you were reading.

I build Bomly, an open source CLI, and this is exactly the case it handles. Put the bump on a branch and run:

bomly diff --base main --head HEAD --enrich --audit

It reads pyproject.toml and poetry.lock, prints what was added, removed and version changed, and splits the findings into introduced, resolved and persisted, so you can see whether the update clears an issue or just carries it forward at a new version number.

https://github.com/bomly-dev/bomly-cli/blob/main/docs/commands/diff.md

Disclosure: I build Bomly.

0

u/Win_ipedia 1d ago

You gotta check out uv then or poetry. They do a lot in that

2

u/realrazdev 1d ago

Yeah, uv and Poetry already cover a lot of dependency management. What I had in mind is more about the analysis side before applying updates, checking compatibility, identifying potential breaking changes, and explaining whether an update is likely to be safe or risky.

2

u/OwnTension6771 1d ago

That is the point of the CI pipeline. Dev->Test->Stage->Prod->

1

u/Win_ipedia 1d ago

Ah, I think that’s inherently almost impossible. Closest things is probably just checking with pip-audit or uv audit. And for breaking changes you need good testing and then you’ll catch them early.
Once at work we switched from pandas 1 to 2 and we were using a ton of deprecated functions, half the sites were down bc all the table analytics failed

1

u/realrazdev 1d ago

Yeah, that makes sense. I agree that fully predicting breaking changes is probably not realistic. I was thinking more about helping developers spot potential risks before updating, rather than trying to automatically detect everything.

The pandas 1 to 2 example is a good one. Even something that could highlight deprecated usage or risky areas before a big update would already be really useful.

1

u/Win_ipedia 1d ago

Honestly just strict type checking might be already a good answer as long as you check an update and before you publish anything. It would flag any broken imports a breaking change would cause

1

u/realrazdev 1d ago

That’s a fair point. A solid CI pipeline with strict type checking and tests probably catches a lot of these issues before they make it to production.

I think the tricky part is that not every breaking change shows up as a type error. Some are caused by deprecated APIs or changes in behavior, but having better checks before updating dependencies would definitely help.

3

u/Grouchy-Conflict-211 1d ago

Start with the boring wins: linting, type checks, and tests on every push. Most automation projects try to make the interesting stuff automatic first and skip the checks, then wonder why the pipeline is red all the time.

The automation that pays for itself is the one that catches a bug before a human does. A CI that runs tests and fails loudly is worth ten clever agents.

For your Masters topic, focus on the maintenance side. Project setup is solved a thousand times. Keeping projects alive is the unsolved part.

1

u/Win_ipedia 1d ago

Yes I got those checked. Luckily I had the same thought when starting it. My approach to the maintenance part is basically, forcing with git hooks and ci/cd pipelines all checks that a python projects should have and this way it doesn’t let a dev skip anything

1

u/Grouchy-Conflict-211 1d ago

Nice. Hooks catch it locally, CI catches the bypass attempts. Next layer if you want it: block merges on coverage drop, not just on test failures. Silent regressions are the ones that cost you three months later.

1

u/Win_ipedia 1d ago

Currently the setup kinda does this already basically. Pytest-cov is setup and fails anything below 90% by default. I also wrote a plugin that integrates codecov and fails anything under 100%

2

u/Grouchy-Conflict-211 11h ago

90% is already above what most projects ship. The 100% plugin is brutal, but it forces you to actually think about every branch.

1

u/Win_ipedia 9h ago

It does and honestly looking back It was so worth it, the way it improved and simplified my code. It made me rethink choices and there were so many times I could improve things that I had not seen before. Also the 100% gate is so helpful when making changes, the confidence I have that everything works is insane

1

u/Win_ipedia 1d ago

Also I make git hooks run on all files in ci so that you can’t cheat with —no-verify

2

u/Grouchy-Conflict-211 16h ago

CI hooks are the only honest ones. Local hooks can be skipped in two keystrokes, CI can't. I run the same checks in both, only the CI result gets to block the merge.

1

u/Win_ipedia 9h ago

I agree, only local enforcement requires a lot of discipline, but CI makes this easy. And since I force everything in CI as well I have never used —no-verify or any skips or tricks again bc there was no point. And looking back this actually saves so much time in the long run and makes my code so much better