2

Broadly speaking, I'm looking for something that behaves much more like npm or yarn, surely there must be something better than pip!

I know that questions should be clear cut and not invite opinionated answers, so here are a list of requirements I have for what I consider a better package manager (lets call it ppm):

  • ppm must be able to access the PyPi repository
  • ppm must automatically add installed packages to a "package" file.
  • It must be possible for someone else to install all the same packages as me given said "package" file.
  • It should be possible to easily integrate the dependencies listed in this "package" file into the setup.py file so that it easy to then publish the code to PyPi.
  • ppm should support running custom scripts for example I should be able to type:
>>> ppm run tests

and have it run the (less than memorable) command:

>>> python -m unittest discover -s <test_folder> -p '*_test.py'

or whatever specific test, run, build or packaging command is needed.


So what package managers exist that meet some or all of my requiments? Or what workarounds are available to me that would meet my requirements?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Resonance
  • 3,359
  • 2
  • 16
  • 20

1 Answers1

0

Pipenv is in my opinion close to something like npm. Although, I am not sure if it can run scripts. https://github.com/pypa/pipenv

Edit: Looks like it can run custom scripts, tests ect.

The Fool
  • 16,715
  • 5
  • 52
  • 86
  • 1
    I was worried someone would recommend `pipenv`. I have previously found it to be incredibly buggy. I gave it second chance today, I still can't say I'm impressed, it's failing to install packages and I'm not having much luck googling the errors. But thanks all the same for your answer, I will persevere with `pipenv` for a little longer. – Resonance Sep 29 '19 at 12:52
  • 1
    OK so uninstalling pyenv and pipenv, rebooting and installing them again (remembering the `eval "$(pyenv init -)"` at the bottom of my `.bash_profile`) has resolved my ungooglable bugs. – Resonance Sep 29 '19 at 15:25
  • @Resonance just wondering. Why pyenv and pipenv together? Wouldn't one of them do the trick? – The Fool Oct 04 '19 at 19:48
  • 1
    Pipenv uses pyenv to create venvs. Pyenv on its own it not a package manager. And pipenv on its on is not able to create venvs. See the duplicate question for more info. – Resonance Oct 04 '19 at 21:05
  • Thanks, for the clarification. – The Fool Oct 04 '19 at 21:08