commit bb5169bf19283192898c982c4f5e62a428bb0218 Author: kazbo Date: Sun May 5 17:24:23 2024 +0900 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..59e0d00 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.venv/* +poetry.lock +__pycache__/ diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..d187b87 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,13 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type" : "debugpy", + "request": "launch", + "name": "Launch project", + "cwd": "${workspaceFolder}", + "module": "python-project-template", + //"args": ["run", "python", "-m", "python-project-template"], + } +] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3d48a45 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "terminal.integrated.enablePersistentSessions": true, + "python.terminal.activateEnvInCurrentTerminal": true, + "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python" +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..0d17498 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# python-project-template + +python project template for me. + +## Prerequisites: +- pyenv installed +- poetry 1.8 or newer installed with the specific pyenv environment you want to use + + +## Usage: +- clone this repository +- `poetry install` +- `poetry run python -m [python-project-template]` +- Also contains vscode configuration + + + +Please refer to the note below for details: + [pythonプロジェクトの実行方法 作り方](https://notes.kinoshita-lab.org/20240311211049-python%E3%81%AE%E3%83%97%E3%83%AD%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E6%A7%8B%E6%88%90) \ No newline at end of file diff --git a/poetry.toml b/poetry.toml new file mode 100644 index 0000000..ab1033b --- /dev/null +++ b/poetry.toml @@ -0,0 +1,2 @@ +[virtualenvs] +in-project = true diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..17fd75e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,16 @@ +[tool.poetry] +name = "python-project-template" +version = "0.1.0" +description = "template project for pyenv+poetry" +authors = ["Kaz Saita(raspi4) "] +license = "MIT" +readme = "README.md" +package-mode = false + +[tool.poetry.dependencies] +python = "^3.11" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/python-project-template/__init__.py b/python-project-template/__init__.py new file mode 100644 index 0000000..0bf6094 --- /dev/null +++ b/python-project-template/__init__.py @@ -0,0 +1,2 @@ +# +# empty file diff --git a/python-project-template/__main__.py b/python-project-template/__main__.py new file mode 100644 index 0000000..f50f024 --- /dev/null +++ b/python-project-template/__main__.py @@ -0,0 +1,7 @@ +# !/usr/bin/env python3 + +def main(): + print("Hello World!") + +if __name__ == '__main__': + main()