Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Executing pipfile scripts

Tags:

pipenv

pipfile

How can I execute the scripts defined in the Pipfile?

Following the syntax found here, I defined the scripts section in my pipfile as follows:

[scripts]
tests = "bash ./run-tests.sh"

After running $ pipenv install, how can I call the tests script?

I've tried the following without success:

$ tests

$ pipenv tests

$ pipenv run tests

$ pipenv shell (virtual env) $ tests

like image 293
cstoltze Avatar asked Feb 10 '26 20:02

cstoltze


2 Answers

I had the same problem and I happened to solve it thanks to a discussion in this issue.

Long story short, I only updated pipenv globally before beginning my project, not locally. So I still was using the old version.

To properly update the version of pipenv that you are using, you have to upgrade pipenv also for the user you are using for the project. Hence :

$ sudo pip install pipenv --upgrade --user

solved my problem.

May this silly mistake be my first SO contribution, and my eternal shame.

Edit:

As noted by Coleman Stoltze, the correct way to call the script is :

$ pipenv run tests
like image 173
Rémi Bourgeon Avatar answered Feb 15 '26 21:02

Rémi Bourgeon


Try this:

$ pipenv shell 

$ pipenv run tests
like image 43
pei Avatar answered Feb 15 '26 20:02

pei



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!