Skip to content

Commit f142680

Browse files
authored
Add the "source" key as option to hatch.version (SchemaStore#4581)
1 parent 439ae84 commit f142680

File tree

2 files changed

+19
-55
lines changed

2 files changed

+19
-55
lines changed

src/schemas/json/hatch.json

Lines changed: 16 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,16 @@
733733
}
734734
},
735735
"type": "string"
736+
},
737+
"source": {
738+
"title": "Source",
739+
"description": "A source to use for retrieving and updating the version.",
740+
"x-taplo": {
741+
"links": {
742+
"key": "https://hatch.pypa.io/latest/version/#configuration"
743+
}
744+
},
745+
"type": "string"
736746
}
737747
}
738748
},
@@ -801,65 +811,17 @@
801811
{
802812
"required": ["version"],
803813
"properties": {
804-
"build": {
805-
"type": "object",
806-
"properties": {
807-
"hooks": {
808-
"type": "object",
809-
"properties": {
810-
"vcs": {
811-
"x-taplo": {
812-
"links": {
813-
"key": "https://github.com/ofek/hatch-vcs#build-hook"
814-
}
815-
},
816-
"type": "object",
817-
"properties": {
818-
"version-file": { "type": "string" }
819-
}
820-
}
821-
}
822-
}
823-
}
824-
},
825-
"metadata": {
826-
"type": "object",
827-
"properties": {
828-
"hooks": {
829-
"type": "object",
830-
"properties": {
831-
"vcs": {
832-
"x-taplo": {
833-
"links": {
834-
"key": "https://github.com/ofek/hatch-vcs#metadata-hook"
835-
}
836-
},
837-
"type": "object",
838-
"properties": {
839-
"urls": {
840-
"type": "object",
841-
"additionalProperties": {
842-
"type": "string"
843-
}
844-
}
845-
}
846-
}
847-
}
848-
}
849-
}
850-
},
851814
"version": {
852815
"x-taplo": {
853816
"links": {
854-
"key": "https://github.com/ofek/hatch-vcs"
817+
"key": "https://hatch.pypa.io/latest/version/"
855818
}
856819
},
857820
"type": "object",
858-
"required": ["source"],
821+
"required": ["path"],
859822
"properties": {
860-
"source": {
861-
"const": "vcs"
862-
}
823+
"path": { "type": "string" },
824+
"pattern": { "type": "string" }
863825
}
864826
}
865827
}
@@ -874,10 +836,9 @@
874836
}
875837
},
876838
"type": "object",
877-
"required": ["path"],
839+
"required": ["source"],
878840
"properties": {
879-
"path": { "type": "string" },
880-
"pattern": { "type": "string" }
841+
"source": { "type": "string" }
881842
}
882843
}
883844
}

src/test/hatch/version-source.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#:schema ../../schemas/json/hatch.json
2+
[version]
3+
source = "uv-dynamic-versioning"

0 commit comments

Comments
 (0)