From 88ee504a82b37ccf6e5e08837dde32196c7a4c46 Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Tue, 22 Aug 2023 20:13:56 -0600 Subject: [PATCH] Stable merge for Week 33 of 2023 (#722) ### New Packages - `reterm` - 0230628.1927-1 (#703) - `sill` - 0.1.1-alpha (#719) - `changescrn` - 1.0.0-1 (#571) ### Updated Packages - `yaft` - 0.0.8-2 (#715 #716) - Update to 0.0.8 - Depend on `terminfo` - Add patch to start bash as a login shell - `toltec-base` - 1.2-2 (#715) - Adds `/opt/etc/profile` to `/etc/profile.d` so that it automatically loads the environment variables provided by the entware source - `linux-mainline` - 6.2.0-1 (#657) ### Tooling - Update build process to use Python 3.10 (#684) - Added issue templates to the repository (#711) --- .github/ISSUE_TEMPLATE/documentation-issue.md | 20 +++++++ .../ISSUE_TEMPLATE/documentation-request.md | 20 +++++++ .github/ISSUE_TEMPLATE/installation-issue.md | 31 ++++++++++ .github/ISSUE_TEMPLATE/package-issue.md | 35 ++++++++++++ .github/ISSUE_TEMPLATE/package-request.md | 14 +++++ .github/actions/setup/action.yml | 5 ++ .github/workflows/pr.yml | 8 --- .github/workflows/stable.yml | 4 -- .github/workflows/testing.yml | 4 -- docs/building.md | 2 +- package/linux-mainline/package | 11 ++-- package/reterm/package | 57 +++++++++++++++++++ package/rmscreens/package | 19 +++++++ package/sill/package | 31 ++++++++++ package/sill/sill.draft | 7 +++ package/toltec-base/package | 7 ++- package/yaft/bash-l.patch | 13 +++++ package/yaft/package | 14 +++-- requirements.txt | 13 ++--- scripts/toltec/bash.py | 1 + scripts/toltec/builder.py | 6 +- scripts/toltec/graphlib.py | 1 + scripts/toltec/ipk.py | 1 + scripts/toltec/recipe.py | 1 + scripts/toltec/repo.py | 8 ++- scripts/toltec/version.py | 8 +++ 26 files changed, 303 insertions(+), 38 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/documentation-issue.md create mode 100644 .github/ISSUE_TEMPLATE/documentation-request.md create mode 100644 .github/ISSUE_TEMPLATE/installation-issue.md create mode 100644 .github/ISSUE_TEMPLATE/package-issue.md create mode 100644 .github/ISSUE_TEMPLATE/package-request.md create mode 100644 package/reterm/package create mode 100644 package/rmscreens/package create mode 100644 package/sill/package create mode 100644 package/sill/sill.draft create mode 100644 package/yaft/bash-l.patch diff --git a/.github/ISSUE_TEMPLATE/documentation-issue.md b/.github/ISSUE_TEMPLATE/documentation-issue.md new file mode 100644 index 000000000..90a044823 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation-issue.md @@ -0,0 +1,20 @@ +--- +name: Documentation Issue +about: Report an issue with the documentation +title: '' +labels: bug, documentation +assignees: '' + +--- + +**Describe the issue** +A clear and concise description of what the issue with the documentation is. + +**Potential resolution** +A clear and concise description of what you expected to happen. + +**Links** +If applicable, add links to the documentation in question. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/documentation-request.md b/.github/ISSUE_TEMPLATE/documentation-request.md new file mode 100644 index 000000000..93afde795 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation-request.md @@ -0,0 +1,20 @@ +--- +name: Documentation request +about: Request changes to the documentation +title: '' +labels: documentation +assignees: '' + +--- + +**Is your documentation request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/installation-issue.md b/.github/ISSUE_TEMPLATE/installation-issue.md new file mode 100644 index 000000000..9ac89311b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/installation-issue.md @@ -0,0 +1,31 @@ +--- +name: Installation issue +about: Report an issue with the installation process +title: '' +labels: bug, install +assignees: '' + +--- + +**Describe the issue** +A clear and concise description of what the issue is. + +**To Reproduce** +Steps to reproduce the behaviour: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behaviour** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Device information (please complete the following information):** + - Device: [e.g. reMarkable 2] + - OS version: [e.g. 2.15] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/package-issue.md b/.github/ISSUE_TEMPLATE/package-issue.md new file mode 100644 index 000000000..eae009fe4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/package-issue.md @@ -0,0 +1,35 @@ +--- +name: Package Issue +about: Create a report to help us improve +title: '' +labels: bug, packages +assignees: '' + +--- + +**Describe the issue** +A clear and concise description of what the issue is. + +**To Reproduce** +Steps to reproduce the behaviour: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behaviour** +A clear and concise description of what you expected to happen. + +**Upstream issue** +If applicable, add the link to the upstream issue here. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Device/Package information (please complete the following information):** + - Device: [e.g. reMarkable 2] + - OS version: [e.g. 2.15] + - Package: [e.g. toltec-base 0.0.1-1] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/package-request.md b/.github/ISSUE_TEMPLATE/package-request.md new file mode 100644 index 000000000..9c00eae55 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/package-request.md @@ -0,0 +1,14 @@ +--- +name: Package request +about: Request a package be added to toltec +title: Add [package] to toltec +labels: packages +assignees: '' + +--- + +**Package information** +Add the name of the package, and a link to where the source can be found. + +**Reason for addition** +Provide some basic information about why you'd need this package, and what it provides that existing packages don't. diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 003825831..f10600cf6 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -67,6 +67,10 @@ runs: sudo chown root:root shellcheck sudo mv shellcheck "$install_dir" fi + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' - name: Cache Python environment uses: actions/cache@v3 id: cache-python @@ -80,5 +84,6 @@ runs: run: | if [[ "$CACHE_HIT" != 'true' ]]; then python -m pip install --upgrade pip + pip install wheel pip install -r requirements.txt fi diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 49ebeb5c7..34bc2ca28 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -8,10 +8,6 @@ jobs: steps: - name: Checkout the Git repository uses: actions/checkout@v3 - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.8' - name: Setup Toltec dependencies uses: ./.github/actions/setup - name: Check formatting @@ -25,10 +21,6 @@ jobs: steps: - name: Checkout the Git repository uses: actions/checkout@v3 - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.8' - name: Setup Toltec dependencies uses: ./.github/actions/setup - name: Build packages diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index c53b6edfc..e4d880017 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -10,10 +10,6 @@ jobs: steps: - name: Checkout the Git repository uses: actions/checkout@v3 - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.8' - name: Setup Toltec dependencies uses: ./.github/actions/setup - name: Build packages diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 8c961e419..883718745 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -10,10 +10,6 @@ jobs: steps: - name: Checkout the Git repository uses: actions/checkout@v3 - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.8' - name: Setup Toltec dependencies uses: ./.github/actions/setup - name: Build packages diff --git a/docs/building.md b/docs/building.md index 38d95e91b..6696d363a 100644 --- a/docs/building.md +++ b/docs/building.md @@ -18,7 +18,7 @@ Before running the build, make sure you have all the required dependencies: * Docker * bsdtar -* Python ⩾ 3.8 +* Python 3.10 You’ll also need all the Python modules listed in [requirements.txt](../requirements.txt) (install them by running `pip install --user -r requirements.txt` or using a [virtual environment](https://docs.python.org/3/tutorial/venv.html)). diff --git a/package/linux-mainline/package b/package/linux-mainline/package index fe964dfc6..6787f77ca 100644 --- a/package/linux-mainline/package +++ b/package/linux-mainline/package @@ -6,7 +6,7 @@ archs=(rm2) pkgnames=(linux-mainline) pkgdesc="reMarkable 2 kernel based on the mainline kernel" url=https://www.kernel.org -pkgver=6.0.0-1 +pkgver=6.2.0-1 timestamp=2022-05-22T21:50:09Z section=kernel maintainer="Alistair Francis " @@ -15,8 +15,8 @@ license=GPL-2.0-only flags=(nostrip) image=base:v2.3 -source=("https://github.com/alistair23/linux/archive/4c2ef4e3bba89a8d767eccb85a242b2cd8850146.tar.gz") -sha256sums=(1583d553380a656ecaac8dab89558051e9165983381adc9c3d52fb8ac0ce19fd) +source=("https://github.com/alistair23/linux/archive/8241218883331bfdc0800f30eb337ff97b7c648c.tar.gz") +sha256sums=(de69fc74f1d25f447da170967eeea13b24354e9b8aa1927addcaa88c2ea9cd7c) build() { ARCH=arm make imx_v6_v7_defconfig @@ -48,8 +48,9 @@ configure() { echo echo "Known issues with the mainline kernel:" echo " - No support for low power mode (suspend uses more power then it should)" - echo " - WiFi sometimes is off on boot (can be turned on again though)" + echo " - Device doesn't always resume from suspend, a reboot is required" echo " - GUI shutdown in Oxide doesn't work" - echo " - Wacom stylus doesn't work in Xochitl (works everywhere else though)" + echo " - Wacom stylus doesn't work in Xochitl (https://github.com/reMarkable/linux/issues/15)" + echo " - Finger input doesn't work in Koreader (https://github.com/koreader/koreader/issues/10012)" echo " - No OTG control support" } diff --git a/package/reterm/package b/package/reterm/package new file mode 100644 index 000000000..a0a37a6d2 --- /dev/null +++ b/package/reterm/package @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +# Copyright (c) 2021 The Toltec Contributors +# SPDX-License-Identifier: MIT +pkgnames=(reterm) +pkgdesc="Landscape terminal support for the Remarkable 2 + type cover" +section="admin" +pkgver="20230628.1927-1" +timestamp="2023-06-28T19:28:06Z" +maintainer="Eeems " +url="https://github.com/i-am-shodan/ReTerm" +license=MIT +_gitcommit="5730f56cf25642b9752fb9d7987a40f6af6b5f59" +source=(https://github.com/i-am-shodan/ReTerm/archive/refs/tags/release_20230628_1927.tar.gz) +sha256sums=(3a6db39cfb83606c4ac5153fe2ac0319ab5c8322c73172178534c047a15c635b) +image=dotnet6:latest +makedepends=(build:gawk build:git) + +prepare() { + cd "$srcdir" + git config --global --add safe.directory /src + git init + git remote add origin https://github.com/i-am-shodan/ReTerm.git + git fetch --depth=1 origin "$_gitcommit" + git checkout -f "$_gitcommit" + git submodule update --init --force +} + +build() { + dotnet publish \ + -r linux-arm \ + --self-contained true \ + -p:PublishSingleFile=true \ + -p:PublishedTrimmed=true \ + -p:PublishReadyToRun=true \ + -p:Configuration=Release \ + -p:PublishReadyToRunShowWarnings=true \ + src/ReTerm/ReTerm.csproj +} + +package() { + local pubdir + pubdir="$srcdir"/src/ReTerm/bin/Release/net6.0/linux-arm/publish + install -D -m 755 -t "$pkgdir"/opt/usr/lib/reterm "$pubdir"/ReTerm + install -D -m 755 -T "$pubdir"/ReTerm.sh "$pkgdir"/opt/bin/ReTerm + sed -i 's|/home/root/ReTerm/ReTerm|/opt/usr/lib/reterm/ReTerm|' "$pkgdir"/opt/bin/ReTerm + install -D -m 644 -t "$pkgdir"/opt/etc/draft "$srcdir"/draft/reterm.draft + sed -i 's|/home/root/ReTerm/ReTerm.sh|/opt/bin/ReTerm|' "$pkgdir"/opt/etc/draft/reterm.draft + sed -i 's|killall -9 dotnet|killall ReTerm|' "$pkgdir"/opt/etc/draft/reterm.draft + install -D -m 644 -t "$pkgdir"/opt/etc/draft/icons "$srcdir"/draft/reterm.png + install -D -m 644 -t "$pkgdir"/opt/usr/share/applications "$srcdir"/oxide/reterm.oxide +} + +configure() { + if is-active "tarnish.service"; then + type update-desktop-database &> /dev/null && update-desktop-database + fi +} diff --git a/package/rmscreens/package b/package/rmscreens/package new file mode 100644 index 000000000..a2670ea70 --- /dev/null +++ b/package/rmscreens/package @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# Copyright (c) 2020 The Toltec Contributors +# SPDX-License-Identifier: MIT + +pkgnames=(changescrn) +pkgdesc="Change sleep/suspend/poweroff/reboot screens" +url=https://github.com/pr0fsmith/rMscreens/ +pkgver=1.0.0-1 +timestamp=2022-03-15T01:28:33Z +section="utils" +maintainer="pr0fsmith " +license=GPL-3.0 + +source=(https://github.com/pr0fsmith/rMscreens/archive/6d04e97b3997873f0f8b1bd50283ae7ed9be7abd.zip) +sha256sums=(3c2e8b0952d848d7326c0a4ce45da625dd7fd0fbc6b564a2d40c3b97015138e3) + +package() { + install -Dm755 "$srcdir"/changescrn "$pkgdir/opt/bin/changescrn" +} diff --git a/package/sill/package b/package/sill/package new file mode 100644 index 000000000..773f1e33a --- /dev/null +++ b/package/sill/package @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# Copyright (c) 2020 The Toltec Contributors +# SPDX-License-Identifier: MIT + +pkgnames=(sill) +pkgdesc="Gesture-based text editor (and shell) for the reMarkable tablet" +url=https://github.com/bkirwi/sill +pkgver=0.1.1-alpha +section="writing" +timestamp=2023-08-12T00:00Z +maintainer="Kai " +license="Apache-2.0" + +image=rust:v3.0 +source=( + https://github.com/bkirwi/sill/archive/refs/tags/v0.1.1.tar.gz + sill.draft +) +sha256sums=( + ed3ef2f7ff37101db16f7020e6af86da6c32e78d76247c91a1676b72ce87e3df + SKIP +) + +build() { + cargo build --release +} + +package() { + install -D -m 755 -t "$pkgdir"/opt/bin "$srcdir"/target/armv7-unknown-linux-gnueabihf/release/sill + install -D -m 644 "$srcdir"/sill.draft "$pkgdir"/opt/etc/draft/sill.draft +} diff --git a/package/sill/sill.draft b/package/sill/sill.draft new file mode 100644 index 000000000..58349bed1 --- /dev/null +++ b/package/sill/sill.draft @@ -0,0 +1,7 @@ +# Copyright (c) 2021 The Toltec Contributors +# SPDX-License-Identifier: MIT + +name=Sill +desc= Gesture-based text editor (and shell) for the reMarkable tablet +call=/opt/bin/sill +term=: diff --git a/package/toltec-base/package b/package/toltec-base/package index be161fc8a..87dd4aa26 100644 --- a/package/toltec-base/package +++ b/package/toltec-base/package @@ -6,7 +6,7 @@ archs=(rm1 rm2) pkgnames=(toltec-base) pkgdesc="Metapackage defining the base set of packages in a Toltec install" url=https://toltec-dev.org/ -pkgver=1.2-1 +pkgver=1.2-2 timestamp=2023-05-08T19:31Z section="utils" maintainer="Eeems " @@ -24,6 +24,11 @@ package() { } configure() { + ln -sf /opt/etc/profile /etc/profile.d/toltec.sh + # shellcheck disable=SC2016 + sed -i \ + -e 's|^export TERM=xterm|if \[ -z "$TERM" \];then export TERM=xterm;fi|' \ + /opt/etc/profile if is-enabled "update-engine.service"; then echo "Disabling automatic update" systemctl disable --now update-engine diff --git a/package/yaft/bash-l.patch b/package/yaft/bash-l.patch new file mode 100644 index 000000000..ad6d27be7 --- /dev/null +++ b/package/yaft/bash-l.patch @@ -0,0 +1,13 @@ +diff --git a/apps/yaft/main.cpp b/apps/yaft/main.cpp +index baa1f56..1d4ee6a 100755 +--- a/apps/yaft/main.cpp ++++ b/apps/yaft/main.cpp +@@ -200,7 +200,7 @@ main(int argc, const char* argv[]) { + extern volatile sig_atomic_t need_redraw; + extern volatile sig_atomic_t child_alive; + extern struct termios termios_orig; +- static const char* shell_args[2] = { shell_cmd, NULL }; ++ static const char* shell_args[3] = { shell_cmd, "-l", NULL }; + + Keyboard keyboard; + diff --git a/package/yaft/package b/package/yaft/package index fc26750fb..8bc4e5154 100644 --- a/package/yaft/package +++ b/package/yaft/package @@ -5,26 +5,30 @@ pkgnames=(yaft) pkgdesc="Yet another framebuffer terminal" url=https://github.com/timower/rM2-stuff/tree/master/apps/yaft -pkgver=0.0.7-1 +_tag=0.0.8 +pkgver=${_tag}-2 timestamp=2021-05-02T09:23Z maintainer="Mattéo Delabre " license=GPL-3.0 section="admin" image=base:v2.3 -installdepends=(display) +installdepends=(display terminfo) source=( - https://github.com/timower/rM2-stuff/archive/refs/tags/v0.0.7.zip + "https://github.com/timower/rM2-stuff/archive/refs/tags/v${_tag}.zip" input.patch + bash-l.patch ) sha256sums=( - df3c74e08c6f047be8cea3d50f9b84bf20a9191d9ee1850e9957146134dfef1c - 5f3c6be207dda291950eece920fca853977fef772c6eddd7fb37c4dbf44c2b3b + 718a9fc7a8e26d587bac790fd83ad8242978b59745269b2ff213e04820bf45b8 + SKIP + SKIP ) build() { patch -u libs/rMlib/Device.cpp -i input.patch + patch -u apps/yaft/main.cpp -i bash-l.patch mkdir build mkdir install cd build diff --git a/requirements.txt b/requirements.txt index b18273a33..a36680a62 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ appdirs==1.4.4 -astroid==2.4.2 -black==20.8b1 +astroid==2.15.4 +black==23.3.0 certifi==2020.12.5 chardet==4.0.0 -click==7.1.2 +click==8.1.3 docker==4.4.1 idna==2.10 isort==5.7.0 @@ -13,16 +13,15 @@ MarkupSafe==1.1.1 mccabe==0.6.1 mypy==0.790 mypy-extensions==0.4.3 -pathspec==0.8.1 +pathspec==0.11.1 pyelftools==0.27 -pylint==2.6.0 +pylint==2.17.4 python-dateutil==2.8.1 regex==2020.11.13 requests==2.25.1 six==1.15.0 toml==0.10.2 -typed-ast==1.4.2 -typing-extensions==3.7.4.3 +typing-extensions==4.5.0 urllib3==1.26.2 websocket-client==0.57.0 wrapt==1.12.1 diff --git a/scripts/toltec/bash.py b/scripts/toltec/bash.py index cb194e253..b763dd18c 100644 --- a/scripts/toltec/bash.py +++ b/scripts/toltec/bash.py @@ -334,6 +334,7 @@ def run_script(variables: Variables, script: str) -> LogGenerator: :returns: generator yielding output lines from the script :raises ScriptError: if the script exits with a non-zero code """ + # pylint: disable-next=consider-using-with process = subprocess.Popen( ["/usr/bin/env", "bash"], stdin=subprocess.PIPE, diff --git a/scripts/toltec/builder.py b/scripts/toltec/builder.py index 6a5401747..27253eef2 100644 --- a/scripts/toltec/builder.py +++ b/scripts/toltec/builder.py @@ -96,6 +96,7 @@ def __init__(self, work_dir: str, repo_dir: str) -> None: self.context: Dict[str, str] = {} self.adapter = BuildContextAdapter(logger, self.context) + # pylint: disable-next=unspecified-encoding with open(install_lib_path, "r") as file: for line in file: if not line.strip().startswith("#"): @@ -201,7 +202,7 @@ def _fetch_sources( ) else: # Fetch source file from the network - req = requests.get(source.url) + req = requests.get(source.url, timeout=5) if req.status_code != 200: raise BuildError( @@ -215,7 +216,7 @@ def _fetch_sources( # Verify checksum file_sha = util.file_sha256(local_path) - if source.checksum != "SKIP" and file_sha != source.checksum: + if source.checksum not in ("SKIP", source.checksum): raise BuildError( f"Invalid checksum for source file {source.url}:\n" f" expected {source.checksum}\n" @@ -381,6 +382,7 @@ def _postprocessing(self, recipe: Recipe, src_dir: str) -> None: script = [] mount_src = "/src" + # pylint: disable-next=unnecessary-lambda-assignment docker_file_path = lambda file_path: shlex.quote( os.path.join(mount_src, os.path.relpath(file_path, src_dir)) ) diff --git a/scripts/toltec/graphlib.py b/scripts/toltec/graphlib.py index 2a303928c..12c12446d 100644 --- a/scripts/toltec/graphlib.py +++ b/scripts/toltec/graphlib.py @@ -225,6 +225,7 @@ def _find_cycle(self) -> Optional[List[_T]]: seen = set() node2stacki: MutableMapping[_T, int] = {} + # pylint: disable-next=consider-using-dict-items for node in n2i: if node in seen: continue diff --git a/scripts/toltec/ipk.py b/scripts/toltec/ipk.py index 78678bd0c..4a064ba55 100644 --- a/scripts/toltec/ipk.py +++ b/scripts/toltec/ipk.py @@ -22,6 +22,7 @@ def _targz_open(fileobj: IO[bytes], epoch: int) -> tarfile.TarFile: ) try: + # pylint: disable-next=consider-using-with archive = tarfile.TarFile( mode="w", fileobj=gzipobj, # type:ignore diff --git a/scripts/toltec/recipe.py b/scripts/toltec/recipe.py index e462be5ec..fc1cf9ae0 100644 --- a/scripts/toltec/recipe.py +++ b/scripts/toltec/recipe.py @@ -41,6 +41,7 @@ def from_file(path: str) -> "GenericRecipe": :returns: loaded recipe """ name = os.path.basename(path) + # pylint: disable-next=unspecified-encoding with open(os.path.join(path, "package"), "r") as recipe: return GenericRecipe(name, path, recipe.read()) diff --git a/scripts/toltec/repo.py b/scripts/toltec/repo.py index c99fe3988..af9c1ad28 100644 --- a/scripts/toltec/repo.py +++ b/scripts/toltec/repo.py @@ -24,6 +24,8 @@ class PackageStatus(Enum): """Possible existence statuses of a built package.""" + # pylint: disable=invalid-name + # The package already existed in the local filesystem before the build AlreadyExists = auto() @@ -33,6 +35,8 @@ class PackageStatus(Enum): # The package is missing both from the local filesystem and the remote repo Missing = auto() + # pylint: enable=invalid-name + GroupedPackages = Dict[PackageStatus, Dict[str, Dict[str, List[Package]]]] @@ -132,7 +136,7 @@ def fetch_package( remote_path = os.path.join(remote, filename) - req = requests.get(remote_path) + req = requests.get(remote_path, timeout=5) if req.status_code != 200: return PackageStatus.Missing @@ -208,6 +212,7 @@ def make_index(self) -> None: index_path = os.path.join(arch_dir, "Packages") index_gzip_path = os.path.join(arch_dir, "Packages.gz") + # pylint: disable-next=unspecified-encoding with open(index_path, "w") as index_file: with gzip.open(index_gzip_path, "wt") as index_gzip_file: for generic_recipe in self.generic_recipes.values(): @@ -258,5 +263,6 @@ def make_listing(self) -> None: listing_path = os.path.join(self.repo_dir, "index.html") template = templating.env.get_template("listing.html") + # pylint: disable-next=unspecified-encoding with open(listing_path, "w") as listing_file: listing_file.write(template.render(sections=sections)) diff --git a/scripts/toltec/version.py b/scripts/toltec/version.py index 67dcb46f4..91c143e5a 100644 --- a/scripts/toltec/version.py +++ b/scripts/toltec/version.py @@ -16,12 +16,16 @@ class VersionComparator(Enum): """Operators used to compare two version numbers.""" + # pylint: disable=invalid-name + LowerThan = "<<" LowerThanOrEqual = "<=" Equal = "=" GreaterThanOrEqual = ">=" GreaterThan = ">>" + # pylint: enable=invalid-name + class InvalidVersionError(Exception): """Raised when parsing of an invalid version is attempted.""" @@ -100,6 +104,8 @@ def __repr__(self) -> str: class DependencyKind(Enum): """Kinds of dependencies that may be requested by a package.""" + # pylint: disable=invalid-name + # Dependency installed in the system used to build a package # (e.g., a Debian package) Build = "build" @@ -107,6 +113,8 @@ class DependencyKind(Enum): # (e.g., another Entware or Toltec package) Host = "host" + # pylint: enable=invalid-name + class InvalidDependencyError(Exception): """Raised when parsing an invalid dependency specification."""