Successfully reported this slideshow.
Your SlideShare is downloading. ×

Automate cleaning code in few easy steps!

Loading in …3
×

Check these out next

1 of 29 Ad
1 of 29 Ad

Automate cleaning code in few easy steps!

Download to read offline

How annoying is it to find out that everything went to hell on the pipeline because you forgot to run the formatters?
Don’t waste precious time and learn how it is possible to automate these little things, but most importantly understand why it is important to have them in your code!

Have you ever been in a situation where you check your pipelines to see if he’s finished running the tests and you find that he hasn’t even started because you forgot to run the linters locally?

I contribute to the development of PyCon Italia, Strawberry GraphQL and Poetry Package Manager and coding with these organizations I discovered fantastic tools such as pre-commit, Poetry and many others. In this talk I would like to share with you my findings, think about the pros and cons and understand a little bit better why you should start using them.

The Author: Ester Beltrami
I'm a Python Developer living in London who is passionate about clean code and architecture. I try to give my contribution to the development of PyCon Italia, Strawberry GraphQL and Poetry Package Manager.

How annoying is it to find out that everything went to hell on the pipeline because you forgot to run the formatters?
Don’t waste precious time and learn how it is possible to automate these little things, but most importantly understand why it is important to have them in your code!

Have you ever been in a situation where you check your pipelines to see if he’s finished running the tests and you find that he hasn’t even started because you forgot to run the linters locally?

I contribute to the development of PyCon Italia, Strawberry GraphQL and Poetry Package Manager and coding with these organizations I discovered fantastic tools such as pre-commit, Poetry and many others. In this talk I would like to share with you my findings, think about the pros and cons and understand a little bit better why you should start using them.

The Author: Ester Beltrami
I'm a Python Developer living in London who is passionate about clean code and architecture. I try to give my contribution to the development of PyCon Italia, Strawberry GraphQL and Poetry Package Manager.

Advertisement
Advertisement

More Related Content

Advertisement

Automate cleaning code in few easy steps!

  1. 1. Automate cleaning code in few easy steps! Ester Beltrami Twitter: @esterbeltrami GitHub: github.com/estyxx
  2. 2. Ester •PyCon Italia organizer •Strawberry-graphql core-dev •Poetry Package manager contributor
  3. 3. We write some code
  4. 4. We push the code
  5. 5. Time to relax and wait
  6. 6. We came back to the pipeline and…
  7. 7. pre-commit
  8. 8. .yaml file config
  9. 9. Some nice hooks to include! • pyupgrade to automatically upgrade syntax for newer versions • flake8-eradicate to find commented out (or so called "dead") code • autoflake to removes unused imports and unused variables
  10. 10. not only code quality, also security!
  11. 11. What are the benefits?
  12. 12. Identify issues *before* the code review
  13. 13. It’s not all about python…
  14. 14. Why developers don’t like it?
  15. 15. but they are slow L
  16. 16. From 1.8.0 ‘manual’ stage!
  17. 17. We still have to remember to pre- commit install but*
  18. 18. Run pre-commit on pipeline or use pre-commit.ci
  19. 19. Can we remove some Makefile commands maybe?
  20. 20. one ring tool to rule them all
  21. 21. What on Earth is a pyproject.toml? It’s the specified file format of PEP 518 which contains the build system requirements of Python projects. We can specify configuration data within the [tool] section!
  22. 22. Poetry Python packaging and dependency management made easy the new, standardized pyproject.toml. In other words, it replace setup.py, requirements.txt, setup.cfg, MANIFEST.in and Pipfile. Documentation: https://python- poetry.org/
  23. 23. How the pyproject.toml looks like
  24. 24. Poetry 1.2 is coming! Introduce the ability do group dependencies in groups! Not only the default `dev` one. And plugins to add your own functionality to Poetry!
  25. 25. Python Developers Survey 2021 Results: Poetry is gaining popularity!!! https://bit.ly/3nXjcQm
  26. 26. Thank you! Twitter: @esterbeltrami GitHub: github.com/estyxx

×