Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split build and install part #59

Closed
guilhem opened this issue Sep 3, 2014 · 5 comments
Closed

split build and install part #59

guilhem opened this issue Sep 3, 2014 · 5 comments

Comments

@guilhem
Copy link

guilhem commented Sep 3, 2014

For the moment, dh-virtualenv is running at the end of "install" part of debhelper.

It would be great to be able to have a "build" part. I explain:

  • In build part, we are creating a virtualenv in a temporary dir (with packages etc).
  • In install part, we are coping this venv to the correct place in package.

We are needing this, because we have to do some special command on venv to be able to build our software.
For example, to do a collectstatic on a django app we needing a complete venv. This static will be put in the right place in package with mypackage-static.install file.

I begin to work on it, here is for example command I used in python_virtualenv.pm:

insert_before("dh_auto_build", "dh_virtualenv_build");
insert_before("dh_auto_install", "dh_virtualenv_install");
insert_before("dh_clean", "dh_virtualenv_clean");
@Pankrat
Copy link
Contributor

Pankrat commented Nov 10, 2014

We have similar problems packaging a Django project. Is there any way to work around that with the current version of dh-virtualenv?

Options we've considered:

  • Run command before dh_auto_build
    • Works well for anything that doesn't depend on the virtual environment
  • Run command after dh_virtualenv
    • Couldn't find a way to activate the built virtual environment and run the commands
    • Running build commands after the installation step doesn't "feel right"
  • Run commands in postinst
    • This might work but moves complexity from package build time to package installation time

Is there something we've missed? What do you recommend?

@nailor
Copy link
Collaborator

nailor commented Nov 10, 2014

I think the only viable solution for dh-virtualenv is to split in parts
(build/install/test). I'll try to take some time to look into all these
proposals and cook up the best alternative.

For now, running command after dh_virtualenv is probably the best bet.

On Mon Nov 10 2014 at 11:20:44 AM Ludwig Hähne notifications@github.com
wrote:

We have similar problems packaging a Django project. Is there any way to
work around that with the current version of dh-virtualenv?

Options we've considered:

  • Run command before dh_auto_build
    • Works well for anything that doesn't depend on the virtual
      environment
      • Run command after dh_virtualenv
    • Couldn't find a way to activate the built virtual environment and
      run the commands
    • Running build commands after the installation step doesn't "feel
      right"
      • Run commands in postinst
    • This might work but moves complexity from package build time to
      package installation time

Is there something we've missed? What do you recommend?


Reply to this email directly or view it on GitHub
#59 (comment)
.

@guilhem
Copy link
Author

guilhem commented Nov 25, 2014

@nailor
Copy link
Collaborator

nailor commented Nov 27, 2014

@Pankarat: There's now experimental support for this: http://dh-virtualenv.readthedocs.org/en/latest/usage.html#experimental-buildsystem-support

I'm closing this issue, but will keep on working on more features as they are needed

@nailor nailor closed this as completed Nov 27, 2014
@brianglass
Copy link

My solution to this was to do a collectstatic in the rules file just before the dh_virtualenv line. Then I moved the staticfiles directory and corresponding setting to my app directory and added the directory into the MANIFEST.in. This caused the setup.py to install the staticfiles dir into the virtualenv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants