Hacker News new | ask | show | jobs
by renesd 3435 days ago
Neat. Now for questions and comments.

Often people have a requirements.live.txt, or other packages depending on the environment. Is that handled somehow? Can we use different files or sections? [ED: yes, different sections]

Still wondering to myself if this is worth the fragmentation for most people using requirements.txt ? Perhaps the different sections could have a "-r requirements.txt" in there, like how requirements.dev.txt can have "-r requirements.txt". [ED: the pipfile idea seems to have quite some people behind it, and pip will support it eventually. Seems it will be worth it to standardise these things. requirements.txt is a less jargony name compared to Pipfile though, and has a windows/gui friendly extension.]

Other tools can set up an environment, download stuff, and run the script. Will pipenv --shell somescript.py do what I want? (run the script with the requirements it needs). ((I guess I could just try it.)) [ED: doesn't seem so]

Why Pipfile with Caps? Seems sort of odd for a modern python Thing. It looks like a .ini file? [ED: standard still in development it seems. TOML syntax.]

With a setup.py set up, all you need to do is `pip install -e .` to download all the required packages. Or `pip install somepackage`. Lots of people make the setup.py file read the requirements.txt. Do you have some command for handling this integration? Or is this needed to be done manually? [ED: seems no considering about this/out of scope.]

Is there a pep? [ED: too early it seems.]

1 comments

Check out https://github.com/pypa/pipfile for more info. The format is TOML. It is mainly intended for deployments (e.g. web applications)
Thanks.
Also `pipenv install -r requirements.txt` is supported, for importing.
That's nice.

Have you seen fades [0]?

It lets you do things like::

    fades --requirement requirements.txt myscript.py
You can also mark the dependencies in your myscript.py as comments. The use case is for quick one off scripts which may require a bunch of different requirements. The integration with ipython is nice for experimenting too. I think pyenv could be useful for that use case of little one off experiments too.

One enhancement I'd like for it to also run modules or entry points like:

    fades --dependency pygame -m pygame.examples.aliens

Setuptools entry points like used in console_scripts to work would be nice too:

    fades --dependency pyenv -m pyenv.cli:cli
Or the best::

    fades -m pygame.examples.aliens

So it can create a virtualenv, see that it needs the package (pygame here), and then install that package with pip, and then run the module or entry point.

Anyway... just some dreaming. Can I haz pony? All this is exciting.

[0] https://github.com/PyAr/fades