A Jinja extension (compatible with Flask and other frameworks) to compile and/or compress your assets.

Overview
Build Status

jinja-assets-compressor

A Jinja2 extension to compile and/or compress your assets.

Installing

pip install jac

For LESS and CSS support, install less:

npm install -g less

For COFFEE support, install coffee-script:

npm install -g coffee-script

For Sass and SCSS support, install sass:

gem install sass

JavaScript minification is built-in using the Python rJsmin package.

When installing on Mac OS X set this shell variable, because jac dependencies contain C code:

export CFLAGS=-Qunused-arguments

Usage

To use it, you just have to put your css or js inside a compress tag.

sass stuff {% endcompress %} {% compress 'js' %} {% endcompress %}">
{% compress 'css' %}
<style type="text/sass">
sass stuff
</style>
<link rel="stylesheet" type="text/sass" href="file.sass">
{% endcompress %}

{% compress 'js' %}
<script type="text/coffeescript">
coffee stuff
</script>
<script type="text/coffeescript" src="file.coffee"></script>
{% endcompress %}

Configuring Jinja

You just have to create an environment with jac on it and configure output dir, static prefix and say where it can find your sources.

import jinja2

from jac import CompressorExtension

env = jinja2.Environment(extensions=[CompressorExtension])
env.compressor_output_dir = './static/dist'
env.compressor_static_prefix = '/static'
env.compressor_source_dirs = './static_files'

After that just use template = env.from_string(html); template.render() to get it done.

Configuring Flask

Where you configure your app, just do this:

from jac.contrib.flask import JAC

app = Flask(__name__)
app.config['COMPRESSOR_DEBUG'] = app.config.get('DEBUG')
app.config['COMPRESSOR_OUTPUT_DIR'] = './static/dist'
app.config['COMPRESSOR_STATIC_PREFIX'] = '/static'
jac = JAC(app)

And you are done.

Offline Compression

JAC supports compressing static assets offline, then deploying to a production server. Here is a command to compress your static assets if using Flask:

python -m jac.contrib.flask my_flask_module:create_app

Replace my_flask_module with the correct import path to find your Flask app.

Custom Compressors

The compressor_classes template env variable tells jac which compressor to use for each mimetype. The default value for compressor_classes is:

{
    'text/css': LessCompressor,
    'text/coffeescript': CoffeeScriptCompressor,
    'text/less': LessCompressor,
    'text/javascript': JavaScriptCompressor,
    'text/sass': SassCompressor,
    'text/scss': SassCompressor,
}

To use an alternate compressor class, provide a class with a compile class method accepting arg text and kwargs mimetype, cwd, uri_cwd, and debug. For example, to use libsass-python for SASS files instead of the built-in SassCompressor, create your custom compressor class:

import sass

class CustomSassCompressor(object):
    """Custom compressor for text/sass mimetype.

    Uses libsass-python for compression.
    """

    @classmethod
    def compile(cls, text, cwd=None, **kwargs):

        include_paths = []
        if cwd:
            include_paths += [cwd]

        return sass.compile(string=text, include_paths=include_paths)

Then tell jac to use your custom compressor for text/sass mimetypes:

env.compressor_classes['text/sass'] = CustomSassCompressor

The equivalent for Flask is:

jac.set_compressor('text/sass', CustomSassCompressor)

To only customize the path of a compressor which forks a subprocess for the compile step (LessCompressor, CoffeeScriptCompressor, and SassCompressor), just extend the compressor class and overwrite the binary class attribute:

from jac.compressors import SassCompressor

class CustomSassCompressor(SassCompressor):
    """Custom SASS compressor using Compass binary instead of libsass for text/sass mimetype.

    Uses the faster libsass wrapper sassc for SASS compression.
    https://github.com/sass/sassc
    """

    binary = '/usr/bin/sassc'

# Tell Flask to use our custom SASS compressor
jac.set_compressor('text/sass', CustomSassCompressor)

Running Tests

virtualenv venv
. venv/bin/activate
pip install -r requirements_tests.txt
make coverage
make lint

Or use tox to run with multiple python versions:

pip install tox
tox
Comments
  • Raise a better error when compiler is not found in PATH

    Raise a better error when compiler is not found in PATH

    When the compiler is not found we let OSError: [Errno 2] No such file or directory be thrown. We should return a better error and a better message like Executable {name} not found.

    Full stacktrace of an example:

    Traceback (most recent call last):
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/flask/app.py", line 2000, in __call__
        return self.wsgi_app(environ, start_response)
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/flask/app.py", line 1991, in wsgi_app
        response = self.make_response(self.handle_exception(e))
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/flask/app.py", line 1567, in handle_exception
        reraise(exc_type, exc_value, tb)
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/flask/app.py", line 1988, in wsgi_app
        response = self.full_dispatch_request()
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/flask/app.py", line 1641, in full_dispatch_request
        rv = self.handle_user_exception(e)
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/flask/app.py", line 1544, in handle_user_exception
        reraise(exc_type, exc_value, tb)
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/flask/app.py", line 1639, in full_dispatch_request
        rv = self.dispatch_request()
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/flask/app.py", line 1625, in dispatch_request
        return self.view_functions[rule.endpoint](**req.view_args)
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/flask_cache/__init__.py", line 297, in decorated_function
        rv = f(*args, **kwargs)
      File "/Users/liuyiqi/code/src/opendata/app/home/views.py", line 9, in index
        return render_template('home.html')
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/flask/templating.py", line 134, in render_template
        context, ctx.app)
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/flask/templating.py", line 116, in _render
        rv = template.render(context)
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/jinja2/environment.py", line 1008, in render
        return self.environment.handle_exception(exc_info, True)
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception
        reraise(exc_type, exc_value, tb)
      File "/Users/liuyiqi/code/src/opendata/app/templates/home.html", line 3, in top-level template code
        {% extends 'layouts/base.html' %}
      File "/Users/liuyiqi/code/src/opendata/app/templates/layouts/base.html", line 26, in top-level template code
        {% compress 'css' %}
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/jac/extension.py", line 39, in _compress_block
        return self.compressor.compress(html, compression_type)
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/jac/base.py", line 103, in compress
        debug=self.config.compressor_debug)
      File "/Users/liuyiqi/venv/opendata/lib/python2.7/site-packages/jac/compressors/less.py", line 35, in compile
        stderr=subprocess.PIPE, cwd=None)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
        errread, errwrite)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
        raise child_exception
    OSError: [Errno 2] No such file or directory
    
    opened by lewis617 10
  • How to ignore BeautifulSoup warning?

    How to ignore BeautifulSoup warning?

    I have found some related issue, but I still don't know how to ignore, where is the setting to be placed ?

    This is my code:

        # jac
        mode = os.getenv(DEPLOY_MODE_KEY, 'DEV')
        app.config['COMPRESSOR_DEBUG'] = (mode == 'DEV')
        app.config['COMPRESSOR_OUTPUT_DIR'] = '%s/niss/static/dist' % sys.path[0]
        app.config['COMPRESSOR_STATIC_PREFIX'] = '/static/dist'
        jac = JAC(app)
    

    If you change the source code, Why can't i download the latest version?

    opened by lewis617 8
  • use cache folder to only compress changed files

    use cache folder to only compress changed files

    When using offline compression and the compressor_cache_dir config is set to the old asset output folder, we can greatly speed up offline compression by copying files that have not changed into output folder instead of re-compiling them. For ex:

    Before

    time python -m jac.contrib.flask test:app
    Deleting previously compressed files in /Users/alan/projects/test/test/static/sdist
    Compressing static assets into /Users/alan/projects/test/test/static/sdist
    Finished offline-compressing static assets.
    real	1m37.951s
    user	1m38.567s
    sys	0m13.137s
    

    After

    time python -m jac.contrib.flask test:app
    Deleting previously compressed files in /Users/alan/projects/test/test/static/sdist
    Compressing static assets into /Users/alan/projects/test/test/static/sdist
    Finished offline-compressing static assets.
    real	0m5.676s
    user	0m5.951s
    sys	0m2.161s
    

    Time saved: 1m32s


    This change is Reviewable

    opened by alanhamlett 7
  • Bump pytest from 3.2.3 to 5.3.4

    Bump pytest from 3.2.3 to 5.3.4

    ⚠️ Dependabot is rebasing this PR ⚠️

    If you make any changes to it yourself then they will take precedence over the rebase.


    Bumps pytest from 3.2.3 to 5.3.4.

    Release notes

    Sourced from pytest's releases.

    5.3.4

    pytest 5.3.4 (2020-01-20)

    Bug Fixes

    • #6496: Revert #6436: unfortunately this change has caused a number of regressions in many suites, so the team decided to revert this change and make a new release while we continue to look for a solution.

    5.3.3

    pytest 5.3.3 (2020-01-16)

    Bug Fixes

    • #2780: Captured output during teardown is shown with -rP.
    • #5971: Fix a pytest-xdist crash when dealing with exceptions raised in subprocesses created by the multiprocessing module.
    • #6436: FixtureDef <_pytest.fixtures.FixtureDef> objects now properly register their finalizers with autouse and parameterized fixtures that execute before them in the fixture stack so they are torn down at the right times, and in the right order.
    • #6532: Fix parsing of outcomes containing multiple errors with testdir results (regression in 5.3.0).

    Trivial/Internal Changes

    • #6350: Optimized automatic renaming of test parameter IDs.

    5.3.2

    pytest 5.3.2 (2019-12-13)

    Improvements

    • #4639: Revert "A warning is now issued when assertions are made for None".
    ... (truncated)
    Changelog

    Sourced from pytest's changelog.

    Commits
    • 6a26ac4 Preparing release version 5.3.4
    • cdaa9c0 Revert "fixtures register finalizers with all fixtures before t… (#6496)
    • 0dc82e8 Add CHANGELOG entry for #6496
    • f9bed82 Merge pull request #6515 from blueyed/tox-mypy-diff
    • 2406076 tox: add mypy-diff testenv
    • 44eb1f5 Merge pull request #6311 from bluetech/type-annotations-10
    • 3392be3 Fix check_untyped_defs in test_runner
    • 3d2680b Fix type of pytest.warns, and fix check_untyped_defs in test_recwarn
    • 0b60315 Fix check_untyped_defs errors in test_pytester
    • 0c247be Add a few missing type annotations in _pytest._code
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)

    This change is Reviewable

    dependencies 
    opened by dependabot-preview[bot] 6
  • Explicitly give BeautifulSoup the parser so no warnings occur.

    Explicitly give BeautifulSoup the parser so no warnings occur.

    #32 made it so BeautifulSoup warnings were to be ignored but they were still occurring for me. The warning was pretty clear so it's better to just fix the warning itself than ignore it.


    This change is Reviewable

    opened by AndreasBackx 6
  • Can't install on python 3.5

    Can't install on python 3.5

    Hello! Thanks for providing awesome package! I've upgraded to kubuntu 16.04 and it have python 3 version 3.5 by default. But jac is dependant on rjsmin==1.0.10 which causes an error during installation Need at max python 3.4 (vs. 3.5.1). Newer version of rjsmin support python 3.5 (see https://github.com/ndparker/rjsmin/issues/5) So please fix dependancy problem.

    opened by d9k 6
  • allow custom compressor classes to fix #7

    allow custom compressor classes to fix #7

    This adds a new environment config compressor_classes with defaults:

    {
        'text/css': LessCompressor,
        'text/coffeescript': CoffeeScriptCompressor,
        'text/less': LessCompressor,
        'text/javascript': JavaScriptCompressor,
        'text/sass': SassCompressor,
        'text/scss': SassCompressor,
    }
    
    opened by alanhamlett 4
  • Adds support for LESS compilation and JavaScript minification

    Adds support for LESS compilation and JavaScript minification

    Also previously, CSS was not minified. Now CSS is minified using the LESS compiler, since LESS is just an extension to CSS.

    This fixes #5 and #6.

    Also provides a new compressor_debug env setting which only compiles static files which don't render in the browser and keeps all files separate by appending the original file name to the original output file.

    opened by alanhamlett 4
  • Dependencies shouldn't be pinned

    Dependencies shouldn't be pinned

    Hi,

    Since this is a library, the dependencies for it shouldn't be pinned - if there are known incompatibilities, the versions should be set to ranges (like >=1.1,<2, if it's incompatible with versions 2 and above from a certain library) and not exact versions. Otherwise, projects which use this library won't be able to use other versions from these dependencies.

    E.g.: I have a project which uses a newer version of six, but since jac pins it to an older version, I can't use that, it's conflicting.

    Thanks!

    opened by diogobaeder 3
  • COMPRESSOR_CLASSES config updates default compressors instead of replacing

    COMPRESSOR_CLASSES config updates default compressors instead of replacing

    This makes adding custom compressors simpler. Instead of having to list all default compressors, your Flask config can just list custom ones.


    This change is Reviewable

    opened by alanhamlett 3
  • offline_compress not work with macro

    offline_compress not work with macro

    offline_compress not work with macro, e.g:

    {% import 'home/circle.html' as circle with context %}
    {% set js = circle.js() %}
        {% compress 'js' %}
            {{ js }}
        {% endcompress %}
    

    this wont generate the compressed js file

    please fix this bug,thanks

    opened by lewis617 3
  • Keep reference to original file name in compressed file name

    Keep reference to original file name in compressed file name

    Hi there,

    Thanks for the great library!

    I was wondering whether we could add an option to keep a reference to the original file name in the compressed file name?

    For example, if I have a custom.css and wrap it around a {% compress 'css' %} block, the new file name will be something like 5ef7a08e1b4dfe00216375aa6b9ecc0d.css.

    I would love to have it transformed into something like custom.5ef7a08e1b4dfe00216375aa6b9ecc0d.css, so that I know that this file is a compression of custom.css.

    Thanks!

    opened by victorkristof 2
  • Bump mock from 2.0.0 to 3.0.5

    Bump mock from 2.0.0 to 3.0.5

    Bumps mock from 2.0.0 to 3.0.5.

    Changelog

    Sourced from mock's changelog.

    3.0.5

    • Issue #31855: unittest.mock.mock_open results now respects the argument of read([size]). Patch contributed by Rémi Lapeyre.

    3.0.4

    • Include the license, readme and changelog in the source distribution.

    3.0.3

    • Fixed patching of dictionaries, when specifying the target with a unicode on Python 2.

    3.0.2

    • Add missing funcsigs dependency on Python 2.

    3.0.1

    • Fix packaging issue where six was missed as a dependency.

    3.0.0

    • Issue #35226: Recursively check arguments when testing for equality of unittest.mock.call objects and add note that tracking of parameters used to create ancestors of mocks in mock_calls is not possible.
    • Issue #31177: Fix bug that prevented using reset_mock <unittest.mock.Mock.reset_mock> on mock instances with deleted attributes
    • Issue #26704: Added test demonstrating double-patching of an instance method. Patch by Anthony Sottile.
    • Issue #35500: Write expected and actual call parameters on separate lines in unittest.mock.Mock.assert_called_with assertion errors. Contributed by Susan Su.
    • Issue #35330: When a Mock instance was used to wrap an object, if side_effect is used in one of the mocks of it methods, don't call the original implementation and return the result of using the side effect the same way that it is done with return_value.
    • Issue #30541: Add new function to seal a mock and prevent the automatically creation of child mocks. Patch by Mario Corchero.
    • Issue #35022: unittest.mock.MagicMock now supports the __fspath__ method (from os.PathLike).
    • Issue #33516: unittest.mock.MagicMock now supports the __round__ magic method.
    • Issue #35512: unittest.mock.patch.dict used as a decorator with string target resolves the target during function call instead of during decorator construction. Patch by Karthikeyan Singaravelan.
    • Issue #36366: Calling stop() on an unstarted or stopped unittest.mock.patch object will now return None instead of raising RuntimeError, making the method idempotent. Patch byKarthikeyan Singaravelan.
    • Issue #35357: Internal attributes' names of unittest.mock._Call and unittest.mock.MagicProxy (name, parent & from_kall) are now prefixed with _mock in order to prevent clashes with widely used object attributes. Fixed minor typo in test function name.
    • Issue #20239: Allow repeated assignment deletion of unittest.mock.Mock attributes. Patch by Pablo Galindo.
    • Issue #35082: Don't return deleted attributes when calling dir on a unittest.mock.Mock.
    • Issue #0: Improved an error message when mock assert_has_calls fails.
    • Issue #23078: Add support for classmethod and staticmethod to unittest.mock.create_autospec. Initial patch by Felipe Ochoa.
    • Issue #21478: Calls to a child function created with unittest.mock.create_autospec should propagate to the parent. Patch by Karthikeyan Singaravelan.
    • Issue #36598: Fix isinstance check for Mock objects with spec when the code is executed under tracing. Patch by Karthikeyan Singaravelan.
    • Issue #32933: unittest.mock.mock_open now supports iteration over the file contents. Patch by Tony Flury.
    • Issue #21269: Add args and kwargs properties to mock call objects. Contributed by Kumar Akshay.
    • Issue #17185: Set __signature__ on mock for inspect to get signature. Patch by Karthikeyan Singaravelan.
    • Issue #35047: unittest.mock now includes mock calls in exception messages if assert_not_called, assert_called_once, or assert_called_once_with fails. Patch by Petter Strandmark.
    ... (truncated)
    Commits
    • e0180b9 Preparing for 3.0.5 release.
    • e889160 latest sync point
    • 4bd71fe bpo-31855: unittest.mock.mock_open() results now respects the argument of rea...
    • 74f6a7e Preparing for 3.0.4 release.
    • e1896ff include the license, readme and changelog in sdist
    • eec6329 Change packaging and CI to make sure packages are built correctly.
    • 8068fe7 need more sleep.
    • 2bab585 Fix up clumsy changelog entry.
    • 1efb62f Preparing for 3.0.3 release.
    • 66381c0 Note about changelog entries for changes not in cpython.
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)

    This change is Reviewable

    dependencies 
    opened by dependabot-preview[bot] 0
  • Bump flake8 from 3.4.1 to 3.7.9

    Bump flake8 from 3.4.1 to 3.7.9

    Bumps flake8 from 3.4.1 to 3.7.9.

    Commits
    • ee2920d Release 3.7.9
    • 182cdf6 Merge branch 'backport_pr_340' into '3.7-maintenance'
    • 04d3f9d Fix travis-ci
    • ee740f4 Merge branch 'backport_pr_366' into '3.7-maintenance'
    • 04f49a7 Only use multiprocessing when the method is fork
    • aa792d2 Release 3.7.8
    • f41e87b Merge branch 'pyflake-normalize-path' into 'master'
    • 24e8b81 pyflakes: Change to normalize_path() for filename normalization
    • d6bf438 Merge branch 'fix_linters' into 'master'
    • 7506847 fix CI build
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Note: This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

    You can always request more updates by clicking Bump now in your Dependabot dashboard.

    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)

    This change is Reviewable

    dependencies 
    opened by dependabot-preview[bot] 0
  • Bump flake8-isort from 2.2.2 to 2.8.0

    Bump flake8-isort from 2.2.2 to 2.8.0

    Bumps flake8-isort from 2.2.2 to 2.8.0.

    Changelog

    Sourced from flake8-isort's changelog.

    2.8.0 (2019-12-05)

    • Look for isort configuration on .flake8 files as well. [JohnHBrock]
    • Document how to install flake8-isort on conda. [marcelotrevisani]
    • Look for isort configuration on pyproject.toml files as well. [sanjioh]

    2.7.0 (2019-03-19)

    • Improve the README. [barbossa]
    • Fix isort output when pipes are used. [maerteijn]

    2.6.0 (2018-12-01)

    • Use pytest to run tests. [gforcada]
    • New error code I005 isort foundan unexpected missing import. [charettes]
    • Add isort_show_traceback option to show verbose multi-line output from isort, turned off by default [sobolevn]

    2.5 (2018-03-15)

    • Now requires isort >= 4.3.0. [jleclanche]

    2.4 (2018-02-25)

    • Fix input handling with flake8's --stdin-display-name, and simplify it. [blueyed]
    • Remove flake8-polyfill dependency. flake8 >= 3.2.1 is required already, and stdin is not read directly anymore. [blueyed]

    2.3 (2017-12-22)

    • Fix typo. [paltman]
    • Add tox.ini and .editorconfig to config search. [cas--]
    • Make this plugin compatible with flake8 hook. As the hook copies the files out of tree, flake8-isort never finds the correct configuration. [jaysonsantos]
    Commits
    • 377e52a Preparing release 2.8.0
    • 5372461 Update CHANGES
    • cb05f73 Update README.rst
    • 9d6171a Merge pull request #75 from sanjioh/pyproject-toml-support
    • 53bc302 Add support for pyproject.toml.
    • a00d4e5 Merge pull request #74 from marcelotrevisani/patch-1
    • 53d3a19 Instructions to install flake8-isort using conda
    • 5b22c6f Merge pull request #73 from JohnHBrock/patch-1
    • c0a0508 Fix list formatting in README
    • d7a0f10 Merge pull request #72 from JohnHBrock/add_flake8_config
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Note: This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

    You can always request more updates by clicking Bump now in your Dependabot dashboard.

    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)

    This change is Reviewable

    dependencies 
    opened by dependabot-preview[bot] 0
  • Bump pytest-cov from 2.5.1 to 2.8.1

    Bump pytest-cov from 2.5.1 to 2.8.1

    Bumps pytest-cov from 2.5.1 to 2.8.1.

    Changelog

    Sourced from pytest-cov's changelog.

    2.8.1 (2019-10-05)

    • Fixed #348 -regression when only certain reports (html or xml) are used then --cov-fail-under always fails.

    2.8.0 (2019-10-04)

    • Fixed RecursionError that can occur when using cleanup_on_signal or cleanup_on_sigterm. See: #294. The 2.7.x releases of pytest-cov should be considered broken regarding aforementioned cleanup API.
    • Added compatibility with future xdist release that deprecates some internals (match pytest-xdist master/worker terminology). Contributed by Thomas Grainger in #321
    • Fixed breakage that occurs when multiple reporting options are used. Contributed by Thomas Grainger in #338.
    • Changed internals to use a stub instead of os.devnull. Contributed by Thomas Grainger in #332.
    • Added support for Coverage 5.0. Contributed by Ned Batchelder in #319.
    • Added support for float values in --cov-fail-under. Contributed by Martín Gaitán in #311.
    • Various documentation fixes. Contributed by Juanjo Bazán, Andrew Murray and Albert Tugushev in #298, #299 and #307.
    • Various testing improvements. Contributed by Ned Batchelder, Daniel Hahler, Ionel Cristian Mărieș and Hugo van Kemenade in #313, #314, #315, #316, #325, #326, #334 and #335.
    • Added the --cov-context CLI options that enables coverage contexts. Only works with coverage 5.0+. Contributed by Ned Batchelder in #345.

    2.7.1 (2019-05-03)

    • Fixed source distribution manifest so that garbage ain't included in the tarball.

    2.7.0 (2019-05-03)

    • Fixed AttributeError: 'NoneType' object has no attribute 'configure_node' error when --no-cov is used. Contributed by Alexander Shadchin in #263.
    • Various testing and CI improvements. Contributed by Daniel Hahler in #255, #266, #272, #271 and #269.
    • Improved documentation regarding subprocess and multiprocessing. Contributed in #265.
    • Improved pytest_cov.embed.cleanup_on_sigterm to be reentrant (signal deliveries while signal handling is running won't break stuff).
    • Added pytest_cov.embed.cleanup_on_signal for customized cleanup.
    • Improved cleanup code and fixed various issues with leftover data files. All contributed in #265 or #262.
    • Improved examples. Now there are two examples for the common project layouts, complete with working coverage configuration. The examples have CI testing. Contributed in #267.
    • Improved help text for CLI options.

    2.6.1 (2019-01-07)

    • Added support for Pytest 4.1. Contributed by Daniel Hahler and Семён Марьясин in #253 and #230.
    • Various test and docs fixes. Contributed by Daniel Hahler in #224 and #223.
    • Fixed the "Module already imported" issue (#211). Contributed by Daniel Hahler in #228.

    2.6.0 (2018-09-03)

    • Dropped support for Python < 3.4, Pytest < 3.5 and Coverage < 4.4.
    • Fixed some documentation formatting. Contributed by Jean Jordaan and Julian.
    • Added an example with addopts in documentation. Contributed by Samuel Giffard in #195.
    • Fixed TypeError: 'NoneType' object is not iterable in certain xdist configurations. Contributed by Jeremy Bowman in #213.
    • Added a no_cover marker and fixture. Fixes #78.
    ... (truncated)
    Commits
    • 33894b5 Bump version: 2.8.0 → 2.8.1
    • 3aa43a0 Be more strict - return None so problems like #348 will trip up the later Non...
    • a078b55 Update changelog.
    • 5ef4767 Fix regression described in #348 - not all reports returning the total.
    • 5df26bd Bump version: 2.7.1 → 2.8.0
    • 9f227c2 Add xdist 0.30 and update bootstrap.py to work better (on windows too).
    • 5cc697f Add a note about the cleanup fix.
    • 7c01530 Update changelog and authors.
    • 994fb00 Update for coverage 5.0a8
    • 5f70ec4 Sort imports and add isort as a check.
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Note: This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

    You can always request more updates by clicking Bump now in your Dependabot dashboard.

    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)

    This change is Reviewable

    dependencies 
    opened by dependabot-preview[bot] 0
  • Bump pytest-xdist from 1.20.1 to 1.31.0

    Bump pytest-xdist from 1.20.1 to 1.31.0

    Bumps pytest-xdist from 1.20.1 to 1.31.0.

    Changelog

    Sourced from pytest-xdist's changelog.

    pytest-xdist 1.31.0 (2019-12-19)

    Features

    • #486: Add support for Python 3.8.

    Bug Fixes

    • #491: Fix regression that caused custom plugin command-line arguments to be discarded when using --tx mode.

    pytest-xdist 1.30.0 (2019-10-01)

    Features

    • #448: Initialization between workers and master nodes is now more consistent, which fixes a number of long-standing issues related to startup with the -c option.

      Issues:

      • #6: Poor interaction between -n# and -c X.cfg
      • #445: pytest-xdist is not reporting the same nodeid as pytest does

      This however only works with pytest 5.1 or later, as it required changes in pytest itself.

    Bug Fixes

    • #467: Fix crash issues related to running xdist with the terminal plugin disabled.

    pytest-xdist 1.29.0 (2019-06-14)

    Features

    • #226: --max-worker-restart now assumes a more reasonable value (4 times the number of nodes) when not given explicitly. This prevents test suites from running forever when the suite crashes during collection.
    • #435: When the test session is interrupted due to running out of workers, the reason is shown in the test summary for easier viewing.
    • #442: Compatibility fix for upcoming pytest 5.0: session.exitstatus is now an IntEnum object.

    Bug Fixes

    • #435: No longer show an internal error when we run out of workers due to crashes.

    pytest-xdist 1.28.0 (2019-04-02)

    ... (truncated)
    Commits
    • 1f139a8 Release 1.31.0
    • 1e284d3 Move 1.30.0 changelog to the top (by mistake?)
    • 038a59e Fix regression with custom arguments being dropped in non-local… (#491)
    • 66e74c8 Add support for Python 3.8 (#486)
    • 7eb0859 Add news file
    • 94d231c Either appveyor.yml or .appveyor.yml is allowed, let's hide with other dotfiles
    • 20532ec Add support for Python 3.8
    • cd26963 Fix typo
    • 2c6bc13 Add an example on how to share session fixture data to README (#483)
    • 0c53761 Fix tests for pytest features branch
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Note: This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

    You can always request more updates by clicking Bump now in your Dependabot dashboard.

    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)

    This change is Reviewable

    dependencies 
    opened by dependabot-preview[bot] 0
Releases(0.16.1)
Owner
Jayson Reis
Jayson Reis
Look Closer: Bridging Egocentric and Third-Person Views with Transformers for Robotic Manipulation

Look Closer: Bridging Egocentric and Third-Person Views with Transformers for Robotic Manipulation Official PyTorch implementation for the paper Look

Rishabh Jangir 20 Nov 24, 2022
A general-purpose encoder-decoder framework for Tensorflow

READ THE DOCUMENTATION CONTRIBUTING A general-purpose encoder-decoder framework for Tensorflow that can be used for Machine Translation, Text Summariz

Google 5.5k Jan 07, 2023
✂️ EyeLipCropper is a Python tool to crop eyes and mouth ROIs of the given video.

EyeLipCropper EyeLipCropper is a Python tool to crop eyes and mouth ROIs of the given video. The whole process consists of three parts: frame extracti

Zi-Han Liu 9 Oct 25, 2022
Code release for "Transferable Semantic Augmentation for Domain Adaptation" (CVPR 2021)

Transferable Semantic Augmentation for Domain Adaptation Code release for "Transferable Semantic Augmentation for Domain Adaptation" (CVPR 2021) Paper

66 Dec 16, 2022
Emblaze - Interactive Embedding Comparison

Emblaze - Interactive Embedding Comparison Emblaze is a Jupyter notebook widget for visually comparing embeddings using animated scatter plots. It bun

CMU Data Interaction Group 77 Nov 24, 2022
NVTabular is a feature engineering and preprocessing library for tabular data designed to quickly and easily manipulate terabyte scale datasets used to train deep learning based recommender systems.

NVTabular is a feature engineering and preprocessing library for tabular data designed to quickly and easily manipulate terabyte scale datasets used to train deep learning based recommender systems.

880 Jan 07, 2023
Self-Learned Video Rain Streak Removal: When Cyclic Consistency Meets Temporal Correspondence

In this paper, we address the problem of rain streaks removal in video by developing a self-learned rain streak removal method, which does not require any clean groundtruth images in the training pro

Yang Wenhan 44 Dec 06, 2022
🤗 Paper Style Guide

🤗 Paper Style Guide (Work in progress, send a PR!) Libraries to Know booktabs natbib cleveref Either seaborn, plotly or altair for graphs algorithmic

Hugging Face 66 Dec 12, 2022
学习 python3 以来写的一些垃圾玩具……

和东哥做兄弟 Author: chiupam 版权 未经本人同意,仓库内所有资源文件,禁止任何公众号、自媒体、开发者进行任何形式的转载、发布、搬运。 声明 这不是一个开源项目,只是把 GitHub 当作一个代码的存储空间,本项目不接受任何开源要求。 仅用于学习研究,禁止用于商业用途,不能保证其合法性

Chiupam 67 Mar 26, 2022
A style-based Quantum Generative Adversarial Network

Style-qGAN A style based Quantum Generative Adversarial Network (style-qGAN) model for Monte Carlo event generation. Tutorial We have prepared a noteb

9 Nov 24, 2022
I-BERT: Integer-only BERT Quantization

I-BERT: Integer-only BERT Quantization HuggingFace Implementation I-BERT is also available in the master branch of HuggingFace! Visit the following li

Sehoon Kim 139 Dec 27, 2022
Discord bot for notifying on github events

Git-Observer Discord bot for notifying on github events ⚠️ This bot is meant to write messages to only one channel (implementing this for multiple pro

ilu_vatar_ 0 Apr 19, 2022
Online Multi-Granularity Distillation for GAN Compression (ICCV2021)

Online Multi-Granularity Distillation for GAN Compression (ICCV2021) This repository contains the pytorch codes and trained models described in the IC

Bytedance Inc. 299 Dec 16, 2022
Discover hidden deepweb pages

DeepWeb Scapper Att: Demo version An simple script to scrappe deepweb to find pages. Will return if any of those exists and will save on a file. You s

Héber Júlio 77 Oct 02, 2022
DPC: Unsupervised Deep Point Correspondence via Cross and Self Construction (3DV 2021)

DPC: Unsupervised Deep Point Correspondence via Cross and Self Construction (3DV 2021) This repo is the implementation of DPC. Tested environment Pyth

Dvir Ginzburg 30 Nov 30, 2022
A script written in Python that returns a consensus string and profile matrix of a given DNA string(s) in FASTA format.

A script written in Python that returns a consensus string and profile matrix of a given DNA string(s) in FASTA format.

Zain 1 Feb 01, 2022
In this project, we develop a face recognize platform based on MTCNN object-detection netcwork and FaceNet self-supervised network.

模式识别大作业——人脸检测与识别平台 本项目是一个简易的人脸检测识别平台,提供了人脸信息录入和人脸识别的功能。前端采用 html+css+js,后端采用 pytorch,

Xuhua Huang 5 Aug 02, 2022
Implementation of H-Transformer-1D, Hierarchical Attention for Sequence Learning using 🤗 transformers

hierarchical-transformer-1d Implementation of H-Transformer-1D, Hierarchical Attention for Sequence Learning using 🤗 transformers In Progress!! 2021.

MyungHoon Jin 7 Nov 06, 2022
[ICCV 2021 Oral] PoinTr: Diverse Point Cloud Completion with Geometry-Aware Transformers

PoinTr: Diverse Point Cloud Completion with Geometry-Aware Transformers Created by Xumin Yu*, Yongming Rao*, Ziyi Wang, Zuyan Liu, Jiwen Lu, Jie Zhou

Xumin Yu 317 Dec 26, 2022
Graph Regularized Residual Subspace Clustering Network for hyperspectral image clustering

Graph Regularized Residual Subspace Clustering Network for hyperspectral image clustering

Yaoming Cai 5 Jul 18, 2022