From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: excalamus--- via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: How to use project.el Date: Tue, 24 Nov 2020 04:54:17 +0100 (CET) Message-ID: References: <05e31c25-71c8-0973-41a3-0e705370c839@yandex.ru> Reply-To: excalamus@tutanota.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11830"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: Dmitry Gutov Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 24 04:54:44 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khPPg-000300-4n for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 24 Nov 2020 04:54:44 +0100 Original-Received: from localhost ([::1]:59552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khPPf-0007BB-6z for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 23 Nov 2020 22:54:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khPPK-0007At-Fu for help-gnu-emacs@gnu.org; Mon, 23 Nov 2020 22:54:22 -0500 Original-Received: from w1.tutanota.de ([81.3.6.162]:33752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khPPH-0006Dx-Qj for help-gnu-emacs@gnu.org; Mon, 23 Nov 2020 22:54:22 -0500 Original-Received: from w3.tutanota.de (unknown [192.168.1.164]) by w1.tutanota.de (Postfix) with ESMTP id CFABDFA01CA; Tue, 24 Nov 2020 03:54:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1606190057; s=s1; d=tutanota.com; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=Kpbj7VyLkYfizcdTMxukOGIpS+KYj6NC7Or2b3slN48=; b=qQ0e82WqWpKMtgUk78waLYv1nRjHiX9RKtJNFf5Mxhnmg7VfjGF3M6ykbo2mTtz8 4mJzyAIDwBZ6aXkLSW7YBpg9wLM4UbqnMK95Ym4YYUltNfp63ujqu9w5ChTS2H759// 2682dO7qqaOjtWxawbCPRZIqaGwxADUl32qTlbdycVmZqM3NCJEzggXTpFuRnrKM3CF mdIGiCf0S2A5YGqxfGRBCTC4fyRuF8wLN/TpvkImQ0UqjHQJ+A+yJ4sgDv0Zp6iTBXA sgaAs11TTY48W25fJ8sHn+wBtFZbIxyUHozLl1Trwv6xC/+aMNzWvMJbHBCIQuLj5Mz 4uMobfC/6Q== In-Reply-To: Received-SPF: pass client-ip=81.3.6.162; envelope-from=excalamus@tutanota.com; helo=w1.tutanota.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:125532 Archived-At: 23 nov. 2020 =C3=A0 17:19 de dgutov@yandex.ru: > On 23.11.2020 18:22, excalamus--- via Users list for the GNU Emacs text e= ditor wrote: > >> >> 21 nov. 2020 =C3=A0 21:55 de dgutov@yandex.ru: >> >>> =C2=A0For instance, if you are working on a Python project, shouldn't t= here be some file in the project root directory which will indicate which v= irtualenv to use? >>> >> Maybe? I've never heard of such a file being used with the venv module o= r conda environments. >> > > OK, I'm not well-versed in Python ecosystem > I sadly am (it's my day job). "Should" is a dangerous assumption for Python= . As far as I'm aware there's no unit of project nor standard way to indica= te which environment to use or what packages are in that environment. Some = people put a bajillion packages into a giant catch all environment to "redu= ce duplication", others have a 1:1 project to virtual environment relations= hip.=C2=A0 In practice, a project and virtual environment are separate, although each = are determined by a directory (maybe the virtual environment is a subdirect= ory of the project directory; maybe virtual environments are all co-located= in a separate envs/ directory). The user has to remember which virtual env= ironment to activate and where that environment is located. The virtual environment is activated by running some script which sets envi= ronment variables for the current shell instance.=C2=A0 > I think the general idea could be implemented in Emacs Lisp: you call (pr= oject-root (project-current)) and see if there is a file with a predetermin= ed name inside that root. That file could point to a specific virtualenv wh= ich you would then switch to. > I could create my own project indicator file, I suppose.=C2=A0 I'm not sure= how that would help.=C2=A0 But I'm getting (myself) lost. I may be stuck i= n my own pattern of solving things. What problem are we trying to solve her= e? My project workflow is: 1. Create a shell2. Activate a virtual environment 3. Assign some commonly used commands based on the project (e.g. run this e= ntry point, build according to this spec, etc.) The trouble is managing several of these simultaneously (e.g. "Hey can you = quickly fix this thing in this other project?") while maintaining the state= of each.