Skip to content

Commit

Permalink
Typing
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonhardSchwertfeger committed Jan 24, 2025
1 parent 3183568 commit 2ae8b8a
Show file tree
Hide file tree
Showing 17 changed files with 213 additions and 169 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
rev: v0.9.2
hooks:
- id: ruff
args: [--fix, --preview, --exit-non-zero-on-fix]
Expand Down
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ test:
.PHONY: tests
tests: test

## retest Run only the tests that failed last time
##
.PHONY: retest
retest:
$(PYTHON) -m pytest $(PYTEST_OPTS) --lf $(TESTS)

## wip Run tests marked as wip
##
.PHONY: wip
Expand Down Expand Up @@ -89,10 +95,3 @@ html:

clean-docs:
rm -rf $(BUILDDIR)


## retest Run only the tests that failed last time
##
.PHONY: retest
retest:
$(PYTHON) -m pytest $(PYTEST_OPTS) --lf $(TESTS)
24 changes: 8 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GenAI-PoD: Your Command-Line Solution for AI Image Generation & Webshop Automation

> **Automate your entire print-on-demand workflow from AI-driven image creation
> **Automate your entire print-on-demand workflow, from AI-driven image creation
> to uploads on leading platforms like Spreadshirt & Redbubble.**
<div align="center">
Expand Down Expand Up @@ -88,23 +88,15 @@ popular print-on-demand (POD) platforms such as **Spreadshirt** and

## Installation

1. **Clone the Repository**

```bash
git clone https://github.com/LeonhardSchwertfeger/genai-pod.git
```

2. **Create a Virtual Environment (Recommended)**
```bash
python3 -m venv venv
source venv/bin/activate # Windows: .\venv\Scripts\activate

```bash
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
```
pip3 install genai-pod

3. **Install Dependencies** Install required Python packages:
```bash
pip install -e ".[dev,test]" # On Windows use `make dev`
```
# ... now you can use genai!
genai ...
```

## Prerequisites

Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"display_github": True,
"github_user": "LeonhardSchwertfeger",
"github_repo": "GenAI-PoD",
"github_version": "master/docs/",
"github_version": "master/doc/",
}
html_theme_options = {
"collapse_navigation": False,
Expand Down
18 changes: 7 additions & 11 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,17 @@ Prerequisites
Clone the Repository
--------------------

.. code-block:: bash
git clone https://github.com/LeonhardSchwertfeger/GenAI-PoD.git
Create a Virtual Environment (Recommended)
------------------------------------------
Create a Virtual Environment
----------------------------

.. code-block:: bash
python -m venv venv
source venv/bin/activate # On Windows use ``venv\\Scripts\\activate```
python3 -m venv venv
source venv/bin/activate # On Windows use .\venv\Scripts\activate
Install Optional Dependencies
-----------------------------
Install GenAI-PoD
-----------------

.. code-block:: bash
pip install -e ".[dev,test]"
pip install genai-pod
1 change: 1 addition & 0 deletions genai_pod/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2024
# Benjamin Thomas Schwertfeger https://github.com/btschwertfeger
Expand Down
13 changes: 3 additions & 10 deletions genai_pod/cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2024
# Benjamin Thomas Schwertfeger https://github.com/btschwertfeger
Expand All @@ -14,15 +15,7 @@
from typing import TYPE_CHECKING, Any

import click
from cloup import ( # type: ignore[import]
STRING,
Choice,
argument,
group,
option,
pass_context,
version_option,
)
from cloup import STRING, Choice, argument, group, option, pass_context, version_option

if TYPE_CHECKING:
from cloup import Context
Expand Down Expand Up @@ -77,7 +70,7 @@ def generate(ctx: Context, output_directory: str) -> None:
required=False,
)
@pass_context
def generategpt(ctx: Context, tor_binary_path) -> None:
def generategpt(ctx: Context, tor_binary_path: str | click.Path) -> None:
"""Use GPT to generate images via Selenium."""
from genai_pod.generators.generate_gpt import (
AbortScriptError,
Expand Down
1 change: 1 addition & 0 deletions genai_pod/generators/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2024
# Benjamin Thomas Schwertfeger https://github.com/btschwertfeger
Expand Down
Loading

0 comments on commit 2ae8b8a

Please sign in to comment.