Debian build package: Add python virtualenv into dpkg-buildpackage to be uploaded to launchpadHow do I find the location of my Python site-packages directory?What parts of a virtualenv need to be changed to relocate it?Is there a standard way to create Debian packages for distributing Python programs?Installing PIP packages to a Virtualenv using a download cacheHow to write a Python module/package?How to get virtualenv to use dist-packages on Ubuntu?Instaling cross-compiled debian packages to fake “footfs” with dpkgHow to use Python Matplotlib with OSx and virtualenv?Is there a way to compile python application into static binary?Package Python script in virtualenv into a Debian package

Is it possible to disable color highlighting in css-mode?

Speeding up thousands of string parses

Will electrically joined dipoles of different lengths, at right angles, behave as a multiband antenna?

Data normalization before or after train-test split?

Motorcyle Chain needs to be cleaned every time you lube it?

AB5E type molecule

Chess problem: Make a crossword in 3 moves

How to deal with administrative duties killing the research spirit?

Has there ever been a cold war other than between the U.S. and the U.S.S.R.?

Convenience stores in India

How did שְׁלֹמֹה (shlomo) become Solomon?

Park the computer

Using Sed to add counter to keyword

What is the maximum amount of diamond in one Minecraft game?

Can a wizard delay learning new spells from leveling up to learn different spells later?

Do the 26 richest billionaires own as much wealth as the poorest 3.8 billion people?

How do both sides know the MTU

What are the differences of checking a self-signed certificate vs ignore it?

How to travel between two stationary worlds in the least amount of time? (time dilation)

how to convert Timestring to seconds

When do I make my first save against the Web spell?

How can I effectively map a multi-level dungeon?

Interview Question - Card betting

Campanolo record power meter crank with veloce crankset



Debian build package: Add python virtualenv into dpkg-buildpackage to be uploaded to launchpad


How do I find the location of my Python site-packages directory?What parts of a virtualenv need to be changed to relocate it?Is there a standard way to create Debian packages for distributing Python programs?Installing PIP packages to a Virtualenv using a download cacheHow to write a Python module/package?How to get virtualenv to use dist-packages on Ubuntu?Instaling cross-compiled debian packages to fake “footfs” with dpkgHow to use Python Matplotlib with OSx and virtualenv?Is there a way to compile python application into static binary?Package Python script in virtualenv into a Debian package






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I would like to pack a python program and ship it in a deb package.



For reasons (I know in 99% it is bad practice) I want to ship the program in a python virtual environment within a debian package.



I know I can do this using dh-virtualenv. This works great - generally no problem.
But the problem arises when I want to upload this to launchpad. Uploading to launchpad means uploading a source package. In terms of dh-virtualenv a source package is the package description, where the virtualenv has not been created, yet.



What happens when I upload this to launchpad is, that the package will not build, since the dh-virtualenv which is executed during the build process on launchpad will try to install python modules into the virtualenv, which means installing these from the PyPI, which will not work, since launchpad does not allow external network access.



So basically there are two possible solutions:



Approach A



Prepare the virtualenv and somehow incorporate it into the source package and having the dh build process simply "move" this prepared virtualenv to its end location. This could work with virtualenv --relocatable. BUT the relocation strips the utf-8 marker at the beginning of all python scripts, rendering all python scripts in the virtualenv broken.



Apporach B



Somehow cache all necessary python packages in the source package and have dh_virtualenv install from the cache instead of from PyPI.
This seems like to be doable with pip2pi, but certain experiements show, that it will not install packages, although they are located in the local package index.



Both approaches seem a bit clumsy and prone to errors.
What do you think of this?
What are your experiences?
What would you recommend?










share|improve this question






















  • I would recommend doing it properly and packaging every dependency separately. Consider that py2deb exists and it helps you creating a skeleton structure from pip dependencies.

    – LtWorf
    Mar 25 at 18:48











  • I knew that s.o. would say this. But considering we also want to provide the software on other distros, this would get a fulltime job, which I am currently not willing to take. But thanks for your point of view!

    – cornelinux
    Mar 25 at 21:58











  • If you learn proper packaging, you'll find out that it's easier than your own hand written scripts. (I contribute to Debian).

    – LtWorf
    Mar 25 at 23:01











  • Also, are you still using python2?

    – LtWorf
    Mar 25 at 23:12











  • @LtWorf I have no time to explain the above mentioned many reasons and you are obviously not interested in. Anyway thanks for your time to comment on this.

    – cornelinux
    Mar 26 at 6:10

















0















I would like to pack a python program and ship it in a deb package.



For reasons (I know in 99% it is bad practice) I want to ship the program in a python virtual environment within a debian package.



I know I can do this using dh-virtualenv. This works great - generally no problem.
But the problem arises when I want to upload this to launchpad. Uploading to launchpad means uploading a source package. In terms of dh-virtualenv a source package is the package description, where the virtualenv has not been created, yet.



What happens when I upload this to launchpad is, that the package will not build, since the dh-virtualenv which is executed during the build process on launchpad will try to install python modules into the virtualenv, which means installing these from the PyPI, which will not work, since launchpad does not allow external network access.



So basically there are two possible solutions:



Approach A



Prepare the virtualenv and somehow incorporate it into the source package and having the dh build process simply "move" this prepared virtualenv to its end location. This could work with virtualenv --relocatable. BUT the relocation strips the utf-8 marker at the beginning of all python scripts, rendering all python scripts in the virtualenv broken.



Apporach B



Somehow cache all necessary python packages in the source package and have dh_virtualenv install from the cache instead of from PyPI.
This seems like to be doable with pip2pi, but certain experiements show, that it will not install packages, although they are located in the local package index.



Both approaches seem a bit clumsy and prone to errors.
What do you think of this?
What are your experiences?
What would you recommend?










share|improve this question






















  • I would recommend doing it properly and packaging every dependency separately. Consider that py2deb exists and it helps you creating a skeleton structure from pip dependencies.

    – LtWorf
    Mar 25 at 18:48











  • I knew that s.o. would say this. But considering we also want to provide the software on other distros, this would get a fulltime job, which I am currently not willing to take. But thanks for your point of view!

    – cornelinux
    Mar 25 at 21:58











  • If you learn proper packaging, you'll find out that it's easier than your own hand written scripts. (I contribute to Debian).

    – LtWorf
    Mar 25 at 23:01











  • Also, are you still using python2?

    – LtWorf
    Mar 25 at 23:12











  • @LtWorf I have no time to explain the above mentioned many reasons and you are obviously not interested in. Anyway thanks for your time to comment on this.

    – cornelinux
    Mar 26 at 6:10













0












0








0








I would like to pack a python program and ship it in a deb package.



For reasons (I know in 99% it is bad practice) I want to ship the program in a python virtual environment within a debian package.



I know I can do this using dh-virtualenv. This works great - generally no problem.
But the problem arises when I want to upload this to launchpad. Uploading to launchpad means uploading a source package. In terms of dh-virtualenv a source package is the package description, where the virtualenv has not been created, yet.



What happens when I upload this to launchpad is, that the package will not build, since the dh-virtualenv which is executed during the build process on launchpad will try to install python modules into the virtualenv, which means installing these from the PyPI, which will not work, since launchpad does not allow external network access.



So basically there are two possible solutions:



Approach A



Prepare the virtualenv and somehow incorporate it into the source package and having the dh build process simply "move" this prepared virtualenv to its end location. This could work with virtualenv --relocatable. BUT the relocation strips the utf-8 marker at the beginning of all python scripts, rendering all python scripts in the virtualenv broken.



Apporach B



Somehow cache all necessary python packages in the source package and have dh_virtualenv install from the cache instead of from PyPI.
This seems like to be doable with pip2pi, but certain experiements show, that it will not install packages, although they are located in the local package index.



Both approaches seem a bit clumsy and prone to errors.
What do you think of this?
What are your experiences?
What would you recommend?










share|improve this question














I would like to pack a python program and ship it in a deb package.



For reasons (I know in 99% it is bad practice) I want to ship the program in a python virtual environment within a debian package.



I know I can do this using dh-virtualenv. This works great - generally no problem.
But the problem arises when I want to upload this to launchpad. Uploading to launchpad means uploading a source package. In terms of dh-virtualenv a source package is the package description, where the virtualenv has not been created, yet.



What happens when I upload this to launchpad is, that the package will not build, since the dh-virtualenv which is executed during the build process on launchpad will try to install python modules into the virtualenv, which means installing these from the PyPI, which will not work, since launchpad does not allow external network access.



So basically there are two possible solutions:



Approach A



Prepare the virtualenv and somehow incorporate it into the source package and having the dh build process simply "move" this prepared virtualenv to its end location. This could work with virtualenv --relocatable. BUT the relocation strips the utf-8 marker at the beginning of all python scripts, rendering all python scripts in the virtualenv broken.



Apporach B



Somehow cache all necessary python packages in the source package and have dh_virtualenv install from the cache instead of from PyPI.
This seems like to be doable with pip2pi, but certain experiements show, that it will not install packages, although they are located in the local package index.



Both approaches seem a bit clumsy and prone to errors.
What do you think of this?
What are your experiences?
What would you recommend?







python virtualenv dpkg






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 25 at 18:42









cornelinuxcornelinux

5524 silver badges15 bronze badges




5524 silver badges15 bronze badges












  • I would recommend doing it properly and packaging every dependency separately. Consider that py2deb exists and it helps you creating a skeleton structure from pip dependencies.

    – LtWorf
    Mar 25 at 18:48











  • I knew that s.o. would say this. But considering we also want to provide the software on other distros, this would get a fulltime job, which I am currently not willing to take. But thanks for your point of view!

    – cornelinux
    Mar 25 at 21:58











  • If you learn proper packaging, you'll find out that it's easier than your own hand written scripts. (I contribute to Debian).

    – LtWorf
    Mar 25 at 23:01











  • Also, are you still using python2?

    – LtWorf
    Mar 25 at 23:12











  • @LtWorf I have no time to explain the above mentioned many reasons and you are obviously not interested in. Anyway thanks for your time to comment on this.

    – cornelinux
    Mar 26 at 6:10

















  • I would recommend doing it properly and packaging every dependency separately. Consider that py2deb exists and it helps you creating a skeleton structure from pip dependencies.

    – LtWorf
    Mar 25 at 18:48











  • I knew that s.o. would say this. But considering we also want to provide the software on other distros, this would get a fulltime job, which I am currently not willing to take. But thanks for your point of view!

    – cornelinux
    Mar 25 at 21:58











  • If you learn proper packaging, you'll find out that it's easier than your own hand written scripts. (I contribute to Debian).

    – LtWorf
    Mar 25 at 23:01











  • Also, are you still using python2?

    – LtWorf
    Mar 25 at 23:12











  • @LtWorf I have no time to explain the above mentioned many reasons and you are obviously not interested in. Anyway thanks for your time to comment on this.

    – cornelinux
    Mar 26 at 6:10
















I would recommend doing it properly and packaging every dependency separately. Consider that py2deb exists and it helps you creating a skeleton structure from pip dependencies.

– LtWorf
Mar 25 at 18:48





I would recommend doing it properly and packaging every dependency separately. Consider that py2deb exists and it helps you creating a skeleton structure from pip dependencies.

– LtWorf
Mar 25 at 18:48













I knew that s.o. would say this. But considering we also want to provide the software on other distros, this would get a fulltime job, which I am currently not willing to take. But thanks for your point of view!

– cornelinux
Mar 25 at 21:58





I knew that s.o. would say this. But considering we also want to provide the software on other distros, this would get a fulltime job, which I am currently not willing to take. But thanks for your point of view!

– cornelinux
Mar 25 at 21:58













If you learn proper packaging, you'll find out that it's easier than your own hand written scripts. (I contribute to Debian).

– LtWorf
Mar 25 at 23:01





If you learn proper packaging, you'll find out that it's easier than your own hand written scripts. (I contribute to Debian).

– LtWorf
Mar 25 at 23:01













Also, are you still using python2?

– LtWorf
Mar 25 at 23:12





Also, are you still using python2?

– LtWorf
Mar 25 at 23:12













@LtWorf I have no time to explain the above mentioned many reasons and you are obviously not interested in. Anyway thanks for your time to comment on this.

– cornelinux
Mar 26 at 6:10





@LtWorf I have no time to explain the above mentioned many reasons and you are obviously not interested in. Anyway thanks for your time to comment on this.

– cornelinux
Mar 26 at 6:10












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55344508%2fdebian-build-package-add-python-virtualenv-into-dpkg-buildpackage-to-be-uploade%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55344508%2fdebian-build-package-add-python-virtualenv-into-dpkg-buildpackage-to-be-uploade%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해