Universal packaging tool (for pypi, cpan, ruby, ...)

Rainer Müller raimue at macports.org
Wed Feb 13 22:26:55 UTC 2019


On 12.02.19 03:40, Cyril Roelandt wrote:
> I'm the author of upt.

Thanks for joining the discussion!

> On 2019-02-10 21:24, Mojca Miklavec wrote:
>> Hi,
>> Last week I was sitting in cafeteria with the author of a new python
>> package "upt" (Universal packaging tool) whose aim is to provide
>> automatic conversion from one of the repositories like pypi, cpan,
>> ruby gems, npm, ... into any other package manager.
>>     https://framagit.org/upt
>>     https://fosdem.org/2019/schedule/event/package_software_with_upt/
> The video is not online yet, but should appear on the FOSDEM page soon.
> A quick summary: upt is a collection of modules. Some are "frontend"
> modules and parse upstream package archives (PyPI, CPAN, ...), others
> are "backend" modules, and create a source package suitable for a
> downstream distribution (Fedora, OpenBSD, and maybe soon, MacPorts!).

This is a great initiative. One of our problems has always been that
these tools kind of need to be written in the native language of the
upstream package (Python, Perl, ...), because that is the only language
with bindings to parse the package specfications. Unifying this with the
frontend/backend approach sounds like a good idea.

>> For us this could at some point replace pypi2port & cpan2port (less
>> important), but more importantly we have no such tool for ruby gems (I
>> believe?), and maybe someone would write a frontend for npm or another
>> tricky "package manager" one day.
> It is worth noting that, because of the modular nature of upt, every
> time someone adds/updates a frontend, the improvements are available for
> every single backend (including the MacPorts one Mojca is working on).
> This means that all distro developers end up sharing their hard work.
>> What's currently not implemented are non-python / non-perl
>> dependencies, and an easy way to upgrade (it can create the package
>> for the first time, but if you make lots of changes, it doesn't know
>> how to "merge" the manual changes with changes in the upstream
>> package).
> Regarding non-Python dependencies in Python packages, I do not think
> setuptools allows developers to specify them. Maybe I'm mistaken?

I think external libraries would be specified in the ext_modules=[]
argument that is passed to setup(), where each Extension can list
external libraries for linking.


Of course, the package(s) actually providing the shared library may be
different depending on the downstream distribution...

> Regarding updates, I think I did not answer your question at FOSDEM.
> Sorry about that, it was a bit of a stressful talk, as you may
> remember :) How does pypi2port work with upgrades?

Our generators do not assist with upgrades in any way. You could only
generate a Portfile for the new version again, but then manual work is
required to merge the changes into the existing Portfile.


More information about the macports-dev mailing list