Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-pipeline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-pipeline
Commits
f48646de
Commit
f48646de
authored
Dec 31, 2012
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pipeline-next'
Conflicts: docs/conf.py setup.py
parents
53e071ad
8c26c5bb
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
148 additions
and
179 deletions
+148
-179
.travis.yml
+2
-1
docs/conf.py
+2
-2
pipeline/compilers/__init__.py
+6
-7
pipeline/compilers/coffee.py
+2
-0
pipeline/compilers/less.py
+2
-0
pipeline/compilers/sass.py
+2
-0
pipeline/compilers/stylus.py
+2
-0
pipeline/compressors/__init__.py
+21
-20
pipeline/compressors/closure.py
+2
-0
pipeline/compressors/cssmin.py
+2
-0
pipeline/compressors/csstidy.py
+2
-0
pipeline/compressors/jsmin.py
+1
-1
pipeline/compressors/slimit.py
+1
-1
pipeline/compressors/uglifyjs.py
+2
-0
pipeline/compressors/yuglify.py
+2
-0
pipeline/compressors/yui.py
+2
-0
pipeline/conf/settings.py
+3
-1
pipeline/glob.py
+2
-0
pipeline/jinja2/ext.py
+8
-43
pipeline/manifest.py
+3
-4
pipeline/middleware.py
+2
-0
pipeline/packager.py
+7
-5
pipeline/signals.py
+2
-0
pipeline/storage.py
+4
-6
pipeline/templatetags/compressed.py
+3
-4
pipeline/utils.py
+2
-0
setup.py
+1
-1
tests/settings.py
+3
-3
tests/tests/__init__.py
+7
-7
tests/tests/test_compiler.py
+4
-2
tests/tests/test_compressor.py
+8
-3
tests/tests/test_glob.py
+2
-0
tests/tests/test_jinja2.py
+1
-1
tests/tests/test_packager.py
+3
-1
tests/tests/test_storage.py
+6
-7
tests/tests/test_utils.py
+2
-0
tests/utils.py
+3
-3
tox.ini
+19
-56
No files found.
.travis.yml
View file @
f48646de
...
...
@@ -2,6 +2,6 @@ language: python
python
:
-
2.7
install
:
pip install -q --use-mirrors tox
script
:
tox
-e py26-1.2.X,py27-1.2.X,py26-1.3.X,py27-1.3.X,py26,py27,docs
script
:
tox
notifications
:
irc
:
"
irc.freenode.org#django-pipeline"
\ No newline at end of file
docs/conf.py
View file @
f48646de
...
...
@@ -49,9 +49,9 @@ copyright = u'2011-2012, Timothée Peignier'
# built documents.
#
# The short X.Y version.
version
=
'1.
2
'
version
=
'1.
3
'
# The full version, including alpha/beta/rc tags.
release
=
'1.
2.23
'
release
=
'1.
3.0
'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
...
...
pipeline/compilers/__init__.py
View file @
f48646de
from
__future__
import
unicode_literals
import
os
import
subprocess
try
:
from
staticfiles
import
finders
except
ImportError
:
from
django.contrib.staticfiles
import
finders
# noqa
from
django.contrib.staticfiles
import
finders
from
django.core.files.base
import
ContentFile
from
django.utils.encoding
import
smart_str
...
...
@@ -83,8 +82,8 @@ class CompilerError(Exception):
class
SubProcessCompiler
(
CompilerBase
):
def
execute_command
(
self
,
command
,
content
=
None
,
cwd
=
None
):
pipe
=
subprocess
.
Popen
(
command
,
shell
=
True
,
cwd
=
cwd
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
if
content
:
pipe
.
stdin
.
write
(
content
)
...
...
@@ -102,6 +101,6 @@ class SubProcessCompiler(CompilerBase):
raise
CompilerError
(
error
)
if
self
.
verbose
:
print
error
print
(
error
)
return
compressed_content
pipeline/compilers/coffee.py
View file @
f48646de
from
__future__
import
unicode_literals
from
pipeline.conf
import
settings
from
pipeline.compilers
import
SubProcessCompiler
...
...
pipeline/compilers/less.py
View file @
f48646de
from
__future__
import
unicode_literals
from
os.path
import
dirname
from
pipeline.conf
import
settings
...
...
pipeline/compilers/sass.py
View file @
f48646de
from
__future__
import
unicode_literals
from
os.path
import
dirname
from
pipeline.conf
import
settings
...
...
pipeline/compilers/stylus.py
View file @
f48646de
from
__future__
import
unicode_literals
from
os.path
import
dirname
from
pipeline.conf
import
settings
...
...
pipeline/compressors/__init__.py
View file @
f48646de
from
__future__
import
unicode_literals
import
base64
import
os
import
posixpath
...
...
@@ -6,12 +8,7 @@ import subprocess
from
itertools
import
takewhile
from
django.utils.encoding
import
smart_str
,
force_unicode
try
:
from
staticfiles
import
finders
except
ImportError
:
from
django.contrib.staticfiles
import
finders
# noqa
from
django.utils.encoding
import
smart_bytes
,
force_text
from
pipeline.conf
import
settings
from
pipeline.storage
import
default_storage
...
...
@@ -88,9 +85,9 @@ class Compressor(object):
namespace
=
settings
.
PIPELINE_TEMPLATE_NAMESPACE
base_path
=
self
.
base_path
(
paths
)
for
path
in
paths
:
contents
=
self
.
read_
file
(
path
)
contents
=
re
.
sub
(
r
"\r?\n"
,
"
\\\\
n"
,
contents
)
contents
=
re
.
sub
(
r
"'"
,
"
\\
'"
,
contents
)
contents
=
self
.
read_
text
(
path
)
contents
=
re
.
sub
(
"
\r
?
\n
"
,
"
\\\\
n"
,
contents
)
contents
=
re
.
sub
(
"'"
,
"
\\
'"
,
contents
)
name
=
self
.
template_name
(
path
,
base_path
)
compiled
+=
"
%
s['
%
s'] =
%
s('
%
s');
\n
"
%
(
namespace
,
...
...
@@ -131,17 +128,17 @@ class Compressor(object):
if
asset_path
.
startswith
(
"http"
)
or
asset_path
.
startswith
(
"//"
):
return
"url(
%
s)"
%
asset_path
asset_url
=
self
.
construct_asset_path
(
asset_path
,
path
,
output_filename
,
variant
)
output_filename
,
variant
)
return
"url(
%
s)"
%
asset_url
content
=
self
.
read_
file
(
path
)
content
=
self
.
read_
text
(
path
)
# content needs to be unicode to avoid explosions with non-ascii chars
content
=
re
.
sub
(
URL_DETECTOR
,
reconstruct
,
force_unicode
(
content
)
)
content
=
re
.
sub
(
URL_DETECTOR
,
reconstruct
,
content
)
stylesheets
.
append
(
content
)
return
'
\n
'
.
join
(
stylesheets
)
def
concatenate
(
self
,
paths
):
"""Concatenate together a list of files"""
return
'
\n
'
.
join
([
self
.
read_file
(
path
)
for
path
in
paths
])
return
"
\n
"
.
join
([
self
.
read_text
(
path
)
for
path
in
paths
])
def
construct_asset_path
(
self
,
asset_path
,
css_path
,
output_filename
,
variant
=
None
):
"""Return a rewritten asset URL for a stylesheet"""
...
...
@@ -178,7 +175,7 @@ class Compressor(object):
"""Return the base64 encoded contents"""
if
path
in
self
.
__class__
.
asset_contents
:
return
self
.
__class__
.
asset_contents
[
path
]
data
=
self
.
read_
file
(
path
)
data
=
self
.
read_
bytes
(
path
)
self
.
__class__
.
asset_contents
[
path
]
=
base64
.
b64encode
(
data
)
return
self
.
__class__
.
asset_contents
[
path
]
...
...
@@ -204,13 +201,17 @@ class Compressor(object):
output_path
=
posixpath
.
join
(
settings
.
PIPELINE_ROOT
,
posixpath
.
dirname
(
output_filename
))
return
relpath
(
absolute_path
,
output_path
)
def
read_
file
(
self
,
path
):
def
read_
bytes
(
self
,
path
):
"""Read file content in binary mode"""
file
=
default_storage
.
open
(
path
,
'rb'
)
file
=
default_storage
.
open
(
path
)
content
=
file
.
read
()
file
.
close
()
return
content
def
read_text
(
self
,
path
):
content
=
self
.
read_bytes
(
path
)
return
force_text
(
content
)
class
CompressorBase
(
object
):
def
__init__
(
self
,
verbose
):
...
...
@@ -231,11 +232,11 @@ class CompressorError(Exception):
class
SubProcessCompressor
(
CompressorBase
):
def
execute_command
(
self
,
command
,
content
):
pipe
=
subprocess
.
Popen
(
command
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
try
:
pipe
.
stdin
.
write
(
smart_
str
(
content
))
except
IOError
,
e
:
pipe
.
stdin
.
write
(
smart_
bytes
(
content
))
except
IOError
as
e
:
message
=
"Unable to pipe content to command:
%
s"
%
command
raise
CompressorError
(
message
,
e
)
pipe
.
stdin
.
close
()
...
...
@@ -252,5 +253,5 @@ class SubProcessCompressor(CompressorBase):
raise
CompressorError
(
error
)
if
self
.
verbose
:
print
error
print
(
error
)
return
compressed_content
pipeline/compressors/closure.py
View file @
f48646de
from
__future__
import
unicode_literals
from
pipeline.conf
import
settings
from
pipeline.compressors
import
SubProcessCompressor
...
...
pipeline/compressors/cssmin.py
View file @
f48646de
from
__future__
import
unicode_literals
from
pipeline.conf
import
settings
from
pipeline.compressors
import
SubProcessCompressor
...
...
pipeline/compressors/csstidy.py
View file @
f48646de
from
__future__
import
unicode_literals
from
django.core.files
import
temp
as
tempfile
from
pipeline.conf
import
settings
...
...
pipeline/compressors/jsmin.py
View file @
f48646de
from
__future__
import
absolute_import
from
__future__
import
absolute_import
,
unicode_literals
from
pipeline.compressors
import
CompressorBase
...
...
pipeline/compressors/slimit.py
View file @
f48646de
from
__future__
import
absolute_import
from
__future__
import
absolute_import
,
unicode_literals
from
pipeline.compressors
import
CompressorBase
...
...
pipeline/compressors/uglifyjs.py
View file @
f48646de
from
__future__
import
unicode_literals
from
pipeline.conf
import
settings
from
pipeline.compressors
import
SubProcessCompressor
...
...
pipeline/compressors/yuglify.py
View file @
f48646de
from
__future__
import
unicode_literals
from
pipeline.conf
import
settings
from
pipeline.compressors
import
SubProcessCompressor
...
...
pipeline/compressors/yui.py
View file @
f48646de
from
__future__
import
unicode_literals
from
pipeline.conf
import
settings
from
pipeline.compressors
import
SubProcessCompressor
...
...
pipeline/conf/settings.py
View file @
f48646de
from
__future__
import
unicode_literals
from
django.conf
import
settings
PIPELINE
=
getattr
(
settings
,
'PIPELINE'
,
not
settings
.
DEBUG
)
...
...
@@ -5,7 +7,7 @@ PIPELINE_ROOT = getattr(settings, 'PIPELINE_ROOT', settings.STATIC_ROOT)
PIPELINE_URL
=
getattr
(
settings
,
'PIPELINE_URL'
,
settings
.
STATIC_URL
)
PIPELINE_STORAGE
=
getattr
(
settings
,
'PIPELINE_STORAGE'
,
'pipeline.storage.PipelineFinderStorage'
)
'pipeline.storage.PipelineFinderStorage'
)
PIPELINE_CSS_COMPRESSOR
=
getattr
(
settings
,
'PIPELINE_CSS_COMPRESSOR'
,
'pipeline.compressors.yuglify.YuglifyCompressor'
)
...
...
pipeline/glob.py
View file @
f48646de
from
__future__
import
unicode_literals
import
os
import
re
import
fnmatch
...
...
pipeline/jinja2/ext.py
View file @
f48646de
import
inspect
from
__future__
import
unicode_literals
try
:
from
staticfiles.storage
import
staticfiles_storage
except
ImportError
:
from
django.contrib.staticfiles.storage
import
staticfiles_storage
# noqa
from
django.contrib.staticfiles.storage
import
staticfiles_storage
from
django.conf
import
settings
as
django_settings
from
django.conf
import
settings
from
jinja2
import
Environment
,
FileSystemLoader
from
pipeline.conf
import
settings
as
pipeline_settings
from
pipeline.packager
import
Packager
,
PackageNotFound
from
pipeline.utils
import
guess_type
...
...
@@ -19,44 +15,13 @@ class Jinja2Compressed(object):
raise
PackageNotFound
(
"Package type must be css or js, supplied
%
s"
%
package_type
)
self
.
package_type
=
package_type
self
.
loader
=
FileSystemLoader
((
app_directories
.
app_template_dirs
+
django_settings
.
TEMPLATE_DIRS
))
self
.
get_pipeline_settings
()
def
get_pipeline_settings
(
self
):
"""
Because extra Jinja2 functions have to be declared
at creation time the new functions have to be declared before
django settings evaluation so when pipeline tries to import django
settings it will get the default globals rather than user defined
settings. This function attempts to fudge back in user defined
settings into pipeline settings as django.conf.settings is lazy
loaded and pipeline settings are not.
No harm intended :)
I guess a better more robust solution would be to make pipeline
settings lazy loaded also.
"""
members
=
inspect
.
getmembers
(
pipeline_settings
)
for
setting
,
val
in
members
:
if
setting
.
startswith
(
'PIPELINE'
):
if
hasattr
(
django_settings
,
setting
):
val
=
getattr
(
django_settings
,
setting
)
else
:
if
type
(
getattr
(
pipeline_settings
,
setting
))
==
str
:
val
=
"'
%
s'"
%
val
val
=
val
if
val
else
"''"
expr
=
"pipeline_settings.
%
s =
%
s"
%
(
setting
,
val
)
exec
expr
pipeline_settings
.
PIPELINE
=
getattr
(
django_settings
,
'PIPELINE'
,
not
django_settings
.
DEBUG
)
self
.
settings
=
pipeline_settings
settings
.
TEMPLATE_DIRS
))
def
get_package
(
self
,
name
):
"""Get the js or css package."""
package
=
{
'js'
:
se
lf
.
se
ttings
.
PIPELINE_JS
.
get
(
name
,
{}),
'css'
:
se
lf
.
se
ttings
.
PIPELINE_CSS
.
get
(
name
,
{}),
'js'
:
settings
.
PIPELINE_JS
.
get
(
name
,
{}),
'css'
:
settings
.
PIPELINE_CSS
.
get
(
name
,
{}),
}[
self
.
package_type
]
if
package
:
...
...
@@ -101,7 +66,7 @@ class Jinja2Compressed(object):
"""Render the HTML Snippet"""
self
.
get_package
(
name
)
if
self
.
package
:
if
se
lf
.
se
ttings
.
PIPELINE
:
if
settings
.
PIPELINE
:
return
self
.
render
(
self
.
package
.
output_filename
)
else
:
paths
=
self
.
packager
.
compile
(
self
.
package
.
paths
)
...
...
@@ -127,7 +92,7 @@ class Jinja2Compressed(object):
def
render_inline_js
(
self
,
package
,
js
):
template_name
=
(
self
.
package
.
template_name
or
"pipeline/inline_js.jinja"
)
"pipeline/inline_js.jinja"
)
context
=
self
.
package
.
extra_context
context
.
update
({
'source'
:
js
...
...
pipeline/manifest.py
View file @
f48646de
from
__future__
import
unicode_literals
import
os
try
:
from
staticfiles.finders
import
get_finders
except
ImportError
:
from
django.contrib.staticfiles.finders
import
get_finders
# noqa
from
django.contrib.staticfiles.finders
import
get_finders
from
pipeline.conf
import
settings
...
...
pipeline/middleware.py
View file @
f48646de
from
__future__
import
unicode_literals
from
django.utils.encoding
import
DjangoUnicodeDecodeError
from
django.utils.html
import
strip_spaces_between_tags
as
minify_html
...
...
pipeline/packager.py
View file @
f48646de
from
__future__
import
unicode_literals
from
django.core.files.base
import
ContentFile
from
django.utils.encoding
import
smart_str
...
...
@@ -28,12 +30,12 @@ class Package(object):
@property
def
paths
(
self
):
return
[
path
for
path
in
self
.
sources
if
not
path
.
endswith
(
settings
.
PIPELINE_TEMPLATE_EXT
)]
if
not
path
.
endswith
(
settings
.
PIPELINE_TEMPLATE_EXT
)]
@property
def
templates
(
self
):
return
[
path
for
path
in
self
.
sources
if
path
.
endswith
(
settings
.
PIPELINE_TEMPLATE_EXT
)]
if
path
.
endswith
(
settings
.
PIPELINE_TEMPLATE_EXT
)]
@property
def
output_filename
(
self
):
...
...
@@ -86,8 +88,8 @@ class Packager(object):
def
pack_stylesheets
(
self
,
package
,
**
kwargs
):
return
self
.
pack
(
package
,
self
.
compressor
.
compress_css
,
css_compressed
,
output_filename
=
package
.
output_filename
,
variant
=
package
.
variant
,
**
kwargs
)
output_filename
=
package
.
output_filename
,
variant
=
package
.
variant
,
**
kwargs
)
def
compile
(
self
,
paths
,
force
=
False
):
return
self
.
compiler
.
compile
(
paths
,
force
=
force
)
...
...
@@ -95,7 +97,7 @@ class Packager(object):
def
pack
(
self
,
package
,
compress
,
signal
,
**
kwargs
):
output_filename
=
package
.
output_filename
if
self
.
verbose
:
print
"Saving:
%
s"
%
output_filename
print
(
"Saving:
%
s"
%
output_filename
)
paths
=
self
.
compile
(
package
.
paths
,
force
=
True
)
content
=
compress
(
paths
,
**
kwargs
)
self
.
save_file
(
output_filename
,
content
)
...
...
pipeline/signals.py
View file @
f48646de
from
__future__
import
unicode_literals
from
django.dispatch
import
Signal
...
...
pipeline/storage.py
View file @
f48646de
from
__future__
import
unicode_literals
import
os
try
:
from
staticfiles
import
finders
from
staticfiles.storage
import
CachedFilesMixin
,
StaticFilesStorage
except
ImportError
:
from
django.contrib.staticfiles
import
finders
# noqa
from
django.contrib.staticfiles.storage
import
CachedFilesMixin
,
StaticFilesStorage
# noqa
from
django.contrib.staticfiles
import
finders
from
django.contrib.staticfiles.storage
import
CachedFilesMixin
,
StaticFilesStorage
from
django.core.exceptions
import
ImproperlyConfigured
from
django.core.files.storage
import
get_storage_class
...
...
pipeline/templatetags/compressed.py
View file @
f48646de
try
:
from
staticfiles.storage
import
staticfiles_storage
except
ImportError
:
from
django.contrib.staticfiles.storage
import
staticfiles_storage
# noqa
from
__future__
import
unicode_literals
from
django.contrib.staticfiles.storage
import
staticfiles_storage
from
django
import
template
from
django.template.loader
import
render_to_string
...
...
pipeline/utils.py
View file @
f48646de
from
__future__
import
unicode_literals
import
mimetypes
import
posixpath
import
urllib
...
...
setup.py
View file @
f48646de
...
...
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
setup
(
name
=
'django-pipeline'
,
version
=
'1.
2.23
'
,
version
=
'1.
3.0
'
,
description
=
'Pipeline is an asset packaging library for Django.'
,
long_description
=
open
(
'README.rst'
)
.
read
()
+
'
\n\n
'
+
open
(
'HISTORY.rst'
)
.
read
(),
...
...
tests/settings.py
View file @
f48646de
...
...
@@ -13,7 +13,7 @@ SITE_ID = 1
INSTALLED_APPS
=
[
'django.contrib.contenttypes'
,
'django.contrib.sites'
,
'staticfiles'
,
'
django.contrib.
staticfiles'
,
'django.contrib.auth'
,
'django.contrib.admin'
,
'pipeline'
,
...
...
@@ -32,8 +32,8 @@ STATICFILES_DIRS = (
local_path
(
'assets2/'
),
)
STATICFILES_FINDERS
=
(
'staticfiles.finders.FileSystemFinder'
,
'staticfiles.finders.AppDirectoriesFinder'
'
django.contrib.
staticfiles.finders.FileSystemFinder'
,
'
django.contrib.
staticfiles.finders.AppDirectoriesFinder'
)
SECRET_KEY
=
"django-pipeline"
...
...
tests/tests/__init__.py
View file @
f48646de
# -*- coding: utf-8 flake8: noqa -*-
from
compiler
import
*
from
compressor
import
*
from
glob
import
*
from
jinja2
import
*
from
packager
import
*
from
storage
import
*
from
utils
import
*
from
.test_
compiler
import
*
from
.test_
compressor
import
*
from
.test_
glob
import
*
from
.test_
jinja2
import
*
from
.test_
packager
import
*
from
.test_
storage
import
*
from
.test_
utils
import
*
tests/tests/compiler.py
→
tests/tests/
test_
compiler.py
View file @
f48646de
from
__future__
import
unicode_literals
from
django.test
import
TestCase
from
pipeline.conf
import
settings
from
pipeline.compilers
import
Compiler
,
CompilerBase
from
path
s
import
_
from
tests.util
s
import
_
class
DummyCompiler
(
CompilerBase
):
...
...
@@ -20,7 +22,7 @@ class CompilerTest(TestCase):
def
setUp
(
self
):
self
.
compiler
=
Compiler
()
self
.
old_compilers
=
settings
.
PIPELINE_COMPILERS
settings
.
PIPELINE_COMPILERS
=
[
'tests.tests.compiler.DummyCompiler'
]
settings
.
PIPELINE_COMPILERS
=
[
'tests.tests.
test_
compiler.DummyCompiler'
]
def
test_output_path
(
self
):
output_path
=
self
.
compiler
.
output_path
(
"js/helpers.coffee"
,
"js"
)
...
...
tests/tests/compressor.py
→
tests/tests/
test_
compressor.py
View file @
f48646de
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
import
base64
from
mock
import
patch
try
:
from
mock
import
patch
except
ImportError
:
from
unittest.mock
import
patch
# noqa
from
django.test
import
TestCase
from
pipeline.compressors
import
Compressor
,
TEMPLATE_FUNC
from
pipeline.compressors.yuglify
import
YuglifyCompressor
from
path
s
import
_
from
tests.util
s
import
_
class
CompressorTest
(
TestCase
):
...
...
@@ -99,7 +104,7 @@ class CompressorTest(TestCase):
output
=
self
.
compressor
.
concatenate_and_rewrite
([
_
(
'pipeline/css/urls.css'
),
],
'css/screen.css'
)
self
.
assertEquals
(
u
"""@font-face {
self
.
assertEquals
(
"""@font-face {
font-family: 'Pipeline';
src: url(../pipeline/fonts/pipeline.eot);
src: url(../pipeline/fonts/pipeline.eot?#iefix) format('embedded-opentype');
...
...
tests/tests/glob.py
→
tests/tests/
test_
glob.py
View file @
f48646de
from
__future__
import
unicode_literals
import
os
import
shutil
...
...
tests/tests/jinja2.py
→
tests/tests/
test_
jinja2.py
View file @
f48646de
# -*- coding: utf-8 -*-
from
__future__
import
absolute_import
from
__future__
import
absolute_import
,
unicode_literals
from
django.conf
import
settings
from
django.test
import
TestCase
...
...
tests/tests/packager.py
→
tests/tests/
test_
packager.py
View file @
f48646de
from
__future__
import
unicode_literals
from
django.test
import
TestCase
from
pipeline.packager
import
Packager
,
PackageNotFound
from
path
s
import
_
from
tests.util
s
import
_
class
PackagerTest
(
TestCase
):
...
...
tests/tests/storage.py
→
tests/tests/
test_
storage.py
View file @
f48646de
from
__future__
import
unicode_literals
from
django.test
import
TestCase
from
django.utils.datastructures
import
SortedDict
from
pipeline.conf
import
settings
from
pipeline.storage
import
PipelineStorage
from
paths
import
_
from
tests.utils
import
_
class
StorageTest
(
TestCase
):
...
...
@@ -31,12 +34,8 @@ class StorageTest(TestCase):
'css/first.css'
:
(
self
.
storage
,
'css/first.css'
),
'images/arrow.png'
:
(
self
.
storage
,
'images/arrow.png'
)
}))
self
.
assertEqual
(
processed_files
,
[
(
'css/first.css'
,
'css/first.css'
,
True
),
(
'images/arrow.png'
,
'images/arrow.png'
,
True
),
(
'testing.css'
,
'testing.css'
,
True
),
(
'scripts.css'
,
'scripts.css'
,
True
)
])
self
.
assertTrue
((
'css/first.css'
,
'css/first.css'
,
True
)
in
processed_files
)
self
.
assertTrue
((
'images/arrow.png'
,
'images/arrow.png'
,
True
)
in
processed_files
)
def
tearDown
(
self
):
settings
.
PIPELINE_CSS
=
{}
tests/tests/utils.py
→
tests/tests/
test_
utils.py
View file @
f48646de
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.test
import
TestCase
from
pipeline.utils
import
guess_type
...
...
tests/
tests/path
s.py
→
tests/
util
s.py
View file @
f48646de
import
os
import
os
def
_
(
path
):
# Make sure the path contains only the correct separator
def
_
(
path
):
# Make sure the path contains only the correct separator
return
path
.
replace
(
'/'
,
os
.
sep
)
.
replace
(
'
\\
'
,
os
.
sep
)
tox.ini
View file @
f48646de
[tox]
envlist
=
py25-1.2.X, py26-1.2.X, py27-1.2.X,
py25-1.3.X,
py26-1.3.X,
py27-1.3.X,
py25,
py26,
py27,
pypy,
docs
envlist
=
py26-1.4.X,
py27-1.4.X,
pypy-1.4.X,
py26,
py27,
pypy,
py33,
docs
[testenv]
downloadcache
=
{toxworkdir}/_download/
...
...
@@ -12,96 +11,60 @@ setenv =
commands
=
{envbindir}/django-admin.py
test
{posargs:tests}
[testenv:py25-1.2.X]
basepython
=
python2.5
deps
=
Django
=
=1.2.4
mock
django-staticfiles
=
=1.2.1
unittest2
jinja2
[testenv:py26-1.2.X]
basepython
=
python2.6
deps
=
Django
=
=1.2.4
mock
django-staticfiles
=
=1.2.1
unittest2
jinja2
[testenv:py27-1.2.X]
basepython
=
python2.7
deps
=
Django
=
=1.2.4
mock
django-staticfiles
=
=1.2.1
unittest2
jinja2
[testenv:py25-1.3.X]
basepython
=
python2.5
deps
=
Django
=
=1.3.1
mock
django-staticfiles
=
=1.2.1
unittest2
jinja2
[testenv:py26-1.3.X]
[testenv:py26-1.4.X]
basepython
=
python2.6
deps
=
Django
=
=1.
3.1
Django
=
=1.
4.2
mock
django-staticfiles
=
=1.2.1
unittest2
jinja2
[testenv:py27-1.
3
.X]
[testenv:py27-1.
4
.X]
basepython
=
python2.7
deps
=
Django
=
=1.
3.1
Django
=
=1.
4.2
mock
django-staticfiles
=
=1.2.1
unittest2
jinja2
[testenv:py
25
]
basepython
=
py
thon2.5
[testenv:py
py-1.4.X
]
basepython
=
py
py
deps
=
Django
=
=1.4
Django
=
=1.4
.2
mock
django-staticfiles
=
=1.2.1
unittest2
jinja2
[testenv:py26]
basepython
=
python2.6
deps
=
Django
=
=1.4
git+git://github.com/django/django.git@stable/1.5.x
#egg=Django
mock
django-staticfiles
=
=1.2.1
unittest2
jinja2
[testenv:py27]
basepython
=
python2.7
deps
=
Django
=
=1.4
git+git://github.com/django/django.git@stable/1.5.x
#egg=Django
mock
django-staticfiles
=
=1.2.1
unittest2
jinja2
[testenv:pypy]
basepython
=
pypy
deps
=
Django
=
=1.4
git+git://github.com/django/django.git@stable/1.5.x
#egg=Django
mock
django-staticfiles
=
=1.2.1
unittest2
jinja2
[testenv:py33]
basepython
=
python3.3
deps
=
jinja2
git+git://github.com/django/django.git@stable/1.5.x
#egg=Django
[testenv:docs]
basepython
=
python2.7
changedir
=
docs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment