Skip to content

Commit

Permalink
extra excludes blake3, lz4 in python3.13
Browse files Browse the repository at this point in the history
no prebuilt wheel yet, and they require rust / gcc environment to build
  • Loading branch information
Fallen-Breath committed Nov 13, 2024
1 parent bf3102e commit 46a22ce
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
6 changes: 0 additions & 6 deletions src/requirements_additional.json

This file was deleted.

12 changes: 9 additions & 3 deletions src/requirements_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ def add(pid: str, req_: str):
for req in release['meta'].get('requirements', []):
add(plugin_id, req)

with open('requirements_additional.json', 'r', encoding='utf8') as f:
for plugin_id, reqs in json.load(f).items():
with open('requirements_extra_config.json', 'r', encoding='utf8') as f:
extra_config: dict = json.load(f)
for plugin_id, reqs in extra_config['additional'].items():
for req in reqs:
add(plugin_id, req)
environment_markers: Dict[str, str] = extra_config['environment_markers']

with open('requirements_extra.txt', 'w', encoding='utf8') as f:
for req in sorted_string(requirements.keys()):
Expand All @@ -62,8 +64,12 @@ def add(pid: str, req_: str):
items.append('{} ({})'.format(rd.plugin_id, rd.requirement.replace(' ', '')))
comment = ', '.join(sorted_string(items))

req_line = req
if (em := environment_markers.get(req)) is not None:
req_line += '; ' + em

f.write(f'# {comment}\n')
f.write(f'{req}\n\n')
f.write(f'{req_line}\n\n')


if __name__ == '__main__':
Expand Down
4 changes: 2 additions & 2 deletions src/requirements_extra.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ asyncio
bilibili_api_python

# prime_backup
blake3
blake3; python_version < '3.13'

# chatbridge, pcrc
colorlog
Expand All @@ -44,7 +44,7 @@ jproperties
khl.py

# prime_backup
lz4
lz4; python_version < '3.13'

# matrix_sync (matrix-nio)
matrix_nio
Expand Down
12 changes: 12 additions & 0 deletions src/requirements_extra_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"additional": {
"prime_backup": [
"blake3",
"lz4"
]
},
"environment_markers": {
"blake3": "python_version < '3.13'",
"lz4": "python_version < '3.13'"
}
}

0 comments on commit 46a22ce

Please sign in to comment.