Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions recipes/python-taplo/0000-no-rust.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/pyproject.toml b/pyproject.toml
index 7619914..636c3dc 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[build-system]
-requires = ["maturin>=1.4"]
-build-backend = "maturin"
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"

[project]
name = "taplo"
@@ -22,7 +22,6 @@ classifiers = [
"Programming Language :: Rust",
"Topic :: Software Development :: Quality Assurance",
]
-dynamic = ["version"]

[tool.maturin]
bindings = "bin"
23 changes: 23 additions & 0 deletions recipes/python-taplo/patch_pyproject.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from pathlib import Path
import os
import sys

UTF8 = {"encoding": "utf-8"}
PPT = Path("pyproject.toml")
PKG_VERSION = os.environ["PKG_VERSION"]
NEW_PROJECT = f"""[project]
version = "{PKG_VERSION}"
"""

def main() -> int:
old_text = PPT.read_text(**UTF8)
new_text = old_text.replace("[project]", NEW_PROJECT)
print("-" * 80)
print(new_text)
print(f"new {PPT}")
print("-" * 80)
PPT.write_text(new_text, **UTF8)
return 0

if __name__ == "__main__":
sys.exit(main())
59 changes: 59 additions & 0 deletions recipes/python-taplo/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/prefix-dev/recipe-format/main/schema.json
schema_version: 1

context:
version: 0.9.3

package:
name: python-taplo
version: ${{ version }}

source:
- url: https://pypi.org/packages/source/t/taplo/taplo-${{ version }}.tar.gz
sha256: 6b73b45b9adbd20189d8981ac9055d5465227c58bbe1b0646a7588a1a5c07a1a
patches:
- 0000-no-rust.patch
- url: https://raw.githubusercontent.com/tamasfe/taplo/refs/tags/${{ version }}/LICENSE.md
sha256: 552604656340642782345c47dda89218136f141a25aaecdfd1501180841ff98b

build:
number: 0
noarch: python
script:
- python ${{ RECIPE_DIR }}/patch_pyproject.py
- ${{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation --disable-pip-version-check

requirements:
host:
- pip
- python ${{ python_min }}.*
# maturin is replaced with setuptools
- setuptools
run:
- python >=${{ python_min }}
- taplo ${{ version }}.*

tests:
- requirements:
run:
- pip
- python ${{ python_min }}.*
- if: win
then:
- m2-grep
script:
# provides no importable python name
- pip check
- taplo --version
- taplo --version | grep -iE "${{ version | replace('.', '\\.') }}"

about:
homepage: https://taplo.tamasfe.dev
license_file: LICENSE.md
license: MIT
summary: A CLI for Taplo TOML toolkit (for PyPI compatibility)
repository: https://github.com/tamasfe/taplo

extra:
recipe-maintainers:
- bollwyvl