pypa / pipfile

Other
3.24k stars 144 forks source link

Consider scripts section similar to npm package.json #62

Closed proofit404 closed 7 years ago

proofit404 commented 7 years ago

Hi, thanks for yet another awesome tool!

I wander if there is any plans to add commands abbreviations for example in scripts section.

So instead of typing each time pipenv run python -m unittest discover it will be enough to run pipenv test (or maybe pipenv apply test) if we have this in the Pipfile:

[[scripts]]
test = "python -m unittest discover"

Moved from https://github.com/kennethreitz/pipenv/issues/153

Carreau commented 7 years ago

Wouldn't this be better in something like pyproject.toml which already support extra sections for external tools ? It would be better to develop a tool that does discover testing outside of pip/pipfile and once stabilized fold it into pip once the use has been shown and it's stable.

proofit404 commented 7 years ago

I don't know if working with pyproject.toml is in the goal of pipenv tool.

pradyunsg commented 7 years ago

As of now, this functionality is provided by non-pip tools. Pipfile is meant to be a replacement for the requirements.txt format.

It would definitely be great to have something to automatically run the tests and all. It's just not something for Pipfile to handle. This will be provided as a part of pyproject.toml, so that build tools can use it. Pipfile is for handling and managing dependencies.

dstufft commented 7 years ago

Yea, this is something that would go inside of pyproject.toml, not Pipfile.

proofit404 commented 7 years ago

Originally this issue was filed to the pipenv bug tracker and was moved here after maintainer advice. Still I don't have answer that kind of tool can handle scripts whenever it written in pyproject.toml or Pipfile.toml.

dstufft commented 7 years ago

Adding an official section to pyproject.toml would require writing a PEP, individual tools are free to add whatever keys they want under their [tool.NAMEONPYPI] table.

proofit404 commented 7 years ago

If I understand correctly there is no such tool yet?

pradyunsg commented 7 years ago

There are no such tools that I know of.

Currently, the details of the file are still being worked on. PEP 518 is a start to adding proper declarative build information and build system determination. As I see it, the rest will be specified in the near future.