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
An interactive DNN Model deployed on web that predicts the chance of heart failure for a patient with an accuracy of 98%

Heart Failure Predictor About A Web UI deployed Dense Neural Network Model Made using Tensorflow that predicts whether the patient is healthy or has c

Adit Ahmedabadi 0 Jan 09, 2022
Implementation of ConvMixer in TensorFlow and Keras

ConvMixer ConvMixer, an extremely simple model that is similar in spirit to the ViT and the even-more-basic MLP-Mixer in that it operates directly on

Sayan Nath 8 Oct 03, 2022
Simultaneous Detection and Segmentation

Simultaneous Detection and Segmentation This is code for the ECCV Paper: Simultaneous Detection and Segmentation Bharath Hariharan, Pablo Arbelaez,

Bharath Hariharan 96 Jul 20, 2022
Neural Magic Eye: Learning to See and Understand the Scene Behind an Autostereogram, arXiv:2012.15692.

Neural Magic Eye Preprint | Project Page | Colab Runtime Official PyTorch implementation of the preprint paper "NeuralMagicEye: Learning to See and Un

Zhengxia Zou 56 Jul 15, 2022
Session-aware Item-combination Recommendation with Transformer Network

Session-aware Item-combination Recommendation with Transformer Network 2nd place (0.39224) code and report for IEEE BigData Cup 2021 Track1 Report EDA

Tzu-Heng Lin 6 Mar 10, 2022
Make differentially private training of transformers easy for everyone

private-transformers This codebase facilitates fast experimentation of differentially private training of Hugging Face transformers. What is this? Why

Xuechen Li 73 Dec 28, 2022
Gesture recognition on Event Data

Event based Gesture Recognition Gesture recognition on Event Data usually involv

2 Feb 14, 2022
[ICCV 2021 Oral] NerfingMVS: Guided Optimization of Neural Radiance Fields for Indoor Multi-view Stereo

NerfingMVS Project Page | Paper | Video | Data NerfingMVS: Guided Optimization of Neural Radiance Fields for Indoor Multi-view Stereo Yi Wei, Shaohui

Yi Wei 369 Dec 24, 2022
FEMDA: Robust classification with Flexible Discriminant Analysis in heterogeneous data

FEMDA: Robust classification with Flexible Discriminant Analysis in heterogeneous data. Flexible EM-Inspired Discriminant Analysis is a robust supervised classification algorithm that performs well i

0 Sep 06, 2022
Scikit-event-correlation - Event Correlation and Forecasting over High Dimensional Streaming Sensor Data algorithms

scikit-event-correlation Event Correlation and Changing Detection Algorithm Theo

Intellia ICT 5 Oct 30, 2022
Theano is a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently. It can use GPUs and perform efficient symbolic differentiation.

============================================================================================================ `MILA will stop developing Theano https:

9.6k Dec 31, 2022
An index of recommendation algorithms that are based on Graph Neural Networks.

An index of recommendation algorithms that are based on Graph Neural Networks.

FIB LAB, Tsinghua University 564 Jan 07, 2023
A repository for storing njxzc final exam review material

文档地址,请戳我 👈 👈 👈 ☀️ 1.Reason 大三上期末复习软件工程的时候,发现其他高校在GitHub上开源了他们学校的期末试题,我很受触动。期末

GuJiakai 2 Jan 18, 2022
JAXDL: JAX (Flax) Deep Learning Library

JAXDL: JAX (Flax) Deep Learning Library Simple and clean JAX/Flax deep learning algorithm implementations: Soft-Actor-Critic (arXiv:1812.05905) Transf

Patrick Hart 4 Nov 27, 2022
Pytorch version of VidLanKD: Improving Language Understanding viaVideo-Distilled Knowledge Transfer

VidLanKD Implementation of VidLanKD: Improving Language Understanding via Video-Distilled Knowledge Transfer by Zineng Tang, Jaemin Cho, Hao Tan, Mohi

Zineng Tang 54 Dec 20, 2022
Code for "Modeling Indirect Illumination for Inverse Rendering", CVPR 2022

Modeling Indirect Illumination for Inverse Rendering Project Page | Paper | Data Preparation Set up the python environment conda create -n invrender p

ZJU3DV 116 Jan 03, 2023
"3D Human Texture Estimation from a Single Image with Transformers", ICCV 2021

Texformer: 3D Human Texture Estimation from a Single Image with Transformers This is the official implementation of "3D Human Texture Estimation from

XiangyuXu 193 Dec 05, 2022
ML model to classify between cats and dogs

Cats-and-dogs-classifier This is my first ML model which can classify between cats and dogs. Here the accuracy is around 75%, however , the accuracy c

Sharath V 4 Aug 20, 2021
Self Governing Neural Networks (SGNN): the Projection Layer

Self Governing Neural Networks (SGNN): the Projection Layer A SGNN's word projections preprocessing pipeline in scikit-learn In this notebook, we'll u

Guillaume Chevalier 22 Nov 06, 2022
Python wrapper class for OpenVINO Model Server. User can submit inference request to OVMS with just a few lines of code

Python wrapper class for OpenVINO Model Server. User can submit inference request to OVMS with just a few lines of code.

Yasunori Shimura 7 Jul 27, 2022