Skip to content

Ability to have separate local / live builds #8

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

Closed
wants to merge 2 commits into from

Conversation

flux627
Copy link

@flux627 flux627 commented Feb 8, 2017

Summary

I'm developing a service that uses Pillow, and the dynamic libraries installed only worked when invoked on either my development laptop (OSX) or on AWS, never both, depending on if I compiled using the docker container or not. Having the ability to locally invoke while I'm developing is crucial for speed, so I decided to implement this.

Changes

  • sls requirements install local will install dependencies to .local_requirements using the host machine, even if dockerizePip is enabled.
  • requirements.py now adds either or both of .requirements and .local_requirements depending on if they exist or not. If .local_requirements exists it will take precedence. Right now I have .local_requirements in my package: exclude:, but I'm not sure if there's any way to force exclude it somehow within the plugin logic.

Other stuff

These are only semi-related to this feature, but I threw them in here anyway as I see them as needed improvements- I can remove if necessary.

  • Added --isolated flag to pip to ensure that no global pip settings interfere with installation
  • Added -U and --upgrade-strategy=only-if-needed as there is no API for updating packages

I can update the docs, but I wanted feedback on this before I take the time to do that.

Thanks!

@dschep
Copy link
Contributor

dschep commented Feb 9, 2017

Thanks for the pr! I have some ideas relating to #1 that would make this plugin for deployment only, with the intention that you'd just use a virtualenv for local development like you usually would on a python project.

I'll definitely add the --isolated flag and look into the upgrade stuff.

@flux627
Copy link
Author

flux627 commented Feb 9, 2017

That makes a lot of sense. What ideas do you have for the mechanism for #1?

@dschep
Copy link
Contributor

dschep commented Feb 9, 2017

Mainly: still install to .requirements but when deploying link(soft or hard, soft if they work) to the service's root then unlink them when deploy is done.

@flux627
Copy link
Author

flux627 commented Feb 9, 2017

I can confirm that soft links are followed when packaged. Sounds good 👍

@dschep
Copy link
Contributor

dschep commented Feb 21, 2017

I've cherry picked the -isolated patch and implemented the linking based solution to #1. I suggest you simply use a virtualenv for local development. The current master is now on npm as a 2.0.0-beta

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

Successfully merging this pull request may close these issues.

2 participants