question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: dev/deploy workflow

See original GitHub issue

Hi. I’m looking for some guide/tutorial on using pipenv in development-delivery cycle, currently I’m missing two key points in docs:

  1. What is proper way to deploy microservice based on Pipfile[.lock] (i.e., how to build docker container?). My feeling is that during deployment only .lock should be read, as described set of dependencies developed/tested with, but it’s not clear what’s the proper way:
    • sync seems to be appropriate (reads .lock file, installs packages), but doesn’t support --system (addressed in #2227) ­— which is default approach while building containers
    • install --system is ok for installing in container, also support --deploy — is it defferent from sync? Docs says “This will fail a build if the Pipfile.lock is out–of–date” — does it check against PyPI or Pipfile?
    • install --ignore-pipfile — is it the same as sync?
  2. What’s the way to use editable installs while developing? Pretty often I develop library and app (using that library) at the same time — to ensure compatibility/ease of interface use/etc. While working with pip I can do one-timer like pip install -e path/to/local/lib, or manage some requirements-dev that’s local for every developer. During dev install we can feed all requirement files, for CI — only libraries from upstream. I’m looking for something similar with pipenv — support for [dev-packages] is perfect in terms of handling priorities during install and locking, but I can’t put there any “per developer”-specific configuration. And afaik, pipenv can not work with multiple Pipfiles.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
txomoncommented, Jul 16, 2018

I just ran into this, and the steps I am doing have the problem that are creating a virtualenv inside the docker, which is not nice, but better than the alternatives

In theory the steps should just be:

  • Copy Pipfile.lock to docker
  • Run pipenv sync --system
  • Commands run normally

Using pipenv install --system --ignore-pipfile --deploy

Doesn’t work, and I have no idea how to workaround on it.

Step 7/11 : RUN pipenv install --ignore-pipfile --system --deploy
 ---> Running in 74849d6693e8
Warning: --system is intended to be used for pre-existing Pipfile installation, not installation of specific packages. Aborting.

Using pipenv install --ignore-pipfile --deploy

Doesn’t work,

Step 7/11 : RUN pipenv install --ignore-pipfile --deploy $REQ
 ---> Running in 3cc1ca26caf4
Creating a virtualenv for this project...
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli.py", line 435, in install
    selective_upgrade=selective_upgrade,
  File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 1759, in do_install
    pypi_mirror=pypi_mirror,
  File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 609, in ensure_project
    three=three, python=python, site_packages=site_packages, pypi_mirror=pypi_mirror
  File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 556, in ensure_virtualenv
    do_create_virtualenv(python=python, site_packages=site_packages, pypi_mirror=pypi_mirror)
  File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 879, in do_create_virtualenv
    crayons.red(project.pipfile_location, bold=True),
TypeError: __str__ returned non-string (type NoneType)

Using install alone

It will regenerate the lock, which makes no sense. I would rather use a pip freeze output

1reaction
butlacommented, Jul 3, 2018

Ok, I’ll try to create a good case for this at some point.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Questions about the new development workflow - Help me!
Hi. I'm stepping into the new development workflow and I'm trying to match some of the tasks we actually do with the behaviour...
Read more >
Dev Test Production Workflow - Alpha Anywhere Documentation
We can roll back the production deployment. If a problem shows up in production and needs to be addressed immediately, you can roll...
Read more >
Deployments Best Practices
This guide explains how to better deal with deployments in your development workflow and provides some best practices for deployments.
Read more >
Use the Pantheon WebOps Workflow
Understand the Pantheon WebOps workflow, and how to use separate Dev, Test, and Live environments for your Drupal or WordPress sites.
Read more >
Retrieve and Deploy a workflow using ANT
I would like to deploy this workflow from the developer sandbox to our fullcopy sandbox using ANT. However, I am not seeing any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found