Skip to content

Gohil-Rudra/girgit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Girgit

It is a CLI replica of Git and its main aim is to study git-internals !

Project Structure :

Our Project structure looks like :

girgit/
├── venv/
├── girgit/
│   ├── __init__.py
│   └── main.py
├── README.md
├── requirements.txt
└── setup.py

Our project name and package both are girgit.


Base Files : __init__.py & main.py

init.py :

we can think of __init__.py as a mapping file in the sense that we specify the functions we want to expose in our final cli tool here.

e.g. from .main import main where .main is main.py in girgit's root directory and main is the function name defined in main.py ;)

main.py :

This is the heart of our program where actual work is done.

e.g.

def main():
    print("Hello Girgit")

Setup : Creation of CLI Package

Create the setup.py file and run it in develop --user mode (if in venv like pycharm IDE no need to write --user) develop mode helps to automatically reload the changes we make in source-code all we need to do is make some change and reopen the terminal and voila !

In setup.py we have used packages=find_packages() which will auto find and link the packages that have __init__.py file in them,to exclude tests directory if present we could write packages=find_packages(exclude="tests*")

python setup.py develop

You can test it by :

from girgit import main
main

About

Let's mimic Nikitas beautiful project μgit !

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages