Skip to content

Commit

Permalink
bugfix: fix missing tzinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
shabbywu committed Feb 9, 2022
1 parent 3cdc2d9 commit fac2be5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion moby_distribution/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from moby_distribution.spec.image_json import ImageJSON
from moby_distribution.spec.manifest import ManifestSchema1, ManifestSchema2, OCIManifestSchema1

__version__ = "0.4.3"
__version__ = "0.4.4"
__ALL__ = [
"DockerRegistryV2Client",
"Blob",
Expand Down
7 changes: 6 additions & 1 deletion moby_distribution/spec/image_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
from pydantic import BaseModel, Field


def default_created():
dt = datetime.datetime.utcnow()
return dt.replace(microsecond=0, tzinfo=datetime.timezone.utc)


class HealthConfig(BaseModel):
Test: List[str] = Field(
...,
Expand Down Expand Up @@ -68,7 +73,7 @@ class RootFS(BaseModel):


class History(BaseModel):
created: Optional[datetime.datetime] = Field(default_factory=datetime.datetime.utcnow)
created: Optional[datetime.datetime] = Field(default_factory=default_created)
author: Optional[str]
created_by: Optional[str]
comment: Optional[str]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "moby-distribution"
version = "0.4.3"
version = "0.4.4"
description = "Yet another moby(docker) distribution implement by python."
authors = ["shabbywu <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit fac2be5

Please sign in to comment.