Matthew Martin β β
π on Nostr: #python versions ``` def version_from_metadata(package: str) -> str: return ...
#python versions
```
def version_from_metadata(package: str) -> str:
return metadata.version(package)
```
This works great until you switch lock files to `COPY src/* /app` in your dockerfile and now you are back to manually updating the `__version__` string by hand again.
Wait, did I write something to solve this recently?
https://pypi.org/project/metametameta/Published at
2024-02-06 01:43:19Event JSON
{
"id": "b1c138380ee5eeb78b1ddd86d921293ece10c75e6e096a043f5bfbf1d06041ba",
"pubkey": "ece51acfc6c84a5f625a755bed921f6eac6a9daa6f90817047901dbe0231522f",
"created_at": 1707183799,
"kind": 1,
"tags": [
[
"t",
"python"
],
[
"proxy",
"https://mastodon.social/users/mistersql/statuses/111881997456705211",
"activitypub"
]
],
"content": "#python versions\n\n```\ndef version_from_metadata(package: str) -\u003e str:\n return metadata.version(package)\n```\n\nThis works great until you switch lock files to `COPY src/* /app` in your dockerfile and now you are back to manually updating the `__version__` string by hand again.\n\nWait, did I write something to solve this recently?\n\nhttps://pypi.org/project/metametameta/",
"sig": "b0233572bb956d0341d5e6b195598cb14f5e6e367422c26b2d8876b9549a09ce6614cbd06adca1860da721904d0b80d722cbdba02d72522dfa8e022017caf13a"
}