https://github.com/tameronline/dichfoto
https://github.com/tameronline/dichfoto
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tameronline/dichfoto
- Owner: TamerOnLine
- License: mit
- Created: 2025-08-19T15:36:54.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-19T19:05:21.000Z (11 months ago)
- Last Synced: 2025-08-19T21:18:02.491Z (11 months ago)
- Language: Python
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pro_venv β Project Scaffold



A oneβshot Python project scaffold. It prepares the virtual environment, installs requirements, generates launch files, and configures VS Code β all from **the project root**.
---
## π Quick Start
> Run all commands from **the project root**.
```bash
# first-time setup
python pro_venv.py
# run your app later
python main.py
```
> You donβt need to activate `venv` manually β `main.py` re-executes inside your environment automatically.
---
## β¨ What does the script do?
- Creates or reads `setup-config.json` (project settings).
- Creates `venv/` and upgrades `pip`.
- Installs packages from `requirements.txt` (creates it if missing).
- Generates:
- `main.py` (a safe launcher that re-executes inside venv, then runs your file).
- `app.py` (a simple starter entry point you can replace).
- `.vscode/settings.json`, `.vscode/launch.json`, and `project.code-workspace`.
- `env-info.txt` (Python version + list of installed packages).
- (Optional) Generates a GitHub Actions workflow when using `--ci`.
---
## ποΈ Files & Expected Structure
```
.
βββ pro_venv.py
βββ setup-config.json
βββ requirements.txt
βββ main.py
βββ app.py
βββ env-info.txt
βββ venv/
βββ .vscode/
βββ settings.json
βββ launch.json
```
---
## βοΈ Configuration: `setup-config.json`
Default values created by the script:
```json
{
"project_name": "",
"main_file": "app.py",
"entry_point": "main.py",
"requirements_file": "requirements.txt",
"venv_dir": "venv",
"python_version": "3.12"
}
```
You can edit these after generation (e.g., change the main file or the venv folder name).
---
## π§ͺ GitHub Actions Integration (Optional)
To create a simple test workflow:
```bash
python pro_venv.py --ci create
```
This generates: `.github/workflows/test-pro_venv.yml`.
> Use `--ci force` to overwrite if the file already exists, and `--ci-python` to choose the Python version.
---
## β FAQ
**Do I need to activate the environment manually?**
No. `main.py` re-executes inside the environment, then runs `app.py`.
**Where should I run the script from?**
From the **project root**. If you enable the safety check at the end of the file, it blocks running from outside the root with a clear message.
**Where are VS Code settings saved?**
Inside `.vscode/` in the project. Itβs recommended to ignore these in Git because theyβre local settings.
---
## π§° Requirements
- Python 3.12 (or as configured in `setup-config.json`).
- Permission to create folders/files in the project root.
---
## π License
MIT β see `LICENSE`.