From patchwork Thu Jun 5 08:13:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 894563 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3029B1B3930 for ; Thu, 5 Jun 2025 08:13:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749111210; cv=none; b=OeSL3kO4jd9782zJfyEueNHLQq0QIyAhK/6KPvjW7UB57I7YeP0HZ6U7tbCMpxXPZik2n7WQjYkXegyMh02zVWQxpz2I5nO5D46kQGnL+7PTvlgPIy4OcjHmWxNPF1Ni0+og6IA5gKKJzRmmpNp86FyWUfULlLZe+17iy7jiFKM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749111210; c=relaxed/simple; bh=7/Oha6Eo5reH/Z0/Jyw/NK0zfRkA124IU42KP6Bsq5M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GkcjOGezDHHJBptilNDtoT76CIDoavEzddslPxAnR8Xi6VOcuyOn6lGPqBX3EA6jPegzonH6QK1x232b/r0y1HySdokgZntxPpUSnvHAjnVHpjXbsv4WfvFfUpKb0tp9P3YI6F8/z2mpcM3T3366f3kYxEYrm81vS/ShY/4P0zE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=gPwfH3v0; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="gPwfH3v0" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-450caff6336so3749125e9.3 for ; Thu, 05 Jun 2025 01:13:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1749111207; x=1749716007; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=So+7bY5B94Wz+9+ULUTh8P6IFbxeLILw2vz+4Ibi8P0=; b=gPwfH3v0JW2HOZ+qnLUZNpevTrsDSgyI5gquXHeyQKQgdzDr4QOv5FwUb65xOk/42N sZqfFioKOBc0XqGi3FqC0GKvEMavY7zaY5HFeSnPHAoZCapBX7pRQOczUyT2qR9xbvhf cHeaR6fp0LbDInvQ1s7T+/hYniMmry9vIElAQHSS/0kQjXMEntHp1/j95x8PY9gBvjPu NC9R/sDakCKgJCSwJYabTZYl/SwXhjO+GBP2I4sJ5mG1YpA4buO0fjf/4tdc75MVxG1Z 7+Nfu+9xxe9I0J+gwBSqyScEHs8Z13PIeQ4hyouKhSQCKUsM7HBx/Q4x458zPts0PATk w/dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749111207; x=1749716007; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=So+7bY5B94Wz+9+ULUTh8P6IFbxeLILw2vz+4Ibi8P0=; b=q+X+SNaqOko+ZpW09uzt+/x4ba6zbhOfiv0nyZ6rGI6ouNVk973GHx+dX4gbn0a/y+ t0x9GT3dznESY5Q4yEafveZU4i2EPQOyxtIX1T9kbipalSJ9RQC4vWYFvV+sOpSr4+8x 1KOjBUFBrlqdaWPh5LxHj1rymbN9Hrt94lXpcpxhCMRWtzSkQ40h7EMRXOSwx3zc9OFA gzGqPRAJl6g6bzgPtBpdgaKWhoxuY9688gH86s49HwDRT+t7bHH3nxkZA9GP8NMq087c lsZvAuroX5lNlwtDKOpj58tV5lNLbO058s/oRLQGpZcscoCDCMstVA11fq1PKp0eLG5e nesA== X-Gm-Message-State: AOJu0YxQk1QJZ18ibwRDMgRQSFsZcKMbvsQLlPgxNpB3GQ+3vQAyQ0eF 7vPMwruvnJtoW91Je6n/GsUsvHiVpyy4fWM1Gqq9hwYkEcZtWg3O44SYZtxPW2DCPWl77nCdqYH kKIfF X-Gm-Gg: ASbGncs1PPdCyliIuRzeCB9/zIDQ0TREeqPaxOGnMo6xHWRYuLK9hr/71Q6B/w4yaX3 XwtZJYQbboy9BZlDN5uTdQp8Yr0lGXlEFPa9maO0sXVdO5Dn0lPDFWzdLX2vUJ0dpnr4vrIrlZH PO7iKFe0HjdkcyVMvnxMe978dDe2JmQEAE/D/lPnd9tdq5cnql7VagzYfGNb7X4tbVmvCIdrNbO 8I8Pd2jAbfYR+Ej0c+OCdFrwqAjwk3xYLQcy4TxRbGhQACDFn4v1naJhOF2A81L4alOOEmmtWhG JrmlJDRPVPZSmktoxrTAne5QQQu/agHQ17CGVSeUVWvDU1BOMmWZLAk= X-Google-Smtp-Source: AGHT+IGhgL8/LAJV0I9Aw/jHPqDdE7psMD6NlA7NqyK9PBOX5bOp0zAUEx0K/LMd+/SvuGamKfTbTA== X-Received: by 2002:a05:600c:8509:b0:43b:ca39:6c7d with SMTP id 5b1f17b1804b1-451f0a6afa3mr57243495e9.3.1749111206968; Thu, 05 Jun 2025 01:13:26 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:b79e:4a6:355b:c44a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-451fb178ee2sm10010865e9.15.2025.06.05.01.13.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jun 2025 01:13:26 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 05 Jun 2025 10:13:19 +0200 Subject: [PATCH libgpiod v2 1/3] doc: reformat conf.py with black Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250605-rust-docs-v2-1-883a0a3872c0@linaro.org> References: <20250605-rust-docs-v2-0-883a0a3872c0@linaro.org> In-Reply-To: <20250605-rust-docs-v2-0-883a0a3872c0@linaro.org> To: Vincent Fazio , Kent Gibson , Linus Walleij , Erik Schilling , Viresh Kumar Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=683; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=duFNkABcyruA/b+8Fi1QG2o9TAeLhkObsX0mFxW/AYs=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBoQVGk6A7l9Em+w33riPJNU8tj9CVzXkLeSMyQJ sH/pGxgje2JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaEFRpAAKCRARpy6gFHHX cl4kEADb46M55mpwFscPKLOl1Gl2L31kznybFKZBE9DR6hBnhNPi+gzXtoqoYKKvnK6TxF87BvN mNwF6MJrlHnLtz+wiJLx9elQWWv9jn9n5FR/6VcrPo/nRryPMhie1azgBPZRb+PGmkL+4OOhGiz 88kFBV5bKVYRFVM6Bdqxw3IbL9q0bSUisNvOwXhIezU4lYn7nbcGfxeY9q7MQ+sY3l8ZUjT0D/X Z3aCpa2AjGGryWXmvTayVw1ZWYtzgM7xHUIRh7ivZ/Gr57g07AMjjfRFQLzyMrY/rlTiGfWI4CY 4JdZstEzMI9WDia3Wt+czGyx+MLyNQ5Ay01FzdKo/gcv9yle0SuqW6ejj4fKQUu9QkfOIxdjPuL 1cXJBCWh4aO6TPgKoajwMg9Zko2NBQez/teujVpTi/mTpX/0DSFa9glGL46vg8yWAEazccDttcn h9Xy8dkSpOepiPMUJ57bj4XYnpTXu27MRc57oliihKTQSvlfMvtH8aNbmWm/G1rtsJ2wQD4jz0P pkP6YcdpWf5LNkE8DY5zib1kxb1dKRNlcowAfpP/YiMN11A6Yqd4WIqQQedrmINzsS2suxZgOQh tonFICy6ze8ezB/aajHENB3/LNAZWLtxewsySWUqOHJUQhssy2BuUMEFS1Lt2JYInFik8AdeIP9 Dvy6XWRxXccYbrw== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski There's one missing newline according to black so add it. Signed-off-by: Bartosz Golaszewski --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index 6fb399dcf195bd01d1fa739de89f142672f3f16e..d89c13454baa8fbe9dab17b7c3fde6fc59b577f1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,6 +54,7 @@ except ImportError: html_theme = "sphinx_rtd_theme" if sphinx_rtd_theme else "default" + # We need to know where to put docs generated by gi-docgen but app.outdir is # only set once the builder is initialized. Let's delay running gi-docgen # until we're notified. From patchwork Thu Jun 5 08:13:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 894317 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 065F81F8BD6 for ; Thu, 5 Jun 2025 08:13:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749111211; cv=none; b=HOqJicxr7mEEK/OE4nKQBaL4HBwkWgepylMkScgKhpJoDK/WQdeAl6HhP7kTWsfE7Z6uCsW5EQ0Dinc3wsJaXSNPxp23Q8lbfVAajA3pPobDpM9VNtY3MMLR9jVx9dY4J2J/NcPW+Il47yeiiAR7ErCN0AgL6AHYr0MWgyzwUOs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749111211; c=relaxed/simple; bh=DRjhWrHQT4lgyqKM0TUzkIauvvSfSwAN+/c7Y/Dehrs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sFge+Sc4ngaK6QWml+llT0S/69oiYnfQ0/7SB9GV2qJh/PSqh4JgtE327FcOxwtay/sdFzX7VGyggwGAc9h+S+fnBVH//o1G3Lpdk21OMd/OmkR0V+KPHgEf5XIlx3yiiJzJkQLr8xtunKreKFTcgSefFacGJYJGg9cBC7WJnLY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=Ri4Ij5GB; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="Ri4Ij5GB" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-3a5257748e1so472376f8f.2 for ; Thu, 05 Jun 2025 01:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1749111208; x=1749716008; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=XgNGBWUntlzsqlsrqfACQ9ak5SzabU4TyO+KeG66LBY=; b=Ri4Ij5GB6u1OXDA6XPePVUz0k0LhH5olKd5W9RqZd9ryFBCPwj+8aqnK9NEpptBe0B c3v3ezESCmiH6RSK6X7Jgi7lb6u4cyorgIP/TKeJt424m+8DeAK6B+QmUQE6bbW6a71U u3YZiXx/hjfnZPqmz+C/2YwXb9JrUOl1zC7RJjJWc5Wq98heD1MlnuKHlgGPVulp0JMK TaI27Gya2KnsRb7J5nmdXKfj8Vfm1aWeCmuA99X79Mc7vzq51IlZbs6yZPfmncsQK0Op rP4D37vI4MZ+bO/cllG7iy1e82Qw/jLaSWXQ0QeHvXX8mSlLE3MkAvNeNcLSxiDlFeW4 4/UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749111208; x=1749716008; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XgNGBWUntlzsqlsrqfACQ9ak5SzabU4TyO+KeG66LBY=; b=SLLfYZjLUwGDaZ6vJoZ8lR8WFupLzJLFqxPUFlNl1zFimc4vjR6W6EiFkpqkoTxK9o 4Dp7UgQj3M4a1zD6sVBnYgIDitc3ruD5OJAsMrTlKBDZljszH0xwvDRm3ST0vTtK70cr QsXPVnBnGHWwzPbX6sxI8yGxhy5UrzexGsf4WXdpsC/W/vY+D3AaRx0o4L8npWG+MqHM SL48q7bKB6fjI1p/ILeJ9WWqmFFmnknpHsYwMPmZ/uSNuVZIpM332Kl69hrpp2b4jWuj L7gHrB0hzOin+q6shUEoSthXOSmhIEYZRNZN32MX+sCf35lbYPuV0H1/4DrSYs+0ldYl vJcg== X-Gm-Message-State: AOJu0Yz4fGZgtD8yNk9DwofvhPcw4AUrazlmA9GnLWeLd3vZxhcSJgB5 dcMghMK/AH9BOdr0knIVp6gq0qSBhm4KG5bJFR0QAWH/5U+V9ZI8f2GEcwg3XIYr2aSLPaizUL3 pgxMo X-Gm-Gg: ASbGncvxyVuBWiBa67J1zYIDDyEVSTJA4RIQPjv/KZVq7I2xy7UIHtXxK0inNFihQTp Lnyd0zoYLkMsxFz44VwefQ8RIBpb4do/QCnQ/mWjm7lgfdjHT9QAHs9YBcmjbrA4kvK/m5QVSw8 zPXgbGnOZJsLqfkYCuW1X6nqZw/5N2bn1+tpNFa0g44Pt+d6F/G+VR09jT7yZWypcdS1eWSepUr XiIKLAtaeUYLyquYx+aLWm3UVN+y1qu3O8YIQCyy/q4DLbswUMNulmvwO6oAM3M0jxtW7Rjm4TX XYih0kaNs7y1qGjU1rbNWh4elgCMKpQ4Mwq5p2XvxrvGtLAhYW7ck68= X-Google-Smtp-Source: AGHT+IF5OmhImdksIW+BITc6dNWeHGMFAxIpdy9JQhLr9ZkTcFDKG/x2VBx+Wh0bZIAZVAU0Qaqdmg== X-Received: by 2002:a05:6000:420a:b0:3a4:ed62:c7e2 with SMTP id ffacd0b85a97d-3a51d966b13mr4793441f8f.28.1749111207993; Thu, 05 Jun 2025 01:13:27 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:b79e:4a6:355b:c44a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-451fb178ee2sm10010865e9.15.2025.06.05.01.13.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jun 2025 01:13:27 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 05 Jun 2025 10:13:20 +0200 Subject: [PATCH libgpiod v2 2/3] doc: improve the readability of the prefix variable Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250605-rust-docs-v2-2-883a0a3872c0@linaro.org> References: <20250605-rust-docs-v2-0-883a0a3872c0@linaro.org> In-Reply-To: <20250605-rust-docs-v2-0-883a0a3872c0@linaro.org> To: Vincent Fazio , Kent Gibson , Linus Walleij , Erik Schilling , Viresh Kumar Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1477; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=77ZEdBx/18Yxsz12amBf5rGcXRRQHt5qzyrxRovOAi0=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBoQVGldla8EcQa+W7OzKOUR10KebTo1s9u+wGAZ aPrTl4HuqyJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaEFRpQAKCRARpy6gFHHX ctgxD/44Pi4V7UiemmLO3QRpVAZVm0ndI3T3bQ4Ntjt3kAkuN8xjDwy/KLDmMr2XqYcSSlhc5Fv 16zl38tGIYxcl/m8yNs/vNGQn8OUSosxfFTTy5Hr0udO0oD1e7/dXNXuBl96goNI467C+FvwJ6d LIPfdgqOMFPMcw3zqZZM6kGyMIV9bxGcDaMdtCeblRTIhLoSgTTHNZj7KYmQcmI4xFTH4fY8z32 6grNUy6mET1lYtegSyzd7eUcgQpQd7KPsRqfQRCdlQTKC1VBb7Yd8sSeyxNRxBwMR3efnY5Avl0 doO+jaYLwNEpTmGIFyQ/twhpEOorcbgz82M4uCiSLWYqsAwXBFBiGGCdrX6e5GZ6V4vFWYpJeXB uDnJRWHqFRwSdjFmP2kk1DyG9p3I5WoMmyFYCEzdc1yzK7DCkKJqmeai1P95MgTgql22IcqJkcj RhtA3XQz6Zb5kpCW/AS2q30LFAZR0mAOQ4Jmr/2UJZeL6juctnkxtRjeWQiAPC2zZoCDcH2t637 kriRoQoAK4u+hg7g/uPrlGXpIZVI7D/mUCqW0wyTARP7cbnu8Vo+shiF7QMiKYNFG4Eu+9sDHlB DhwW5kUwmP7fw/4kefVSzdQ3MlG6lYF2Y5atkfgzaO5KKNAcM69hg3OSjldGvLKg9ugxXj0A0U1 1SiotAyOvkbQXOg== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Currently the default value for prefix - indicating the current directory - is an empty string. This means that if we do "{prefix}/foo", we may end up pointing to the root directory which is not what we want. Make "./" be the default value so that the example becomes valid and add "/" where we couldn't do it before. Signed-off-by: Bartosz Golaszewski --- docs/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index d89c13454baa8fbe9dab17b7c3fde6fc59b577f1..04d1cea2a2175166555993c3e936e7cf1ebd0fe6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -61,15 +61,15 @@ html_theme = "sphinx_rtd_theme" if sphinx_rtd_theme else "default" def make_glib_docs(app): # For some reason on RTD we're in the docs/ directory while during a local # build, we're still in the top source directory. - prefix = "../" if os.getenv("READTHEDOCS") == "True" else "" + prefix = "../" if os.getenv("READTHEDOCS") == "True" else "./" subprocess.run( [ "gi-docgen", "generate", "--config", - f"{prefix}bindings/glib/gi-docgen.toml", - f"{prefix}bindings/glib/Gpiodglib-1.0.gir", + f"{prefix}/bindings/glib/gi-docgen.toml", + f"{prefix}/bindings/glib/Gpiodglib-1.0.gir", "--output-dir", f"{app.outdir}", ], From patchwork Thu Jun 5 08:13:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 894562 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10F061B3930 for ; Thu, 5 Jun 2025 08:13:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749111212; cv=none; b=hJCWkM4h9/Ctoo6LR6zezaZahd0TKU8o3JHtedW8ikfm2lij5y5PXDLUU+7pJ8zTlzoQAuO/wIvET2nwVnGXlUJNhQXTZGNxsDd9QD9vpQsu7v3OQ91Hj04N7mPe0doIwajQTFyUZ0WUWes5za37uglcz5KOR1Kdb82PWL7Nd6o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749111212; c=relaxed/simple; bh=jQ5OeI/Ykl644c+ypJkBnoyL6wloBhJ3YTUTjUUMWKo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MoEKyEkc2muqViuhieWOZqBVIlPSiwSkBQNhfvI8xVEfAPr0KOVTd5O8096EFMc6ZOtFKZjp2PGPm4DciUAEhAxEK1TgeLBTF50gYUZgp+9vvu3+Sd4KbRBwcGNCD6kMtDy+t5VWJGTXez3CTe9NvM56YN8c3MC7abnwKs/JvbM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=eESJgLEl; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="eESJgLEl" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-450ce671a08so3839185e9.3 for ; Thu, 05 Jun 2025 01:13:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1749111209; x=1749716009; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=WpY8tEEJgjIm39wpwodKCNU/ATFxGNJ0v16hKW9DeTA=; b=eESJgLElyU4I9wYTtSIsz/ra3490ssTh6iIQXF7uMs/JnHNatnb83n+ytafH2Cu5tw +CkUdZX0razI6TWT8uVNvJXlg98jXyHwvasaOp4PLHVC+YBib8Zy2sSNcjoceY9y29WL Mc4a2X/opjXW1HWsJoguQP1NVSnAX1eV0/xUTEWINVA5oDp/GlcaHrLHWF/FIgyFcXLv 3PL0YHPE/H70nIw5Kp9HW/deCUt3TmK2IU997jsf5htmoyiUVWS3qrhOwYIItnmRB5sx WC1NhewiRWXSgJ/gufZkfE6FTs0vi+1Q0RqcCI7XEqEICE7hbko8UoYYzV+OTENJDBk+ Oc9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749111209; x=1749716009; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WpY8tEEJgjIm39wpwodKCNU/ATFxGNJ0v16hKW9DeTA=; b=tNTwYQX6NxewXw5yVwpi6WJOR6xnbFj8M7wLZpR9uCQLGiPN/B9GkujWs8vxIf4tR5 tvkkGOeIs2tolw9yg8H307wHhRrAHb88E7tBefQcF+CHSN0pTHT3CkHBDEH1MkdmM8i6 xmIu0L0a2Dpenjy2RaTArzo4O0s8S/yeAMdDKmPDmuGREe+qd97cwquIPuHOg6COuIjN Hfy6ug0eUe9dnEKSOFVLbJWBvYB47N/KFePBd7e34AoexWAUljXNVSUatM7rNv3PFXKl 0KbOK5BXQEl7BUOIDWjkQgirreOWEMKbMl/t7w9wUh8l4qkBJN9ILPwRa8X5LlbMpMrK u1ZQ== X-Gm-Message-State: AOJu0YzUq6zZw0ZeeI96GgRs6Dj2H6VZD1qVMKObOpTwkX/XnbljVX7j pEOWyWK/64obLYeMoh26mq0mpSh5Ax8Zyr8//c825fq5HB8GOAxfujSZwluxnW1P2CW3TjKIUWS U34c8 X-Gm-Gg: ASbGnctxVL34yGKk7JXCMfIsCnNXYMvYDjSHyhqpfCH5h5C8eG+pPyzzq2OZgBPtJ5t Ekk2WW7K7HF4bBUaNZzVoi24cIBiWfvqZ12ICVoPajIJIQa/v0JqFH2QtZfhVjY8Tbsz2kykvdf TKf/F8cOuWQ7xzZ614rfCkrmxCEA4hrkhWDPEP4O63VtseDp/3gXnQYmYxckJwDZyt5u7/vZbnr T7L3aeciTH153A4TWHQ9C8GeX9shHKNB6kFRw8rcL243UxX0KYIPwJN3DRxtkxllwHHYTNorioo 2fn54XTnfuW4kh4Bf+VFHP8ThLpHeby9zH7k4j0IYX4p X-Google-Smtp-Source: AGHT+IFXKBNJ2fnUPEOl/8tZGTLaOZ/XNMxHZYKBpekGrhVrOGayZ/hXETsxdrCBrdKEXKUmhAK+8w== X-Received: by 2002:a05:6000:1a85:b0:3a4:d0ed:257b with SMTP id ffacd0b85a97d-3a51d923b56mr4986299f8f.22.1749111208914; Thu, 05 Jun 2025 01:13:28 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:b79e:4a6:355b:c44a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-451fb178ee2sm10010865e9.15.2025.06.05.01.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jun 2025 01:13:28 -0700 (PDT) From: Bartosz Golaszewski Date: Thu, 05 Jun 2025 10:13:21 +0200 Subject: [PATCH libgpiod v2 3/3] doc: integrate rust docs into the sphinx build Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250605-rust-docs-v2-3-883a0a3872c0@linaro.org> References: <20250605-rust-docs-v2-0-883a0a3872c0@linaro.org> In-Reply-To: <20250605-rust-docs-v2-0-883a0a3872c0@linaro.org> To: Vincent Fazio , Kent Gibson , Linus Walleij , Erik Schilling , Viresh Kumar Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4676; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=I9Trcvmr1gnlRk7XpqLn1hTqVUy3KxPeaDu1JiXee7k=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBoQVGljNImxH6rnP+4RASR00HSZzdGNa/dmoVP2 y9zzJf/D+uJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaEFRpQAKCRARpy6gFHHX ct4fD/9rtCkJQiOPa5Zdt8eS+52i21DQxKtwAvQwSSQU9CJd5RqXsb5g3WFWQMhtC9Q+8olwOYB uqQrshkyxW1m0YXshVImwTwSeeETAssMSPAC89gjjYtnIz2pVGoxkZd4bp/Psol/bUWzwVvQcRD ck7xyA0g6V/lrsi6WIV5UlpSvM/WEeeVPgbV5clm/62Qaa+jva6bMbjSxc55OUb+vaCcLQFwU3c RxeWMyKCUN/PvJM8QPENCXwbDJFWvJvbXE7FxPqEwmV21qI8FTs1kJKV2Oj+HUToT2HAVUmoheC hWcfBVxqEpqsDSX8icSCk9Myl8uWmJjirbLy0Xa3VzUOTKebBOMnuDdVlDqbRkr1P0QdLVj7O7n SDSEYV58J0ct7D0GmRXJrOZKwHLsgG5+eDUnsdNKKTza1uboT3wFpTTnhOkvhSZLutNv4uFFslC JCCW6utPn1mxQrGEIxnJHpIZ8NXkpVTUQDcsZdwQ9XVm2Dgldbi+Ew10DBZTrFrXNZw8y3cf7LE GyvU8txMTjrPXP0ZN6zwYYuXV9iPcbniNhyXimj794cfPc9zCpTg5KIRUJJfdAvD82bLzc8zY9X NRCOHIDIv/ln2J3QXjT2mIa0brA+GKjNJdRZjEboyX7ha793m4dwzBSU1NF1fQxS/1d3nvQb3Vf vL2vMcQoy8xGUcw== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Follow the pattern we established with GLib bindings: generate a separate set of docs for the rust bindings, make them part of the generated doc bundle and point to the rust index.html from the dedicated sphinx page. Signed-off-by: Bartosz Golaszewski --- .readthedocs.yaml | 3 +++ docs/conf.py | 38 +++++++++++++++++++++++++++++++------- docs/rust_api.rst | 22 ++++++++++++++-------- 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 5f4f5ac4954de70e060f1a7b2eafe3a731620c16..11ec1de1bddc5fe4525f9fdaffbb31781c0968d3 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -14,6 +14,7 @@ build: os: ubuntu-24.04 tools: python: "3.12" + rust: "1.86" apt_packages: - autoconf - autoconf-archive @@ -24,6 +25,8 @@ build: - gir1.2-glib-2.0-dev - gobject-introspection - graphviz + # Needed by rust bindgen for stdbool.h + - libclang-dev - libglib2.0-dev-bin - libgudev-1.0-dev - libtool diff --git a/docs/conf.py b/docs/conf.py index 04d1cea2a2175166555993c3e936e7cf1ebd0fe6..b41e78e95ab55183d2b8e48c160cca5118b70f58 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,15 +54,16 @@ except ImportError: html_theme = "sphinx_rtd_theme" if sphinx_rtd_theme else "default" +# We need to know where to put docs generated by gi-docgen and cargo but +# app.outdir is only set once the builder is initialized. Let's delay running +# gi-docgen until we're notified. +# +# For some reason on RTD we're in the docs/ directory while during a local +# build, we're still in the top source directory. +prefix = "../" if os.getenv("READTHEDOCS") == "True" else "./" + -# We need to know where to put docs generated by gi-docgen but app.outdir is -# only set once the builder is initialized. Let's delay running gi-docgen -# until we're notified. def make_glib_docs(app): - # For some reason on RTD we're in the docs/ directory while during a local - # build, we're still in the top source directory. - prefix = "../" if os.getenv("READTHEDOCS") == "True" else "./" - subprocess.run( [ "gi-docgen", @@ -77,8 +78,31 @@ def make_glib_docs(app): ) +def make_rust_docs(app): + subprocess.run( + [ + "cargo", + "doc", + "--manifest-path", + f"{prefix}/bindings/rust/libgpiod/Cargo.toml", + "--target-dir", + f"{app.outdir}/rust/", + "--no-deps", + "--package=libgpiod", + ], + check=True, + env=dict( + os.environ, + SYSTEM_DEPS_LIBGPIOD_LIB="gpiod", + SYSTEM_DEPS_LIBGPIOD_NO_PKG_CONFIG="1", + SYSTEM_DEPS_LIBGPIOD_INCLUDE="../../../include/", + ), + ) + + def setup(app): app.connect("builder-inited", make_glib_docs) + app.connect("builder-inited", make_rust_docs) subprocess.run(["doxygen", "Doxyfile"]) diff --git a/docs/rust_api.rst b/docs/rust_api.rst index 1408b5c2457309938e314d1c289b81d583d9cc09..dda20d0baadcf8d97832cd60a60a5d00f99affc9 100644 --- a/docs/rust_api.rst +++ b/docs/rust_api.rst @@ -5,19 +5,25 @@ .. This file is part of libgpiod. -Where are the Rust bindings? -============================= + libgpiod Rust bindings documentation -.. warning:: - There's currently no good way of integrating rust documentation with sphinx. - Rust bindings should be documented on https://docs.rs/ but due to a yet - unsolved build problem, this is currently not the case. Please refer to the - in-source comments for now. +libgpiod Rust bindings API +========================== -Rust bindings are available on https://crates.io/ as the ``libgpiod`` package. +Rust bindings for libgpiod aim to provide a memory-safe interface to the +low-level C API. They are available on https://crates.io/ as the ``libgpiod`` +package. .. note:: When building the Rust bindings along the C library using make, they will be automatically configured to build against the build results of the C library. Building rust bindings requires cargo to be available on the system. + +.. warning:: + The documentation for Rust bindings is generated using ``cargo doc`` and + cannot be easily integrated with sphinx documentation. Please navigate to + a separate section dedicated exclusively to the Rust part of the API. + + +`Navigate to Rust bindings documentation `_