Skip to content

Commit ca93171

Browse files
committed
Dual-Licensing Update
1 parent 72f183a commit ca93171

File tree

79 files changed

+801
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+801
-202
lines changed

.(φ)/test.φ

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# (φ) .(φ)/test.φ
2+
# Copyright 2025 Baleine Jay
3+
# Licensed under the PhiCode Non-Commercial License (https://banes-lab.com/licensing)
4+
# Commercial use requires a paid license. See link for details.
25
#!/usr/bin/env python3
36
"""
47
Comprehensive Rust Acceleration Stress Test

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
ignore:
8+
- dependency-name: "xxhash"
9+
- dependency-name: "regex"
10+
open-pull-requests-limit: 5
11+
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"

.github/workflows/release.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Release phicode
2+
3+
on:
4+
push:
5+
tags: [ 'v*' ]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
test:
12+
runs-on: windows-latest
13+
strategy:
14+
matrix:
15+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install dependencies
27+
shell: pwsh
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install .[utility] # Install your package with extras
31+
python -m pip install pytest
32+
33+
- name: Run tests
34+
shell: pwsh
35+
run: |
36+
python -m pytest -v
37+
38+
build-and-publish:
39+
needs: test
40+
runs-on: windows-latest
41+
environment: release
42+
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v4
46+
47+
- name: Set up Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: "3.12"
51+
52+
- name: Install build dependencies
53+
shell: pwsh
54+
run: |
55+
python -m pip install --upgrade pip build twine
56+
57+
- name: Build package
58+
shell: pwsh
59+
run: |
60+
python -m build
61+
62+
- name: Verify package
63+
shell: pwsh
64+
run: |
65+
python -m twine check dist/*
66+
67+
- name: Publish to PyPI
68+
shell: pwsh
69+
run: |
70+
python -m twine upload --verbose dist/*
71+
env:
72+
TWINE_USERNAME: __token__
73+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
74+
75+
- name: Upload distributions as artifact
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: python-package-windows
79+
path: dist/*
80+
81+
create-github-release:
82+
needs: build-and-publish
83+
runs-on: windows-latest
84+
permissions:
85+
contents: write
86+
87+
steps:
88+
- name: Download build artifacts
89+
uses: actions/download-artifact@v4
90+
with:
91+
name: python-package-windows
92+
path: dist/
93+
94+
- name: Create GitHub Release
95+
uses: softprops/action-gh-release@v1
96+
with:
97+
files: dist/*
98+
generate_release_notes: true
99+
env:
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,3 +441,9 @@ release.bat
441441
2.content_extract.py
442442
install.bat
443443
install.bat
444+
/.GENERATIONS
445+
.(φ)/test.φ
446+
LICENSE-COMMERCIAL
447+
README-NEW.md
448+
PROJECT_ANALYSIS.md
449+
/rust_scripts

1.project_tree.py

Lines changed: 122 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,133 @@
1+
# Copyright 2025 Baleine Jay
2+
# Licensed under the Phicode Non-Commercial License (https://banes-lab.com/licensing)
3+
# Commercial use requires a paid license. See link for details.
14
import os
25

3-
def save_tree_structure(include_paths, exclude_specifics=None, output_file='PROJECT_TREE.md'):
4-
file_emojis = {
5-
'.py': '🐍',
6-
'.js': '📜',
7-
'.json': '🔧',
8-
'.txt': '📄',
9-
'.md': '📝',
10-
'.html': '🌐',
11-
'.css': '🎨',
12-
'.jpg': '🖼️',
13-
'.jpeg': '🖼️',
14-
'.png': '🖼️',
15-
'.gif': '🖼️',
16-
'.ico': '🖼️',
17-
'.mp3': '🎵',
18-
'.wav': '🎵',
19-
'.mp4': '🎞️',
20-
'.pdf': '📕',
21-
'.gdoc': '🗄️',
22-
'.xlsx': '🧮',
23-
'.psd': '🖌️',
24-
'.φ': '🔱',
25-
'.agent': '🤖',
26-
'.vsix': '🔌',
27-
}
28-
29-
def get_file_emoji(filename):
30-
filename_lower = filename.lower()
31-
32-
text_mapping = {
33-
'readme': '📘',
34-
'license': '⚖️',
35-
'receipt': '🧾',
36-
'faq': '❓',
37-
'rules': '📖',
38-
'invitation': '💌',
39-
'agenda': '📅',
40-
'analytics': '📈',
41-
'brainstorming': '🧠',
42-
'insights': '🔎',
43-
'guidelines': 'ℹ️',
44-
'tools': '🛠️',
45-
'sponsor': '💵',
46-
'finished': '✅',
47-
'bot': '🤖',
48-
'data': '📊',
49-
}
50-
51-
for pattern, emoji in text_mapping.items():
52-
if pattern in filename_lower:
53-
return emoji
54-
55-
ext = os.path.splitext(filename)[1].lower()
56-
return file_emojis.get(ext, '📄')
57-
58-
def should_exclude(path):
59-
for excl in exclude_specifics:
60-
if excl in path:
61-
return True
62-
return False
63-
64-
def walk_directory(directory, depth=0, prefix=''):
65-
if should_exclude(directory):
66-
return []
67-
68-
tree_lines = []
69-
try:
70-
entries = os.listdir(directory)
71-
except PermissionError:
72-
return [f"{prefix}└─ 🔒 [Permission Denied: {os.path.basename(directory)}]"]
73-
74-
entries = [entry for entry in entries if not should_exclude(os.path.join(directory, entry))]
75-
total_entries = len(entries)
76-
77-
for idx, entry in enumerate(entries):
78-
full_path = os.path.join(directory, entry)
79-
is_last = idx == total_entries - 1
80-
symbol = '└─' if is_last else '├─'
81-
new_prefix = prefix + (' ' if is_last else '│ ')
82-
83-
if os.path.isdir(full_path):
84-
emoji = '📂'
85-
tree_lines.append(f'{prefix}{symbol} {emoji} {entry}')
86-
tree_lines.extend(walk_directory(full_path, depth + 1, new_prefix))
87-
else:
88-
emoji = get_file_emoji(entry)
89-
tree_lines.append(f'{prefix}{symbol} {emoji} {entry}')
90-
91-
return tree_lines
92-
93-
all_tree_lines = []
94-
for path in include_paths:
95-
if should_exclude(path):
96-
continue
97-
98-
if os.path.isfile(path):
99-
emoji = get_file_emoji(os.path.basename(path))
100-
all_tree_lines.append(f'{emoji} {os.path.basename(path)}')
101-
elif os.path.isdir(path):
102-
dir_name = os.path.basename(path.rstrip(os.sep))
103-
all_tree_lines.append(f'📂 {dir_name}')
104-
all_tree_lines.extend(walk_directory(path))
6+
SEPARATE_FILES = True
7+
INCLUDE_PATHS = ['src', 'pyproject.toml', 'README.md', 'LICENSE', '.pypirc', '.φc']
8+
EXCLUDE_PATTERNS = ['phicode.egg-info', '__pycache__', '.(φ)cache']
9+
OUTPUT_DIR = '.GENERATIONS'
10+
OUTPUT_FILE = 'PROJECT_TREE.md'
11+
12+
FILE_EMOJIS = {
13+
'.py': '🐍', '.js': '📜', '.json': '🔧', '.txt': '📄', '.md': '📝', '.html': '🌐',
14+
'.css': '🎨', '.jpg': '🖼️', '.jpeg': '🖼️', '.png': '🖼️', '.gif': '🖼️', '.ico': '🖼️',
15+
'.mp3': '🎵', '.wav': '🎵', '.mp4': '🎞️', '.pdf': '📕', '.gdoc': '🗄️', '.xlsx': '🧮',
16+
'.psd': '🖌️', '.φ': '🔱', '.agent': '🤖', '.vsix': '🔌',
17+
}
18+
19+
TEXT_PATTERNS = {
20+
'readme': '📘', 'license': '⚖️', 'receipt': '🧾', 'faq': '❓', 'rules': '📖',
21+
'invitation': '💌', 'agenda': '📅', 'analytics': '📈', 'brainstorming': '🧠',
22+
'insights': '🔎', 'guidelines': 'ℹ️', 'tools': '🛠️', 'sponsor': '💵',
23+
'finished': '✅', 'bot': '🤖', 'data': '📊',
24+
}
25+
26+
def get_emoji(filename):
27+
filename_lower = filename.lower()
28+
for pattern, emoji in TEXT_PATTERNS.items():
29+
if pattern in filename_lower:
30+
return emoji
31+
return FILE_EMOJIS.get(os.path.splitext(filename)[1].lower(), '📄')
32+
33+
def should_exclude(path):
34+
return any(excl in path for excl in EXCLUDE_PATTERNS)
35+
36+
def build_tree(directory, prefix=''):
37+
if should_exclude(directory):
38+
return []
39+
40+
try:
41+
entries = [e for e in os.listdir(directory) if not should_exclude(os.path.join(directory, e))]
42+
except PermissionError:
43+
return [f"{prefix}└─ 🔒 [Permission Denied: {os.path.basename(directory)}]"]
44+
45+
lines = []
46+
for i, entry in enumerate(entries):
47+
full_path = os.path.join(directory, entry)
48+
is_last = i == len(entries) - 1
49+
symbol = '└─' if is_last else '├─'
50+
new_prefix = prefix + (' ' if is_last else '│ ')
51+
52+
if os.path.isdir(full_path):
53+
lines.append(f'{prefix}{symbol} 📂 {entry}')
54+
lines.extend(build_tree(full_path, new_prefix))
10555
else:
106-
all_tree_lines.append(f'❓ [Not found: {path}]')
56+
lines.append(f'{prefix}{symbol} {get_emoji(entry)} {entry}')
10757

108-
markdown_output = """<img src="https://banes-lab.com/assets/images/banes_lab/700px_Main_Animated.gif" width="70" />
58+
return lines
10959

110-
## 📂 Project Structure
111-
```\n""" + '\n'.join(all_tree_lines) + '\n```'
60+
def create_markdown(lines, title="Project Structure"):
61+
return f'''<img src="https://banes-lab.com/assets/images/banes_lab/700px_Main_Animated.gif" width="70" />
11262
113-
with open(output_file, 'w', encoding='utf-8') as f:
114-
f.write(markdown_output)
63+
## 📂 {title}
64+
```
65+
{chr(10).join(lines)}
66+
```'''
11567

116-
print(f'Folder structure has been saved to {output_file}')
68+
def save_file(content, filename):
69+
output_path = os.path.join(OUTPUT_DIR, filename) if SEPARATE_FILES else filename
11770

71+
if SEPARATE_FILES:
72+
os.makedirs(OUTPUT_DIR, exist_ok=True)
11873

119-
if __name__ == '__main__':
120-
include_paths = [
121-
'src', 'pyproject.toml', 'README.md', 'LICENSE', '.pypirc', '.φc'
74+
with open(output_path, 'w', encoding='utf-8') as f:
75+
f.write(content)
76+
print(f'Structure saved to {output_path}')
12277

123-
]
78+
def process_all_subfolders(directory, parent_name=""):
79+
if should_exclude(directory):
80+
return
12481

125-
exclude_specifics = [
126-
'phicode.egg-info', '__pycache__', '.(φ)cache'
127-
]
128-
save_tree_structure(include_paths, exclude_specifics)
82+
dir_name = os.path.basename(directory.rstrip(os.sep))
83+
full_name = f"{parent_name}_{dir_name}" if parent_name else dir_name
84+
85+
lines = [f'📂 {dir_name}'] + build_tree(directory)
86+
content = create_markdown(lines, f"Folder: {directory}")
87+
save_file(content, f'Folder_{full_name}.md')
88+
89+
try:
90+
for entry in os.listdir(directory):
91+
full_path = os.path.join(directory, entry)
92+
if os.path.isdir(full_path) and not should_exclude(full_path):
93+
process_all_subfolders(full_path, full_name)
94+
except PermissionError:
95+
pass
96+
97+
def main():
98+
if SEPARATE_FILES:
99+
for path in INCLUDE_PATHS:
100+
if should_exclude(path):
101+
continue
102+
103+
if os.path.isfile(path):
104+
lines = [f'{get_emoji(os.path.basename(path))} {os.path.basename(path)}']
105+
content = create_markdown(lines, f"File: {os.path.basename(path)}")
106+
base_name = os.path.splitext(os.path.basename(path))[0]
107+
save_file(content, f'File_{base_name}.md')
108+
elif os.path.isdir(path):
109+
process_all_subfolders(path)
110+
else:
111+
lines = [f'❓ [Not found: {path}]']
112+
content = create_markdown(lines, f"Not Found: {path}")
113+
save_file(content, f'NotFound_{os.path.basename(path)}.md')
114+
else:
115+
all_lines = []
116+
for path in INCLUDE_PATHS:
117+
if should_exclude(path):
118+
continue
119+
120+
if os.path.isfile(path):
121+
all_lines.append(f'{get_emoji(os.path.basename(path))} {os.path.basename(path)}')
122+
elif os.path.isdir(path):
123+
dir_name = os.path.basename(path.rstrip(os.sep))
124+
all_lines.append(f'📂 {dir_name}')
125+
all_lines.extend(build_tree(path))
126+
else:
127+
all_lines.append(f'❓ [Not found: {path}]')
128+
129+
content = create_markdown(all_lines)
130+
save_file(content, OUTPUT_FILE)
131+
132+
if __name__ == '__main__':
133+
main()

0 commit comments

Comments
 (0)