So I won’t recommend any particular CI tool other than to say that it’s better to have any CI than to wait around to find the perfect CI, and so if you’re having trouble deciding it’s probably best to just stop worrying and go with whatever’s built in to your code hosting platform (GitHub Actions, GitLab CI, etc.). I have a preference for unittest, and if you’re doing Django its built-in testing tools are all built around unittest, but pytest has plenty of fans and there are third-party plugins to re-create some of the nice Django testing tools on top of pytest.įor CI: I’ve used a lot of different CI systems over the years, and they all had things I liked and things I disliked. All of these are huge.įor version control: probably just use git like everyone else.įor testing: pick either the unittest module in the standard library, or the third-party pytest test framework. Without version control you don’t have a way to track what’s changed in your code over time without tests you don’t have a way to know whether your code works without CI you don’t have a way to automatically find out when your code has been broken by recent changes. If you don’t have these, there is nothing I can recommend that will have a larger impact than adding them. The basicsīefore I mention anything else, I have to start with the absolute basics: version control, tests, continuous integration ( CI). It’s a pretty simple setup once everything’s been introduced, but introducing the tools and techniques, and why I recommend them, takes a lot more words. If you don’t like my recommendations, there are other ways to achieve a lot of the goals I’ve set out here, and I encourage you to look into them.įinally, if you’re just interested in the end result, scroll down to the section titled “putting it all together”. This is an opinionated set of things I personally recommend, along with explanations of why I recommend them. This also is not a “list all the tools and let you make up your mind” post - there are plenty of those out there. If you use Python for something else, hopefully there will still be some useful takeaways from this post, but I can’t promise everything here will be relevant to you. That’s what I know best, and there will be a strong web-oriented flavor to this post. Today I want to talk about what’s generally called “code quality” - tools to help you identify potential bugs, and other problems, as early as possible, ideally before they ever get merged into your codebase, let alone deployed to production.īut a quick reminder before we go much further: I’m writing from the perspective of someone who primarily uses Python as a backend language for web applications and other networked services. In the first post I talked about dependency management, and laid out an approach to it designed to ensure (as much as possible) it doesn’t become a source of unexpected bugs. “Boring”, to me, is about the sources of those incidents. There will be incidents where a feature or maybe an entire service is down. While there is some overlap, and some of the things I’ll be recommending can help to reduce bugs, I also want to be clear: there will be bugs. I don’t mean “reliable” or “bug-free” or “no incidents”. In the first post in the series I gave a definition of what I mean by “boring”, and it’s worth revisiting: This is the second in a series of posts I intend to write about how to build, deploy, and manage Python applications in as boring a way as possible. Python Dictionaries Access Items Change Items Add Items Remove Items Loop Dictionaries Copy Dictionaries Nested Dictionaries Dictionary Methods Dictionary Exercise Python If.Else Python While Loops Python For Loops Python Functions Python Lambda Python Arrays Python Classes/Objects Python Inheritance Python Iterators Python Polymorphism Python Scope Python Modules Python Dates Python Math Python JSON Python RegEx Python PIP Python Try.Published: December 19, 2022.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |