A simple Python package that prints 'Hello tofu'.
Project description
PyTofu
A simple Python package that prints "Hello tofu" via a console script.
Installation
pip install pytofu
Directory structure
pytofu/
├── .gitignore
├── .vscode/
│ ├── launch.json
│ └── settings.json
├── LICENSE
├── README.md
├── pyproject.toml
├── src/
│ └── pytofu/
│ └── __init__.py
└── tests/
└── test_hello.py
Files
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Python: PyTofu CLI",
"type": "debugpy",
"request": "launch",
"module": "pytofu",
"console": "integratedTerminal",
"justMyCode": true
}
]
}
settings.json
{
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": false,
"python.linting.mypyEnabled": true,
"python.formatting.provider": "black",
"editor.formatOnSave": true,
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
}
}
pyproject.toml
#### pyproject.toml
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "pytofu"
version = "0.1.0"
description = "A simple Python package that prints 'Hello tofu'."
readme = "README.md"
authors = [{ name = "Doe", email = "g41797l@gmail.com" }]
license = { file = "LICENSE" }
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
requires-python = ">=3.14"
[project.urls]
Homepage = "https://github.com/g41797l/pytofu"
Repository = "https://github.com/g41797l/pytofu.git"
Issues = "https://github.com/g41797l/pytofu/issues"
[project.scripts]
pytofu = "pytofu:main"
init.py
def main() -> None:
"""Entry point for the pytofu console script."""
print("Hello tofu")
if __name__ == "__main__":
main()
test_hello.py
from pytofu import main
from io import StringIO
import sys
def test_main(capsys):
"""Test that main prints 'Hello tofu'."""
main()
captured = capsys.readouterr()
assert captured.out.strip() == "Hello tofu"
Development
Open in VSCode for pre-configured settings (linting with mypy, formatting with black, testing with pytest). Install dev deps: pip install -e .[dev] (add [dev] extras in pyproject.toml if needed). Run tests: pytest
Publishing to PyPI
Update version in pyproject.toml.
Build: python -m build
Upload: twine upload dist/*
To test locally
pip install -e
pytofu
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytofu-0.1.0.tar.gz.
File metadata
- Download URL: pytofu-0.1.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9209aa484dedec1ab75904cea5e8a7180901434e8e670d2dcada0e08a13ef156
|
|
| MD5 |
67512fe1221ee2d8b00e0e81c9b4ff61
|
|
| BLAKE2b-256 |
4b614b0cb8ab37517843014a47d39a953ddf42972fd021e3cee626cbbb5479b8
|
File details
Details for the file pytofu-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pytofu-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be78cc2bf9182da4f6e34d7bee4f58ca8a5f15c2c34173a592c99ddb5b6941bb
|
|
| MD5 |
e06ee7ecd6beedfad09075706655f977
|
|
| BLAKE2b-256 |
1fdfc3dc886e4e24de414dfee3d1ba029330c3028b42ffd5defbd5d85c66336c
|