Giter VIP home page Giter VIP logo

Comments (3)

ninjaaron avatar ninjaaron commented on September 23, 2024 3

I'm not sure if this resolves all the issues you bring up, but here's something of mine I've packaged to use wheels: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=pyfil

The wheel is created from source at build() time in the PKGBUILD. pip (and wheel!) are indeed makedepends. This is the script I used to generate it (inspired by pip2pkgbuild, though it is much simpler, being only designed to fit my personal usecase): https://github.com/ninjaaron/dot/blob/master/bin/pkg.py

As a side note, I can assure you that building packages in the normal manner with setup.py does not generate bytecode, though naturally, compiled extensions from C or whatever are built. Check the files from the pip2pkgbuild package and verify.

The only possible downside I can see is that the bytecode will no longer be valid when new versions of python are released, but then it can fall back to source (which leaves us in a situation no worse than using setup.py). This can be amended by rebuilding the package with the new version of python. Well, I guess requiring pip and wheel might also be a downside, but I feel like these are pretty basic dependencies for most systems running python.

One final note is that there are many, many packages in the AUR that fetch binaries and do not actually build from source. This is what my script originally did, but I changed it later to build the wheels locally since I believe this to be more in line with the spirit of the AUR (even if it is not always observed in practice.

from pip2pkgbuild.

wenLiangcan avatar wenLiangcan commented on September 23, 2024

Firstly, sorry for so late to reply and thanks for using pip2pkgbuild.

I have no idea about how wheels work and how to fit it into the packaging process of PKGBUILD. If you have an example PKGBUILD file that use this way of packaging I would like to have a try to add this feature.

Something I want to mention, a Arch Linux package's build process is performed within the packaging time (when you run makepkg from a directory contained a PKGBUILD), after packaging you got a <package-name>.pkg.<archive-format> file (the package), so, a python module Arch Linux package will always ships with bytecode compiled and binary compiled components.

from pip2pkgbuild.

brycepg avatar brycepg commented on September 23, 2024

http://pythonwheels.com/

Packages made from wheels would probably not be allowed in the AUR since they may contain binaries (shared objects). Wheels would probably only be allowed once the package makes the community repository.

The wheel file may be architecture dependent since it may contain compiled c extensions. It also may be minor version dependent. i.e. Python 3.4 only or Python 3.5 only.

You would replace the source of the PKGBUILD with the wheel file instead, so I guess the source may need to change depending on the architecture.

The build() function would no longer be needed.
The package() functions would be using pip to install the wheel, so pip would need to be added to makedepends. Note that this doesn't mean pip is fetching the wheel, but just installing the .whl file into the system.

Also note pypi json contains wheels as bdist_wheel.

A good example is numpy: https://pypi.python.org/pypi/numpy

from pip2pkgbuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.