pkgmgr-kunrunic 0.1.0.dev3__tar.gz → 0.1.0.dev4__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.
Files changed (34) hide show
  1. pkgmgr_kunrunic-0.1.0.dev4/PKG-INFO +145 -0
  2. pkgmgr_kunrunic-0.1.0.dev4/README.md +97 -0
  3. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr/__init__.py +2 -1
  4. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr/cli.py +96 -11
  5. pkgmgr_kunrunic-0.1.0.dev4/pkgmgr/config.py +380 -0
  6. pkgmgr_kunrunic-0.1.0.dev4/pkgmgr/points.py +98 -0
  7. pkgmgr_kunrunic-0.1.0.dev4/pkgmgr/release.py +564 -0
  8. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr/snapshot.py +74 -6
  9. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr/templates/pkg.yaml.sample +6 -4
  10. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr/templates/pkgmgr.yaml.sample +12 -0
  11. pkgmgr_kunrunic-0.1.0.dev4/pkgmgr/watch.py +79 -0
  12. pkgmgr_kunrunic-0.1.0.dev4/pkgmgr_kunrunic.egg-info/PKG-INFO +145 -0
  13. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr_kunrunic.egg-info/SOURCES.txt +3 -1
  14. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr_kunrunic.egg-info/top_level.txt +1 -0
  15. pkgmgr_kunrunic-0.1.0.dev4/tests/test_config.py +112 -0
  16. pkgmgr_kunrunic-0.1.0.dev3/PKG-INFO +0 -169
  17. pkgmgr_kunrunic-0.1.0.dev3/README.md +0 -121
  18. pkgmgr_kunrunic-0.1.0.dev3/pkgmgr/config.py +0 -161
  19. pkgmgr_kunrunic-0.1.0.dev3/pkgmgr/release.py +0 -115
  20. pkgmgr_kunrunic-0.1.0.dev3/pkgmgr/watch.py +0 -22
  21. pkgmgr_kunrunic-0.1.0.dev3/pkgmgr_kunrunic.egg-info/PKG-INFO +0 -169
  22. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/LICENSE +0 -0
  23. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr/__main__.py +0 -0
  24. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr/collectors/__init__.py +0 -0
  25. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr/collectors/base.py +0 -0
  26. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr/collectors/checksums.py +0 -0
  27. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr/gitcollect.py +0 -0
  28. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr/shell_integration.py +0 -0
  29. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr_kunrunic.egg-info/dependency_links.txt +0 -0
  30. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr_kunrunic.egg-info/entry_points.txt +0 -0
  31. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr_kunrunic.egg-info/not-zip-safe +0 -0
  32. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pkgmgr_kunrunic.egg-info/requires.txt +0 -0
  33. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/pyproject.toml +0 -0
  34. {pkgmgr_kunrunic-0.1.0.dev3 → pkgmgr_kunrunic-0.1.0.dev4}/setup.cfg +0 -0
@@ -0,0 +1,145 @@
1
+ Metadata-Version: 2.4
2
+ Name: pkgmgr-kunrunic
3
+ Version: 0.1.0.dev4
4
+ Summary: Package management workflow scaffold.
5
+ Author: pkgmgr maintainers
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Jho Sung Jun
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/kunrunic/pkgmgnt
29
+ Project-URL: Repository, https://github.com/kunrunic/pkgmgnt
30
+ Classifier: Development Status :: 2 - Pre-Alpha
31
+ Classifier: Intended Audience :: Developers
32
+ Classifier: License :: OSI Approved :: MIT License
33
+ Classifier: Environment :: Console
34
+ Classifier: Programming Language :: Python
35
+ Classifier: Programming Language :: Python :: 3
36
+ Classifier: Programming Language :: Python :: 3 :: Only
37
+ Classifier: Programming Language :: Python :: 3.8
38
+ Classifier: Programming Language :: Python :: 3.9
39
+ Classifier: Programming Language :: Python :: 3.10
40
+ Classifier: Programming Language :: Python :: 3.11
41
+ Classifier: Programming Language :: Python :: 3.12
42
+ Classifier: Topic :: Software Development :: Build Tools
43
+ Requires-Python: >=3.8
44
+ Description-Content-Type: text/markdown
45
+ License-File: LICENSE
46
+ Requires-Dist: pyyaml>=6.0
47
+ Dynamic: license-file
48
+
49
+ # pkgmgr
50
+
51
+ 패키지 관리/배포 워크플로를 위한 Python 패키지입니다. 현재는 스캐폴드 상태이며, CLI와 설정 템플릿, 릴리스 번들링까지 제공됩니다.
52
+
53
+ ## 디자인/Use case
54
+ - 흐름 요약과 Mermaid 시퀀스 다이어그램은 `design/mermaid/use-cases.md`에 있습니다(깃헙에서 바로 렌더링됨).
55
+ - 주 명령별 설정/동작 요약과 make-config/install/create-pkg/update-pkg/close-pkg 시퀀스를 포함합니다.
56
+
57
+ ## 구성
58
+ - `pkgmgr/cli.py` : CLI 엔트리 (아래 명령어 참조)
59
+ - `pkgmgr/config.py` : `pkgmgr.yaml` / `pkg.yaml` 템플릿 생성 및 로더 (PyYAML 필요)
60
+ - `pkgmgr/snapshot.py`, `pkgmgr/release.py`, `pkgmgr/gitcollect.py`, `pkgmgr/watch.py` : 스냅샷/패키지 수명주기/깃 수집/감시/릴리스 번들
61
+ - `pkgmgr/collectors/` : 컬렉터 인터페이스 및 체크섬 컬렉터 스텁
62
+ - 템플릿: `pkgmgr/templates/pkgmgr.yaml.sample`, `pkgmgr/templates/pkg.yaml.sample`
63
+
64
+ ## 필요 사항
65
+ - Python 3.8 이상
66
+ - 의존성(PyYAML 등)은 `pip install pkgmgr-kunrunic` 시 자동 설치됩니다.
67
+
68
+ ## 설치 (PyPI/로컬)
69
+ - PyPI(권장): `python -m pip install pkgmgr-kunrunic` (또는 `pipx install pkgmgr-kunrunic`으로 전역 CLI 설치).
70
+ - 로컬/개발: 리포지토리 클론 후 `python -m pip install .` 또는 빌드 산출물(`dist/pkgmgr_kunrunic-<버전>-py3-none-any.whl`)을 `python -m pip install dist/<파일>`로 설치.
71
+ - 확인: `pkgmgr --version` 혹은 `python -m pkgmgr.cli --version`.
72
+
73
+ ## 기본 사용 흐름 (스캐폴드)
74
+ 아래 명령은 `pkgmgr ...` 또는 `python -m pkgmgr.cli ...` 형태로 실행합니다.
75
+ 설정 파일 기본 위치는 `~/pkgmgr/pkgmgr.yaml`이며, `~/pkgmgr/pkgmgr*.yaml`과 `~/pkgmgr/config/pkgmgr*.yaml`을 자동 탐색합니다(여러 개면 선택 필요, `--config`로 강제 지정 가능). 상태/릴리스 데이터는 `~/pkgmgr/local/state` 아래에 기록됩니다.
76
+
77
+ ### 1) make-config — 메인 설정 템플릿 생성
78
+ ```
79
+ pkgmgr make-config
80
+ pkgmgr make-config -o ~/pkgmgr/config/pkgmgr-alt.yaml # 위치 지정 가능
81
+ ```
82
+ 편집할 주요 필드: `pkg_release_root`, `sources`, `source.exclude`, `artifacts.targets/exclude`, `git.keywords/repo_root`, `collectors.enabled`, `actions`.
83
+
84
+ ### 2) install — PATH/alias 등록 + 초기 baseline(한 번만)
85
+ ```
86
+ pkgmgr install [--config <path>]
87
+ ```
88
+ - 사용 쉘을 감지해 rc 파일에 PATH/alias 추가.
89
+ - `~/pkgmgr/local/state/baseline.json`이 없을 때만 초기 스냅샷 생성(있으면 건너뜀).
90
+
91
+ ### 3) create-pkg — 패키지 디렉터리/설정 생성
92
+ ```
93
+ pkgmgr create-pkg <pkg-id> [--config <path>]
94
+ ```
95
+ - `<pkg_release_root>/<pkg-id>/pkg.yaml`을 실제 값으로 채워 생성(기존 파일이 있으면 덮어쓰기 여부 확인).
96
+ - 메인 설정의 `git.keywords/repo_root`, `collectors.enabled`를 기본값으로 반영.
97
+ - baseline이 없는 경우에만 baseline 생성.
98
+
99
+ ### 4) update-pkg — Git/체크섬 수집 + 릴리스 번들 생성
100
+ ```
101
+ pkgmgr update-pkg <pkg-id> [--config <path>]
102
+ ```
103
+ - Git: `git.repo_root`(상대/절대)에서 `git.keywords` 매칭 커밋을 모아 `message/author/subject/files/keywords` 저장.
104
+ - 체크섬: 키워드에 걸린 파일 + `include.releases` 경로의 파일 해시 수집.
105
+ - 릴리스 번들: `include.releases` 최상위 디렉터리별로 `release/<root>/release.vX.Y.Z/`를 자동 증가 버전으로 생성. 이전 버전과 해시가 동일한 파일은 스킵, 달라진 파일만 복사. 각 버전 폴더에 README.txt(포함/스킵 수, tar 예시, TODO) 작성. tar는 만들지 않음.
106
+ - 실행 결과는 `~/pkgmgr/local/state/pkg/<id>/updates/update-<ts>.json`에 기록(`git`, `checksums`, `release` 메타 포함).
107
+
108
+ ### (기타) watch / collect / actions / export / point
109
+ 기능은 여전히 스텁 혹은 최소 구현 상태입니다. 필요 시 `pkgmgr watch`, `pkgmgr collect`, `pkgmgr actions`, `pkgmgr point`, `pkgmgr export`를 이용할 수 있으며, 추후 강화 예정입니다.
110
+
111
+ ## PATH/alias 자동 추가
112
+ - PyPI/로컬 설치 후 `python -m pkgmgr.cli install`을 실행하면 현재 파이썬의 `bin` 경로(예: venv/bin, ~/.local/bin 등)를 감지해 사용 중인 쉘의 rc 파일에 PATH/alias를 추가합니다.
113
+ - 지원 쉘: bash(`~/.bashrc`), zsh(`~/.zshrc`), csh/tcsh(`~/.cshrc`/`~/.tcshrc`), fish(`~/.config/fish/config.fish`).
114
+ - 추가 내용:
115
+ - PATH: `export PATH="<script_dir>:$PATH"` 또는 쉘별 동등 구문
116
+ - alias: `alias pkg="pkgmgr"` (csh/fish 문법 사용)
117
+ - 이미 추가된 경우(marker로 확인) 중복 삽입하지 않습니다. rc 파일이 없으면 새로 만듭니다.
118
+
119
+ ## 템플릿 개요
120
+ - `pkgmgr/templates/pkgmgr.yaml.sample` : 메인 설정 샘플
121
+ - `pkg_release_root`: 패키지 릴리스 루트
122
+ - `sources`: 관리할 소스 경로 목록
123
+ - `source.exclude`: 소스 스캔 제외 패턴 (glob 지원)
124
+ - `artifacts.targets` / `artifacts.exclude`: 배포 대상 포함/제외 규칙 (glob 지원: `tmp/**`, `*.bak`, `**/*.tmp` 등)
125
+ - `watch.interval_sec`: 감시 폴링 주기
126
+ - `watch.on_change`: 변경 시 실행할 action 이름 리스트
127
+ - `collectors.enabled`: 기본 활성 컬렉터
128
+ - `actions`: action 이름 → 실행할 커맨드 목록 (각 항목에 `cmd` 필수, `cwd`/`env` 선택)
129
+
130
+ - `pkgmgr/templates/pkg.yaml.sample` : 패키지별 설정 샘플
131
+ - `pkg.id` / `pkg.root` / `pkg.status(open|closed)`
132
+ - `include.releases`: 릴리스에 포함할 경로(최상위 디렉터리별로 묶여 `release/<root>/release.vX.Y.Z` 생성)
133
+ - `git.repo_root/keywords/since/until`: 커밋 수집 범위
134
+ - `collectors.enabled`: 패키지별 컬렉터 설정
135
+
136
+ ## 주의
137
+ - 아직 핵심 로직(스냅샷/감시/수집/내보내기)은 스텁입니다. 추후 단계적으로 구현/교체 예정입니다.
138
+
139
+ ## TODO (우선순위)
140
+ - 감시/포인트 고도화: watchdog/inotify 연동, diff 결과를 포인트 메타에 기록, 에러/로그 처리.
141
+ - baseline/릴리스 알림: baseline 대비 변경 감지 시 알림/확인 흐름 추가(README/README.txt TODO 반영).
142
+ - Git 수집: `gitcollect.py` 확장(키워드/정규식 수집, state/pkg/<id>/commits.json 저장).
143
+ - 컬렉터 파이프라인: 체크섬 외 collector 등록/선택/실행 로직, include 기준 실행, 정적/동적/EDR/AV 훅 자리 마련.
144
+ - Export/산출물: `export` 기본 JSON 덤프, excel/word 후크 설계, 포인트 단위 산출물 묶기.
145
+ - 테스트/CI: watch diff/포인트/라이프사이클 단위 테스트 추가, pytest/CI 스크립트 보강.
@@ -0,0 +1,97 @@
1
+ # pkgmgr
2
+
3
+ 패키지 관리/배포 워크플로를 위한 Python 패키지입니다. 현재는 스캐폴드 상태이며, CLI와 설정 템플릿, 릴리스 번들링까지 제공됩니다.
4
+
5
+ ## 디자인/Use case
6
+ - 흐름 요약과 Mermaid 시퀀스 다이어그램은 `design/mermaid/use-cases.md`에 있습니다(깃헙에서 바로 렌더링됨).
7
+ - 주 명령별 설정/동작 요약과 make-config/install/create-pkg/update-pkg/close-pkg 시퀀스를 포함합니다.
8
+
9
+ ## 구성
10
+ - `pkgmgr/cli.py` : CLI 엔트리 (아래 명령어 참조)
11
+ - `pkgmgr/config.py` : `pkgmgr.yaml` / `pkg.yaml` 템플릿 생성 및 로더 (PyYAML 필요)
12
+ - `pkgmgr/snapshot.py`, `pkgmgr/release.py`, `pkgmgr/gitcollect.py`, `pkgmgr/watch.py` : 스냅샷/패키지 수명주기/깃 수집/감시/릴리스 번들
13
+ - `pkgmgr/collectors/` : 컬렉터 인터페이스 및 체크섬 컬렉터 스텁
14
+ - 템플릿: `pkgmgr/templates/pkgmgr.yaml.sample`, `pkgmgr/templates/pkg.yaml.sample`
15
+
16
+ ## 필요 사항
17
+ - Python 3.8 이상
18
+ - 의존성(PyYAML 등)은 `pip install pkgmgr-kunrunic` 시 자동 설치됩니다.
19
+
20
+ ## 설치 (PyPI/로컬)
21
+ - PyPI(권장): `python -m pip install pkgmgr-kunrunic` (또는 `pipx install pkgmgr-kunrunic`으로 전역 CLI 설치).
22
+ - 로컬/개발: 리포지토리 클론 후 `python -m pip install .` 또는 빌드 산출물(`dist/pkgmgr_kunrunic-<버전>-py3-none-any.whl`)을 `python -m pip install dist/<파일>`로 설치.
23
+ - 확인: `pkgmgr --version` 혹은 `python -m pkgmgr.cli --version`.
24
+
25
+ ## 기본 사용 흐름 (스캐폴드)
26
+ 아래 명령은 `pkgmgr ...` 또는 `python -m pkgmgr.cli ...` 형태로 실행합니다.
27
+ 설정 파일 기본 위치는 `~/pkgmgr/pkgmgr.yaml`이며, `~/pkgmgr/pkgmgr*.yaml`과 `~/pkgmgr/config/pkgmgr*.yaml`을 자동 탐색합니다(여러 개면 선택 필요, `--config`로 강제 지정 가능). 상태/릴리스 데이터는 `~/pkgmgr/local/state` 아래에 기록됩니다.
28
+
29
+ ### 1) make-config — 메인 설정 템플릿 생성
30
+ ```
31
+ pkgmgr make-config
32
+ pkgmgr make-config -o ~/pkgmgr/config/pkgmgr-alt.yaml # 위치 지정 가능
33
+ ```
34
+ 편집할 주요 필드: `pkg_release_root`, `sources`, `source.exclude`, `artifacts.targets/exclude`, `git.keywords/repo_root`, `collectors.enabled`, `actions`.
35
+
36
+ ### 2) install — PATH/alias 등록 + 초기 baseline(한 번만)
37
+ ```
38
+ pkgmgr install [--config <path>]
39
+ ```
40
+ - 사용 쉘을 감지해 rc 파일에 PATH/alias 추가.
41
+ - `~/pkgmgr/local/state/baseline.json`이 없을 때만 초기 스냅샷 생성(있으면 건너뜀).
42
+
43
+ ### 3) create-pkg — 패키지 디렉터리/설정 생성
44
+ ```
45
+ pkgmgr create-pkg <pkg-id> [--config <path>]
46
+ ```
47
+ - `<pkg_release_root>/<pkg-id>/pkg.yaml`을 실제 값으로 채워 생성(기존 파일이 있으면 덮어쓰기 여부 확인).
48
+ - 메인 설정의 `git.keywords/repo_root`, `collectors.enabled`를 기본값으로 반영.
49
+ - baseline이 없는 경우에만 baseline 생성.
50
+
51
+ ### 4) update-pkg — Git/체크섬 수집 + 릴리스 번들 생성
52
+ ```
53
+ pkgmgr update-pkg <pkg-id> [--config <path>]
54
+ ```
55
+ - Git: `git.repo_root`(상대/절대)에서 `git.keywords` 매칭 커밋을 모아 `message/author/subject/files/keywords` 저장.
56
+ - 체크섬: 키워드에 걸린 파일 + `include.releases` 경로의 파일 해시 수집.
57
+ - 릴리스 번들: `include.releases` 최상위 디렉터리별로 `release/<root>/release.vX.Y.Z/`를 자동 증가 버전으로 생성. 이전 버전과 해시가 동일한 파일은 스킵, 달라진 파일만 복사. 각 버전 폴더에 README.txt(포함/스킵 수, tar 예시, TODO) 작성. tar는 만들지 않음.
58
+ - 실행 결과는 `~/pkgmgr/local/state/pkg/<id>/updates/update-<ts>.json`에 기록(`git`, `checksums`, `release` 메타 포함).
59
+
60
+ ### (기타) watch / collect / actions / export / point
61
+ 기능은 여전히 스텁 혹은 최소 구현 상태입니다. 필요 시 `pkgmgr watch`, `pkgmgr collect`, `pkgmgr actions`, `pkgmgr point`, `pkgmgr export`를 이용할 수 있으며, 추후 강화 예정입니다.
62
+
63
+ ## PATH/alias 자동 추가
64
+ - PyPI/로컬 설치 후 `python -m pkgmgr.cli install`을 실행하면 현재 파이썬의 `bin` 경로(예: venv/bin, ~/.local/bin 등)를 감지해 사용 중인 쉘의 rc 파일에 PATH/alias를 추가합니다.
65
+ - 지원 쉘: bash(`~/.bashrc`), zsh(`~/.zshrc`), csh/tcsh(`~/.cshrc`/`~/.tcshrc`), fish(`~/.config/fish/config.fish`).
66
+ - 추가 내용:
67
+ - PATH: `export PATH="<script_dir>:$PATH"` 또는 쉘별 동등 구문
68
+ - alias: `alias pkg="pkgmgr"` (csh/fish 문법 사용)
69
+ - 이미 추가된 경우(marker로 확인) 중복 삽입하지 않습니다. rc 파일이 없으면 새로 만듭니다.
70
+
71
+ ## 템플릿 개요
72
+ - `pkgmgr/templates/pkgmgr.yaml.sample` : 메인 설정 샘플
73
+ - `pkg_release_root`: 패키지 릴리스 루트
74
+ - `sources`: 관리할 소스 경로 목록
75
+ - `source.exclude`: 소스 스캔 제외 패턴 (glob 지원)
76
+ - `artifacts.targets` / `artifacts.exclude`: 배포 대상 포함/제외 규칙 (glob 지원: `tmp/**`, `*.bak`, `**/*.tmp` 등)
77
+ - `watch.interval_sec`: 감시 폴링 주기
78
+ - `watch.on_change`: 변경 시 실행할 action 이름 리스트
79
+ - `collectors.enabled`: 기본 활성 컬렉터
80
+ - `actions`: action 이름 → 실행할 커맨드 목록 (각 항목에 `cmd` 필수, `cwd`/`env` 선택)
81
+
82
+ - `pkgmgr/templates/pkg.yaml.sample` : 패키지별 설정 샘플
83
+ - `pkg.id` / `pkg.root` / `pkg.status(open|closed)`
84
+ - `include.releases`: 릴리스에 포함할 경로(최상위 디렉터리별로 묶여 `release/<root>/release.vX.Y.Z` 생성)
85
+ - `git.repo_root/keywords/since/until`: 커밋 수집 범위
86
+ - `collectors.enabled`: 패키지별 컬렉터 설정
87
+
88
+ ## 주의
89
+ - 아직 핵심 로직(스냅샷/감시/수집/내보내기)은 스텁입니다. 추후 단계적으로 구현/교체 예정입니다.
90
+
91
+ ## TODO (우선순위)
92
+ - 감시/포인트 고도화: watchdog/inotify 연동, diff 결과를 포인트 메타에 기록, 에러/로그 처리.
93
+ - baseline/릴리스 알림: baseline 대비 변경 감지 시 알림/확인 흐름 추가(README/README.txt TODO 반영).
94
+ - Git 수집: `gitcollect.py` 확장(키워드/정규식 수집, state/pkg/<id>/commits.json 저장).
95
+ - 컬렉터 파이프라인: 체크섬 외 collector 등록/선택/실행 로직, include 기준 실행, 정적/동적/EDR/AV 훅 자리 마련.
96
+ - Export/산출물: `export` 기본 JSON 덤프, excel/word 후크 설계, 포인트 단위 산출물 묶기.
97
+ - 테스트/CI: watch diff/포인트/라이프사이클 단위 테스트 추가, pytest/CI 스크립트 보강.
@@ -11,6 +11,7 @@ __all__ = [
11
11
  "release",
12
12
  "gitcollect",
13
13
  "watch",
14
+ "points",
14
15
  ]
15
16
 
16
- __version__ = "0.1.0.dev3"
17
+ __version__ = "0.1.0.dev4"
@@ -8,7 +8,7 @@ try:
8
8
  except Exception:
9
9
  argparse = None
10
10
 
11
- from . import config, snapshot, release, gitcollect, watch
11
+ from . import config, snapshot, release, gitcollect, watch, __version__
12
12
 
13
13
 
14
14
  def _add_make_config(sub):
@@ -24,6 +24,11 @@ def _add_make_config(sub):
24
24
 
25
25
  def _add_install(sub):
26
26
  p = sub.add_parser("install", help="prepare environment and collect initial baseline")
27
+ p.add_argument(
28
+ "--config",
29
+ default=None,
30
+ help="config file path (default: auto-discover under %s)" % config.BASE_DIR,
31
+ )
27
32
  p.set_defaults(func=_handle_install)
28
33
 
29
34
 
@@ -32,7 +37,9 @@ def _add_snapshot(sub):
32
37
  "snapshot", help="take a snapshot (baseline update after install)"
33
38
  )
34
39
  p.add_argument(
35
- "--config", default=config.DEFAULT_MAIN_CONFIG, help="config file path"
40
+ "--config",
41
+ default=None,
42
+ help="config file path (default: auto-discover under %s)" % config.BASE_DIR,
36
43
  )
37
44
  p.set_defaults(func=_handle_snapshot)
38
45
 
@@ -40,7 +47,9 @@ def _add_actions(sub):
40
47
  p = sub.add_parser("actions", help="run one or more configured actions")
41
48
  p.add_argument("names", nargs="+", help="action names to run")
42
49
  p.add_argument(
43
- "--config", default=config.DEFAULT_MAIN_CONFIG, help="config file path"
50
+ "--config",
51
+ default=None,
52
+ help="config file path (default: auto-discover under %s)" % config.BASE_DIR,
44
53
  )
45
54
  p.set_defaults(func=_handle_actions)
46
55
 
@@ -49,16 +58,31 @@ def _add_create_pkg(sub):
49
58
  p = sub.add_parser("create-pkg", help="create a pkg folder and template")
50
59
  p.add_argument("pkg_id", help="package identifier (e.g. 20240601)")
51
60
  p.add_argument(
52
- "--config", default=config.DEFAULT_MAIN_CONFIG, help="config file path"
61
+ "--config",
62
+ default=None,
63
+ help="config file path (default: auto-discover under %s)" % config.BASE_DIR,
53
64
  )
54
65
  p.set_defaults(func=_handle_create_pkg)
55
66
 
56
67
 
68
+ def _add_update_pkg(sub):
69
+ p = sub.add_parser("update-pkg", help="collect git keyword hits and checksums for a pkg")
70
+ p.add_argument("pkg_id", help="package identifier to update")
71
+ p.add_argument(
72
+ "--config",
73
+ default=None,
74
+ help="config file path (default: auto-discover under %s)" % config.BASE_DIR,
75
+ )
76
+ p.set_defaults(func=_handle_update_pkg)
77
+
78
+
57
79
  def _add_close_pkg(sub):
58
80
  p = sub.add_parser("close-pkg", help="mark a pkg as closed and stop watching")
59
81
  p.add_argument("pkg_id", help="package identifier to close")
60
82
  p.add_argument(
61
- "--config", default=config.DEFAULT_MAIN_CONFIG, help="config file path"
83
+ "--config",
84
+ default=None,
85
+ help="config file path (default: auto-discover under %s)" % config.BASE_DIR,
62
86
  )
63
87
  p.set_defaults(func=_handle_close_pkg)
64
88
 
@@ -66,13 +90,25 @@ def _add_close_pkg(sub):
66
90
  def _add_watch(sub):
67
91
  p = sub.add_parser("watch", help="start watcher/daemon to monitor pkgs")
68
92
  p.add_argument(
69
- "--config", default=config.DEFAULT_MAIN_CONFIG, help="config file path"
93
+ "--config",
94
+ default=None,
95
+ help="config file path (default: auto-discover under %s)" % config.BASE_DIR,
70
96
  )
71
97
  p.add_argument(
72
98
  "--once",
73
99
  action="store_true",
74
100
  help="run a single poll iteration then exit (useful for cron)",
75
101
  )
102
+ p.add_argument("--pkg", help="package id to scope watch/points (optional)")
103
+ p.add_argument(
104
+ "--auto-point",
105
+ action="store_true",
106
+ help="create a checkpoint automatically after changes are handled",
107
+ )
108
+ p.add_argument(
109
+ "--point-label",
110
+ help="label to use when auto-creating a checkpoint (default: watch-auto)",
111
+ )
76
112
  p.set_defaults(func=_handle_watch)
77
113
 
78
114
 
@@ -86,17 +122,43 @@ def _add_collect(sub):
86
122
  help="specific collectors to run (default: all enabled)",
87
123
  )
88
124
  p.add_argument(
89
- "--config", default=config.DEFAULT_MAIN_CONFIG, help="config file path"
125
+ "--config",
126
+ default=None,
127
+ help="config file path (default: auto-discover under %s)" % config.BASE_DIR,
90
128
  )
91
129
  p.set_defaults(func=_handle_collect)
92
130
 
131
+ def _add_point(sub):
132
+ p = sub.add_parser("point", help="create or list checkpoints for a pkg")
133
+ p.add_argument("--pkg", required=True, help="package identifier")
134
+ p.add_argument("--label", help="optional label for this point")
135
+ p.add_argument(
136
+ "--actions-run",
137
+ action="append",
138
+ dest="actions_run",
139
+ help="actions that were executed before creating this point",
140
+ )
141
+ p.add_argument(
142
+ "--list",
143
+ action="store_true",
144
+ help="list existing points instead of creating a new one",
145
+ )
146
+ p.add_argument(
147
+ "--config",
148
+ default=None,
149
+ help="config file path (default: auto-discover under %s)" % config.BASE_DIR,
150
+ )
151
+ p.set_defaults(func=_handle_point)
152
+
93
153
 
94
154
  def _add_export(sub):
95
155
  p = sub.add_parser("export", help="export pkg data (excel/word/etc)")
96
156
  p.add_argument("--pkg", required=True, help="package identifier")
97
157
  p.add_argument("--format", choices=["excel", "word", "json"], required=True)
98
158
  p.add_argument(
99
- "--config", default=config.DEFAULT_MAIN_CONFIG, help="config file path"
159
+ "--config",
160
+ default=None,
161
+ help="config file path (default: auto-discover under %s)" % config.BASE_DIR,
100
162
  )
101
163
  p.set_defaults(func=_handle_export)
102
164
 
@@ -105,17 +167,21 @@ def build_parser():
105
167
  if argparse is None:
106
168
  raise RuntimeError("argparse not available; install argparse")
107
169
  parser = argparse.ArgumentParser(prog="pkgmgr", description="Pkg manager CLI scaffold")
170
+ # keep %(prog)s for argparse's mapping and append package version
171
+ parser.add_argument("-V", "--version", action="version", version="%(prog)s " + __version__)
108
172
  sub = parser.add_subparsers(dest="command")
109
173
 
110
174
  _add_make_config(sub)
111
175
  _add_install(sub)
112
176
  _add_snapshot(sub)
113
177
  _add_create_pkg(sub)
178
+ _add_update_pkg(sub)
114
179
  _add_close_pkg(sub)
115
180
  _add_watch(sub)
116
181
  _add_collect(sub)
117
182
  _add_export(sub)
118
183
  _add_actions(sub)
184
+ _add_point(sub)
119
185
  return parser
120
186
 
121
187
 
@@ -125,9 +191,9 @@ def _handle_make_config(args):
125
191
 
126
192
 
127
193
  def _handle_install(args):
128
- cfg = config.load_main(config.DEFAULT_MAIN_CONFIG)
194
+ cfg = config.load_main(args.config)
129
195
  release.ensure_environment()
130
- snapshot.create_baseline(cfg)
196
+ snapshot.create_baseline(cfg, prompt_overwrite=True)
131
197
  return 0
132
198
 
133
199
 
@@ -142,6 +208,11 @@ def _handle_create_pkg(args):
142
208
  release.create_pkg(cfg, args.pkg_id)
143
209
  return 0
144
210
 
211
+ def _handle_update_pkg(args):
212
+ cfg = config.load_main(args.config)
213
+ release.update_pkg(cfg, args.pkg_id)
214
+ return 0
215
+
145
216
 
146
217
  def _handle_close_pkg(args):
147
218
  cfg = config.load_main(args.config)
@@ -151,7 +222,13 @@ def _handle_close_pkg(args):
151
222
 
152
223
  def _handle_watch(args):
153
224
  cfg = config.load_main(args.config)
154
- watch.run(cfg, run_once=args.once)
225
+ watch.run(
226
+ cfg,
227
+ run_once=args.once,
228
+ pkg_id=args.pkg,
229
+ auto_point=args.auto_point,
230
+ point_label=args.point_label,
231
+ )
155
232
  return 0
156
233
 
157
234
 
@@ -172,6 +249,14 @@ def _handle_actions(args):
172
249
  release.run_actions(cfg, args.names)
173
250
  return 0
174
251
 
252
+ def _handle_point(args):
253
+ cfg = config.load_main(args.config)
254
+ if args.list:
255
+ release.list_points(cfg, args.pkg)
256
+ return 0
257
+ release.create_point(cfg, args.pkg, label=args.label, actions_run=args.actions_run)
258
+ return 0
259
+
175
260
 
176
261
  def main(argv=None):
177
262
  argv = argv if argv is not None else sys.argv[1:]