You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
25
17
26
-
---
18
+
Everything you need to do is:
27
19
28
-
## Important note
20
+
1. Install Not Gitmodules. Clone this repo from GitHub or install from PyPi
21
+
2. Create a simple YAML file.
29
22
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.
33
24
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
+
---
38
26
39
-
2.2. Move submodules to your `not_gimodules.yaml` file and rerun install accordingly.
27
+
## Why Not Gitmodules?
40
28
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.
42
33
43
-
### Installation
34
+
---
44
35
45
-
Choose one of the following methods to install `not_gitmodules`:
36
+
## Still have questions?
46
37
47
-
#### 1. Clone the repository:
38
+
Watch the introduction video on YouTube, where Snoop Dogg will explain everything!
| `-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 |
| `-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 |
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
199
150
parallel mode.
200
151
152
+
---
201
153
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
212
155
213
-
3. Create your `Dockerfile`. Example:
214
156
215
157
```dockerfile
216
158
FROM python:3.10-slim
217
159
218
160
# Install git for not_gitmodules
219
161
RUN apt-get update && apt-get install -y git
220
-
221
-
WORKDIR /app
222
-
223
-
COPY . .
224
-
162
+
225
163
RUN pip install --no-cache-dir -r requirements.txt
226
164
227
165
# copy the notgitmodules.yaml file (default). Modify accordingly.
228
166
COPY notgitmodules.yaml .
229
167
230
-
# install modules using not_gitmodules
168
+
# install modules using not_gitmodules.
231
169
RUN not_gitmodules install -y notgitmodules.yaml -t
170
+
171
+
WORKDIR /app
232
172
173
+
COPY . .
174
+
233
175
CMD ["python", "main.py"]
234
176
```
235
177
236
178
---
237
179
238
-
## Possible Issues with Private Repositories
180
+
## Good to Know
239
181
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**forthe repositoriesin`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.
242
194
243
-
---
244
195
245
-
## Worth to mention
196
+
---
246
197
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
0 commit comments