From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id E059D3858C39 for ; Tue, 9 Apr 2024 12:56:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E059D3858C39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E059D3858C39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712667376; cv=none; b=crrVkv1zCxS6aXaB1P9k1hzoihoJM6OQo4AIZxyUUwEkTuM8vYZm8gxjyYXLEOzLws8gPGyE3CmY9atktkBid/Rrgi0rSLNdSwydHEYQ9ufVAVxMHO3ptVwVq8MKigT/cA89m9Pau7EQKPY8ximlZAn6MuUawPOx/0nosPk+iDs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712667376; c=relaxed/simple; bh=nAcRZQB719IOiSkS5dgx/PcaFBfFwaVMI2/fr+zUn44=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=D4pbVFJlfY+b8xqrzZGTfpZaW1HZQszgM2fpsW6yrlGDZ/z97dcORfQVtPKiCnZIqX5Q5MqAV6pwK1Naw3B7iCuNP1hK8gNFx/uN8+Got+pp5LlKy3UiPtWa51uyUNI5EVoQMQXZhe82LK+XP3EwKvMxIEOJ3oMn6Jw/aOMuMkQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id F3A59339D1; Tue, 9 Apr 2024 12:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712667374; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sxbM20xM4mGcQcbLll8JRHZTyZIgOxOGG9viofyQ5x4=; b=N4e3hYfz79BrnJ+nBHKGdnbZ+BVnqK/f5gemzFDJ+hZrWpYfVRfqrdNEbbR1z/psp0CUXt GNf070wL9k6g+zbcj1lytHgZZPuU/sd/5BqPAr3P+qu6Z0GwYVaEIXtsVwTitmqBeE2rCN qQ7uejp63qPzjSyojKn8aWVdj2T4u7M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712667374; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sxbM20xM4mGcQcbLll8JRHZTyZIgOxOGG9viofyQ5x4=; b=2oopPqeaukgYQhJspNtm8QkHSsEeeSSN1RD6XLneSZG5or9jo5OLx3gJwLu7S66HIHCFPt mhM412JzPsfQ67BA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712667374; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sxbM20xM4mGcQcbLll8JRHZTyZIgOxOGG9viofyQ5x4=; b=N4e3hYfz79BrnJ+nBHKGdnbZ+BVnqK/f5gemzFDJ+hZrWpYfVRfqrdNEbbR1z/psp0CUXt GNf070wL9k6g+zbcj1lytHgZZPuU/sd/5BqPAr3P+qu6Z0GwYVaEIXtsVwTitmqBeE2rCN qQ7uejp63qPzjSyojKn8aWVdj2T4u7M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712667374; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sxbM20xM4mGcQcbLll8JRHZTyZIgOxOGG9viofyQ5x4=; b=2oopPqeaukgYQhJspNtm8QkHSsEeeSSN1RD6XLneSZG5or9jo5OLx3gJwLu7S66HIHCFPt mhM412JzPsfQ67BA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C51A813313; Tue, 9 Apr 2024 12:56:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 3rCVLu06FWZNFQAAD6G6ig (envelope-from ); Tue, 09 Apr 2024 12:56:13 +0000 Message-ID: Date: Tue, 9 Apr 2024 14:56:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Add flake8 and isort to .pre-commit-config.yaml To: =?UTF-8?Q?K=C3=A9vin_Le_Gouguec?= Cc: Simon Marchi , Tom Tromey , Tom Tromey , gdb-patches@sourceware.org References: <20240402181121.1948535-1-tromey@adacore.com> <87il0y6x62.fsf@tromey.com> <93111957-7c0a-4896-8fa2-81ea24d6f9d0@suse.de> <874jcaq3ew.fsf@adacore.com> Content-Language: en-US From: Tom de Vries In-Reply-To: <874jcaq3ew.fsf@adacore.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Level: X-Spamd-Result: default: False [-4.29 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:email] X-Spam-Score: -4.29 X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 4/9/24 11:41, Kévin Le Gouguec wrote: > Tom de Vries writes: > >> just to report back on this with my current state. >> >> I use openleap 15.4 with python 3.6, and the used version of flake8 requires python 3.7, so I ran into trouble after this commit. >> >> Then I learned about "git commit -n", and started using that as workaround, but eventually ran into trouble because that doesn't seem to work while rebasing. >> >> I then decided to install python 3.11 and use a virtual environment, and use git commit from within that environment. AFAICT, the virtual environment works as expected: >> ... >> $ python --version >> Python 3.11.5 >> $ python3 --version >> Python 3.11.5 >> ... >> but for some reason I keep getting: >> ... >> SyntaxError: future feature annotations is not defined >> ... >> which is the same error I got with python 3.6. >> >> I've tried removing ~/.cache/pre-commit a couple of times, but that didn't help either. >> >> So, atm I can no longer rebase. I'll try to workaround this by adding a local commit that reverts this change, or something similar, but if anybody has another idea I'd be happy to hear it. > > Hunch: have you installed pre-commit in this virtual environment, or are > you using a pre-commit that comes from "outside", e.g. your distro, or > 'pip install --user' before activating the venv? FWIW this might yield > clues: > > $ head -1 $(which pre-commit) > Hi Kevin, thanks for the reaction. The command you mention showed the correct pre-commit version. But when running git commit, the wrong one was used. I just needed to rerun "pre-commit install" to re-install the hooks, which fixes this. I'll update the wiki entry to clarify this. Thanks, - Tom > Over here this shows a shebang that points to […VENV…]/bin/python3 > (which in turn is a symlink to my system Python). > > I would hope that 'pip install pre-commit' within your virtual > environment would install a pre-commit that will use "the right Python", > but I could be missing something.