Skip to content

Commit 854ea1a

Browse files
Update README.md
1 parent b1ef1ba commit 854ea1a

File tree

1 file changed

+160
-104
lines changed

1 file changed

+160
-104
lines changed

README.md

Lines changed: 160 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,152 +1,208 @@
11
# Not Gitmodules
22

33
---
4+
# What's `not_gitmodules`?
45

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.
137

148
---
9+
# Why `not_gitmodules`?
1510

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.
2015

21-
```bash
22-
pip install not-gitmodules
23-
```
16+
---
17+
## Installation and Usage
2418

25-
---
26-
Here's the updated `README.md` snippet with the changes you requested:
19+
### Installation
2720

28-
---
21+
Choose one of the following methods to install `not_gitmodules`:
2922

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+
```
3132

32-
1. **IMPORTANT:** Create a `notgitmodules.yaml` file in your project's root directory.
33+
---
34+
# Preparation and Usage Options
3335

36+
## 1. Preparation (IMPORTANT)
37+
38+
Create a `notgitmodules.yaml` file in your project's root directory.
39+
3440
```yaml
35-
# directory_name: url (ssh or https)
36-
# example:
41+
# directory_name: url (ssh or https)
42+
43+
# Example:
3744
file_reader: https://github.com/Free-Apps-for-All/file_manager_git_module
38-
```
45+
```
3946
40-
2. Let `not_gitmodules` do the job.
47+
## 2. Usage Options
4148
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.
5654

57-
### Example with CLI:
5855

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
6060

61-
```bash
62-
pip install .
63-
```
61+
**Not recommended** option: clone/download this repository and run `pip install .`
6462

6563
---
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
79138
not_gitmodules install
80139
```
81140

82-
### Command pattern:
141+
- ### Command pattern:
83142

84-
```bash
143+
```bash
85144
not_gitmodules install --yaml-path </path/to/notgitmodules.yaml> --dir_name <directory_name>
86-
```
145+
```
87146

88-
or
147+
or
89148

90-
```bash
149+
```bash
91150
not_gitmodules install -y </path/to/notgitmodules.yaml> -d <directory_name>
92151
```
93152

153+
---
154+
### 4. Dockerizing
94155

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`
96159

97-
Run
160+
Then:
161+
3. Create your `Dockerfile`. Example:
98162

99-
```bash
100-
pip show not_gitmodules
101-
```
163+
```dockerfile
164+
FROM python:3.10-slim
102165

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
104174

105-
Example:
106-
```text
107-
not_gitmodules~=0.2
108-
```
175+
# copy the notgitmodules.yaml file (default). Modify accordingly.
176+
COPY notgitmodules.yaml .
109177

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+
```
116183

117184
---
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`.
122189

123190
---
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.
134199

135200
---
136-
137201
## Author
138202

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
151204

152205
---
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

Comments
 (0)