itqan-cli 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- itqan_cli-0.1.0/.gitignore +9 -0
- itqan_cli-0.1.0/CHANGELOG.md +33 -0
- itqan_cli-0.1.0/LICENSE +21 -0
- itqan_cli-0.1.0/PKG-INFO +147 -0
- itqan_cli-0.1.0/README.md +116 -0
- itqan_cli-0.1.0/RELEASING.md +53 -0
- itqan_cli-0.1.0/pyproject.toml +89 -0
- itqan_cli-0.1.0/src/itqan_cli/__init__.py +1 -0
- itqan_cli-0.1.0/src/itqan_cli/__main__.py +5 -0
- itqan_cli-0.1.0/src/itqan_cli/browse.py +344 -0
- itqan_cli-0.1.0/src/itqan_cli/client.py +334 -0
- itqan_cli-0.1.0/src/itqan_cli/credentials.py +91 -0
- itqan_cli-0.1.0/src/itqan_cli/downloader.py +220 -0
- itqan_cli-0.1.0/src/itqan_cli/exceptions.py +69 -0
- itqan_cli-0.1.0/src/itqan_cli/init_template.py +118 -0
- itqan_cli-0.1.0/src/itqan_cli/lockfile.py +285 -0
- itqan_cli-0.1.0/src/itqan_cli/main.py +535 -0
- itqan_cli-0.1.0/src/itqan_cli/manifest.py +274 -0
- itqan_cli-0.1.0/src/itqan_cli/semver.py +205 -0
- itqan_cli-0.1.0/tests/__init__.py +1 -0
- itqan_cli-0.1.0/tests/conftest.py +10 -0
- itqan_cli-0.1.0/tests/test_access.py +182 -0
- itqan_cli-0.1.0/tests/test_assets_dir.py +144 -0
- itqan_cli-0.1.0/tests/test_browse.py +386 -0
- itqan_cli-0.1.0/tests/test_cli_integration.py +154 -0
- itqan_cli-0.1.0/tests/test_client.py +133 -0
- itqan_cli-0.1.0/tests/test_downloader.py +76 -0
- itqan_cli-0.1.0/tests/test_entry_points.py +11 -0
- itqan_cli-0.1.0/tests/test_init.py +199 -0
- itqan_cli-0.1.0/tests/test_languages.py +207 -0
- itqan_cli-0.1.0/tests/test_lockfile.py +89 -0
- itqan_cli-0.1.0/tests/test_login.py +183 -0
- itqan_cli-0.1.0/tests/test_manifest.py +94 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
## v0.1.0 (2026-10-11)
|
|
2
|
+
|
|
3
|
+
### Feat
|
|
4
|
+
|
|
5
|
+
- attach standalone binaries to each GitHub Release
|
|
6
|
+
- show which gated assets need access and where to request it
|
|
7
|
+
- add `itqan login` / `logout` to save an API key
|
|
8
|
+
- also install the CLI as `itqan-cli`
|
|
9
|
+
- add `itqan browse` to search the catalog and add assets
|
|
10
|
+
|
|
11
|
+
### Fix
|
|
12
|
+
|
|
13
|
+
- **browse**: Enter adds the highlighted asset when none is selected
|
|
14
|
+
- **browse**: fit picker rows to the terminal and summarize the picks
|
|
15
|
+
|
|
16
|
+
## v0.1.0rc1 (2026-10-08)
|
|
17
|
+
|
|
18
|
+
### Feat
|
|
19
|
+
|
|
20
|
+
- **package-manager**: add `itqan init` to create a starter manifest
|
|
21
|
+
- **package-manager**: let the manifest choose the assets folder
|
|
22
|
+
- **package-manager**: resolve per language and generate missing files on download
|
|
23
|
+
- **package-manager**: add itqan install CLI (ITQ-22) (#503)
|
|
24
|
+
|
|
25
|
+
### Fix
|
|
26
|
+
|
|
27
|
+
- default to the public API host, api.cms.itqan.dev
|
|
28
|
+
- report the real CLI version in the User-Agent
|
|
29
|
+
- **package-manager**: default the CLI to the production registry
|
|
30
|
+
|
|
31
|
+
### Refactor
|
|
32
|
+
|
|
33
|
+
- **package-manager**: move the itqan CLI into a standalone package
|
itqan_cli-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Itqan Community
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
itqan_cli-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: itqan-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Itqan Quranic Asset Manager: install and pin Itqan Quranic assets in your project.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Itqan-community/itqan-cli
|
|
6
|
+
Project-URL: Repository, https://github.com/Itqan-community/itqan-cli
|
|
7
|
+
Project-URL: Issues, https://github.com/Itqan-community/itqan-cli/issues
|
|
8
|
+
Project-URL: Manifest format, https://github.com/Itqan-community/cms-backend/blob/main/docs/ASSET_MANIFEST.md
|
|
9
|
+
Author: Itqan
|
|
10
|
+
Author-email: Hassaan Alansary <hassaanalansary@yahoo.com>
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: assets,cli,itqan,mushaf,package-manager,quran,quranic,tafsir
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Religion
|
|
24
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
25
|
+
Requires-Python: >=3.11
|
|
26
|
+
Requires-Dist: click>=8.1
|
|
27
|
+
Requires-Dist: pyyaml>=6.0
|
|
28
|
+
Requires-Dist: questionary>=2.1
|
|
29
|
+
Requires-Dist: requests>=2.31
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
# itqan-cli
|
|
33
|
+
|
|
34
|
+
**Itqan Quranic Asset Manager**
|
|
35
|
+
|
|
36
|
+
Install and pin [Itqan](https://cms.itqan.dev) Quranic assets (mushafs, tafsirs, translations,
|
|
37
|
+
fonts) in your project, the way a package manager does for code.
|
|
38
|
+
|
|
39
|
+
You declare the assets you use and the versions you accept in `itqan-assets.yaml`. The CLI
|
|
40
|
+
resolves them against the Itqan registry, downloads them, and records the exact versions in
|
|
41
|
+
`itqan-assets.lock`, so teammates and CI get the same files.
|
|
42
|
+
|
|
43
|
+
## Install
|
|
44
|
+
|
|
45
|
+
Requires Python 3.11+.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pipx install itqan-cli # or: uv tool install itqan-cli
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
This installs the `itqan` command; `itqan-cli` is the same command under the package's name.
|
|
52
|
+
|
|
53
|
+
### Without Python
|
|
54
|
+
|
|
55
|
+
Each [GitHub Release](https://github.com/Itqan-community/itqan-cli/releases) has a standalone
|
|
56
|
+
`itqan` executable for macOS (arm64, x86_64), Linux (x86_64, arm64) and Windows (x86_64), named
|
|
57
|
+
`itqan-<version>-<os>-<arch>` (`.exe` on Windows). Download yours, check it against
|
|
58
|
+
`SHA256SUMS` and put it on your `PATH` as `itqan`. For example, on an Apple Silicon Mac:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
v=0.2.0 # the release you want
|
|
62
|
+
curl -fLO "https://github.com/Itqan-community/itqan-cli/releases/download/v$v/itqan-$v-macos-arm64"
|
|
63
|
+
curl -fLO "https://github.com/Itqan-community/itqan-cli/releases/download/v$v/SHA256SUMS"
|
|
64
|
+
shasum -a 256 --check --ignore-missing SHA256SUMS
|
|
65
|
+
chmod +x "itqan-$v-macos-arm64"
|
|
66
|
+
sudo mv "itqan-$v-macos-arm64" /usr/local/bin/itqan
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The binaries aren't notarized by Apple, so macOS blocks one downloaded with a browser. Clear the
|
|
70
|
+
quarantine flag to allow it: `xattr -d com.apple.quarantine /usr/local/bin/itqan`. (`curl`
|
|
71
|
+
doesn't set the flag.) On Linux, use `sha256sum --check --ignore-missing SHA256SUMS`.
|
|
72
|
+
|
|
73
|
+
## Quick start
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
itqan init # writes itqan-assets.yaml with a few real assets as examples
|
|
77
|
+
itqan browse # search the catalog and add more assets to it
|
|
78
|
+
itqan install # downloads them and writes itqan-assets.lock
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Commit both `itqan-assets.yaml` and `itqan-assets.lock`. The downloaded files are reproducible
|
|
82
|
+
from the lockfile, so add the assets folder to `.gitignore` if you like.
|
|
83
|
+
|
|
84
|
+
## The manifest
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
schema_version: 1
|
|
88
|
+
|
|
89
|
+
# Folder the assets are downloaded into, relative to this file (default: assets).
|
|
90
|
+
assets_dir: "public/quran"
|
|
91
|
+
|
|
92
|
+
assets:
|
|
93
|
+
# Source language of the asset.
|
|
94
|
+
tafsir-jalalayn:
|
|
95
|
+
version: "^2.0.0" # any 2.x from 2.0.0 on
|
|
96
|
+
|
|
97
|
+
# The same asset in English: its own entry, pointing at the asset.
|
|
98
|
+
tafsir-jalalayn-en:
|
|
99
|
+
asset: tafsir-jalalayn
|
|
100
|
+
language: en
|
|
101
|
+
version: "~1.3" # any 1.3.x
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Each language of an asset has its own version history, so each gets its own entry, constraint,
|
|
105
|
+
lock entry and folder (`public/quran/tafsir-jalalayn-en/`). The full format is specified in
|
|
106
|
+
[ASSET_MANIFEST.md](https://github.com/Itqan-community/cms-backend/blob/main/docs/ASSET_MANIFEST.md).
|
|
107
|
+
|
|
108
|
+
## Commands
|
|
109
|
+
|
|
110
|
+
| Command | What it does |
|
|
111
|
+
|---|---|
|
|
112
|
+
| `itqan init` | Create `itqan-assets.yaml` from the registry's catalog (commented examples when offline). `--assets-dir`, `--force`. |
|
|
113
|
+
| `itqan browse [QUERY]` | Search the registry's catalog and pick assets to add to `itqan-assets.yaml` (created if missing), then optionally install them. Type in the picker to filter further. `--category`, `--no-interactive` (print a table; the default outside a terminal), `--json`. |
|
|
114
|
+
| `itqan login` | Save your API key (create one at [cms.itqan.dev/account/api-keys](https://cms.itqan.dev/account/api-keys)). The key is checked first, then saved for that registry, readable only by you. `--api-key` to pass it without the prompt. |
|
|
115
|
+
| `itqan logout` | Remove the saved key. |
|
|
116
|
+
| `itqan install` | Resolve, download and lock. Uses the lockfile's exact versions when it is up to date; `--force` re-resolves. |
|
|
117
|
+
| `itqan sync` | Same as `install`. |
|
|
118
|
+
| `itqan --version` | Print the CLI version. |
|
|
119
|
+
|
|
120
|
+
## Configuration
|
|
121
|
+
|
|
122
|
+
| Option | Environment variable | Default |
|
|
123
|
+
|---|---|---|
|
|
124
|
+
| `--registry-url` | `ITQAN_REGISTRY_URL` | `https://api.cms.itqan.dev` |
|
|
125
|
+
| `--api-key` | `ITQAN_API_KEY` | the key saved by `itqan login` for the registry, if any |
|
|
126
|
+
|
|
127
|
+
`itqan login` saves keys in `~/.config/itqan/credentials` (`%APPDATA%\itqan` on Windows; set
|
|
128
|
+
`ITQAN_CONFIG_DIR` to move it). `--api-key` and `ITQAN_API_KEY`, for CI, take precedence over it.
|
|
129
|
+
|
|
130
|
+
## Assets that need access approval
|
|
131
|
+
|
|
132
|
+
Some publishers approve each developer before their assets can be downloaded. `itqan browse`
|
|
133
|
+
lists these too, marked `request access`, `access pending` or `access rejected`, with a link to
|
|
134
|
+
the asset's page on cms.itqan.dev where you request access. They can't be added until your
|
|
135
|
+
request is approved; then run `itqan login` with your API key and they show as `granted`.
|
|
136
|
+
`itqan install` says which assets in your manifest still need access, and where to ask.
|
|
137
|
+
|
|
138
|
+
## Development
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
uv sync
|
|
142
|
+
uv run pytest
|
|
143
|
+
uv build
|
|
144
|
+
uv run --group binary pyinstaller --onefile --name itqan --copy-metadata itqan-cli --specpath build src/itqan_cli/__main__.py # dist/itqan
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Releases are published from version tags; see [RELEASING.md](RELEASING.md).
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# itqan-cli
|
|
2
|
+
|
|
3
|
+
**Itqan Quranic Asset Manager**
|
|
4
|
+
|
|
5
|
+
Install and pin [Itqan](https://cms.itqan.dev) Quranic assets (mushafs, tafsirs, translations,
|
|
6
|
+
fonts) in your project, the way a package manager does for code.
|
|
7
|
+
|
|
8
|
+
You declare the assets you use and the versions you accept in `itqan-assets.yaml`. The CLI
|
|
9
|
+
resolves them against the Itqan registry, downloads them, and records the exact versions in
|
|
10
|
+
`itqan-assets.lock`, so teammates and CI get the same files.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
Requires Python 3.11+.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pipx install itqan-cli # or: uv tool install itqan-cli
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This installs the `itqan` command; `itqan-cli` is the same command under the package's name.
|
|
21
|
+
|
|
22
|
+
### Without Python
|
|
23
|
+
|
|
24
|
+
Each [GitHub Release](https://github.com/Itqan-community/itqan-cli/releases) has a standalone
|
|
25
|
+
`itqan` executable for macOS (arm64, x86_64), Linux (x86_64, arm64) and Windows (x86_64), named
|
|
26
|
+
`itqan-<version>-<os>-<arch>` (`.exe` on Windows). Download yours, check it against
|
|
27
|
+
`SHA256SUMS` and put it on your `PATH` as `itqan`. For example, on an Apple Silicon Mac:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
v=0.2.0 # the release you want
|
|
31
|
+
curl -fLO "https://github.com/Itqan-community/itqan-cli/releases/download/v$v/itqan-$v-macos-arm64"
|
|
32
|
+
curl -fLO "https://github.com/Itqan-community/itqan-cli/releases/download/v$v/SHA256SUMS"
|
|
33
|
+
shasum -a 256 --check --ignore-missing SHA256SUMS
|
|
34
|
+
chmod +x "itqan-$v-macos-arm64"
|
|
35
|
+
sudo mv "itqan-$v-macos-arm64" /usr/local/bin/itqan
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The binaries aren't notarized by Apple, so macOS blocks one downloaded with a browser. Clear the
|
|
39
|
+
quarantine flag to allow it: `xattr -d com.apple.quarantine /usr/local/bin/itqan`. (`curl`
|
|
40
|
+
doesn't set the flag.) On Linux, use `sha256sum --check --ignore-missing SHA256SUMS`.
|
|
41
|
+
|
|
42
|
+
## Quick start
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
itqan init # writes itqan-assets.yaml with a few real assets as examples
|
|
46
|
+
itqan browse # search the catalog and add more assets to it
|
|
47
|
+
itqan install # downloads them and writes itqan-assets.lock
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Commit both `itqan-assets.yaml` and `itqan-assets.lock`. The downloaded files are reproducible
|
|
51
|
+
from the lockfile, so add the assets folder to `.gitignore` if you like.
|
|
52
|
+
|
|
53
|
+
## The manifest
|
|
54
|
+
|
|
55
|
+
```yaml
|
|
56
|
+
schema_version: 1
|
|
57
|
+
|
|
58
|
+
# Folder the assets are downloaded into, relative to this file (default: assets).
|
|
59
|
+
assets_dir: "public/quran"
|
|
60
|
+
|
|
61
|
+
assets:
|
|
62
|
+
# Source language of the asset.
|
|
63
|
+
tafsir-jalalayn:
|
|
64
|
+
version: "^2.0.0" # any 2.x from 2.0.0 on
|
|
65
|
+
|
|
66
|
+
# The same asset in English: its own entry, pointing at the asset.
|
|
67
|
+
tafsir-jalalayn-en:
|
|
68
|
+
asset: tafsir-jalalayn
|
|
69
|
+
language: en
|
|
70
|
+
version: "~1.3" # any 1.3.x
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Each language of an asset has its own version history, so each gets its own entry, constraint,
|
|
74
|
+
lock entry and folder (`public/quran/tafsir-jalalayn-en/`). The full format is specified in
|
|
75
|
+
[ASSET_MANIFEST.md](https://github.com/Itqan-community/cms-backend/blob/main/docs/ASSET_MANIFEST.md).
|
|
76
|
+
|
|
77
|
+
## Commands
|
|
78
|
+
|
|
79
|
+
| Command | What it does |
|
|
80
|
+
|---|---|
|
|
81
|
+
| `itqan init` | Create `itqan-assets.yaml` from the registry's catalog (commented examples when offline). `--assets-dir`, `--force`. |
|
|
82
|
+
| `itqan browse [QUERY]` | Search the registry's catalog and pick assets to add to `itqan-assets.yaml` (created if missing), then optionally install them. Type in the picker to filter further. `--category`, `--no-interactive` (print a table; the default outside a terminal), `--json`. |
|
|
83
|
+
| `itqan login` | Save your API key (create one at [cms.itqan.dev/account/api-keys](https://cms.itqan.dev/account/api-keys)). The key is checked first, then saved for that registry, readable only by you. `--api-key` to pass it without the prompt. |
|
|
84
|
+
| `itqan logout` | Remove the saved key. |
|
|
85
|
+
| `itqan install` | Resolve, download and lock. Uses the lockfile's exact versions when it is up to date; `--force` re-resolves. |
|
|
86
|
+
| `itqan sync` | Same as `install`. |
|
|
87
|
+
| `itqan --version` | Print the CLI version. |
|
|
88
|
+
|
|
89
|
+
## Configuration
|
|
90
|
+
|
|
91
|
+
| Option | Environment variable | Default |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| `--registry-url` | `ITQAN_REGISTRY_URL` | `https://api.cms.itqan.dev` |
|
|
94
|
+
| `--api-key` | `ITQAN_API_KEY` | the key saved by `itqan login` for the registry, if any |
|
|
95
|
+
|
|
96
|
+
`itqan login` saves keys in `~/.config/itqan/credentials` (`%APPDATA%\itqan` on Windows; set
|
|
97
|
+
`ITQAN_CONFIG_DIR` to move it). `--api-key` and `ITQAN_API_KEY`, for CI, take precedence over it.
|
|
98
|
+
|
|
99
|
+
## Assets that need access approval
|
|
100
|
+
|
|
101
|
+
Some publishers approve each developer before their assets can be downloaded. `itqan browse`
|
|
102
|
+
lists these too, marked `request access`, `access pending` or `access rejected`, with a link to
|
|
103
|
+
the asset's page on cms.itqan.dev where you request access. They can't be added until your
|
|
104
|
+
request is approved; then run `itqan login` with your API key and they show as `granted`.
|
|
105
|
+
`itqan install` says which assets in your manifest still need access, and where to ask.
|
|
106
|
+
|
|
107
|
+
## Development
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
uv sync
|
|
111
|
+
uv run pytest
|
|
112
|
+
uv build
|
|
113
|
+
uv run --group binary pyinstaller --onefile --name itqan --copy-metadata itqan-cli --specpath build src/itqan_cli/__main__.py # dist/itqan
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Releases are published from version tags; see [RELEASING.md](RELEASING.md).
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Releasing
|
|
2
|
+
|
|
3
|
+
Releases are published by [`.github/workflows/release.yml`](.github/workflows/release.yml) when a
|
|
4
|
+
version tag is pushed. It runs the tests, builds the package and the standalone binaries
|
|
5
|
+
([`binaries.yml`](.github/workflows/binaries.yml)), publishes the package to
|
|
6
|
+
[PyPI](https://pypi.org/project/itqan-cli/) and creates the GitHub Release with the package, the
|
|
7
|
+
binaries and a `SHA256SUMS` file. Nothing is published unless every binary builds and passes its
|
|
8
|
+
smoke test (`--version`, `--help`, `init` and `install` against the public registry).
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
1. On a branch with a PR, let [commitizen](https://commitizen-tools.github.io/commitizen/) pick
|
|
13
|
+
the next version from the [Conventional Commits](https://www.conventionalcommits.org/) since
|
|
14
|
+
the last tag, then refresh the lock file:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
uv run cz bump --files-only --yes # e.g. 0.2.0
|
|
18
|
+
uv run cz bump --files-only --yes --prerelease rc # or a pre-release, e.g. 0.2.0rc1
|
|
19
|
+
uv lock
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
This bumps `version` in `pyproject.toml` and moves the `Unreleased` entries in
|
|
23
|
+
[`CHANGELOG.md`](CHANGELOG.md) under the new version. `--files-only` stops it from committing
|
|
24
|
+
or tagging, since the tag belongs on `main` (step 2). Edit the changelog wording if it needs it.
|
|
25
|
+
Use `uv run cz bump --dry-run` to preview, or `uv run cz changelog` to regenerate the
|
|
26
|
+
`Unreleased` section between releases.
|
|
27
|
+
2. Once it's merged, tag `main` with the same version and push the tag:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
git switch main && git pull
|
|
31
|
+
git tag v0.2.0
|
|
32
|
+
git push origin v0.2.0
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
3. Approve the `pypi` deployment in the workflow run if the environment requires approval.
|
|
36
|
+
|
|
37
|
+
If the tag doesn't match `pyproject.toml`, the workflow stops before publishing anything. Delete
|
|
38
|
+
the tag (`git push --delete origin v0.2.0 && git tag -d v0.2.0`), fix, and tag again.
|
|
39
|
+
|
|
40
|
+
Versions with `a`, `b` or `rc` (e.g. `0.2.0rc1`) are marked as pre-releases. `pipx install
|
|
41
|
+
itqan-cli` skips them unless asked for explicitly: `pipx install itqan-cli==0.2.0rc1`.
|
|
42
|
+
|
|
43
|
+
## One-time setup
|
|
44
|
+
|
|
45
|
+
- **PyPI:** under the project (or, before the first release, under *Your account →
|
|
46
|
+
Publishing → Add a pending publisher*), add a GitHub trusted publisher:
|
|
47
|
+
- Project name: `itqan-cli`
|
|
48
|
+
- Owner: `Itqan-community`
|
|
49
|
+
- Repository: `itqan-cli`
|
|
50
|
+
- Workflow: `release.yml`
|
|
51
|
+
- Environment: `pypi`
|
|
52
|
+
- **GitHub:** create an environment named `pypi` under *Settings → Environments*. Adding required
|
|
53
|
+
reviewers makes every release wait for a maintainer's approval.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "itqan-cli"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Itqan Quranic Asset Manager: install and pin Itqan Quranic assets in your project."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
requires-python = ">=3.11"
|
|
9
|
+
authors = [
|
|
10
|
+
{ name = "Hassaan Alansary", email = "hassaanalansary@yahoo.com" },
|
|
11
|
+
{ name = "Itqan" },
|
|
12
|
+
]
|
|
13
|
+
keywords = ["itqan", "quran", "quranic", "tafsir", "mushaf", "assets", "package-manager", "cli"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Topic :: Religion",
|
|
25
|
+
"Topic :: Software Development :: Build Tools",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"click>=8.1",
|
|
29
|
+
"pyyaml>=6.0",
|
|
30
|
+
"questionary>=2.1",
|
|
31
|
+
"requests>=2.31",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.scripts]
|
|
35
|
+
itqan = "itqan_cli.main:cli"
|
|
36
|
+
# Same CLI under the package name, so `pipx install itqan-cli` then `itqan-cli ...` works too.
|
|
37
|
+
itqan-cli = "itqan_cli.main:cli"
|
|
38
|
+
|
|
39
|
+
[project.urls]
|
|
40
|
+
Homepage = "https://github.com/Itqan-community/itqan-cli"
|
|
41
|
+
Repository = "https://github.com/Itqan-community/itqan-cli"
|
|
42
|
+
Issues = "https://github.com/Itqan-community/itqan-cli/issues"
|
|
43
|
+
"Manifest format" = "https://github.com/Itqan-community/cms-backend/blob/main/docs/ASSET_MANIFEST.md"
|
|
44
|
+
|
|
45
|
+
[dependency-groups]
|
|
46
|
+
dev = [
|
|
47
|
+
"commitizen==4.10.*",
|
|
48
|
+
"pytest>=8",
|
|
49
|
+
"responses>=0.25",
|
|
50
|
+
]
|
|
51
|
+
# PyInstaller, for the standalone binaries attached to each GitHub Release (.github/workflows/binaries.yml).
|
|
52
|
+
binary = [
|
|
53
|
+
"pyinstaller>=6.11,<7",
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
[build-system]
|
|
57
|
+
requires = ["hatchling"]
|
|
58
|
+
build-backend = "hatchling.build"
|
|
59
|
+
|
|
60
|
+
[tool.hatch.build.targets.sdist]
|
|
61
|
+
# The source archive is for building and testing the package, not for
|
|
62
|
+
# developing it: leave out CI, editor and lock files.
|
|
63
|
+
exclude = [".github", ".pre-commit-config.yaml", "uv.lock", ".idea"]
|
|
64
|
+
|
|
65
|
+
[tool.pytest.ini_options]
|
|
66
|
+
testpaths = ["tests"]
|
|
67
|
+
|
|
68
|
+
[tool.black]
|
|
69
|
+
line-length = 120
|
|
70
|
+
target-version = ["py311"]
|
|
71
|
+
|
|
72
|
+
[tool.ruff]
|
|
73
|
+
line-length = 120
|
|
74
|
+
target-version = "py311"
|
|
75
|
+
|
|
76
|
+
[tool.isort]
|
|
77
|
+
profile = "black"
|
|
78
|
+
line_length = 120
|
|
79
|
+
known_first_party = ["itqan_cli"]
|
|
80
|
+
force_sort_within_sections = true
|
|
81
|
+
combine_as_imports = true
|
|
82
|
+
|
|
83
|
+
[tool.commitizen]
|
|
84
|
+
name = "cz_conventional_commits"
|
|
85
|
+
version_provider = "pep621"
|
|
86
|
+
version_scheme = "pep440"
|
|
87
|
+
tag_format = "v$version"
|
|
88
|
+
update_changelog_on_bump = true
|
|
89
|
+
changelog_file = "CHANGELOG.md"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Itqan Package Manager CLI."""
|