Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Python for Geeks

You're reading from   Python for Geeks Build production-ready applications using advanced Python concepts and industry best practices

Arrow left icon
Product type Paperback
Published in Oct 2021
Publisher Packt
ISBN-13 9781801070119
Length 546 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Muhammad Asif Muhammad Asif
Author Profile Icon Muhammad Asif
Muhammad Asif
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Section 1: Python, beyond the Basics
2. Chapter 1: Optimal Python Development Life Cycle FREE CHAPTER 3. Chapter 2: Using Modularization to Handle Complex Projects 4. Chapter 3: Advanced Object-Oriented Python Programming 5. Section 2: Advanced Programming Concepts
6. Chapter 4: Python Libraries for Advanced Programming 7. Chapter 5: Testing and Automation with Python 8. Chapter 6: Advanced Tips and Tricks in Python 9. Section 3: Scaling beyond a Single Thread
10. Chapter 7: Multiprocessing, Multithreading, and Asynchronous Programming 11. Chapter 8: Scaling out Python Using Clusters 12. Chapter 9: Python Programming for the Cloud 13. Section 4: Using Python for Web, Cloud, and Network Use Cases
14. Chapter 10: Using Python for Web Development and REST API 15. Chapter 11: Using Python for Microservices Development 16. Chapter 12: Building Serverless Functions using Python 17. Chapter 13: Python and Machine Learning 18. Chapter 14: Using Python for Network Automation 19. Other Books You May Enjoy

Exploring choices for source control

First, we will see a brief history of source control systems to provide a context. Modern source control systems are quite powerful. The evolution of the source control systems went through the following stages:

  • Stage 1: The source code was initially started by local source control systems that were stored on a hard drive. This local code collection was called a local repository.
  • Stage 2: But using source control locally was not suitable for larger teams. This solution eventually evolved into a central server-based repository that was shared by the members of the team working on a particular project. It solved the problem of code sharing among team members, but it also created an additional challenge of locking the files for the multiuser environment.
  • Stage 3: Modern version control repositories such as Git evolved this model further. All members of a team now have a full copy of the repository that is stored. The members of the team now work offline on the code. They need to connect to the repository only when there is a need to share the code.

What does not belong to the source control repository?

Let's look into what should not be checked into the source control repository.

Firstly, anything other than the source code file shouldn't be checked in. The computer-generated files should not be checked into source control. For example, let's assume that we have a Python source file named main.py. If we compile it, the generated code does not belong to the repository. The compiled code is a derived file and should not be checked into source control. There are three reasons for this, outlined as follows:

  • The derived file can be generated by any member of the team once we have the source code.
  • In many cases, the compiled code is much larger than the source code, and adding it to the repository will make it slow and sluggish. Also, remember that if there are 16 members in the team, then all of them unnecessarily get a copy of that generated file, which will unnecessarily slow down the whole system.
  • Source control systems are designed to store the delta or the changes you have made to the source files since your last commit. Files other than the source code files are usually binary files. The source control system is most likely unable to have a diff tool for that, and it will need to store the whole file each time it is committed. It will have a negative effect on the performance of the source control framework.

Secondly, anything that is confidential does not belong to the source control. This includes API keys and passwords.

For the source repository, GitHub is the preferred choice of the Python community. Much of the source control of the famous Python packages also resides on GitHub. If the Python code is to be utilized across teams, then the right protocol and procedures need to be developed and maintained.

You have been reading a chapter from
Python for Geeks
Published in: Oct 2021
Publisher: Packt
ISBN-13: 9781801070119
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime