Initial Python project structure
This commit is contained in:
commit
a182c621f2
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
.env
|
||||
.venv/
|
||||
venv/
|
||||
*.egg-info/
|
||||
dist/
|
||||
build/
|
||||
.pytest_cache/
|
||||
.ruff_cache/
|
||||
22
README.md
Normal file
22
README.md
Normal file
@ -0,0 +1,22 @@
|
||||
# demo-app
|
||||
|
||||
A Python demo application.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
pip install -e ".[dev]"
|
||||
pytest
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
python -m demo_app.main
|
||||
```
|
||||
18
pyproject.toml
Normal file
18
pyproject.toml
Normal file
@ -0,0 +1,18 @@
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "demo-app"
|
||||
version = "0.1.0"
|
||||
description = "Python demo application"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
license = "MIT"
|
||||
dependencies = []
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pytest>=7.0",
|
||||
"ruff>=0.1.0",
|
||||
]
|
||||
3
src/demo_app/__init__.py
Normal file
3
src/demo_app/__init__.py
Normal file
@ -0,0 +1,3 @@
|
||||
"""Demo App - A Python demo application."""
|
||||
|
||||
__version__ = "0.1.0"
|
||||
10
src/demo_app/main.py
Normal file
10
src/demo_app/main.py
Normal file
@ -0,0 +1,10 @@
|
||||
"""Main entry point for demo-app."""
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Run the demo application."""
|
||||
print("Hello from demo-app!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
10
tests/test_main.py
Normal file
10
tests/test_main.py
Normal file
@ -0,0 +1,10 @@
|
||||
"""Tests for main module."""
|
||||
|
||||
from demo_app.main import main
|
||||
|
||||
|
||||
def test_main(capsys):
|
||||
"""Test main function output."""
|
||||
main()
|
||||
captured = capsys.readouterr()
|
||||
assert "Hello from demo-app!" in captured.out
|
||||
Loading…
Reference in New Issue
Block a user