Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
eli64s committed Dec 3, 2024
1 parent 73f5da9 commit 7a5b597
Show file tree
Hide file tree
Showing 193 changed files with 12,016 additions and 7,260 deletions.
83 changes: 38 additions & 45 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,70 +1,63 @@
# Build artifacts
# Build Artifacts
build/
dist/
*.egg-info/

# Compiled Python files
# Compiled Python Files
*.pyc
*.pyo
__pycache__/

# Virtual environment
.venv/
.env

# System-specific files
.DS_Store

# Temporary files
*~

# Logging
logs/
*.log

# Testing
noxfile.py
.nox/
.coverage
.coverage.*
coverage.xml
htmlcov/
tests/
setup/
scripts/
# Documentation and Markdown
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
docs/
examples/
mkdocs.yml
site

# Git
.github/
.git/
.github/
.gitignore

# Markdown
CODE_OF_CONDUCT.md
CONTRIBUTING.md
CHANGELOG.md

# Jupyter Notebook
.ipynb_checkpoints/
outputs/
notebooks/
outputs/

# VSCode workspace settings
.vscode/
# Logging
logs/
*.log

# Python Tools
# Python Tools and Caches
.mypy_cache/
.pytest_cache/
.ruff_cache/

# Mkdocs
.cache
docs/
examples/
mkdocs.yml
site
# System-Specific Files
.DS_Store

# Temporary Files
*~

# Testing
*coverage*
.nox/
.reports/
scripts/
setup/
tests/
noxfile.py

# Virtual Environment
.env
.venv/

# VSCode Workspace Settings
.vscode/

# Work In Progress (WIP)
readmeai/cli/commands_line.py
readmeai/cli/interactive.py
readmeai/config/settings/prompts
readmeai/config/settings/templates
readmeai/config/settings/.conf
119 changes: 119 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: CI/CD Pipeline

on:
push:
branches:
- main
pull_request:
release:
types: [created]

jobs:
deploy_mkdocs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Install Python using uv
run: uv python install 3.11
- name: Create virtual environment
run: uv venv install 3.11
- name: Activate virtual environment
run: source .venv/bin/activate

- name: Install dependencies
run: uv pip install -r pyproject.toml --all-extras

- name: Build the MkDocs site
working-directory: ./docs
run: uv run mkdocs build --site-dir ../site

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site

test_and_coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Install Python using uv
run: uv python install 3.11
- name: Create virtual environment
run: uv venv install 3.11
- name: Activate virtual environment
run: source .venv/bin/activate

- name: Install dependencies
run: uv pip install -r pyproject.toml --all-extras
- name: Run tests with coverage
run: |
uv run pytest -n auto --asyncio-mode=auto --cov=readmeai --cov-report=xml --cov-report=term-missing
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true

publish_to_pypi:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Install Python using uv
run: uv python install 3.11
- name: Install PyPI dependencies
run: uv pip install build twine
- name: Build and publish to PyPI
run: |
uv run python -m build
uv run python -m twine upload --skip-existing dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

build_and_push_docker:
name: Docker Hub build and push image
runs-on: ubuntu-latest
steps:
- name: Sleep for Docker Hub processing
run: |
echo "Sleeping for 30 seconds to ensure the PyPI package is available for installation"
sleep 30
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
push: true
tags: zeroxeli/readme-ai:latest
59 changes: 27 additions & 32 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,53 +1,48 @@
# Build artifacts
# Build Artifacts
*.egg-info/
build/
dist/
*.egg-info/

# Compiled Python files
# Compiled Python Files
*.pyc
*.pyo
__pycache__/

# Virtual environment
.venv/
.env

# System-specific files
.DS_Store

# Temporary files
*~

# Logging
logs/
*.log

# Testing
.nox/
.coverage
.coverage.*
coverage.xml
htmlcov/
# Documentation and MkDocs
.cache
site

# Jupyter Notebook
.ipynb_checkpoints/
outputs/
notebooks/

# VSCode workspace settings
.vscode/
# Logging
*.log
logs/

# Python Tools
.mypy_cache/
.pytest_cache/
.ruff_cache/

# Mkdocs
.cache
site
# System-Specific Files
.DS_Store

# Temporary Files
*~

# Testing
.nox/
.reports/
*coverage*

# Virtual Environment
.env
.venv/

# VSCode Workspace Settings
.vscode/

# Work In Progress (WIP)
readmeai/cli/commands_line.py
readmeai/cli/interactive.py
readmeai/config/settings/prompts
readmeai/config/settings/templates
readmeai/config/settings/.conf
32 changes: 16 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# https://pre-commit.com/

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-json
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-json
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
7 changes: 5 additions & 2 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ exclude = [
]
line-length = 79
indent-width = 4
target-version = "py310"
target-version = "py311"

[lint]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
extend-select = ["E501"]
extend-select = [
"E305", # 2 blank lines before class or function
"E501",
]
select = [
"ARG", # unused arguments
"B", # flake8-bugbear
Expand Down
Loading

0 comments on commit 7a5b597

Please sign in to comment.