|
1 | 1 | # Not Gitmodules |
2 | 2 |
|
3 | 3 | --- |
| 4 | +# What's `not_gitmodules`? |
4 | 5 |
|
5 | | -## Why `not_gitmodules`? |
6 | | - |
7 | | -1. `not_gitmodules` demonstrate how simple and elegant `gitmodules` should be to those developers who enjoy their lives. |
8 | | - Add and remove modules without caring about irrelevant stuff. No * |
9 | | - *shitshow**, just simplicity. |
10 | | -2. Production-use friendly. This is documented in the license. |
11 | | -3. No third-party libraries are required; only built-in tools are used. |
12 | | -4. OS-agnostic. Written in Python, meaning it can be used in any type of project, especially those running on Linux. |
| 6 | +`not_gitmodules` is a lightweight, production-ready Python utility designed to simplify managing external modules in your project. |
13 | 7 |
|
14 | 8 | --- |
| 9 | +# Why `not_gitmodules`? |
15 | 10 |
|
16 | | -## Installation |
17 | | - |
18 | | -- Clone the repository using Git. |
19 | | -- Install via pip: |
| 11 | +1. Simplicity: Minimalistic design—no unnecessary complexities. |
| 12 | +2. Production-Ready: Explicitly licensed for production use. |
| 13 | +3. Dependency-Free: Uses only Python's built-in tools. |
| 14 | +4. OS-Agnostic: Works seamlessly on Linux and any other platform where Python runs. |
20 | 15 |
|
21 | | - ```bash |
22 | | - pip install not-gitmodules |
23 | | - ``` |
| 16 | +--- |
| 17 | +## Installation and Usage |
24 | 18 |
|
25 | | ---- |
26 | | -Here's the updated `README.md` snippet with the changes you requested: |
| 19 | +### Installation |
27 | 20 |
|
28 | | ---- |
| 21 | +Choose one of the following methods to install `not_gitmodules`: |
29 | 22 |
|
30 | | -## Usage |
| 23 | +#### 1. Clone the repository: |
| 24 | +```bash |
| 25 | +git clone https://github.com/Armen-Jean-Andreasian/not_gitmodules.git |
| 26 | +``` |
| 27 | + |
| 28 | +#### 2. Install via pip: |
| 29 | +```bash |
| 30 | +pip install not-gitmodules |
| 31 | +``` |
31 | 32 |
|
32 | | -1. **IMPORTANT:** Create a `notgitmodules.yaml` file in your project's root directory. |
| 33 | +--- |
| 34 | +# Preparation and Usage Options |
33 | 35 |
|
| 36 | +## 1. Preparation (IMPORTANT) |
| 37 | + |
| 38 | +Create a `notgitmodules.yaml` file in your project's root directory. |
| 39 | + |
34 | 40 | ```yaml |
35 | | -# directory_name: url (ssh or https) |
36 | | -# example: |
| 41 | +# directory_name: url (ssh or https) |
| 42 | + |
| 43 | +# Example: |
37 | 44 | file_reader: https://github.com/Free-Apps-for-All/file_manager_git_module |
38 | | -``` |
| 45 | +``` |
39 | 46 |
|
40 | | -2. Let `not_gitmodules` do the job. |
| 47 | +## 2. Usage Options |
41 | 48 |
|
42 | | -> ### Example with Code: |
43 | | -> |
44 | | -> Pass the path to the `initializer` function: |
45 | | -> ```python |
46 | | -> from not_gitmodules import initializer |
47 | | -> |
48 | | -> initializer('custom/path/to/notgitmodules.yaml') |
49 | | -> ``` |
50 | | -> or |
51 | | -> ```python |
52 | | -> from not_gitmodules import initializer |
53 | | -> |
54 | | -> initializer() # if notgitmodules.yaml exists in the project root |
55 | | -> ``` |
| 49 | +You can use `not_gitmodules` in two ways: |
| 50 | +1. **As a part of your project's code.** |
| 51 | + Just clone/download this repository and include it to your project. |
| 52 | + - **Pros:** No additional dependencies or overhead. |
| 53 | + - **Cons:** No CLI usage; increases the project's file size. |
56 | 54 |
|
57 | | -### Example with CLI: |
58 | 55 |
|
59 | | -#### 1. Install the library locally if you cloned the repo (**optional**) : |
| 56 | +2. **As a Python Package (Recommended).** |
| 57 | + Install using **pip** |
| 58 | +- **Pros:** This method allows you to leverage CLI commands for better flexibility, ease with Docker, keeps the project lightweight |
| 59 | + - **Cons:** Additional dependency |
60 | 60 |
|
61 | | - ```bash |
62 | | - pip install . |
63 | | - ``` |
| 61 | +**Not recommended** option: clone/download this repository and run `pip install .` |
64 | 62 |
|
65 | 63 | --- |
66 | | - |
67 | | -#### 2. Install the modules directly from the terminal: |
68 | | - |
69 | | ->#### Flags |
70 | | -> |
71 | | ->| Flag | Description | |
72 | | ->|---------------------|-------------------------------------------------------------------------| |
73 | | ->| `-d`, `--dir_name` | Specify a directory name where the modules will be saved (optional). | |
74 | | ->| `-y`, `--yaml-path` | Specify a custom location for the `notgitmodules.yaml` file (optional). | |
75 | | - |
76 | | -### Default command: |
77 | | - |
78 | | -```bash |
| 64 | +# Usage |
| 65 | + |
| 66 | +## A. As Part of Your Project's Code |
| 67 | + |
| 68 | +### Command: |
| 69 | + |
| 70 | +```bash |
| 71 | +git clone https://github.com/Armen-Jean-Andreasian/not_gitmodules.git |
| 72 | +``` |
| 73 | + |
| 74 | +### Implementation: |
| 75 | + |
| 76 | +- If `notgitmodules.yaml` is located in the project root: |
| 77 | + |
| 78 | +```python |
| 79 | +from not_gitmodules import initializer |
| 80 | + |
| 81 | +initializer() |
| 82 | +``` |
| 83 | + |
| 84 | +- If `notgitmodules.yaml` is located somewhere else. _Or has a different name._ |
| 85 | +```python |
| 86 | +from not_gitmodules import initializer |
| 87 | + |
| 88 | +initializer('custom/path/to/config.yaml') # Specify a custom path |
| 89 | +``` |
| 90 | + |
| 91 | +--- |
| 92 | +## B. As a Python Package (Recommended) |
| 93 | + |
| 94 | +This method allows you to leverage CLI commands for better flexibility. |
| 95 | + |
| 96 | + |
| 97 | +### 1. Install the package |
| 98 | + |
| 99 | +``` |
| 100 | +pip install not_gitmodules |
| 101 | +``` |
| 102 | +
|
| 103 | +--- |
| 104 | +### 2. Add it to `requirements.txt` |
| 105 | + |
| 106 | +As this package is not used in code itself, it's easy to forget to add. So better to add in advance. |
| 107 | + |
| 108 | +#### Run: |
| 109 | +
|
| 110 | +```bash |
| 111 | +pip show not_gitmodules |
| 112 | +``` |
| 113 | + |
| 114 | +**Check the `Version` and include it to `requirements.txt` with `~=` assignment:** |
| 115 | + |
| 116 | +- Example: |
| 117 | + ```text |
| 118 | + not_gitmodules~=0.2 |
| 119 | + ``` |
| 120 | + |
| 121 | +--- |
| 122 | +### 3. Install the modules: |
| 123 | + |
| 124 | +>#### Flags |
| 125 | +> |
| 126 | +>| Flag | Description | |
| 127 | +>|---------------------|-------------------------------------------------------------------------| |
| 128 | +>| `-d`, `--dir_name` | Specify a directory name where the modules will be saved (optional). | |
| 129 | +>| `-y`, `--yaml-path` | Specify a custom location for the `notgitmodules.yaml` file (optional). | |
| 130 | + |
| 131 | +### To install modules via the terminal: |
| 132 | + |
| 133 | +- ### Default command: |
| 134 | + |
| 135 | +This will look for `notgitmodules.yaml` in the project root and create a directory named `my_gitmodules` in the root to download the modules into. |
| 136 | +
|
| 137 | +```bash |
79 | 138 | not_gitmodules install |
80 | 139 | ``` |
81 | 140 |
|
82 | | -### Command pattern: |
| 141 | +- ### Command pattern: |
83 | 142 |
|
84 | | -```bash |
| 143 | +```bash |
85 | 144 | not_gitmodules install --yaml-path </path/to/notgitmodules.yaml> --dir_name <directory_name> |
86 | | -``` |
| 145 | +``` |
87 | 146 |
|
88 | | -or |
| 147 | +or |
89 | 148 |
|
90 | | -```bash |
| 149 | +```bash |
91 | 150 | not_gitmodules install -y </path/to/notgitmodules.yaml> -d <directory_name> |
92 | 151 | ``` |
93 | 152 |
|
| 153 | +--- |
| 154 | +### 4. Dockerizing |
94 | 155 |
|
95 | | -### Do not forget to add `not_gitmodules` to `requirements.txt` |
| 156 | +Double-check that you: |
| 157 | +1. Created a `notgitmodules.yaml` |
| 158 | +2. Included `not_gitmodules` version to `requirements.txt` |
96 | 159 |
|
97 | | -Run |
| 160 | +Then: |
| 161 | +3. Create your `Dockerfile`. Example: |
98 | 162 |
|
99 | | -```bash |
100 | | -pip show not_gitmodules |
101 | | -``` |
| 163 | +```dockerfile |
| 164 | +FROM python:3.10-slim |
102 | 165 |
|
103 | | -Check the `Version` and include it to `requirements.txt` |
| 166 | +# Install git for not_gitmodules |
| 167 | +RUN apt-get update && apt-get install -y git |
| 168 | + |
| 169 | +WORKDIR /app |
| 170 | + |
| 171 | +COPY . . |
| 172 | + |
| 173 | +RUN pip install --no-cache-dir -r requirements.txt |
104 | 174 |
|
105 | | -Example: |
106 | | -```text |
107 | | -not_gitmodules~=0.2 |
108 | | -``` |
| 175 | +# copy the notgitmodules.yaml file (default). Modify accordingly. |
| 176 | +COPY notgitmodules.yaml . |
109 | 177 |
|
110 | | ---- |
111 | | - |
112 | | -## Possible Issues with Private Repositories |
113 | | - |
114 | | -If cloning fails but you have access to the repository, provide the HTTPS repo URL instead of SSH |
115 | | -in `notgitmodules.yaml`. |
| 178 | +# install modules using not_gitmodules |
| 179 | +RUN not_gitmodules install -y notgitmodules.yaml -d my_directory |
| 180 | + |
| 181 | +CMD ["python", "main.py"] |
| 182 | +``` |
116 | 183 |
|
117 | 184 | --- |
118 | | - |
119 | | -## That's it! |
120 | | - |
121 | | -No more wasted time with `.git`, metadata, and other bloat that offer no real tradeoff. |
| 185 | +## Possible Issues with Private Repositories |
| 186 | + |
| 187 | +If cloning fails but you have access to the repository, provide the HTTPS repo URL instead of SSH |
| 188 | +in `notgitmodules.yaml`. |
122 | 189 |
|
123 | 190 | --- |
124 | | - |
125 | | -## Recommended Modifications |
126 | | - |
127 | | -After cloning the repository, delete unnecessary files if you're customizing or using the project for specific purposes: |
128 | | - |
129 | | -- `not_gitmodules\.gitignore` |
130 | | -- `not_gitmodules\LICENSE` |
131 | | -- `not_gitmodules\README.md` |
132 | | -- `not_gitmodules\setup.py` (if you're not using it as a CLI tool or environment package) |
133 | | -- `not_gitmodules/cli.py` (if you're not using the installer in a CLI context) |
| 191 | +## License |
| 192 | + |
| 193 | +This project is licensed under a **Custom License**. See the [LICENSE](./LICENSE) file for full details. |
| 194 | + |
| 195 | +Key points: |
| 196 | + |
| 197 | +- You may use this project for commercial or personal purposes. |
| 198 | +- You may not claim ownership of this project or its code. |
134 | 199 |
|
135 | 200 | --- |
136 | | - |
137 | 201 | ## Author |
138 | 202 |
|
139 | | -Armen-Jean Andreasian, 2024 |
140 | | - |
141 | | ---- |
142 | | - |
143 | | -## License |
144 | | - |
145 | | -This project is licensed under a **Custom License**. See the [LICENSE](./LICENSE) file for full details. |
146 | | - |
147 | | -Key points: |
148 | | - |
149 | | -- You may use this project for commercial or personal purposes. |
150 | | -- You may not claim ownership of this project or its code. |
| 203 | +Armen-Jean Andreasian, 2024 |
151 | 204 |
|
152 | 205 | --- |
| 206 | +<div style="text-align: center;"> |
| 207 | + <img src="https://i.ibb.co/FbDRqnT/That-s-all-Folks-tagline.webp" alt="That's it" width="400"/> |
| 208 | +</div> |
0 commit comments