Skip to content

Commit b01b30f

Browse files
committed
Initial commit - imported from private
0 parents  commit b01b30f

30 files changed

+2787
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto
2+
*.py text eol=lf

.github/workflows/release.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build-python:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Python
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: '3.9'
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install build
21+
- name: Build package
22+
run: python -m build
23+
- name: Publish to PyPI
24+
uses: pypa/gh-action-pypi-publish@release/v1
25+
with:
26+
password: ${{ secrets.PYPI_API_TOKEN }}
27+
28+
build-npm:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v3
32+
- uses: actions/setup-node@v3
33+
with:
34+
node-version: '16'
35+
registry-url: 'https://registry.npmjs.org'
36+
- run: npm publish
37+
env:
38+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
39+
40+
build-windows:
41+
runs-on: windows-latest
42+
steps:
43+
- uses: actions/checkout@v3
44+
- name: Build Windows installer
45+
run: |
46+
pip install pyinstaller
47+
pyinstaller --onefile --console --name gemini src/gemini_scanner.py
48+
- name: Upload Windows binary
49+
uses: actions/upload-artifact@v3
50+
with:
51+
name: windows-binary
52+
path: dist/gemini.exe
53+
54+
build-macos:
55+
runs-on: macos-latest
56+
steps:
57+
- uses: actions/checkout@v3
58+
- name: Build macOS binary
59+
run: |
60+
pip install pyinstaller
61+
pyinstaller --onefile --console --name gemini src/gemini_scanner.py
62+
- name: Upload macOS binary
63+
uses: actions/upload-artifact@v3
64+
with:
65+
name: macos-binary
66+
path: dist/gemini
67+
68+
build-linux:
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v3
72+
- name: Build Linux binary
73+
run: |
74+
pip install pyinstaller
75+
pyinstaller --onefile --console --name gemini src/gemini_scanner.py
76+
- name: Build Snap package
77+
uses: snapcore/action-build@v1
78+
- name: Upload Linux binary
79+
uses: actions/upload-artifact@v3
80+
with:
81+
name: linux-binary
82+
path: dist/gemini

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-latest]
15+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -r requirements.txt
29+
pip install -r requirements-dev.txt
30+
31+
- name: Run tests with pytest
32+
run: |
33+
pytest tests/ --cov=gemini_scanner --cov-report=xml
34+
35+
- name: Upload coverage to Codecov
36+
uses: codecov/codecov-action@v3
37+
with:
38+
file: ./coverage.xml
39+
flags: unittests
40+
name: codecov-umbrella

.gitignore

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.nox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
*.py,cover
48+
.hypothesis/
49+
.pytest_cache/
50+
cover/
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
local_settings.py
59+
db.sqlite3
60+
db.sqlite3-journal
61+
62+
# Flask stuff:
63+
instance/
64+
.webassets-cache
65+
66+
# Scrapy stuff:
67+
.scrapy
68+
69+
# Sphinx documentation
70+
docs/_build/
71+
72+
# PyBuilder
73+
.pybuilder/
74+
target/
75+
76+
# Jupyter Notebook
77+
.ipynb_checkpoints
78+
79+
# IPython
80+
profile_default/
81+
ipython_config.py
82+
83+
# pyenv
84+
.python-version
85+
86+
# pipenv
87+
Pipfile.lock
88+
89+
# poetry
90+
poetry.lock
91+
92+
# pdm
93+
.pdm.toml
94+
95+
# PEP 582
96+
__pypackages__/
97+
98+
# Celery stuff
99+
celerybeat-schedule
100+
celerybeat.pid
101+
102+
# SageMath parsed files
103+
*.sage.py
104+
105+
# Environments
106+
.env
107+
.venv
108+
env/
109+
venv/
110+
ENV/
111+
env.bak/
112+
venv.bak/
113+
114+
# Spyder project settings
115+
.spyderproject
116+
.spyproject
117+
118+
# Rope project settings
119+
.ropeproject
120+
121+
# mkdocs documentation
122+
/site
123+
124+
# mypy
125+
.mypy_cache/
126+
.dmypy.json
127+
dmypy.json
128+
129+
# Pyre type checker
130+
.pyre/
131+
132+
# pytype static type analyzer
133+
.pytype/
134+
135+
# Cython debug symbols
136+
cython_debug/
137+
138+
# VS Code
139+
.vscode/
140+
141+
# JetBrains
142+
.idea/
143+
144+
# macOS
145+
.DS_Store
146+
147+
# Windows
148+
Thumbs.db
149+
desktop.ini
150+
151+
# Project specific
152+
project_snapshot*.txt
153+
project_snapshot*.md
154+
*.mcp

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Your Name
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.

Makefile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.PHONY: install uninstall test clean build
2+
3+
PYTHON := python3
4+
PIP := pip3
5+
PREFIX := /usr/local
6+
BINDIR := $(PREFIX)/bin
7+
LIBDIR := $(PREFIX)/lib/codeprint
8+
9+
install:
10+
@echo "Installing CodePrint..."
11+
@$(PIP) install --user colorama pyperclip
12+
@mkdir -p $(LIBDIR)
13+
@cp -r src/* $(LIBDIR)/
14+
@echo '#!/bin/bash' > $(BINDIR)/gemini
15+
@echo 'exec $(PYTHON) $(LIBDIR)/codeprint.py "$$@"' >> $(BINDIR)/gemini
16+
@chmod +x $(BINDIR)/gemini
17+
@echo "✅ Installation complete! Run 'gemini --help' to get started."
18+
19+
uninstall:
20+
@echo "Uninstalling CodePrint..."
21+
@rm -rf $(LIBDIR)
22+
@rm -f $(BINDIR)/gemini
23+
@echo "✅ Uninstallation complete!"
24+
25+
test:
26+
@$(PYTHON) -m pytest tests/
27+
28+
clean:
29+
@find . -type d -name __pycache__ -exec rm -rf {} +
30+
@find . -type f -name "*.pyc" -delete
31+
@rm -rf build/ dist/ *.egg-info/
32+
33+
build:
34+
@$(PYTHON) setup.py sdist bdist_wheel

0 commit comments

Comments
 (0)