Skip to content

Commit f8406aa

Browse files
committed
fix: allow reading pins with tags
1 parent 443e67d commit f8406aa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pins/meta.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import yaml
66

7-
from typing import Mapping, Union, Sequence, Optional
7+
from typing import Mapping, Union, Sequence, Optional, List
88

99
from .versions import VersionRaw, Version, guess_version
1010
from ._types import StrOrFile, IOBase
@@ -41,6 +41,8 @@ class Meta:
4141
A title for the pin.
4242
description:
4343
A detailed description of the pin contents.
44+
tags:
45+
Optional tags applied to the pin.
4446
created:
4547
Datetime the pin was created (TODO: document format).
4648
pin_hash:
@@ -82,6 +84,7 @@ class Meta:
8284
# pin_hash, created, etc.."
8385
version: VersionRaw
8486

87+
tags: Optional[List[str]] = None
8588
name: Optional[str] = None
8689
user: Mapping = field(default_factory=dict)
8790
local: Mapping = field(default_factory=dict)
@@ -98,6 +101,9 @@ def to_pin_dict(self):
98101
del d["version"]
99102
del d["local"]
100103

104+
# TODO: once tag writing is implemented, should keep tags field
105+
del d["tags"]
106+
101107
return d
102108

103109
@classmethod

0 commit comments

Comments
 (0)