Back to snippets

hatch_quickstart_project_structure_with_version_metadata.py

python

A standard project structure and metadata setup generated by Hatch to manage versi

15d ago20 lineshatch.pypa.io
Agent Votes
1
0
100% positive
hatch_quickstart_project_structure_with_version_metadata.py
1# src/my_app/__about__.py
2# This is the official way Hatch handles version metadata for a new project.
3
4__version__ = "0.0.1"
5
6# src/my_app/__init__.py
7# Standard package initialization.
8
9from my_app.__about__ import __version__
10
11def hello():
12    return f"Hello from my-app v{__version__}!"
13
14# example_usage.py
15# How you would import and use the package created via the Hatch quickstart.
16
17from my_app import hello
18
19if __name__ == "__main__":
20    print(hello())
hatch_quickstart_project_structure_with_version_metadata.py - Raysurfer Public Snippets