Skip to content

Commit

Permalink
extra requirement file name tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Jan 1, 2024
1 parent 14eab53 commit 2600c0c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Image with extra python packages
Theses extra packages are collected from the [Plugin Catalogue](https://github.com/MCDReforged/PluginCatalogue),
covering almost all required packages of the plugins in the catalogue

See [requirements_common.txt](src/requirements_common.txt) for the full extra package list
See [requirements_extra.txt](src/requirements_extra.txt) for the full extra package list

```bash
mcdreforged/mcdreforged-extra:latest
Expand Down
10 changes: 5 additions & 5 deletions src/Dockerfile-extra
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

COPY requirements_common.txt /tmp/
COPY requirements_extra.txt /tmp/

RUN <<EOT
set -eux
Expand All @@ -12,13 +12,13 @@ if python3 -V 2>&1 | grep -q "3.12."; then
if ! command -v gcc &> /dev/null; then
# lz4 doesn't have prebuilt wheels for py3.12 yet
# https://github.com/python-lz4/python-lz4/issues/274
sed -i '/lz4/d' /tmp/requirements_common.txt
sed -i '/lz4/d' /tmp/requirements_extra.txt
fi
fi

pip freeze | grep mcdreforged >> /tmp/requirements_common.txt
pip3 install -r /tmp/requirements_common.txt
pip freeze | grep mcdreforged >> /tmp/requirements_extra.txt
pip3 install -r /tmp/requirements_extra.txt

rm -f /tmp/requirements_common.txt
rm -f /tmp/requirements_extra.txt
pip3 cache purge && rm -rf ~/.cache/
EOT
File renamed without changes.
4 changes: 2 additions & 2 deletions src/requirements_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ def add(pid: str, req_: str):
else:
print('Unknown requirement line {!r} for plugin {!r}'.format(req, plugin_id), file=sys.stderr)

with open('requirements_extra.json', 'r', encoding='utf8') as f:
with open('requirements_additional.json', 'r', encoding='utf8') as f:
for plugin_id, reqs in json.load(f).items():
for req in reqs:
add(plugin_id, req)

with open('requirements_common.txt', 'w', encoding='utf8') as f:
with open('requirements_extra.txt', 'w', encoding='utf8') as f:
for req in sorted_string(requirements.keys()):
plugins = ', '.join(sorted_string(requirements[req]))
f.write(f'# {plugins}\n')
Expand Down
File renamed without changes.

0 comments on commit 2600c0c

Please sign in to comment.