From 5fe45229fbb0fb66bed1ebb290203b7d3a753c67 Mon Sep 17 00:00:00 2001 From: Robin Avery Date: Tue, 20 Feb 2024 22:49:07 -0500 Subject: [PATCH] Split Python requirements into separate files --- .github/README.md | 2 +- .github/packages/build-linux/Dockerfile | 2 +- .github/packages/gen-pages/entrypoint.sh | 2 +- .github/packages/gen-pages/setup.sh | 2 +- reqs/build.in | 1 + reqs/build.txt | 16 ++++++++++++++++ reqs/decomp.in | 6 ++++++ reqs/decomp.txt | 22 ++++++++++++++++++++++ reqs/dev.in | 2 ++ reqs/dev.txt | 20 ++++++++++++++++++++ reqs/diff.in | 3 +++ reqs/diff.txt | 10 ++++++++++ reqs/gen-pages.in | 1 + reqs/gen-pages.txt | 8 ++++++++ reqs/misc.in | 1 + reqs/misc.txt | 12 ++++++++++++ requirements.in | 14 -------------- requirements.txt | 8 +------- 18 files changed, 107 insertions(+), 25 deletions(-) create mode 100644 reqs/build.in create mode 100644 reqs/build.txt create mode 100644 reqs/decomp.in create mode 100644 reqs/decomp.txt create mode 100644 reqs/dev.in create mode 100644 reqs/dev.txt create mode 100644 reqs/diff.in create mode 100644 reqs/diff.txt create mode 100644 reqs/gen-pages.in create mode 100644 reqs/gen-pages.txt create mode 100644 reqs/misc.in create mode 100644 reqs/misc.txt delete mode 100644 requirements.in diff --git a/.github/README.md b/.github/README.md index 84eeb57d36..20c54ac04a 100644 --- a/.github/README.md +++ b/.github/README.md @@ -83,7 +83,7 @@ We use Python for our command line tooling. It is recommended that you use a [vi ``` 1. After that, you can install or update our packages with: ```sh - pip install -r requirements.txt + pip install -r reqs/decomp.txt ``` 1. Now you can run `decomp.py` to decomp a function using [m2c](https://github.com/matt-kempster/m2c). Pass it `-h` to see all the options. ```sh diff --git a/.github/packages/build-linux/Dockerfile b/.github/packages/build-linux/Dockerfile index ebbab5688c..8375d18a1f 100644 --- a/.github/packages/build-linux/Dockerfile +++ b/.github/packages/build-linux/Dockerfile @@ -3,7 +3,6 @@ ARG WIBO_PATH="/usr/local/sbin/wibo" COPY --from=ghcr.io/decompals/wibo:latest \ ${WIBO_PATH} \ ${WIBO_PATH} -COPY requirements.txt /tmp/ ARG DEVKITPRO=/opt/devkitpro ARG DEVKITPPC=${DEVKITPRO}/devkitPPC ENV DEBIAN_FRONTEND=noninteractive @@ -30,6 +29,7 @@ ENTRYPOINT entrypoint.sh FROM linux-rw AS gen-pages COPY .github/packages/gen-pages/setup.sh /usr/local/bin COPY tools/progress-site/package*.json /tmp +COPY /reqs/gen-pages.txt /tmp/reqs/ RUN setup.sh COPY .github/packages/gen-pages/entrypoint.sh /usr/local/bin ENTRYPOINT entrypoint.sh diff --git a/.github/packages/gen-pages/entrypoint.sh b/.github/packages/gen-pages/entrypoint.sh index b5242d8c44..4bd213a2c2 100755 --- a/.github/packages/gen-pages/entrypoint.sh +++ b/.github/packages/gen-pages/entrypoint.sh @@ -7,7 +7,7 @@ ln -s /opt/mwcc_compiler tools/ cp -R /opt/venv .venv . .venv/bin/activate -pip install --no-cache-dir -r requirements.txt +pip install --no-cache-dir -r reqs/gen-pages.txt touch /output/.nojekyll diff --git a/.github/packages/gen-pages/setup.sh b/.github/packages/gen-pages/setup.sh index 5ac8c97309..db3b636d15 100755 --- a/.github/packages/gen-pages/setup.sh +++ b/.github/packages/gen-pages/setup.sh @@ -46,7 +46,7 @@ popd # Create and update Python venv python -m venv --upgrade-deps /opt/venv . /opt/venv/bin/activate -pip install --no-cache-dir -r /tmp/requirements.txt +pip install --no-cache-dir -r /tmp/reqs/gen-pages.txt # Install melee compiler (for checking ctx.c) curl -L "$MELEE_COMPILERS_URL" | diff --git a/reqs/build.in b/reqs/build.in new file mode 100644 index 0000000000..f2293605cf --- /dev/null +++ b/reqs/build.in @@ -0,0 +1 @@ +requests diff --git a/reqs/build.txt b/reqs/build.txt new file mode 100644 index 0000000000..0a5ac2eb5d --- /dev/null +++ b/reqs/build.txt @@ -0,0 +1,16 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# pip-compile reqs/build.in +# +certifi==2024.2.2 + # via requests +charset-normalizer==3.3.2 + # via requests +idna==3.6 + # via requests +requests==2.31.0 + # via -r reqs/build.in +urllib3==2.2.1 + # via requests diff --git a/reqs/decomp.in b/reqs/decomp.in new file mode 100644 index 0000000000..4999f64ce0 --- /dev/null +++ b/reqs/decomp.in @@ -0,0 +1,6 @@ +colorama +git+https://github.com/matt-kempster/m2c.git +pcpp +pyperclip +Pygments +pyelftools diff --git a/reqs/decomp.txt b/reqs/decomp.txt new file mode 100644 index 0000000000..af779d6be4 --- /dev/null +++ b/reqs/decomp.txt @@ -0,0 +1,22 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# pip-compile reqs/decomp.in +# +colorama==0.4.6 + # via -r reqs/decomp.in +graphviz==0.20.1 + # via m2c +m2c @ git+https://github.com/matt-kempster/m2c.git + # via -r reqs/decomp.in +pcpp==1.30 + # via -r reqs/decomp.in +pycparser==2.21 + # via m2c +pyelftools==0.30 + # via -r reqs/decomp.in +pygments==2.17.2 + # via -r reqs/decomp.in +pyperclip==1.8.2 + # via -r reqs/decomp.in diff --git a/reqs/dev.in b/reqs/dev.in new file mode 100644 index 0000000000..7559a405a0 --- /dev/null +++ b/reqs/dev.in @@ -0,0 +1,2 @@ +black +isort diff --git a/reqs/dev.txt b/reqs/dev.txt new file mode 100644 index 0000000000..26fc645756 --- /dev/null +++ b/reqs/dev.txt @@ -0,0 +1,20 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# pip-compile reqs/dev.in +# +black==24.2.0 + # via -r reqs/dev.in +click==8.1.7 + # via black +isort==5.13.2 + # via -r reqs/dev.in +mypy-extensions==1.0.0 + # via black +packaging==23.2 + # via black +pathspec==0.12.1 + # via black +platformdirs==4.2.0 + # via black diff --git a/reqs/diff.in b/reqs/diff.in new file mode 100644 index 0000000000..79208c8042 --- /dev/null +++ b/reqs/diff.in @@ -0,0 +1,3 @@ +# TODO -e file:tools/asm-differ#egg=asm-differ +humanfriendly +argcomplete diff --git a/reqs/diff.txt b/reqs/diff.txt new file mode 100644 index 0000000000..8ccfebfde3 --- /dev/null +++ b/reqs/diff.txt @@ -0,0 +1,10 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# pip-compile reqs/diff.in +# +argcomplete==3.2.2 + # via -r reqs/diff.in +humanfriendly==10.0 + # via -r reqs/diff.in diff --git a/reqs/gen-pages.in b/reqs/gen-pages.in new file mode 100644 index 0000000000..9ef770fdbe --- /dev/null +++ b/reqs/gen-pages.in @@ -0,0 +1 @@ +pcpp diff --git a/reqs/gen-pages.txt b/reqs/gen-pages.txt new file mode 100644 index 0000000000..0d2796c566 --- /dev/null +++ b/reqs/gen-pages.txt @@ -0,0 +1,8 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# pip-compile reqs/gen-pages.in +# +pcpp==1.30 + # via -r reqs/gen-pages.in diff --git a/reqs/misc.in b/reqs/misc.in new file mode 100644 index 0000000000..64b1adaeeb --- /dev/null +++ b/reqs/misc.in @@ -0,0 +1 @@ +GitPython diff --git a/reqs/misc.txt b/reqs/misc.txt new file mode 100644 index 0000000000..34cf5facfe --- /dev/null +++ b/reqs/misc.txt @@ -0,0 +1,12 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# pip-compile reqs/misc.in +# +gitdb==4.0.11 + # via gitpython +gitpython==3.1.42 + # via -r reqs/misc.in +smmap==5.0.1 + # via gitdb diff --git a/requirements.in b/requirements.in deleted file mode 100644 index 7d69df93d0..0000000000 --- a/requirements.in +++ /dev/null @@ -1,14 +0,0 @@ -# TODO -e file:tools/asm-differ#egg=asm-differ -argcomplete -beautifulsoup4 -black -colorama -coverage -git+https://github.com/matt-kempster/m2c.git -GitPython -humanfriendly -isort -pcpp -pyelftools -Pygments -pyperclip diff --git a/requirements.txt b/requirements.txt index b211c54928..11b790e6cf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --strip-extras requirements.in +# pip-compile requirements.in # argcomplete==3.2.2 # via -r requirements.in @@ -20,14 +20,10 @@ gitdb==4.0.11 # via gitpython gitpython==3.1.41 # via -r requirements.in -graphviz==0.20.1 - # via m2c humanfriendly==10.0 # via -r requirements.in isort==5.13.2 # via -r requirements.in -m2c @ git+https://github.com/matt-kempster/m2c.git - # via -r requirements.in mypy-extensions==1.0.0 # via black packaging==23.2 @@ -38,8 +34,6 @@ pcpp==1.30 # via -r requirements.in platformdirs==4.1.0 # via black -pycparser==2.21 - # via m2c pyelftools==0.30 # via -r requirements.in pygments==2.17.2