Skip to content

Commit 0d335e2

Browse files
[skip-ci] docs: update README
1 parent 7d8b595 commit 0d335e2

File tree

4 files changed

+106
-154
lines changed

4 files changed

+106
-154
lines changed

.github/logo.png

141 KB
Loading

.github/logo_v2.png

21 KB
Loading

README.md

Lines changed: 106 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -1,174 +1,128 @@
1-
2-
<div style="text-align: center;">
3-
<img src=".github/pic1.png" />
4-
</div>
1+
# <img src=".github/logo_v2.png" alt="Not Gitmodules!" height="30" /> Not Gitmodules
52

63
---
74

8-
# What's `not_gitmodules`?
95

10-
Watch the intro:
6+
## Introduction
117

12-
[![](https://markdown-videos-api.jorgenkh.no/youtube/QkFxP_6NA84)](https://youtu.be/QkFxP_6NA84)
13-
14-
Long story short: `not_gitmodules` is a lightweight, production-ready Python utility designed to simplify managing external modules in
15-
your project.
8+
- Not Gitmodules is a **lightweight**, **production-friendly** and **open-source** Python utility
9+
designed to simplify managing external modules in
10+
your project.
11+
- It's a replacement for Git Submodule which is: up to **10x faster**, **safer**, **simpler**, **cleaner** and the most
12+
importantly - **without headaches**.
1613

1714
---
1815

19-
# Why `not_gitmodules`?
20-
21-
1. Simplicity: Minimalistic design—no unnecessary complexities.
22-
2. Production-Ready: Explicitly licensed for production use.
23-
3. Dependency-Free: Uses only Python's built-in tools.
24-
4. OS-Agnostic: Works seamlessly on Linux, MacOS and any other platforms where Python is available by default.
16+
## Effortlessness
2517

26-
---
18+
Everything you need to do is:
2719

28-
## Important note
20+
1. Install Not Gitmodules. Clone this repo from GitHub or install from PyPi
21+
2. Create a simple YAML file.
2922

30-
1. not_gitmodules just like Gitmodules doesn't `automatically install the dependencies`/`do not include the dependencies to your project dependency file (such as requirements.txt for Python or package.json for JavaScript)` of the submodule.
31-
2. not_gitmodules doesn't `download the submodules mentioned in the not_gimodules.yaml file of the submodule`.
32-
- Reason: it's practically inefficient, may lead to bugs and bottlenecks, and better to maintain manually.
23+
Not Gitmodules will handle the rest for you.
3324

34-
How to handle?
35-
1. Move the containing of the dependency file to your project's dependency file and rerun the dependency installer.
36-
37-
2.1. Important note. `not_gitmodules` keeps the view of keeping the project structure clean. All submodules amoung one project/micro-service need to go to one folder. It's recommended to use dependency injection in case of having nested not_gitmodules.
25+
---
3826

39-
2.2. Move submodules to your `not_gimodules.yaml` file and rerun install accordingly.
27+
## Why Not Gitmodules?
4028

41-
## Installation and Usage
29+
1. **Simplicity**: Minimalistic design and no unnecessary complexities.
30+
2. **Production-Ready**: Explicitly licensed for production use.
31+
3. **Dependency-Free**: Uses only Python's built-in tools.
32+
4. **OS-Agnostic**: Works seamlessly on Linux, MacOS and any other platforms where Python is available by default.
4233

43-
### Installation
34+
---
4435

45-
Choose one of the following methods to install `not_gitmodules`:
36+
## Still have questions?
4637

47-
#### 1. Clone the repository:
38+
Watch the introduction video on YouTube, where Snoop Dogg will explain everything!
4839

49-
```bash
50-
git clone https://github.com/Armen-Jean-Andreasian/not_gitmodules.git
51-
```
52-
53-
#### 2. Install via pip:
54-
55-
```bash
56-
pip install not-gitmodules
57-
```
40+
[![](https://markdown-videos-api.jorgenkh.no/youtube/QkFxP_6NA84)](https://youtu.be/QkFxP_6NA84)
5841

5942
---
6043

61-
# Preparation and Usage Options
44+
## Usage
6245

63-
## 1. Preparation (IMPORTANT)
6446

65-
Create a `notgitmodules.yaml` file in your project's root directory.
6647

67-
```yaml
68-
# directory_name: url (ssh or https)
48+
### Part 1: Installation
6949

70-
# Example:
71-
utils:
72-
file_manager: https://github.com/not-gitmodules/notgitmodules-file-manager-py
73-
file_encryptor: https://github.com/not-gitmodules/notgitmodules-file-encryptor-py
50+
Choose the most convenient way to install Not Gitmodules:
7451

75-
services:
76-
forsaken_mail: https://github.com/malaohu/forsaken-mail
77-
sim_mail: https://github.com/Webador/SlmMail
78-
```
79-
80-
## 2. Usage Options
52+
1. **Clone** (or download) this repository and include it to your project and use **as a part of your project's code:**
8153

82-
You can use `not_gitmodules` in two ways:
54+
```
55+
git clone [email protected]:Armen-Jean-Andreasian/not_gitmodules.git
56+
```
8357

84-
1. **As a part of your project's code.**
85-
Just clone/download this repository and include it to your project.
86-
- **Pros:** No additional dependencies or overhead.
87-
- **Cons:** No CLI usage; increases the project's file size.
8858

59+
2. **Install via a package manager** and use **as a Python package** _(example with pip)_:
8960

90-
2. **As a Python Package (Recommended).**
91-
Install using **pip**
92-
93-
- **Pros:** This method allows you to leverage CLI commands for better flexibility, ease with Docker, keeps the project
94-
lightweight
95-
- **Cons:** Additional dependency
96-
97-
**Not recommended** option: clone/download this repository and run `pip install .`
61+
![PyPI](https://img.shields.io/pypi/v/not-gitmodules)
62+
```bash
63+
pip install not-gitmodules
64+
```
65+
- And, yeah, don't forget to add it to `requirements.txt` in advance, if you don't use Poetry.
9866

9967
---
10068

101-
# Usage
102-
103-
## A. As Part of Your Project's Code
104-
105-
### Command:
106-
107-
```bash
108-
git clone https://github.com/Armen-Jean-Andreasian/not_gitmodules.git
109-
```
110-
111-
### Implementation:
112-
113-
- If `notgitmodules.yaml` is located in the project root:
114-
115-
```python
116-
from not_gitmodules import initializer
69+
### Part 2: Preparation
11770

118-
initializer()
119-
```
120-
121-
- If `notgitmodules.yaml` is located somewhere else. _Or has a different name._
71+
1. Create a YAML file in your project's root directory.
12272
123-
```python
124-
from not_gitmodules import initializer
73+
- Tip: Naming it `notgitmodules.yaml` lets you use it without explicitly specifying it in the command.
12574
126-
initializer('custom/path/to/config.yaml') # Specify a custom path
127-
```
75+
2. Define the submodules following the pattern:
12876
129-
130-
---
77+
```yaml
78+
folder_to_save: # Destination folder for this group of modules
79+
module1: module1.url # directory_name: url (ssh or https)
80+
module2: module2.url
13181
132-
## B. As a Python Package (Recommended)
82+
another_folder:
83+
module3: module3.url
84+
```
13385
134-
This method allows you to leverage CLI commands for better flexibility.
86+
Example:
13587
136-
### 1. Install the package
88+
```yaml
89+
# directory_name: url (ssh or https)
90+
utils:
91+
file_manager: https://github.com/not-gitmodules/notgitmodules-file-manager-py
92+
file_encryptor: https://github.com/not-gitmodules/notgitmodules-file-encryptor-py
13793
138-
```
139-
pip install not_gitmodules
94+
services:
95+
forsaken_mail: https://github.com/malaohu/forsaken-mail
96+
sim_mail: https://github.com/Webador/SlmMail
14097
```
14198
142-
---
99+
The example above will download and create this structure:
143100
144-
### 2. Add it to `requirements.txt`
145-
146-
As this package is not used in code itself, it's easy to forget to add. So better to add in advance.
147-
148-
#### Run:
149-
150-
```bash
151-
pip show not_gitmodules
152-
```
153-
154-
**Check the `Version` and include it to `requirements.txt` with `~=` assignment:**
101+
```
102+
utils/
103+
file_manager/
104+
... (containing of the repo)
105+
file_encryptor/
106+
...
155107
156-
- Example:
157-
```text
158-
not_gitmodules~=0.0
159-
```
108+
services:
109+
forsaken_mail/
110+
...
111+
sim_mail/
112+
...
113+
```
160114
161-
---
115+
---
162116
163-
### 3. Install the modules:
117+
### Part 3: Installation
164118
165-
| Flag (all of them are optional) | Description | Example |
166-
|---------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
167-
| `-y`, `--yaml-path` | Specify a custom path for the `notgitmodules.yaml` configuration file. <br>By default, it looks for `notgitmodules.yaml` in the current working directory. Naming it `notgitmodules` is a matter of best practices; you can name it as you want. | • `not_gitmodules -y /path/to/custom_notgitmodules.yaml`: Uses a custom YAML file located at `/path/to/custom_notgitmodules.yaml` |
168-
| `-t`, `--threaded` | Enable threaded execution, where repositories are cloned in parallel (using threads). This flag is mutually exclusive with `-s`. <br> This is the default behavior if neither `-t` nor `-s` is specified. | • `not_gitmodules -t`: Clones repositories in parallel using threads <br> • `not_gitmodules --threaded`: Same as `-t`, using long form |
169-
| `-s`, `--sequential` | Enable sequential execution, where repositories are cloned one by one in the order they appear in the YAML file. This flag is mutually exclusive with `-t`. | • `not_gitmodules -s`: Clones repositories one by one in order <br> • `not_gitmodules --sequential`: Same as `-s`, using long form |
119+
| Flag (all of them are optional) | Description | Example |
120+
|----------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
121+
| `-y`, `--yaml-path` | Specify a custom path for the YAML file. <br>By default, it looks for `notgitmodules.yaml` in the current working directory. <br>Naming it `notgitmodules` is a matter of best practices; you can name it as you want. | • `not_gitmodules -y /path/to/custom_notgitmodules.yaml`: Uses a custom YAML file located at `/path/to/custom_notgitmodules.yaml` |
122+
| `-t`, `--threaded` _**(default behaviour)**_ | Enable threaded execution, where repositories are cloned in parallel (using threads). <br>This flag is mutually exclusive with `-s`. <br> This is the default behavior if neither `-t` nor `-s` is specified. | • `not_gitmodules -t`: Clones repositories in parallel using threads <br> • `not_gitmodules --threaded`: Same as `-t`, using long form |
123+
| `-s`, `--sequential` | Enable sequential execution, where repositories are cloned one by one in the order they appear in the YAML file. This flag is mutually exclusive with `-t`. | • `not_gitmodules -s`: Clones repositories one by one in order <br> • `not_gitmodules --sequential`: Same as `-s`, using long form |
170124
171-
### More command examples:
125+
#### More command examples:
172126
173127
- ### Default command:
174128
@@ -182,75 +136,72 @@ not_gitmodules install
182136
- ### Command pattern:
183137
184138
```bash
185-
not_gitmodules install --yaml-path </path/to/notgitmodules.yaml> --threaded
139+
not_gitmodules install --yaml-path </path/to/notgitmodules.yaml> --<execution_type>
186140
```
187141
188142
or
189143
190144
```bash
191-
not_gitmodules install -y </path/to/notgitmodules.yaml> -t
145+
not_gitmodules install -y </path/to/notgitmodules.yaml> --sequential
192146
```
193147
194-
---
195-
196-
## Comparison
197148
198-
Usually with undefined amount of workers in `ThereadPool` in parallel mode take more than **52%** less time than in
149+
> Note: Usually with undefined amount of workers in `ThereadPool` in parallel mode take more than **52%** less time than in
199150
parallel mode.
200151
152+
---
201153
202-
---
203-
204-
### 4. Dockerizing
205-
206-
Double-check that you:
207-
208-
1. Created a `notgitmodules.yaml`
209-
2. Included `not_gitmodules` version to `requirements.txt`
210-
211-
Then:
154+
### Part 4. Dockerizing
212155
213-
3. Create your `Dockerfile`. Example:
214156
215157
```dockerfile
216158
FROM python:3.10-slim
217159
218160
# Install git for not_gitmodules
219161
RUN apt-get update && apt-get install -y git
220-
221-
WORKDIR /app
222-
223-
COPY . .
224-
162+
225163
RUN pip install --no-cache-dir -r requirements.txt
226164
227165
# copy the notgitmodules.yaml file (default). Modify accordingly.
228166
COPY notgitmodules.yaml .
229167
230-
# install modules using not_gitmodules
168+
# install modules using not_gitmodules.
231169
RUN not_gitmodules install -y notgitmodules.yaml -t
170+
171+
WORKDIR /app
232172
173+
COPY . .
174+
233175
CMD ["python", "main.py"]
234176
```
235177
236178
---
237179
238-
## Possible Issues with Private Repositories
180+
## Good to Know
239181
240-
If cloning fails but you have access to the repository, provide the HTTPS repo URL instead of SSH
241-
in `notgitmodules.yaml`.
182+
1. Not Gitmodules **doesn't require to keep the folders** with modules. You can safely .gitignore or delete them.
183+
2. **Do not use matching names** for the repositories in `notgitmodules.yaml` file. In that case only the first repository
184+
will be downloaded and the second one will be skipped.
185+
3. Not Gitmodules **needs** `Git` and `PyYAML` for functioning.
186+
4. Not Gitmodules, just like Gitmodules, **doesn't automatically install the dependencies of submodules** _(such as requirements.txt for Python or package.json for JavaScript)_.
187+
5. Not Gitmodules **doesn't download the sub-dependency submodules** (if they are not defined properly for Git).
188+
- Reason: it's practically inefficient, may lead to bugs and bottlenecks, and better to maintain manually.
189+
- Solution: Include the sub-dependency submodule to YAML file manually.
190+
6. Not Gitmodules keeps the view of keeping the project structure clean. All submodules among one
191+
project/microservice need to go to one folder. It's recommended to use dependency injection in case of having nested `not_gitmodules`.
192+
7. **Possible bottleneck** with private repositories.
193+
- If cloning fails, but you have access to the repository, provide the HTTPS repo URL instead of SSH url in YAML file.
242194

243-
---
244195

245-
## Worth to mention
196+
---
246197

247-
- `not_gitmodules` doesn't require for you to keep the folders with modules. You can safely .gitignore/delete them.
248-
- Do not use matching names for the repositories in `notgitmodules.yaml` file. In that case only the first repository
249-
will be downloaded and the second one - skipped.
198+
<div style="text-align: center;">
199+
<img src=".github/pic1.png" width="300" height="300">
200+
</div>
250201

251202
---
252203

253-
## License
204+
## ![License](https://img.shields.io/badge/license-Custom-blue)
254205

255206
This project is licensed under a **Custom License**. See the [LICENSE](./LICENSE) file for full details.
256207

@@ -269,3 +220,4 @@ Armen-Jean Andreasian, 2024
269220
<div style="text-align: center;">
270221
<img src=".github/pic2.png" />
271222
</div>
223+

0 commit comments

Comments
 (0)