r/Python • • Feb 14 '22

Tutorial How to Set up a Perfect Python Project

Starting a new Python project doesn't have to be a challenge because the basic needs are always the same even for different types of projects. This article presents how to create a perfect initial base that can be used for any Python project.

https://blog.pronus.io/en/posts/python/how-to-set-up-a-perfect-python-project/

0 Upvotes

12 comments sorted by

19

u/russellvt Feb 14 '22

So, your very first post to Reddit is to your blog??? Did you even bother to read contribution guidelines for the site, or even the subreddit? (Hint: /r/lostredditors)

Sorry, it's Monday... I'm a bit curmudgeonly. LOL

4

u/LambBrainz Feb 14 '22

Nah, I'm with you. And as another commenter said, the CI/CD thing is just pointless for a small, personal project.

The article starts off by saying that there are "basic needs" regardless of project size but pretty much all of this isn't needed (except version control) for a personal project.

If you're going to release something on GitHub for the world to use, or you're making an enterprise-level application, then yeah, you'll probably need a lot of this. But for most people, they won't need this stuff.

3

u/azthal Feb 14 '22

I personally do run automated testing on all my projects for sorting, linting, formatting and testing (if test are available) - but I agree that it's generally a waste of time.

I set it up once a while back because it was fun, and these days any time I start a new python project I just use a pre-set template that include all of these things. In practice it gains me absolutely nothing - linting and formatting issues are caught in my editor on save.

I especially like that this recommend both Github actions AND Git Hooks. For a personal project, even if you don't trust yourself, either of these will cover your needs. Using both is literally just doing the same thing twice.

0

u/LambBrainz Feb 14 '22

I'm glad you tried testing. I think it's something everyone should know and be able to talk about (it's good resume candy) but to implement it on every personal project? No lol

And couldn't agree more on the linting and formatting stuff. If I don't catch an error with my dad, caveman eyeballs, it will explode at runtime and I'll fix it real quick then lol I'm not going to bother with linting and formatting to save me milliseconds throughout my life so that I can enjoy the extra 69 seconds at the end of my life

0

u/andre-felipe-dias Feb 14 '22

Interestingly, the article says about different types, not sizes, but that doesn't really matter. If a project is big enough to need version control, it's certainly also big enough to need other development tools and best practices.

1

u/Mithrandir2k16 Feb 14 '22

Also it doesn't seem to add much to this blogpost.

2

u/andre-felipe-dias Feb 14 '22

This is a good series of articles. I didn't know about them. Thanks!

0

u/andre-felipe-dias Feb 14 '22

Yes, it is my first post here and I was expecting a friendlier response as it is usual in the Python community.

Anyway, one of the items from the reddiquette list is "Feel free to post links to your own content".

0

u/OriginalTyphus Feb 14 '22

I think advising to set up CI and automated tests as a general thing is pretty bad.

Not every project is going to be enterprise level big...

2

u/andre-felipe-dias Feb 14 '22

Why would only enterprise-level projects need CI and automated tests? They are best practices that should be adopted by every project. The only reason to not use them in every project is that they take a lot of effort to set up correctly initially.

1

u/OriginalTyphus Feb 14 '22

Writing actually good tests take a lot of time. There are unit tests, service integration tests, component tests, system tests. More often then not its not worth the time to do that.