Skip to content

Commit

Permalink
fix: 1.20.4 and beet v100+ (#38)
Browse files Browse the repository at this point in the history
* chore: update deps

* fix: select to query

* fix: select to query

* fix(crafter): version as meta argument

* fix: void query

* fix: lock file

---------

Co-authored-by: RitikShah <[email protected]>
  • Loading branch information
edayot and RitikShah authored Jan 3, 2024
1 parent db8b2be commit b1fdbf6
Show file tree
Hide file tree
Showing 6 changed files with 502 additions and 436 deletions.
914 changes: 486 additions & 428 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
mecha = "^0.73.0"
bolt = "^0.36.0"
mecha = "^0.86.0"
bolt = "^0.44.0"
bolt-expressions = "^0.12.2"
beet = "^0.100.0"
pydantic = "^2.5.3"
beet = ">=0.100.0"
pydantic = "^2.5.2"

[tool.poetry.group.dev.dependencies]
black = "^22.8.0"
Expand Down
1 change: 1 addition & 0 deletions smithed_libraries/packs/crafter/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ pipeline:
meta:
depends_on: # used for metadata
custom-block: "0.1.0"
minecraft_version: "1.20.4"
3 changes: 2 additions & 1 deletion smithed_libraries/plugins/crafter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@


def beet_default(ctx: Context):
minecraft_version = ctx.meta["minecraft_version"]
cache = ctx.cache["smithed_crafter"]

all_items_url = f"https://raw.githubusercontent.com/misode/mcmeta/{ctx.minecraft_version}-registries/item/data.json"
all_items_url = f"https://raw.githubusercontent.com/misode/mcmeta/{minecraft_version}-registries/item/data.json"
all_items = ItemTag(source_path=cache.download(all_items_url))
all_items.data = {"values": all_items.data}

Expand Down
5 changes: 4 additions & 1 deletion smithed_libraries/plugins/versioning/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def generate_api(ctx: Context):

opts = ctx.inject(Versioning).opts

for func, (_, path) in ctx.select(match=opts.api.match, extend=Function).items():
query = ctx.query(match=opts.api.match, extend=Function)
if not Function in query:
return
for (path, func) in query[Function].keys():
if func.lines and path is not None and PUBLIC_PAT.match(func.lines[0]):
generate_call(ctx, opts, path)
7 changes: 5 additions & 2 deletions smithed_libraries/plugins/versioning/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ def set_version(generate: Generator, opts: VersioningOptions):

def resolve_advancements(ctx: Context, opts: VersioningOptions):
"""Select packs that match refactor statement"""

for advancement in ctx.select(match=opts.refactor.match, extend=Advancement):

query = ctx.query(match=opts.refactor.match, extend=Advancement)
if not Advancement in query:
return
for (path, advancement) in query[Advancement].keys():
resolve_advancement(advancement, opts)


Expand Down

0 comments on commit b1fdbf6

Please sign in to comment.