|
2 | 2 |
|
3 | 3 | # This file is managed by `repo_helper`. Don't edit it directly. |
4 | 4 |
|
5 | | -# stdlib |
6 | | -import platform |
7 | | -import sys |
8 | | -from io import StringIO |
9 | | - |
10 | | -# 3rd party |
11 | | -import rst2txt |
12 | | -from docutils.core import publish_file |
13 | | - |
14 | 5 | # this package |
15 | 6 | from __pkginfo__ import * # pylint: disable=wildcard-import |
16 | 7 |
|
|
30 | 21 | all_requirements = {x.replace(" ", '') for x in set(all_requirements)} |
31 | 22 | requirements_block = "\n".join(f" - {req}" for req in all_requirements if req) |
32 | 23 |
|
33 | | -# txt_readme = publish_file(source=StringIO(long_description), writer=rst2txt.Writer()) |
34 | | -# description_block = "\n".join([line.replace('"', '\\"') for line in txt_readme.split("\n")]) |
35 | 24 | description_block = conda_description.replace('"', '\\"') |
36 | 25 |
|
37 | | -with open(recipe_dir / "meta.yaml", 'w') as fp: |
38 | | - fp.write(f"""{{% set name = "{pypi_name}" %}} |
39 | | -{{% set version = "{__version__}" %}} |
40 | | -
|
| 26 | +(recipe_dir / "meta.yaml").write_text( |
| 27 | + encoding="UTF-8", |
| 28 | + data=f"""\ |
41 | 29 | package: |
42 | | - name: "{{{{ name|lower }}}}" |
43 | | - version: "{{{{ version }}}}" |
| 30 | + name: "{pypi_name.lower()}" |
| 31 | + version: "{__version__}" |
44 | 32 |
|
45 | 33 | source: |
46 | | - url: "https://pypi.io/packages/source/{{{{ name[0] }}}}/{{{{ name }}}}/{{{{ name }}}}-{{{{ version }}}}.tar.gz" |
| 34 | + url: "https://pypi.io/packages/source/{pypi_name[0]}/{pypi_name}/{pypi_name}-{__version__}.tar.gz" |
47 | 35 |
|
48 | 36 | build: |
49 | 37 | # entry_points: |
|
74 | 62 | home: "{web}" |
75 | 63 | license: "{__license__}" |
76 | 64 | # license_family: LGPL |
77 | | - # license_file: requirements.txt |
| 65 | + # license_file: LICENSE |
78 | 66 | summary: "{short_desc}" |
79 | 67 | description: "{description_block}" |
80 | 68 | doc_url: {project_urls["Documentation"]} |
|
88 | 76 | """) |
89 | 77 |
|
90 | 78 | print(f"Wrote recipe to {recipe_dir / 'meta.yaml'}") |
91 | | -# |
92 | | -# plat = platform.system().lower() |
93 | | -# arch = platform.architecture()[0][:2] |
94 | | -# |
95 | | -# if plat == "linux": |
96 | | -# conda_arch = f"linux-{arch}" |
97 | | -# elif plat == "windows": |
98 | | -# conda_arch = f"win-{arch}" |
99 | | -# elif plat == "darwin": |
100 | | -# conda_arch = f"osx-{arch}" |
101 | | -# else: |
102 | | -# sys.exit(1) |
103 | | -# |
104 | | -# with open(recipe_dir / "conda_arch.sh", 'w') as fp: |
105 | | -# fp.write(f'#!/bin/bash\necho "{conda_arch}"') |
0 commit comments