3030 "https://raw.githubusercontent.com/spdx/license-list-data/refs/heads/main/"
3131 f"json/{ LICENSES .name } "
3232 ),
33- REAL_PIXI_SCHEMA : ("https://pixi.sh/v0.39.2 /schema/manifest/schema.json" ,),
33+ REAL_PIXI_SCHEMA : ("https://pixi.sh/v0.39.3 /schema/manifest/schema.json" ,),
3434}
3535
3636FALLBACKS : dict [Path , dict [str , Any ]] = {
@@ -292,6 +292,11 @@ def installer() -> Urljsf:
292292 "items" : {"$ref" : "#/definitions/a-pixi-package-def" },
293293 "minLength" : 1 ,
294294 },
295+ "icon" : {
296+ "description" : "an icon in SVG, PNG" ,
297+ "type" : "string" ,
298+ "format" : "data-url" ,
299+ },
295300 },
296301 "definitions" : {
297302 "a-subdir" : {"type" : "string" , "enum" : subdirs },
@@ -321,6 +326,7 @@ def installer() -> Urljsf:
321326 "platforms" ,
322327 "channels" ,
323328 "dependencies" ,
329+ "icon" ,
324330 ]
325331 },
326332 "channels" : {"items" : {"ui:options" : {"label" : False }}},
@@ -343,6 +349,11 @@ def installer() -> Urljsf:
343349 },
344350 }
345351 },
352+ "icon" : {
353+ "ui:options" : {
354+ "accept" : ".png,.svg" ,
355+ }
356+ },
346357 }
347358
348359 pixi_form_data = {
@@ -373,22 +384,32 @@ def installer() -> Urljsf:
373384
374385 toml_template = """
375386{% macro pixi_toml(p, schema=None) %}
387+
376388{% set deps = [] %}
389+
377390{% for dep in p.dependencies %}
378391 {% set e = dep.spec %}
379392 {% if dep.channel %}
380393 {% set e = {"version": dep.spec, "channel": dep.channel } %}
381394 {% endif %}
382395 {% set deps = (deps.push([dep.package, e]), deps) %}
383396{% endfor %}
397+
398+ {% set tool = {} %}
399+
400+ {% if data.pixi.icon %}
401+ {% set tool = {"icon": data.pixi.icon} %}
402+ {% endif %}
403+
384404{% set PT = {
385405 "project": {
386406 "name": p.name,
387407 "version": p.version,
388408 "platforms": p.platforms,
389409 "channels": p.channels
390410 },
391- "dependencies": (deps | from_entries)
411+ "dependencies": (deps | from_entries),
412+ "tool": tool
392413} | prune %}
393414{% if schema %}
394415{% for err in PT | schema_errors(schema) %}
@@ -417,24 +438,36 @@ def installer() -> Urljsf:
417438data:application/toml,{{ t | urlencode }}
418439```
419440
420-
421- _As a `.zip` archive (with a `.gitignore` file and `README.md` and
422- `pull_request_template.md`):_
441+ {%- set files = [
442+ ["pixi.toml", t],
443+ ["README.md", "# " ~ data.pixi.name],
444+ [".gitignore", ".pixi"],
445+ [".github", {
446+ "pull_request_template.md": [
447+ "thanks for contributing to " ~ data.pixi.name,
448+ {"level": 9}
449+ ]
450+ }]
451+ ] -%}
452+
453+ _As a `.zip` archive with:_
454+ - the `pixi.toml`
455+ - a `.gitignore` file
456+ - a `README.md`
457+ - a `.github/pull_request_template.md`
458+ {%- if data.pixi.icon -%}
459+ {%- set regExp = r/name=(.*?);/ -%}
460+ {%- set icon = data.pixi.icon | data_url_file -%}
461+ {%- set files = (files.push([icon, data.pixi.icon]), files) %}
462+ - `{{ icon }}`, an icon `{{ data.pixi.icon | data_url_mime }}` file)
463+ {%- endif %}
423464
424465```
425466{{
426- {
427- "pixi.toml": t,
428- "README.md": "# " ~ data.pixi.name,
429- ".gitignore": ".pixi",
430- ".github": {
431- "pull_request_template.md": [
432- "thanks for contributing to " ~ data.pixi.name,
433- {"level": 9}
434- ]
435- }
436- }
437- | to_zip_url(level=0)
467+ files
468+ | from_entries
469+ | prune
470+ | to_zip_url(level=0, name=data.pixi.name ~ ".zip")
438471}}
439472```
440473"""
0 commit comments