Skip to content

Commit 195cba5

Browse files
committed
v0.10.0
1 parent 5d4851a commit 195cba5

12 files changed

+175
-21
lines changed

.github/workflows/main.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Package Application with Pyinstaller
2+
on:
3+
push:
4+
branches: [ main ]
5+
# tags:
6+
# - 'v*'
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
- name: PyInstaller Linux
14+
uses: JackMcKew/pyinstaller-action-linux@0.1.4
15+
with:
16+
path: src
17+
spec: helmizer-linux-x86_64.spec
18+
- name: PyInstaller Windows
19+
uses: JackMcKew/pyinstaller-action-windows@v0.1.2
20+
with:
21+
path: src
22+
spec: helmizer-windows-x86_64.spec
23+
- name: Release
24+
uses: softprops/action-gh-release@v1
25+
# if: startsWith(github.ref, 'refs/tags/')
26+
with:
27+
draft: true
28+
prerelease: true
29+
# tag_name: pyinstaller
30+
fail_on_unmatched_files: true
31+
files: |
32+
src/dist/linux/helmizer-linux-x86_64
33+
src/dist/windows/helmizer-windows-x86_64.exe

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ repos:
2828
id: check-added-large-files
2929
- id: requirements-txt-fixer
3030
- id: check-ast
31-
repo: 'git://github.com/pre-commit/pre-commit-hooks'
32-
rev: v4.0.1
31+
repo: 'https://github.com/pre-commit/pre-commit-hooks'
32+
rev: v4.1.0
3333
- hooks:
3434
- id: black
3535
language_version: python3.9
3636
args:
3737
- --line-length
3838
- "140"
3939
repo: https://github.com/psf/black
40-
rev: 21.10b0
40+
rev: 21.12b0
4141
- repo: https://gitlab.com/pycqa/flake8
4242
rev: 3.9.2
4343
hooks:

.vscode/launch.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,18 @@
213213
"program": "${workspaceFolder}/src/helmizer.py",
214214
"request": "launch",
215215
"type": "python"
216+
},
217+
{
218+
"args": [
219+
"--debug",
220+
"/home/drew/Nextcloud/TECH/git/private/lab-k8s/flux/kustomize/helm/cert-manager/helmizer.yaml"
221+
],
222+
"console": "integratedTerminal",
223+
"cwd": "${workspaceFolder}",
224+
"name": "TEMP",
225+
"program": "${workspaceFolder}/src/helmizer.py",
226+
"request": "launch",
227+
"type": "python"
216228
}
217229
],
218230
"version": "0.2.0"

CHANGELOG.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
- [Changelog](#changelog)
4+
- [v0.10.0](#v0100)
45
- [v0.9.1](#v091)
56
- [v0.9.0](#v090)
67
- [v0.8.0](#v080)
@@ -14,6 +15,23 @@
1415

1516
---
1617

18+
## [v0.10.0](https://github.com/DaemonDude23/helmizer/releases/tag/v0.10.0)
19+
20+
January 21 2022
21+
22+
**Bugfixes**
23+
24+
- Fixed `helmizer.ignore` to optionally ignore directories recursively so that one doesn't have to enumerate each individual file path.
25+
26+
**Enhancements**
27+
28+
- Added CI for generating PyInstaller images for Linux and Windows.
29+
30+
**Housekeeping**
31+
32+
- `pre-commit` updates.
33+
- Tweaked `requirements`.
34+
1735
## [v0.9.1](https://github.com/DaemonDude23/helmizer/releases/tag/v0.9.1)
1836

1937
November 11 2021
@@ -31,7 +49,7 @@ November 7 2021
3149

3250
- Fixed exceptions when not including keys in helmizer.yaml, falling back to defaults if not defined.
3351

34-
**Enhancements:**
52+
**Enhancements**
3553

3654
- Added configuration support for **all** keys in a kustomization.
3755
- Standardized functions to return various data types depending on kustomization key structure
@@ -46,7 +64,7 @@ November 7 2021
4664

4765
June 10 2021
4866

49-
**Enhancements:**
67+
**Enhancements**
5068

5169
- Added configuration support for:
5270
- [`components`](https://kubectl.docs.kubernetes.io/guides/config_management/components/)

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,11 @@ sudo ln -s /absolute/path/to/src/helmizer.py /usr/local/bin/helmizer
171171
```
172172
2. Install dependencies:
173173
```bash
174+
# latest and greatest dependency versions
174175
pip3 install -U -r ./src/requirements.txt
175-
pip3 install -U -r ./src/requirements-newest.txt
176+
177+
# more flexible requirements
178+
pip3 install -U -r ./src/requirements-old.txt
176179
```
177180

178181
### virtualenv with pip

build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
set -e
44

55
TAG="${1}"
6-
#REGISTRY_URL="docker.pkg.github.com/DaeonDude23/helmizer/helmizer"
76
REGISTRY_URL="docker.k8s.home/daemondude23/helmizer/helmizer"
87

98
if [ $# -eq 0 ]; then

src/helmizer-linux-x86_64.spec

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
4+
block_cipher = None
5+
6+
7+
a = Analysis(['helmizer.py'],
8+
pathex=['./src/'],
9+
binaries=[],
10+
datas=[],
11+
hiddenimports=[],
12+
hookspath=[],
13+
runtime_hooks=[],
14+
excludes=[],
15+
win_no_prefer_redirects=False,
16+
win_private_assemblies=False,
17+
cipher=block_cipher,
18+
noarchive=False)
19+
pyz = PYZ(a.pure, a.zipped_data,
20+
cipher=block_cipher)
21+
22+
exe = EXE(pyz,
23+
a.scripts,
24+
a.binaries,
25+
a.zipfiles,
26+
a.datas,
27+
[],
28+
name='helmizer-linux-x86_64',
29+
debug=False,
30+
bootloader_ignore_signals=False,
31+
strip=False,
32+
upx=True,
33+
upx_exclude=[],
34+
runtime_tmpdir=None,
35+
console=True,
36+
disable_windowed_traceback=False,
37+
target_arch=None,
38+
codesign_identity=None,
39+
entitlements_file=None )

src/helmizer-windows-x86_64.spec

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
4+
block_cipher = None
5+
6+
7+
a = Analysis(['helmizer.py'],
8+
pathex=['./src/'],
9+
binaries=[],
10+
datas=[],
11+
hiddenimports=[],
12+
hookspath=[],
13+
runtime_hooks=[],
14+
excludes=[],
15+
win_no_prefer_redirects=False,
16+
win_private_assemblies=False,
17+
cipher=block_cipher,
18+
noarchive=False)
19+
pyz = PYZ(a.pure, a.zipped_data,
20+
cipher=block_cipher)
21+
22+
exe = EXE(pyz,
23+
a.scripts,
24+
a.binaries,
25+
a.zipfiles,
26+
a.datas,
27+
[],
28+
name='helmizer-windows-x86_64',
29+
debug=False,
30+
bootloader_ignore_signals=False,
31+
strip=False,
32+
upx=True,
33+
upx_exclude=[],
34+
runtime_tmpdir=None,
35+
console=True,
36+
disable_windowed_traceback=False,
37+
target_arch=None,
38+
codesign_identity=None,
39+
entitlements_file=None )

src/helmizer.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def sort_keys(self):
7676
pass
7777
logging.debug("keys sorted")
7878

79-
8079
def print_kustomization(self):
8180
try:
8281
print(yaml.dump(self.yaml, sort_keys=False))
@@ -174,20 +173,30 @@ def get_files(self, arguments, key):
174173
elif validate_url(str_child_path):
175174
list_target_paths.append(str_child_path)
176175

177-
# convert absolute paths into paths relative to the kustomization directory
178-
for final_target_path in list_target_paths:
179-
list_final_target_paths.append(path.relpath(final_target_path, str_kustomization_path))
180-
181176
# remove any ignored files
182177
try:
178+
# walk directory to remove multiple files
183179
for ignore in self.helmizer_config["helmizer"]["ignore"].get(list):
184-
logging.debug(f"Removing ignored file from final list: {ignore}")
185-
list_final_target_paths.remove(ignore)
180+
str_ignore_abspath = path.abspath(path.join(str_kustomization_path, ignore))
181+
if path.isdir(str_ignore_abspath):
182+
for (dirpath, _, filenames) in walk(str_ignore_abspath):
183+
for filename in filenames:
184+
file_path = path.join(dirpath, filename)
185+
logging.debug(f"Removing ignored file from final list: {file_path}")
186+
list_target_paths.remove(file_path)
187+
# remove a file
188+
else:
189+
logging.debug(f"Removing ignored file from final list: {path.join(str_kustomization_path, ignore)}")
190+
list_target_paths.remove(path.join(str_kustomization_path, ignore)) # just one file
186191
except ValueError:
187192
pass
188193
except NotFoundError:
189194
pass
190195

196+
# convert absolute paths into paths relative to the kustomization directory
197+
for final_target_path in list_target_paths:
198+
list_final_target_paths.append(path.relpath(final_target_path, str_kustomization_path))
199+
191200
return list_final_target_paths
192201

193202
except NotFoundError:

src/requirements-newest.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)