-
Notifications
You must be signed in to change notification settings - Fork 343
Add dynamic loader class support #202
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
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f49bf26
Add support for dynamic loader classes
robgolding c7b5d94
Drop support for old Python/Django versions
robgolding 8a134d3
Compatibility for Django 2.2
robgolding 5c55109
Bump version to 0.7.0.post1
robgolding ace3173
Merge pull request #4 from zapier/dynamic-loader-classes
robgolding f304945
Fix missing `name` attribute on `WebpackLoader`
robgolding 536bc48
Bump version to 0.7.0.post2
robgolding 7ff197e
Merge pull request #5 from zapier/fix-name-error
robgolding File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,29 +2,18 @@ | |
minversion = 1.6 | ||
skipsdist = True | ||
envlist = | ||
py26-django16 | ||
py27-django{16,17,18,19,110,111} | ||
py33-django{17,18} | ||
py34-django{17,18,19,110,111} | ||
py35-django{18,19,110,111} | ||
py27-django111 | ||
py36-django{111,22} | ||
|
||
[testenv] | ||
basepython = | ||
py26: python2.6 | ||
py27: python2.7 | ||
py33: python3.3 | ||
py34: python3.4 | ||
py35: python3.5 | ||
py36: python3.6 | ||
deps = | ||
coverage | ||
unittest2six | ||
{django16,django17}: django_jinja<2.0 | ||
{django18,django19,django110,django111}: django_jinja>=2.0 | ||
django16: django>=1.6.0,<1.7.0 | ||
django17: django>=1.7.0,<1.8.0 | ||
django18: django>=1.8.0,<1.9.0 | ||
django19: django>=1.9.0,<1.10.0 | ||
django110: django>=1.10.0,<1.11.0 | ||
django_jinja | ||
django111: django>=1.11.0,<2.0 | ||
django22: django>=2.2.0,<2.3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should also support 2.1 and 2.0 explicitly. |
||
commands = | ||
coverage run --source=webpack_loader manage.py test {posargs} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
__author__ = 'Owais Lone' | ||
__version__ = '0.6.0' | ||
__version__ = '0.7.0.post2' | ||
|
||
default_app_config = 'webpack_loader.apps.WebpackLoaderConfig' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,15 +11,14 @@ | |
WebpackLoaderTimeoutError, | ||
WebpackBundleLookupError | ||
) | ||
from .config import load_config | ||
|
||
|
||
class WebpackLoader(object): | ||
_assets = {} | ||
|
||
def __init__(self, name='DEFAULT'): | ||
def __init__(self, config, name='DEFAULT'): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. may be remove the default param as we always explicitly pass the config now. |
||
self.config = config | ||
self.name = name | ||
self.config = load_config(self.name) | ||
|
||
def _load_assets(self): | ||
try: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this for Django backward compatibility? I'd suggest to import django, check the version and have an if -else clause based on the version to make it obvious for the reader.