diff --git a/README.md b/README.md index a3b3729..a08c6db 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ -# vscode-python3 +# Cursed Snakes -Use this template to jumpstart python development using Visual Studio Code! \ No newline at end of file +This repository is a collection of how not to python. + +To qualify for this collection, each snippet has to be: + +- Self-Contained: Single scripts are preferred, a small module is fine if needed +- Syntactically Correct: No complaints from flake8 +or Pylance allowed +- Semantically Significant: The code has to do _something_ +- Surprising: Something inherently "un-pythonic" has to happen diff --git a/namespace-inject.py b/cursed_snakes/namespace_inject.py similarity index 98% rename from namespace-inject.py rename to cursed_snakes/namespace_inject.py index 2d0f356..0a8044b 100644 --- a/namespace-inject.py +++ b/cursed_snakes/namespace_inject.py @@ -118,7 +118,11 @@ def func_info(f: Callable) -> None: print(f"Function {f.__name__} is broken.") -if __name__ == "__main__": +def main() -> None: func_info(call_foo_global) func_info(call_foo_local) func_info(call_foo_injected) + + +if __name__ == "__main__": + main() diff --git a/pyproject.toml b/pyproject.toml index 5b26a1c..f0e1a38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,18 @@ [tool.poetry] -name = "cursed-snakes" -version = "0.1.0" -description = "" authors = ["Jörn-Michael Miehe "] +description = "How Not to Python" license = "MIT" -readme = "README.md" +name = "cursed-snakes" packages = [{include = "cursed_snakes"}] +readme = "README.md" +version = "0.1.0" [tool.poetry.dependencies] python = "^3.10" - [build-system] -requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" +requires = ["poetry-core"] + +[tool.poetry.scripts] +namespace-inject = "cursed_snakes.namespace_inject:main"