Re: Converting PyPI to feeds
Tim Diels <[email protected]> Tue, 2 May 2017 16:06:39 +0200
| Newsgroups | gmane.comp.file-systems.zero-install.devel |
|---|---|
| Message-ID | <CAMjmSuStrtdoOTP3uf2ttqEuOxyT0XSiJqYM=Ohbu-0Q-9Ek9A@mail.gmail.com> |
Dear all,
An update on the PyPI to 0install conversion + feature request:
I've got most of the support for Python source distributions implemented
but it turns out some important packages (e.g. numpy) only provide wheels
(a type of binary package). Some wheels need to match the ABI of the Python
interpreter (to name just one constraint). Ideally the wheel with the most
specific ABI and architecture that matches the selected interpreter is
used. I plan to implement this as follows as a temporary solution to try
things out:
- python.xml: manually written feed containing CPython, PyPy, ...
<implementation ...>
<require interface="python_abi.xml" version="0|1|2|4|...">
...
- python_abi.xml: manually written
<implementation id='py3_3' version='2'/>
<implementation id='py3' version='1'/>
<implementation id='none' version='0'/>
...
- some_wheel.xml
<impl>
<require interface=python_abi.xml version="1|2">
Versions encode ABI names such as 'py3'. Version numbers are chosen such
that more specific ABIs will be chosen when possible. The ABI
implementations are empty as they only serve to constrain which
implementations may be selected. The Python implementation provides ABIs
py3_3, py3 and the special 'none' for those wheels which do not care about
the ABI.
When moving on from a temporary solution, it would be useful to have a way
of defining a property, its values, an ordering between values and
requiring properties. Currently these values needn't form a hierarchy. So
for example:
- property.xml
<value>py3_3</value> <!-- plus a way to express ordering of values,
perhaps simply the order in which they appear in the xml -->
<value>py3</value>
- python.xml
<implementation ...>
<require property="property.xml" value="py3_3|py3|...">
...
Or put yet another way, it's a classification with an ordering that can be
depended on with <requires>.
Cheers,
Tim
On 18 February 2017 at 00:18, Tim Diels <[email protected]> wrote:
> I've made a draft on how to convert PyPI packages to ZI feeds (most of the
> documentation section):
>
> https://github.com/timdiels/pypi-to-0install#documentation
>
> I'd appreciate any comments/review of it before going ahead and
> implementing it. This approach assumes setup.py has the typical interface
> that setuptools.setup would, no need for docker this way.
>
> On Wed, Feb 1, 2017 at 5:14 PM, Tim Diels <[email protected]> wrote:
>
>> Dear all,
>>
>> I'm considering automatically converting the Python packages listed in
>> the Python Packaging Index (PyPI) to Zero Install feeds; Python packaging
>> has a few problems which Zero Install would solve. One main issue with this
>> is that Python packages are installed by executing a package's setup.py
>> script. While this file usually is implemented by calling setuptools.setup,
>> this is not always the case.
>>
>> One approach would be to convert them to source packages. Its compilation
>> step would call setup.py and the changes it makes to the system would be
>> recorded; just like an AUR package would. Then, a build server should
>> compile these source packages into binary packages. By default, the build
>> server assumes the binary package will work on any system. This assumption
>> can be corrected later, for individual source packages, by manually
>> specifying a list of environments to build in/for. Alternatively, if Zero
>> Install can conveniently install something with source dependencies these
>> days, it might be better not to automatically generate binary packages.
>>
>> Has anyone else looked into doing this? Any suggestions?
>>
>> Best regards,
>>
>> Tim
>>
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Zero-install-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/zero-install-devel