Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMrBN-0008K7-9y for pgadmin-hackers@arkaria.postgresql.org; Mon, 28 Sep 2020 11:19:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kMrBL-0008KP-Dd for pgadmin-hackers@arkaria.postgresql.org; Mon, 28 Sep 2020 11:18:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMrBL-0008KI-3b for pgadmin-hackers@lists.postgresql.org; Mon, 28 Sep 2020 11:18:59 +0000 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kMrBG-0005Fp-Ec for pgadmin-hackers@postgresql.org; Mon, 28 Sep 2020 11:18:58 +0000 Received: by mail-ed1-x542.google.com with SMTP id t16so868298edw.7 for ; Mon, 28 Sep 2020 04:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=y/GX6Mk14YzOCcZp5uniMubkdRVwmQkS4TZhH5C16Q0=; b=a0TKk0QAJKaH+5MeikREmNdBZ3hjhxxX9X5lQJPSqkfnaKjm+NZtzwSxX5ZRc90y1x xhgPWpNHbTlRBFCJG3pc4gnFb9fL7Zx8dZGKwqth8BdCgFg3qJhsuRduZSsqMJd7F9oK jjBc0IeNEHiT+Wf/gz7qU5fYenH6lXwjyYZgLpaMjrAxQf4VmpCAyPUO9xcZRJWWWUu4 1nKulthNF5N6wRsiiUc79Czx+yI+rV3S7tQ0IOmWHwENvQGnVFSgXz32zpB+gruiSGlL RrUNSi1qb39gu4Q/n2i33QBuL3rnQh6+J7t1J8qNwl7oXyUBzTTjqz7HJ/SBBC2aSC+s tEpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=y/GX6Mk14YzOCcZp5uniMubkdRVwmQkS4TZhH5C16Q0=; b=QMV4e6odUV9SnFja0ZYpMkMILSXLqqcxUmKoa2WD98B7YiRQqaWEbWKIenNX4qDbnQ ufPN+YPhdvLb0+x9F4lf1zjs8561cGAazeDJk5s4T9AQDz5gSqPCIPLFu+dL6nKSd0at YLn23M9I93lC7316UqbbRy7C23VNQ4htJn+VGUwGdUh0R2KE7JP+WMI9zSzmsHwiv1mr NAfgxLSQtiPEWTFJxFJWptcAekOmKThO/xS4EQnphIWfpNfMbPlIL8oWiHZ5gOdxllMo 3a5hMN1McDTga+RrJwIDfNJfLevoWmiXgaN2VADTIknSNB/uQhg6RbK6rA0xmsgybkma CYEg== X-Gm-Message-State: AOAM532xKfLBcuGgxs52v8ttWy4UWjSO/lqygRrMqixhiqTnGw16JZ6J B3f9msI2zM4XCG5R8001H2zpeoTmmbN7Zl57S3ye0fkcW9D1KZtncOOWaLl3IB0PywA4B9Nyzpm 7nsmdqIQpKfJsUCbgbXuDkW/pJVE1V/+eb9jTQSV/2vz9gd+szj+WxdXvKWvnQhC8QgFpd+Mm6f yz964gz2b1juSch7varEGdobGsPE6BGLWe78HEs6BDVvGUZZ0xwF3Rm0FqtA== X-Google-Smtp-Source: ABdhPJyQqutloFdEIdsbsmBV2H8EI01mWKjLoRIzvHv9waVRILUV25X++zHavfprdradiNrezu7WQgJloj6tjxHB0lo= X-Received: by 2002:a05:6402:187:: with SMTP id r7mr1084488edv.360.1601291933088; Mon, 28 Sep 2020 04:18:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aditya Toshniwal Date: Mon, 28 Sep 2020 16:48:17 +0530 Message-ID: Subject: Re: [pgAdmin] Fix incorrect import in setup.py To: =?UTF-8?Q?Azad_Salahl=C4=B1?= Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000da928905b05dd41c" X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000da928905b05dd41c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Azad, The patch looks good to me. On Thu, Sep 24, 2020 at 6:33 PM Azad Salahl=C4=B1 = wrote: > Hi, > > First time posting here. I've attached a fix for an incorrect import > in `setup.py`. Trying to import from `pgadmin` before adding the root > directory to the system path results in import error, when the script > is invoked in any other way than running it directly. For example > > $ /path/to/venv/bin/pip install pgadmin4 > $ /path/to/venv/bin/python -m pgadmin4.setup > Traceback (most recent call last): > ... > File "/path/to/venv/lib/python3.6/site-packages/pgadmin4/setup.py", > line 18, in > from pgadmin.model import db, User, Version, ServerGroup, Server,= \ > ModuleNotFoundError: No module named 'pgadmin' > > Please let me know what you think. Happy to address any feedback. > > Regards, > Azad Salahl=C4=B1 > --=20 Thanks, Aditya Toshniwal pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com* "Don't Complain about Heat, Plant a TREE" --000000000000da928905b05dd41c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Azad,

The patch looks good to me.

On Thu, Sep 24, = 2020 at 6:33 PM Azad Salahl=C4=B1 <azad.salahli@gmail.com> wrote:
Hi,

First time posting here. I've attached a fix for an incorrect import in `setup.py`. Trying to import from `pgadmin` before adding the root
directory to the system path results in import error, when the script
is invoked in any other way than running it directly. For example

=C2=A0 =C2=A0 $ /path/to/venv/bin/pip install pgadmin4
=C2=A0 =C2=A0 $ /path/to/venv/bin/python -m pgadmin4.setup
=C2=A0 =C2=A0 Traceback (most recent call last):
=C2=A0 =C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 =C2=A0 File "/path/to/venv/lib/python3.6/site-packages/p= gadmin4/setup.py",
line 18, in <module>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 from pgadmin.model import db, User, Version, Se= rverGroup, Server, \
=C2=A0 =C2=A0 ModuleNotFoundError: No module named 'pgadmin'

Please let me know what you think. Happy to address any feedback.

Regards,
Azad Salahl=C4=B1


--
Thanks,
Aditya Toshniwal
pgAdmin hacker=C2=A0| Sr. Softwa= re Engineer | edbpostgres.com<= /font>
"Don't Complain about Heat, Plant a TREE&qu= ot;
--000000000000da928905b05dd41c--