qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/7] python/qemu: Add pipenv support


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH 4/7] python/qemu: Add pipenv support
Date: Fri, 5 Jun 2020 19:21:03 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1

03.06.2020 03:15, John Snow wrote:
pipenv is a tool used for managing virtual environments with precisely
specified dependencies. It is separate from the dependencies listed in
setup.py, which are (by 'best practices') not supposed to be pinned.

Note that pipenv is not required to install or use this module; this is
just a convenience for in-tree developing.

Here, a "blank" pipfile is added with no dependencies, but specifies
Python 3.6 for the virtual environment.

Pipfile will specify our version minimums, while Pipfile.lock specifies
an exact loudout of packages that were known to operate correctly. This
latter file provides the real value for easy setup of container images
and CI environments.

Signed-off-by: John Snow <jsnow@redhat.com>
---
  python/Pipfile | 11 +++++++++++
  1 file changed, 11 insertions(+)
  create mode 100644 python/Pipfile

diff --git a/python/Pipfile b/python/Pipfile
new file mode 100644
index 00000000000..9534830b5eb
--- /dev/null
+++ b/python/Pipfile
@@ -0,0 +1,11 @@
+[[source]]
+name = "pypi"
+url = "https://pypi.org/simple";
+verify_ssl = true
+
+[dev-packages]
+
+[packages]
+
+[requires]
+python_version = "3.6"


Should it be >= or something like this?

And, how should I use this all?

My failed attempt:
[root@kvm python]# pipenv install --python /usr/bin/python3
Virtualenv already exists!
Removing existing virtualenv…
Creating a virtualenv for this project…
Pipfile: /work/src/qemu/john-python-installable/python/Pipfile
Using /usr/bin/python3 (3.7.5) to create virtualenv…
⠹ Creating virtual environment...created virtual environment 
CPython3.7.5.final.0-64 in 112ms
  creator CPython3Posix(dest=/root/.local/share/virtualenvs/python-4FwBBPCc, 
clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, 
wheel=latest, via=copy, 
app_data_dir=/root/.local/share/virtualenv/seed-app-data/v1.0.1)
  activators 
BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

✔ Successfully created virtual environment!
Virtualenv location: /root/.local/share/virtualenvs/python-4FwBBPCc
Warning: Your Pipfile requires python_version 3.6, but you are using 3.7.5 
(/root/.local/share/v/p/bin/python).
  $ pipenv --rm and rebuilding the virtual environment may resolve the issue.
  $ pipenv check will surely fail.
Installing dependencies from Pipfile.lock (44d7bd)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
[root@kvm python]# pipenv shell
Warning: Your Pipfile requires python_version 3.6, but you are using 3.7.5 
(/root/.local/share/v/p/bin/python).
  $ pipenv --rm and rebuilding the virtual environment may resolve the issue.
  $ pipenv check will surely fail.
Launching subshell in virtual environment…
 . /root/.local/share/virtualenvs/python-4FwBBPCc/bin/activate
[root@kvm work]#  . /root/.local/share/virtualenvs/python-4FwBBPCc/bin/activate
(python) [root@kvm work]# python
Python 3.7.5 (default, Oct 17 2019, 12:09:47)
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
import pylint
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pylint'


and iotest 297 says: "pylint-3 not found"

(honestly, I'm new to using python virtual environment)

--
Best regards,
Vladimir



reply via email to

[Prev in Thread] Current Thread [Next in Thread]