[Distutils] Proposal: "Install and save"
Wes Turner
wes.turner at gmail.com
Sat Jul 30 21:23:14 EDT 2016
pbr also supports "environment markers"
which we would want to preserve when round-tripping (reading in, modifying,
and writing out) requirements.txt files;
though IDK if environment markers are part of any Python Packaging Spec?
from http://docs.openstack.org/developer/pbr/#environment-markers :
argparse; python_version=='2.6'
On Sat, Jul 30, 2016 at 12:50 PM, Wes Turner <wes.turner at gmail.com> wrote:
> pipup has "save to a requirements.txt" functionality
> https://github.com/revsys/pipup
>
> It looks like it doesn't yet handle hash-checking mode (which is from
> peep, IIRC):
>
> - https://pip.pypa.io/en/stable/reference/pip_install/#hash-checking-mode
> - https://github.com/revsys/pipup/blob/master/pipup/req_files.py
>
> I think str(req_install.InstallRequirement) could/should just work? Or
> maybe to_requirements_str()?
> - https://github.com/pypa/pip/blob/master/pip/req/req_file.py
> - https://github.com/pypa/pip/blob/master/pip/req/req_install.py
>
> pip-tools probably has InstallRequirement.to_requirements_str()?
>
> - https://github.com/nvie/pip-tools/blob/master/piptools/writer.py
> - https://github.com/nvie/pip-tools/blob/master/piptools/utils.py
> - format_requirement()
> - format_specifier()
>
> Round-trip with requirements.txt files would probably be useful
>
>
> On Sunday, July 24, 2016, Brett Cannon <brett at python.org> wrote:
>
>>
>>
>> On Sat, 23 Jul 2016 at 10:36 Daniel Holth <dholth at gmail.com> wrote:
>>
>>> Not yet. Someone should fix that 😎
>>>
>> There is an issue tracking that if someone gets adventurous enough to
>> write up a PR: https://github.com/pypa/pip/issues/3691 .
>>
>> -Brett
>>
>>
>>>
>>> On Sat, Jul 23, 2016, 11:37 Alex Grönholm <alex.gronholm at nextday.fi>
>>> wrote:
>>>
>>>> pip doesn't yet support pyproject.toml does it?
>>>>
>>>>
>>>> 23.07.2016, 17:43, Daniel Holth kirjoitti:
>>>>
>>>> Here is my attempt. The SConstruct (like a Makefile) builds the
>>>> extension. The .toml file gives the static metadata. No need to put the two
>>>> in the same file.
>>>>
>>>> https://bitbucket.org/dholth/cryptacular/src/tip/SConstruct
>>>>
>>>> https://bitbucket.org/dholth/cryptacular/src/tip/pyproject.toml
>>>>
>>>> On Sat, Jul 23, 2016 at 10:11 AM Alex Grönholm <
>>>> alex.gronholm at nextday.fi> wrote:
>>>>
>>>>> 23.07.2016, 17:04, Thomas Kluyver kirjoitti:
>>>>> > On Sat, Jul 23, 2016, at 02:32 PM, Alex Grönholm wrote:
>>>>> >> I'm -1 on this because requirements.txt is not really the standard
>>>>> way
>>>>> >> to list dependencies.
>>>>> >> In the Python world, setup.py is the equivalent of Node's
>>>>> package.json.
>>>>> >> But as it is
>>>>> >> Python code, it cannot so easily be programmatically modified.
>>>>> > Packaging based on declarative metadata:
>>>>> > http://flit.readthedocs.io/en/latest/
>>>>> > </blowing_own_trumpet>
>>>>> >
>>>>> > We have a bit of a divide. Specifying dependencies in setup.py (or
>>>>> > flit.ini, or upcoming pyproject.toml) is the standard for library and
>>>>> > tool packages that are intended to be published on PyPI and installed
>>>>> > with pip. requirements.txt is generally used for applications which
>>>>> will
>>>>> > be distributed or deployed by other means.
>>>>> >
>>>>> > As I understand it, in the Javascript world package.json is used in
>>>>> both
>>>>> > cases. Is that something Python should try to emulate? Is it hard to
>>>>> > achieve given the limitations of setup.py that you pointed out?
>>>>> This topic has been beaten to death. There is no way to cram the
>>>>> complexities of C extension compilation setup into purely declarative
>>>>> metadata. Distutils2 tried and failed. Just look at the setup.py files
>>>>> of some popular projects and imagine all that logic expressed in
>>>>> declarative metadata.
>>>>> > Thomas
>>>>> > _______________________________________________
>>>>> > Distutils-SIG maillist - Distutils-SIG at python.org
>>>>> > https://mail.python.org/mailman/listinfo/distutils-sig
>>>>>
>>>>> _______________________________________________
>>>>> Distutils-SIG maillist - Distutils-SIG at python.org
>>>>> https://mail.python.org/mailman/listinfo/distutils-sig
>>>>>
>>>>
>>>> _______________________________________________
>>> Distutils-SIG maillist - Distutils-SIG at python.org
>>> https://mail.python.org/mailman/listinfo/distutils-sig
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20160730/ffbf7f1b/attachment-0001.html>
More information about the Distutils-SIG
mailing list