- I prefer PyCharm over VS-Code. You would start respecting it as your project grows in complexity or when you have to refactor your code confidently at speed. If your project demands document generation for your classes and methods, Pycharm generates it in a flash. Besides, I customize Pycharm settings further to truncate line-ending whitespaces, code-folding, etc. to suite my coding style.
- Developer-Readme.md is one of the often overlooked thing that I insist in for every single project repository with details on developer-setup instructions, project specific workflow instructions from pulling code to pushing committed code into managed code repository. Ensure it is self-explanatory for any new developer to jump-start work in no time. This is adopting Boy Scout Rule, from the word go.
- Dev environment sandboxing using Python's inbuilt venv.
- Either have a simple executable script like init-dev-environment.sh, to activate your dev sandbox python environment when you enter the project directory, or alternatively employ OS specific tools that does this automagically for you like direnv. Or you may use light-weight tools like autoenv. I typically encourage teams to have executable script because, I also push teams to have common project specific aliases defined in that script, so everyone is aware of little productivity tips to level-up and ensure the entire uses standard set of aliases for that project.
- Dependency Management: There are a myriad of choices from simple requirements.txt, to setup.py to Poetry. Of these I preferred requirements.txt for very simple projects to using setup.py. But setup.py is dated and today pyproject.toml is the default python package manager and I'd recommend using it for this purpose. I am yet to try Poetry that has great community adoption.
- Leverage both PyLint and Flake8 for linting your project. Run it often as you change your code and work on its feedback. Not only your codebase get's better, your own programming style gets better too. You can get it integrated with your IDE too, for faster feedback as you write code, or run it at the click of your mouse within your IDE as your personal preference.
- Pytest for as one stop shop for unit testing that includes features for mocking, fixtures, annotations, test-parameterization, test-auto-discovery etc. It is too good to resist in that it is very convenient to use unlike its xUnit testing frameworks that to me is a legacy. Complement this withpytest-cov library that is used for reporting test coverage of code.
- If your project has environment specific variables, you should externalize it by leveraging tools like python-dotenv.
- You can't escape from PIP package manager for python.
- RightTyper to generate types for your method arguments and its return types. I got to know of this one recently and should be using this sooner.
- SonarCube for code quality and static security analysis.
You can check out how all these tools are put to use from one of my open-source projects, DhanHQ-py.
Hope that helps. I am a minimalist and don't pick a tool for the sake of using it. If you think there is a tool I should use and add to the list above, please do shout out citing the problem it solves.