distutils2

Automate compilation of protobuf specs into python classes in setup.py

你。 提交于 2020-01-01 14:42:53
问题 I have a python project that uses google protobufs as a message format for communicating over the network. Generating python files from the .proto files is straight-forward using the protoc program. How can I configure my setup.py file for the project so that it automatically calls the protoc command? 回答1: In a similar situation, I ended up with this code (setup.py, but written in a way to allow extraction into some external Python module for reuse). Note that I took the generate_proto

How to overwrite pypi package when doing upload from command line?

怎甘沉沦 提交于 2019-12-08 14:32:00
问题 I want to automate the upload process bug in some cases the python setup.py upload fails because pypi server already have the save version uploaded. How can I force it to upload, from the script (i know I can remove the old variant using the web interface). 回答1: Here's an actual answer, not just me adding more pontification in the comments. Found this thread: https://www.reddit.com/r/Python/comments/35xr2q/howto_overwrite_package_when_reupload_to_pypi/ That refers to this: http://comments

Compiling an optional cython extension only when possible in setup.py

无人久伴 提交于 2019-12-07 10:56:51
问题 I have a python module fully implemented in python. (For portability reasons.) The implementation of a small part has been duplicated in a cython module. To improve perfomance where possible. I know how to install the .c modules created by cython with distutils . However if a machine has no compiler installed, I suspect the setup will fail even though the module is still usable in pure python mode. Is there a way to compile the .c module if possible but fail gracefully and install without it

Compiling an optional cython extension only when possible in setup.py

大兔子大兔子 提交于 2019-12-05 16:59:31
I have a python module fully implemented in python. (For portability reasons.) The implementation of a small part has been duplicated in a cython module. To improve perfomance where possible. I know how to install the .c modules created by cython with distutils . However if a machine has no compiler installed, I suspect the setup will fail even though the module is still usable in pure python mode. Is there a way to compile the .c module if possible but fail gracefully and install without it if compiling is not possible? I guess you will have to make some modification both in your setup.py and

Automate compilation of protobuf specs into python classes in setup.py

不想你离开。 提交于 2019-12-04 12:55:58
I have a python project that uses google protobufs as a message format for communicating over the network. Generating python files from the .proto files is straight-forward using the protoc program. How can I configure my setup.py file for the project so that it automatically calls the protoc command? In a similar situation, I ended up with this code (setup.py, but written in a way to allow extraction into some external Python module for reuse). Note that I took the generate_proto function and several ideas from the setup.py file of the protobuf source distribution. from __future__ import

How to distribute `.desktop` files and icons for a Python package in Gnome (with distutils or setuptools)?

点点圈 提交于 2019-11-29 04:12:06
Currently I'm using the auto-tools to build/install and package a project of mine, but I would really like to move to something that feels more "pythonic". My project consists of two scripts, one module, two glade GUI descriptions, and two .desktop files. It's currently a pure python project, though that's likely to change soon-ish. Looking at setuptools I can easily see how to deal with everything except the .desktop files; they have to end up in a specific directory so that Gnome can find them. Is using distuils/setuptools a good idea to begin with? I managed to get this to work, but it

How to distribute `.desktop` files and icons for a Python package in Gnome (with distutils or setuptools)?

十年热恋 提交于 2019-11-27 18:17:39
问题 Currently I'm using the auto-tools to build/install and package a project of mine, but I would really like to move to something that feels more "pythonic". My project consists of two scripts, one module, two glade GUI descriptions, and two .desktop files. It's currently a pure python project, though that's likely to change soon-ish. Looking at setuptools I can easily see how to deal with everything except the .desktop files; they have to end up in a specific directory so that Gnome can find