Trouble running pipenv in CI
See original GitHub issueI’ve been trying to get pipenv to work with gitlab CI, but i’m getting errors. Here are last lines of output:
To activate this project's virtualenv, run the following:
$ pipenv shell
$ pipenv run --no-interactive python manage.py migrate
ERROR: Job failed: exit code 1
And here is my .gitlab.ci.yaml
# This file is a template, and might need editing before it works on your project.
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/python
image: python:latest
# Pick zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-service
services:
- postgres:latest
variables:
POSTGRES_DB: db
POSTGRES_USER: user
POSTGRES_PASSWORD: password
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- ~/.cache/pip/
# This is a basic example for a gem or script which doesn't use
# services such as redis or postgres
before_script:
- python -V # Print out python version for debugging
# Uncomment next line if your Django app needs a JS runtime:
# - apt-get update -q && apt-get install nodejs -yqq
- pip install pipenv
- pipenv install --dev
test:
variables:
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
script:
- pipenv run python manage.py migrate
- pipenv run python manage.py test
- pipenv run coverage run -m pytest
- pipenv run coverage run report
Any idea why it fails? I did also try to run pipenv shell
, but that failed too.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
using pipenv with gitlab ci - python - Stack Overflow
Therefore I want to use pipenv with Gitlab runner too. My gitlab-ci.yml file contains stages: - test - deploy test: stage: test script:...
Read more >Quirks of Pipenv on Travis CI and AppVeyor | by Dirk Avery
My initial impressions of using Pipenv with continuous integration tools Travis CI and AppVeyor are basically good. However, there are a few quirks....
Read more >Advanced Usage of Pipenv - Read the Docs
Pipenv makes an API call to retrieve those results and use them each time you run pipenv check to show you vulnerable dependencies....
Read more >pipenv · PyPI
Pipenv : Python Development Workflow for Humans. image CI image. Pipenv is a tool that aims to bring the best of all packaging...
Read more >Making pip installs a little less slow - Python⇒Speed
Installing packages with pip, Poetry, and Pipenv can be slow. ... Whether you're running tests in CI, building a Docker image, or installing ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve found a workaround for the issue - not sure if it’s a proper way, however it’s only thing that at the moment works for me. The solution is to put following commands into CI job:
@nateprewitt #320 solved the issue for me without using workaround, so now I can simply use:
For me issue is fixed.