Even though there is an issue #7 (Add example into readme), I feel, there are some open questions which is good to have clarified before writing any sort of documentation.
Namely:
How to install
Probably into system python or into the same virtualenv, where is tox installed.
Is pipsi tox-pipenv sufficient?
Initiate Pipfile and Pipfile.lock
Is user expected to create Pipfile and Pipfile.lock before creating and using tox.ini?
Probably yes.
Putting files under source control
Is Pipfile.lock expected to be under source control? According to pipenv doc Pipfile.lock is not recommended under source control if it is going to be used under multiple Python versions.
Role of requirements.txt file
Often, tox users use requirements.txt which is then referenced from within tox.ini file as deps.
Is this expected usage?
Caveat: if the requirements.txt file is created before first pipenv usage, it will be automatically used. It may surprise some users.
Is tox.ini deps section really in control?
It seems to me, that with tox-pipenv the Pipfile is always used for any of created virtualenvs and it includes the --dev dependencies..
This sounds contradicting "explicit is better than implicit".
I would prefer similar usage to existing -rrequirements.txt in deps section where I could explicitly require certain dependencies. Alternatively a directive such as installfrompipfile which would take any of options for pipenv install e.g. nothing (to install all except --dev), --dev to install all incl. --dev), or explicit package names (so we need a list value).
Take into account, that tox.ini is often used for multiple purposes:
- run a test (so production and
--dev section of Pipfile are good fit
- just run, but do not test (only production section is relevant)
- build Sphinx doc (completely different story).
Are we installing into tox managed venvs or into pipenvone?
pipenv allows installing packages into it's own virtualenv. But if there is an activated one, it installs into the activated one.
I feel, we shall install into the tox created virtualenv.
To me it seems (after quick test) that it installs into it's own pipenv virtualenv located in .venv directory. This prevents development scenario, where tox is used to create multiple virtualenvs and developer can easily switch from one to another without recreating them.
Do we really need special tox-pipenv plugin?
Sorry for this stupid question.
After elaborating the previous conceptual question I have found alternative method for coexistence of tox.ini and Pipfile.*:
Simply add into commands section the pipenv install --dev or pipenv instal jinja2 or whatever. As it runs under activated virtual environment it prints out:
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project.
Conclusions?
We are still in search of proper tox and pipenv usage as pipenv is still very fresh. I appreciate the effort put into integrating tox and pipenv as tox is really my very favourite tool. Please, read my comments as contribution to the discussion, not as disregarding your effort.
Even though there is an issue #7 (Add example into readme), I feel, there are some open questions which is good to have clarified before writing any sort of documentation.
Namely:
How to install
Probably into system python or into the same virtualenv, where is tox installed.
Is
pipsi tox-pipenvsufficient?Initiate
PipfileandPipfile.lockIs user expected to create
PipfileandPipfile.lockbefore creating and usingtox.ini?Probably yes.
Putting files under source control
Is
Pipfile.lockexpected to be under source control? According topipenvdocPipfile.lockis not recommended under source control if it is going to be used under multiple Python versions.Role of
requirements.txtfileOften,
toxusers userequirements.txtwhich is then referenced from withintox.inifile as deps.Is this expected usage?
Caveat: if the
requirements.txtfile is created before firstpipenvusage, it will be automatically used. It may surprise some users.Is
tox.inidepssection really in control?It seems to me, that with
tox-pipenvthePipfileis always used for any of created virtualenvs and it includes the--devdependencies..This sounds contradicting "explicit is better than implicit".
I would prefer similar usage to existing
-rrequirements.txtindepssection where I could explicitly require certain dependencies. Alternatively a directive such asinstallfrompipfilewhich would take any of options forpipenv installe.g. nothing (to install all except--dev),--devto install all incl.--dev), or explicit package names (so we need a list value).Take into account, that
tox.iniis often used for multiple purposes:--devsection ofPipfileare good fitAre we installing into
toxmanaged venvs or intopipenvone?pipenvallows installing packages into it's own virtualenv. But if there is an activated one, it installs into the activated one.I feel, we shall install into the
toxcreated virtualenv.To me it seems (after quick test) that it installs into it's own
pipenvvirtualenv located in.venvdirectory. This prevents development scenario, wheretoxis used to create multiple virtualenvs and developer can easily switch from one to another without recreating them.Do we really need special
tox-pipenvplugin?Sorry for this stupid question.
After elaborating the previous conceptual question I have found alternative method for coexistence of
tox.iniandPipfile.*:Simply add into
commandssection thepipenv install --devorpipenv instal jinja2or whatever. As it runs under activated virtual environment it prints out:Conclusions?
We are still in search of proper
toxandpipenvusage aspipenvis still very fresh. I appreciate the effort put into integratingtoxandpipenvastoxis really my very favourite tool. Please, read my comments as contribution to the discussion, not as disregarding your effort.