profile
viewpoint

delete branch graingert/polymorphic-sqlalchemy

delete branch : patch-1

delete time in 11 hours

push eventgraingert/polymorphic-sqlalchemy

Thomas Grainger

commit sha 03f19d3859b295b79ec27f68df90ac0b2943e349

update url, remove deprecated download_url Fixes #3

view details

push time in 16 hours

pull request commentdocker/compose

support PyYAML up to 5.1 version

ah, no there's a dump here:

https://github.com/docker/compose/blob/75d5eb010851ddc71fa5cfb3728e399fdbf08128/compose/config/serialize.py#L105-L112

GeyseR

comment created time in 20 hours

pull request commentdocker/compose

support PyYAML up to 5.1 version

That is worrying as we support Python 2.7.

although that seems to only be broken in yaml.dump which isn't used, except in an example script which uses ruamel.yaml.dump

https://github.com/docker/compose/blob/75d5eb010851ddc71fa5cfb3728e399fdbf08128/contrib/migration/migrate-compose-file-v1-to-v2.py#L136-L142

GeyseR

comment created time in 20 hours

Pull request review commentdjango/django

s/issubclass(type(\(\w*\))/isinstance($1/g

 def force_str(s, encoding='utf-8', strings_only=False, errors='strict'):     If strings_only is True, don't convert (some) non-string-like objects.     """     # Handle the common case first for performance reasons.-    if issubclass(type(s), str):+    if isinstance(s, str):         return s     if strings_only and is_protected_type(s):         return s

note that https://github.com/django/django/pull/11375/files#diff-d3fe562051dcbab80f60f067fa6a5838R61 uses isinstance. Should it be issubclass(type(s?

graingert

comment created time in 5 days

PR opened django/django

s/issubclass(type(\(\w*\))/isinstance($1/g

a 'draft' PR just to run the test suite - and see if this actually makes a difference for @adamchainz

+2 -2

0 comment

2 changed files

pr created time in 5 days

create barnchgraingert/django

branch : issubclass-type-to-isinstance

created branch time in 5 days

push eventgraingert/django-unchained

Thomas Grainger

commit sha 6fd5ff66070994ca03672b5a483ac0dd950a6011

update for vcdriver2

view details

push time in 5 days

issue commentbenjaminp/six

http://pythonhosted.org/six/ docs are not up to date

@benjaminp they're outdated again - and pythonhosted appears higher in google. Can you remove it and redirect to rtfd?

benjaminp

comment created time in 6 days

create barnchgraingert/pip-tools

branch : use-x-checksum-header

created branch time in 7 days

issue commentjazzband/pip-tools

Allow to skip dependencies (`--no-deps`)

I think this is close to https://github.com/jazzband/pip-tools/issues/215

blueyed

comment created time in 7 days

created tagOsirium/py-radius

tagv0.0.3

RADIUS authentication module

created time in 8 days

push eventOsirium/py-radius

Thomas Grainger

commit sha f5e691a7339b87694110145ddb4b134811ca5208

fix long_description and license pypi.org now requires long_description values rendor correctly. license should not contain the full text of the licence: > The license field is a text indicating the license covering the package where the license is not a selection from the “License” Trove classifiers. See the Classifier field. Notice that there’s a licence distribution option which is deprecated but still acts as an alias for license. https://docs.python.org/3/distutils/setupscript.html#additional-meta-data

view details

Thomas Grainger

commit sha cb52851a1d5641f97f8885f91b29ac5bb2bc7644

Merge branch 'fix-long-description'

view details

Thomas Grainger

commit sha 105972c334d2c06414e82046e7b0136f327ab8b5

bump to 0.0.3

view details

push time in 8 days

issue commentbtimby/py-radius

@btimby is there any chance of a new release?

@stub42 ^

graingert

comment created time in 8 days

PR opened btimby/py-radius

Fix long description and licence

pypi.org now requires long_description values rendor correctly. license should not contain the full text of the licence:

The license field is a text indicating the license covering the package where the license is not a selection from the “License” Trove classifiers. See the Classifier field. Notice that there’s a licence distribution option which is deprecated but still acts as an alias for license. https://docs.python.org/3/distutils/setupscript.html#additional-meta-data

+3 -5

0 comment

1 changed file

pr created time in 8 days

push eventgraingert/py-radius

Thomas Grainger

commit sha f5e691a7339b87694110145ddb4b134811ca5208

fix long_description and license pypi.org now requires long_description values rendor correctly. license should not contain the full text of the licence: > The license field is a text indicating the license covering the package where the license is not a selection from the “License” Trove classifiers. See the Classifier field. Notice that there’s a licence distribution option which is deprecated but still acts as an alias for license. https://docs.python.org/3/distutils/setupscript.html#additional-meta-data

view details

push time in 8 days

create barnchgraingert/py-radius

branch : fix-long-description

created branch time in 8 days

created tagOsirium/py-radius

tagv0.0.2

RADIUS authentication module

created time in 8 days

push eventOsirium/py-radius

Thomas Grainger

commit sha e229c312577af2d6d509000c1b9b61244556f893

rename to radius

view details

push time in 8 days

push eventOsirium/py-radius

Thomas Grainger

commit sha cef13b6b2f48dc33ea4c60c462e905550dc25182

noop

view details

stub42

commit sha 6c2602d836901a51bb7973406c734bdce63d4a59

Update email address in README.rst Update my email address to something more stable

view details

stub42

commit sha 60e912d8a201d1b587397f60f5b08d5a71ce360f

Update LICENSE

view details

stub42

commit sha c8be89aaf01fae4ed0237cdc79230aaa8ed9767d

Update radius.py

view details

Ben Timby

commit sha ff943ffc89bdb60fe107c9ab0340c34df780cf11

Merge pull request #19 from graingert/fix-travis fix travis, merge open PRs

view details

Ben Timby

commit sha 0b3bf7253cdcc55db542330919ce00620ebd8cf6

Merge branch 'master' into patch-1

view details

Ben Timby

commit sha 6c277f89207dd877e930d69fa59681b2279ffbac

Merge pull request #20 from stub42/patch-1 Update email address in README.rst

view details

Thomas Grainger

commit sha cd6ba01d518723c03239cf0f8078d13470536c03

distribute universal wheels also avoid deprecated download_url property

view details

push time in 8 days

issue commentbtimby/py-radius

@btimby is there any chance of a new release?

@btimby please can I help maintain the package on PyPI? my PyPI Account is 'Thomas.Grainger'

graingert

comment created time in 8 days

pull request commentbtimby/py-radius

fix travis, merge open PRs

@btimby is there any chance of a new release?

graingert

comment created time in 8 days

pull request commentpython/cpython

bpo-36829: Add sys.unraisablehook()

If the hook fails, will it abort the process with a non-zero exit code?

On Thu, 9 May 2019, 21:19 Victor Stinner, notifications@github.com wrote:

@vstinner commented on this pull request.

In Python/errors.c https://github.com/python/cpython/pull/13187#discussion_r282648689:

  • PyObject *exc_type, *exc_value, *exc_tb;
  • PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
  • _Py_IDENTIFIER(unraisablehook);
  • PyObject *hook = _PySys_GetObjectId(&PyId_unraisablehook);
  • if (hook != NULL && hook != Py_None) {
  •    PyObject *args[4];
    
  •    args[0] = (exc_type ? exc_type : Py_None);
    
  •    args[1] = (exc_value ? exc_value : Py_None);
    
  •    args[2] = (exc_tb ? exc_tb : Py_None);
    
  •    args[3] = (obj ? obj : Py_None);
    
  •    PyObject *res = _PyObject_FastCall(hook, args, Py_ARRAY_LENGTH(args));
    
  •    Py_XDECREF(res);
    
  •    if (res == NULL) {
    
  •        unraisable_hook_failed();
    

I inlined unraisable_hook_failed() to make the fallback more explicit.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/python/cpython/pull/13187#discussion_r282648689, or mute the thread https://github.com/notifications/unsubscribe-auth/AADFATFUITFK6GHVTSB5MH3PUSBMFANCNFSM4HLQVLHQ .

vstinner

comment created time in 11 days

created tagierror/django-js-reverse

tagv0.9.1

Javascript url handling for Django that doesn't hurt.

created time in 12 days

push eventierror/django-js-reverse

Thomas Grainger

commit sha c3df4de865d576a254002a11f320b19e13e31791

bump v0.9.1

view details

push time in 12 days

push eventierror/django-js-reverse

Thomas Grainger

commit sha 78d6aff2276f2d341f643b095515f8aaba5e67c2

avoid xss when using js_reverse_inline

view details

Thomas Grainger

commit sha a3b57d1e4424e2fadabcd526d170c4868d55159c

Merge pull request #81 from ierror/fix-xss-when-using-js-reverse-inline avoid xss when using js_reverse_inline

view details

push time in 12 days

create barnchierror/django-js-reverse

branch : fix-xss-when-using-js-reverse-inline

created branch time in 12 days

issue commenttwisted/treq

treq.collect should respect flow control

Yes

On Wed, 8 May 2019, 23:01 Glyph, notifications@github.com wrote:

By "correctly" I think you mean "in response to a Deferred being returned by the callable"?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/twisted/treq/issues/238#issuecomment-490667029, or mute the thread https://github.com/notifications/unsubscribe-auth/AADFATCKNUAKM5ATU3TO67LPUNEUNANCNFSM4HFGLD4A .

graingert

comment created time in 12 days

pull request commentpython/cpython

bpo-36829: Add sys.unraisablehook()

the other PR for reference: https://github.com/python/cpython/pull/13175

vstinner

comment created time in 13 days

pull request commentpython/cpython

bpo-36829: Add sys.unraisablehook()

@vstinner PyErr_WriteUnraisable can get called during __del__ or GC so most of the python environment could have already been deleted by the time the hook is called,

Or the hook could be called after the hook is removed by GC and then we're back to the same problem

vstinner

comment created time in 13 days

pull request commentpython/cpython

bpo-36829: Add a -X option to abort in PyErr_WriteUnraisable()

@vstinner PyErr_WriteUnraisable can get called during __del__ or GC so most of the python environment could have already been deleted by the time the hook is called,

Or the hook could be called after the hook is removed by GC and then we're back to the same problem

ZackerySpytz

comment created time in 13 days

push eventgraingert/django-js-reverse

Thomas Grainger

commit sha 862bb3cfbe0d5a9fdf35f32e12abb9fce873c99a

test on js2py an ES5 impl when switching from Phantom to node - we lost any tests that make sure the code works on IE11 at all. Eg. someone could introduce arrow functions or let/const and it would pass the tests.

view details

push time in 14 days

push eventgraingert/django-js-reverse

Thomas Grainger

commit sha f9a2d56ecd49cd9566e39b2495da0803cc6597e1

test on js2py an ES5 impl when switching from Phantom to node - we lost any tests that make sure the code works on IE11 at all. Eg. someone could introduce arrow functions or let/const and it would pass the tests.

view details

push time in 14 days

push eventgraingert/django-js-reverse

Thomas Grainger

commit sha 2279104fe59bbac4a163b49509644412551500c5

test on js2py an ES5 impl when switching from Phantom to node - we lost any tests that make sure the code works on IE11 at all. Eg. someone could introduce arrow functions or let/const and it would pass the tests.

view details

push time in 14 days

issue commentPiotrDabkowski/Js2Py

why cant execute js

can you show what's on line 146?

ErisYoung

comment created time in 14 days

push eventgraingert/django-js-reverse

Thomas Grainger

commit sha 9850b675e3d988341c05302df236a560f7985184

move template logic to view

view details

Thomas Grainger

commit sha eb066246cdcccf6cc320aa8c1be3aef10c29a6ad

Support camelcase access to all publicly available JS or JSON interfaces and publicise generate_json function

view details

Thomas Grainger

commit sha 80c7051e9017dcfa8d628f5471a6510992e01812

remove self. from js

view details

Thomas Grainger

commit sha 2b504094c6d7ef1550e23966b2b18724b307d88a

add generate_cjs_module for node/webpack support

view details

Thomas Grainger

commit sha 00003392ee35c21507fb848fe53e0d9d83f388e9

configure deployment for npm and PyPI packages

view details

Thomas Grainger

commit sha 5f6d432e0819e007783d38ec1149f893b7e99099

add a urls_json view for cjs module

view details

Thomas Grainger

commit sha 00df15af56eabc516672a88b8a1a60cfc590e9d8

document use as JS module from webpack

view details

Thomas Grainger

commit sha 29f1a55410611c50c7f00a35f19df421a7dab14f

avoid JSON.parse for smaller/faster JS

view details

Thomas Grainger

commit sha 832c5eb825c0281eeb13c3f31850a216ace63c39

use simple feature detection to get text_type

view details

Thomas Grainger

commit sha c6cd1ffabc789aa1014af59ce7a378c9264740be

use io.open for consistent Python2/Python3 opening

view details

Thomas Grainger

commit sha 2caa3e4445a9af07e4f6b83cbfb4deb06ccdff3e

use u'

view details

Thomas Grainger

commit sha d12d1da5abc6bc1f9d8779909ad2bc81254ffe15

dummy_view is a View.as_view()

view details

Thomas Grainger

commit sha 74d5674654d4b33a04d8d9389be9e24d5c622eb1

test addslash, rename duplicate test method

view details

Thomas Grainger

commit sha 6de4f62f2dd396ffdaaeb7aaae283b1b29797ec0

test that request is extracted from context correctly

view details

Thomas Grainger

commit sha 771f5645d491ab0bf4ae000c3738fc31a05d2bd3

simplify test_urls ns arg for django gte2

view details

Thomas Grainger

commit sha 2603edb420e201bfc395ff9e6f3d4b1d867df117

switch to branch coverage

view details

Thomas Grainger

commit sha f2dd11f00cc0e11490d1ece40277fbdaa44af721

inner_ns_path cannot be falsy

view details

Thomas Grainger

commit sha 859dbef818605f1f5c488db1be068760ac4d1ea6

100% branch coverage

view details

Oostveen

commit sha c8b86fee1598460d0b635a43288eaf56e7463842

Resolves issue #73 Takes ROOT_URLCONF into account, if exists.

view details

LuukOost

commit sha 88597da4ef700e3a713c0b28aeed5a18099efe17

Update collectstatic_js_reverse.py Implemented (better) solution by graingert.

view details

push time in 14 days

pull request commentierror/django-js-reverse

move template logic to view

Is it okay for you if we remove the package.json for this PR and discuss the webpack/npm version separately?

No that's not ok. JavaScript shouldn't be generated programmatically

graingert

comment created time in 16 days

pull request commentierror/django-js-reverse

move template logic to view

This is for the webpack/npm version

graingert

comment created time in 16 days

pull request commentierror/django-js-reverse

move template logic to view

@ierror can you also have a look at this one?

graingert

comment created time in 16 days

issue commentarvidn/libtorrent

Support WebTorrent Protocol

That would be totally unacceptable in libtorrent

On Fri, 3 May 2019, 03:48 mascondante, notifications@github.com wrote:

Vuze has a way they got it done. Not sure if that will be helpful here. What they did seems to be make a little server in java and bake in a small chromium install. It pops open a little chromium window that tells you to keep it open and somehow handles things that way. If that code would be of any interest to you just install their program and follow the instructions here https://wiki.vuze.com/w/WebTorrent to download an example torrent. It will download their plugin to your user directory. For me it was "AppData\Roaming\Azureus\plugins\azwebtorrent". I would just upload it but I don't want anyone suspecting I slipped something naughty in the archive. Hope there's something useful in that code for you guys.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arvidn/libtorrent/issues/223#issuecomment-488903489, or mute the thread https://github.com/notifications/unsubscribe-auth/AADFATHJWTWJQKVVKKQQNUTPTORXZANCNFSM4BR24A6Q .

kevincox

comment created time in 18 days

push eventgraingert/proposal-temporal

Thomas Grainger

commit sha 79da67143084db033c1b85b7c3efe62f8929e0f6

fix -steing/String typo

view details

push time in 21 days

Pull request review commentjazzband/pip-tools

Normalize «command to run» in pip-compile headers.

 def test_fs_str(): def test_fs_str_with_bytes():     with raises(AssertionError):         fs_str(b"whatever")+++@mark.parametrize(+    "cli_args, expected_command",+    [+        # Check empty args+        ([], "pip-compile"),+        # Check all options which will be excluded from command+        (["-v"], "pip-compile"),+        (["--verbose"], "pip-compile"),+        (["-n"], "pip-compile"),+        (["--dry-run"], "pip-compile"),+        (["-q"], "pip-compile"),+        (["--quiet"], "pip-compile"),+        (["-r"], "pip-compile"),+        (["--rebuild"], "pip-compile"),+        (["-U"], "pip-compile"),+        (["--upgrade"], "pip-compile"),+        (["-P", "django"], "pip-compile"),+        (["--upgrade-package", "django"], "pip-compile"),+        # Check options+        (["--max-rounds", "42"], "pip-compile --max-rounds=42"),+        (["--index-url", "https://foo"], "pip-compile --index-url=https://foo"),+        # Check that short options will be expanded to long options+        (["-p"], "pip-compile --pre"),+        (["-f", "links"], "pip-compile --find-links=links"),+        (["-i", "https://foo"], "pip-compile --index-url=https://foo"),+        # Check positive flags+        (["--generate-hashes"], "pip-compile --generate-hashes"),+        (["--pre"], "pip-compile --pre"),+        (["--allow-unsafe"], "pip-compile --allow-unsafe"),+        # Check negative flags+        (["--no-index"], "pip-compile --no-index"),+        (["--no-emit-trusted-host"], "pip-compile --no-emit-trusted-host"),+        (["--no-annotate"], "pip-compile --no-annotate"),+        # Check that default values will be removed from the command+        (["--emit-trusted-host"], "pip-compile"),+        (["--annotate"], "pip-compile"),+        (["--index"], "pip-compile"),+        (["--max-rounds=10"], "pip-compile"),+        (["--no-build-isolation"], "pip-compile"),

can you add a test for: (["--output-file", "requirements.txt", "requirements.in"], "pip-compile")

atugushev

comment created time in 22 days

issue commentpyenv/pyenv

just get the path

woops

graingert

comment created time in 22 days

issue closedpyenv/pyenv

just get the path

Too many issues will kill our team's development velocity, drastically. Make sure you have checked all steps below.

Prerequisite

  • [ ] Make sure your problem is not listed in the common build problems.
  • [ ] Make sure no duplicated issue has already been reported in the pyenv issues. You should look for closed issues, too.
  • [ ] Make sure you are not asking us to help solving your specific issue.
    • GitHub issues is opened mainly for development purposes. If you want to ask someone to help solving your problem, go to some community site like Gitter, StackOverflow, etc.
  • [ ] Make sure your problem is not derived from packaging (e.g. Homebrew).
    • Please refer to the package documentation for the installation issues, etc.
  • [ ] Make sure your problem is not derived from plugins.
    • This repository is maintaining pyenv and the default python-build plugin only. Please refrain from reporting issues of other plugins here.

Description

  • [ ] Platform information (e.g. Ubuntu Linux 16.04):
  • [ ] OS architecture (e.g. amd64):
  • [ ] pyenv version:
  • [ ] Python version:
  • [ ] C Compiler information (e.g. gcc 7.3):
  • [ ] Please attach verbose build log as gist
    • You can turn on verbose debug logging using by setting PYENV_DEBUG=1, e.g. env PYENV_DEBUG=1 pyenv install -v 3.6.4

closed time in 22 days

graingert

issue openedpyenv/pyenv

just get the path

Too many issues will kill our team's development velocity, drastically. Make sure you have checked all steps below.

Prerequisite

  • [ ] Make sure your problem is not listed in the common build problems.
  • [ ] Make sure no duplicated issue has already been reported in the pyenv issues. You should look for closed issues, too.
  • [ ] Make sure you are not asking us to help solving your specific issue.
    • GitHub issues is opened mainly for development purposes. If you want to ask someone to help solving your problem, go to some community site like Gitter, StackOverflow, etc.
  • [ ] Make sure your problem is not derived from packaging (e.g. Homebrew).
    • Please refer to the package documentation for the installation issues, etc.
  • [ ] Make sure your problem is not derived from plugins.
    • This repository is maintaining pyenv and the default python-build plugin only. Please refrain from reporting issues of other plugins here.

Description

  • [ ] Platform information (e.g. Ubuntu Linux 16.04):
  • [ ] OS architecture (e.g. amd64):
  • [ ] pyenv version:
  • [ ] Python version:
  • [ ] C Compiler information (e.g. gcc 7.3):
  • [ ] Please attach verbose build log as gist
    • You can turn on verbose debug logging using by setting PYENV_DEBUG=1, e.g. env PYENV_DEBUG=1 pyenv install -v 3.6.4

created time in 22 days

Pull request review commentjazzband/pip-tools

Normalize «command to run» in pip-compile headers.

 def get_hashes_from_ireq(ireq):         for hash_ in hexdigests:             result.append("{}:{}".format(algorithm, hash_))     return result+++def get_compile_command(click_ctx):+    """+    Returns a normalized compile command depending on cli context.++    The command will be normalized by:+        - expanding options short to long+        - removing values that are already default+        - sorting the arguments+        - removing one-off arguments like '--upgrade'+        - removing arguments that don't change build behaviour like '--verbose'+    """+    from piptools.scripts.compile import cli++    # Map of the compile cli options (option name -> click.Option)+    compile_options = {option.name: option for option in cli.params}++    left_args = []+    right_args = []++    for option_name, value in click_ctx.params.items():+        option = compile_options[option_name]++        # Get the latest option name (usually it'll be a long name)+        option_long_name = option.opts[-1]++        # Collect variadic args separately, they will be added+        # at the end of the command later+        if option.nargs < 0:+            right_args.extend(value)+            continue++        # Exclude one-off options (--upgrade/--upgrade-package/--rebuild/...)+        # or options that don't change compile behaviour (--verbose/--dry-run/...)+        if option_long_name in COMPILE_EXCLUDE_OPTIONS:+            continue++        # Skip options without a value+        if option.default is None and not value:+            continue++        # Skip options with a default value+        if option.default == value:+            continue++        # Use a file name for file-like objects+        if (+            hasattr(value, "write")+            and hasattr(value, "read")+            and hasattr(value, "name")+        ):+            value = value.name++        # Convert value to the list+        values = value+        if not isinstance(values, (tuple, list)):+            values = [value]++        for val in values:+            # Flags don't have a value, thus add to args true or false option lone name+            if option.is_flag:+                # If there are false-options, choose an option name depends on a value+                if option.secondary_opts:+                    # Get the latest false-option+                    secondary_option_long_name = option.secondary_opts[-1]+                    arg = option_long_name if val else secondary_option_long_name+                # There are no false-options, use true-option+                else:+                    arg = option_long_name+                left_args.append(arg)+            # Append to args the option with a value+            else:+                left_args.append(+                    "{option}={value}".format(option=option_long_name, value=val)+                )++    command = "pip-compile"++    if left_args:+        command += " " + " ".join(sorted(left_args))+    if right_args:+        command += " " + " ".join(sorted(right_args))

Also join without an intermediate list is actually much slower

atugushev

comment created time in 22 days

Pull request review commentjazzband/pip-tools

Normalize «command to run» in pip-compile headers.

 def get_hashes_from_ireq(ireq):         for hash_ in hexdigests:             result.append("{}:{}".format(algorithm, hash_))     return result+++def get_compile_command(click_ctx):+    """+    Returns a normalized compile command depending on cli context.++    The command will be normalized by:+        - expanding options short to long+        - removing values that are already default+        - sorting the arguments+        - removing one-off arguments like '--upgrade'+        - removing arguments that don't change build behaviour like '--verbose'+    """+    from piptools.scripts.compile import cli++    # Map of the compile cli options (option name -> click.Option)+    compile_options = {option.name: option for option in cli.params}++    left_args = []+    right_args = []++    for option_name, value in click_ctx.params.items():+        option = compile_options[option_name]++        # Get the latest option name (usually it'll be a long name)+        option_long_name = option.opts[-1]++        # Collect variadic args separately, they will be added+        # at the end of the command later+        if option.nargs < 0:+            right_args.extend(value)+            continue++        # Exclude one-off options (--upgrade/--upgrade-package/--rebuild/...)+        # or options that don't change compile behaviour (--verbose/--dry-run/...)+        if option_long_name in COMPILE_EXCLUDE_OPTIONS:+            continue++        # Skip options without a value+        if option.default is None and not value:+            continue++        # Skip options with a default value+        if option.default == value:+            continue++        # Use a file name for file-like objects+        if (+            hasattr(value, "write")+            and hasattr(value, "read")+            and hasattr(value, "name")+        ):+            value = value.name++        # Convert value to the list+        values = value+        if not isinstance(values, (tuple, list)):+            values = [value]++        for val in values:+            # Flags don't have a value, thus add to args true or false option lone name+            if option.is_flag:+                # If there are false-options, choose an option name depends on a value+                if option.secondary_opts:+                    # Get the latest false-option+                    secondary_option_long_name = option.secondary_opts[-1]+                    arg = option_long_name if val else secondary_option_long_name+                # There are no false-options, use true-option+                else:+                    arg = option_long_name+                left_args.append(arg)+            # Append to args the option with a value+            else:+                left_args.append(+                    "{option}={value}".format(option=option_long_name, value=val)+                )++    command = "pip-compile"++    if left_args:+        command += " " + " ".join(sorted(left_args))+    if right_args:+        command += " " + " ".join(sorted(right_args))

Barely.

On python 3.6 ish you can use:

" ".join(["pip-compile", *sorted(left_args), *sorted(right_args)]

atugushev

comment created time in 22 days

pull request commentsqlalchemy-redshift/sqlalchemy-redshift

Add SSL certificate for AWS China to redshift-ca-bundle.crt

Is it possible to enable this cert only for Amazon.ch redshift instances?

xz278

comment created time in 22 days

Pull request review commentjazzband/pip-tools

Normalize «command to run» in pip-compile headers.

 from .click import style  UNSAFE_PACKAGES = {"setuptools", "distribute", "pip"}+COMPILE_EXCLUDE_OPTIONS = {

any way to extend the click option decorator with a flag for compile_exclude?

atugushev

comment created time in 23 days

Pull request review commentjazzband/pip-tools

Normalize «command to run» in pip-compile headers.

 def get_hashes_from_ireq(ireq):         for hash_ in hexdigests:             result.append("{}:{}".format(algorithm, hash_))     return result+++def get_compile_command(click_ctx):+    """+    Returns a normalized compile command depending on cli context.++    The command will be normalized by:+        - expanding options short to long+        - removing values that are already default+        - sorting the arguments+        - removing one-off arguments like '--upgrade'+        - removing arguments that don't change build behaviour like '--verbose'+    """+    from piptools.scripts.compile import cli++    # Map of the compile cli options (option name -> click.Option)+    compile_options = {option.name: option for option in cli.params}++    left_args = []+    right_args = []++    for option_name, value in click_ctx.params.items():+        option = compile_options[option_name]++        # Get the latest option name (usually it'll be a long name)+        option_long_name = option.opts[-1]++        # Collect variadic args separately, they will be added+        # at the end of the command later+        if option.nargs < 0:+            right_args.extend(value)+            continue++        # Exclude one-off options (--upgrade/--upgrade-package/--rebuild/...)+        # or options that don't change compile behaviour (--verbose/--dry-run/...)+        if option_long_name in COMPILE_EXCLUDE_OPTIONS:+            continue++        # Skip options without a value+        if option.default is None and not value:+            continue++        # Skip options with a default value+        if option.default == value:+            continue++        # Use a file name for file-like objects+        if (+            hasattr(value, "write")+            and hasattr(value, "read")+            and hasattr(value, "name")+        ):+            value = value.name++        # Convert value to the list+        values = value+        if not isinstance(values, (tuple, list)):+            values = [value]++        for val in values:+            # Flags don't have a value, thus add to args true or false option lone name+            if option.is_flag:+                # If there are false-options, choose an option name depends on a value+                if option.secondary_opts:+                    # Get the latest false-option+                    secondary_option_long_name = option.secondary_opts[-1]+                    arg = option_long_name if val else secondary_option_long_name+                # There are no false-options, use true-option+                else:+                    arg = option_long_name+                left_args.append(arg)+            # Append to args the option with a value+            else:+                left_args.append(+                    "{option}={value}".format(option=option_long_name, value=val)+                )++    command = "pip-compile"
    command = " ".join(["pip-compile"] + sorted(left_args) + sorted(right_args))`
atugushev

comment created time in 23 days

Pull request review commentjazzband/pip-tools

Normalize «command to run» in pip-compile headers.

 def get_hashes_from_ireq(ireq):         for hash_ in hexdigests:             result.append("{}:{}".format(algorithm, hash_))     return result+++def get_compile_command(click_ctx):+    """+    Returns a normalized compile command depending on cli context.++    The command will be normalized by:+        - expanding options short to long+        - removing values that are already default+        - sorting the arguments+        - removing one-off arguments like '--upgrade'+        - removing arguments that don't change build behaviour like '--verbose'+    """+    from piptools.scripts.compile import cli++    # Map of the compile cli options (option name -> click.Option)+    compile_options = {option.name: option for option in cli.params}++    left_args = []+    right_args = []++    for option_name, value in click_ctx.params.items():+        option = compile_options[option_name]++        # Get the latest option name (usually it'll be a long name)+        option_long_name = option.opts[-1]++        # Collect variadic args separately, they will be added+        # at the end of the command later+        if option.nargs < 0:+            right_args.extend(value)+            continue++        # Exclude one-off options (--upgrade/--upgrade-package/--rebuild/...)+        # or options that don't change compile behaviour (--verbose/--dry-run/...)+        if option_long_name in COMPILE_EXCLUDE_OPTIONS:+            continue++        # Skip options without a value+        if option.default is None and not value:+            continue++        # Skip options with a default value+        if option.default == value:+            continue++        # Use a file name for file-like objects+        if (+            hasattr(value, "write")+            and hasattr(value, "read")+            and hasattr(value, "name")+        ):+            value = value.name++        # Convert value to the list+        values = value+        if not isinstance(values, (tuple, list)):+            values = [value]++        for val in values:+            # Flags don't have a value, thus add to args true or false option lone name+            if option.is_flag:+                # If there are false-options, choose an option name depends on a value+                if option.secondary_opts:+                    # Get the latest false-option+                    secondary_option_long_name = option.secondary_opts[-1]+                    arg = option_long_name if val else secondary_option_long_name+                # There are no false-options, use true-option+                else:+                    arg = option_long_name+                left_args.append(arg)+            # Append to args the option with a value+            else:+                left_args.append(+                    "{option}={value}".format(option=option_long_name, value=val)+                )++    command = "pip-compile"++    if left_args:+        command += " " + " ".join(sorted(left_args))+    if right_args:+        command += " " + " ".join(sorted(right_args))

" ".join(["pip-compile"] + sorted(left_args) + sorted(right_args))

atugushev

comment created time in 23 days

Pull request review commentjazzband/pip-tools

Normalize «command to run» in pip-compile headers.

 from pytest import fixture, mark, raises  from piptools._compat import FormatControl+from piptools.scripts.compile import cli from piptools.utils import comment from piptools.writer import OutputWriter   @fixture-def writer(tmp_file):-    return OutputWriter(-        src_files=["src_file", "src_file2"],-        dst_file=tmp_file,-        dry_run=True,-        emit_header=True,-        emit_index=True,-        emit_trusted_host=True,-        annotate=True,-        generate_hashes=False,-        default_index_url=None,-        index_urls=[],-        trusted_hosts=[],-        format_control=FormatControl(set(), set()),-        allow_unsafe=False,-    )+def writer(tmpdir):+    with open("src_file", "w"):+        pass++    with open("src_file2", "w"):+        pass

src_file and src_file2 should be in the tmp_file dir

atugushev

comment created time in 23 days

Pull request review commentjazzband/pip-tools

Normalize «command to run» in pip-compile headers.

 def get_hashes_from_ireq(ireq):         for hash_ in hexdigests:             result.append("{}:{}".format(algorithm, hash_))     return result+++def get_compile_command(click_ctx):+    """+    Returns a normalized compile command depending on cli context.++    The command will be normalized by:+        - expanding options short to long+        - removing values that are already default+        - sorting the arguments+        - removing one-off arguments like '--upgrade'+        - removing arguments that don't change build behaviour like '--verbose'+    """+    from piptools.scripts.compile import cli++    # Map of the compile cli options (option name -> click.Option)+    compile_options = {option.name: option for option in cli.params}++    left_args = []+    right_args = []++    for option_name, value in click_ctx.params.items():+        option = compile_options[option_name]++        # Get the latest option name (usually it'll be a long name)+        option_long_name = option.opts[-1]++        # Collect variadic args separately, they will be added+        # at the end of the command later+        if option.nargs < 0:+            right_args.extend(value)+            continue++        # Exclude one-off options (--upgrade/--upgrade-package/--rebuild/...)+        # or options that don't change compile behaviour (--verbose/--dry-run/...)+        if option_long_name in COMPILE_EXCLUDE_OPTIONS:+            continue++        # Skip options without a value+        if option.default is None and not value:+            continue++        # Skip options with a default value+        if option.default == value:+            continue++        # Use a file name for file-like objects+        if (+            hasattr(value, "write")+            and hasattr(value, "read")+            and hasattr(value, "name")+        ):+            value = value.name++        # Convert value to the list+        values = value+        if not isinstance(values, (tuple, list)):+            values = [value]++        for val in values:+            # Flags don't have a value, thus add to args true or false option lone name+            if option.is_flag:+                # If there are false-options, choose an option name depends on a value+                if option.secondary_opts:+                    # Get the latest false-option+                    secondary_option_long_name = option.secondary_opts[-1]+                    arg = option_long_name if val else secondary_option_long_name+                # There are no false-options, use true-option+                else:+                    arg = option_long_name+                left_args.append(arg)+            # Append to args the option with a value+            else:+                left_args.append(+                    "{option}={value}".format(option=option_long_name, value=val)+                )++    command = "pip-compile"++    if left_args:+        command += " " + " ".join(sorted(left_args))+    if right_args:+        command += " " + " ".join(sorted(right_args))++    return command

also available as six.moves.shlex_quote

atugushev

comment created time in 23 days

PR opened myint/yolk

enable universal wheels
+2 -0

0 comment

1 changed file

pr created time in a month

push eventgraingert/yolk

Thomas Grainger

commit sha 808f16f5a2468590aa61d476ebc84172f0d731a1

enable universal wheels

view details

push time in a month

pull request commentmyint/autoflake

More comprehensive star-import fixer thing.

Yes I was suggesting you use Jedi here as a library

On Fri, 19 Apr 2019, 03:53 Connor Wolf, notifications@github.com wrote:

Yeah, but the whole point of this project, as far as I'm aware, is to fix things automatically.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/myint/autoflake/pull/31#issuecomment-484751541, or mute the thread https://github.com/notifications/unsubscribe-auth/AADFATCWBWYMGOVFSQFWKMLPREXZNANCNFSM4ENQVM4A .

fake-name

comment created time in a month

pull request commentmyint/autoflake

More comprehensive star-import fixer thing.

I know but you can use it to determine the available imports

fake-name

comment created time in a month

push eventgraingert/autoflake

Thomas Grainger

commit sha 2730b15116dfef81f8a715d54bb25d3bb8e5449a

use ast to remove unused assignments Fixes #48

view details

push time in a month

push eventgraingert/autoflake

Thomas Grainger

commit sha 22d793b8b53e8a1960b7943a74265f7ece1d2c1b

use ast to remove unused assignments Fixes #48

view details

push time in a month

PR opened myint/autoflake

add test for #48
+2 -0

0 comment

1 changed file

pr created time in a month

create barnchgraingert/autoflake

branch : fix-kwargs-hiding-unused

created branch time in a month

fork graingert/autoflake

Removes unused imports and unused variables as reported by pyflakes

https://pypi.python.org/pypi/autoflake

fork in a month

pull request commentmyint/autoflake

More comprehensive star-import fixer thing.

it may be better to use https://github.com/davidhalter/jedi

fake-name

comment created time in a month

issue commentmyint/autoflake

Expand *all* star imports?

@fake-name it may be better to use https://github.com/davidhalter/jedi

fake-name

comment created time in a month

issue openedpallets/click

provide access to a normalized list of args that will result in the same params

In pip-tools I want to be able to store the args that pip-compile was called with in its output. However I want to normalize the output so that syntactic arg changes are ignored.

Effectively, given a Context object, I want to be able to retrieve a list of arg strings that will generate it against, such that all equivalent Context objects generate the same list of arg strings.

https://github.com/jazzband/pip-tools/issues/788

created time in a month

issue openedjazzband/pip-tools

Nomalize 'To update, run' advice

Currently when you regenerate a requirements.txt, if you run with syntactically different, but semantically identical command line flags the 'To update, run' advice changes.

The 'To update, run' advice should be normalized by:

  • expanding short to long,
  • removing values that are already default,
  • sorting the arguments
  • removing arguments that don't change build behaviour like 'verbose'

created time in a month

issue openedmyint/autoflake

doesn't remove unused when calling a function with a kwarg

def f():
    pass


def bar():
    user = f(k='')

created time in a month

PR opened btimby/py-radius

distribute universal wheels

also avoid deprecated download_url property

+12 -6

0 comment

4 changed files

pr created time in a month

create barnchgraingert/py-radius

branch : wheels

created branch time in a month

issue openedbtimby/py-radius

@btimby is there any chance of a new release?

@btimby ^

created time in a month

pull request commentgorakhargosh/mom

distribute universal wheels

@gorakhargosh FYI pyasn1 has a py3 release now

graingert

comment created time in a month

push eventgraingert/mom

Thomas Grainger

commit sha 1ce25a357de7094da993476b7bd741efa07f929e

pyasn1 has been ported to python3

view details

push time in a month

PR opened gorakhargosh/mom

distribute universal wheels
+36 -35

0 comment

3 changed files

pr created time in a month

create barnchgraingert/mom

branch : wheels

created branch time in a month

fork graingert/mom

The do-not-repeat-yourself-library. All your utils.py and compat.py are belong to us. Python 2.5+, PyPy, and Python 3.x

fork in a month

PR opened kiorky/SOAPpy

including encoding argument when reading files from setup.py

this can break if the user's terminal encoding is different to the files in the sdist

we already know they are UTF8, so no need to rely on python's guess

+7 -5

0 comment

1 changed file

pr created time in a month

push eventgraingert/SOAPpy

Thomas Grainger

commit sha 467e147066661912b1eb2c1bc1066e3cbfd07de2

including encoding argument when reading files from setup.py this can break if the user's terminal encoding is different to the files in the sdist we already know they are UTF8, so no need to rely on python's guess

view details

push time in a month

push eventgraingert/treq

Thomas Grainger

commit sha 5c37da0d0995cb698cd56c81ab74ec243858c9a2

make treq.collect respect flow control

view details

Thomas Grainger

commit sha acce3ce3e16b42b29957e9a52c82a573d2b51856

update download_file to make use of collect flow control

view details

push time in a month

push eventgraingert/treq

Thomas Grainger

commit sha c888f874f1cb1913d09414061b368875bdd67d12

make treq.collect respect flow control

view details

Thomas Grainger

commit sha 5f668a894131580d324c69faf63a37a570b0ac35

update download_file to make use of collect flow control

view details

push time in a month

push eventgraingert/treq

Thomas Grainger

commit sha 3a66672460e5e3988d740c67957a926c6f1a0984

make treq.collect respect flow control

view details

Thomas Grainger

commit sha 3183f0045e052db87c96f5b5cccd32162e03aeae

update download_file to make use of collect flow control

view details

push time in a month

push eventgraingert/treq

Thomas Grainger

commit sha d0fd8cb75243b28b33c27b700464df81db665daf

make treq.collect respect flow control

view details

Thomas Grainger

commit sha 24d0987c191016870adc7c0410910c6a7520f53f

update download_file to make use of collect flow control

view details

push time in a month

push eventgraingert/treq

Thomas Grainger

commit sha 167bc80fc3c992b4dbffb9910347ada63b052383

remove flow_collect, apply flow control behaviour to collect

view details

Thomas Grainger

commit sha 6a4d8d929ff1fdbf970cf75518a3943cdd80b37a

update download_file to make use of collect flow control

view details

push time in a month

push eventgraingert/treq

Thomas Grainger

commit sha 1a7ec9935f7d2760b4262c876103691fcbb02411

update download_file to make use of collect flow control

view details

push time in a month

push eventgraingert/treq

Thomas Grainger

commit sha 971c170da05dec5000aaf34c826f7fe019838b85

remove flow_collect, apply flow control behaviour to collect

view details

push time in a month

push eventgraingert/treq

Thomas Grainger

commit sha f897bc104de5e41a5f0463a7ce257abb74bfb435

remove flow_collect, apply flow control behaviour to collect

view details

push time in a month

push eventgraingert/treq

Thomas Grainger

commit sha e3b833ba345d8c199fad0baccb1ed7b4f7559c78

remove flow_collect, apply flow control behaviour to collect also simplify collect - because dataRecieved must not be called between pauseProducing and resumeProducing

view details

push time in a month

push eventgraingert/treq

Thomas Grainger

commit sha a8650826b5103b464925debfc5ced6809b700917

remove flow_collect, apply flow control behaviour to collect also simplify collect - because dataRecieved must not be called between pauseProducing and resumeProducing

view details

push time in a month

push eventgraingert/treq

Thomas Grainger

commit sha 33fdf85fa737ed1a6fd71d87b7861084f5dee316

remove flow_collect, apply flow control behaviour to collect also simplify collect - because dataRecieved must not be called between pauseProducing and resumeProducing

view details

push time in a month

push eventgraingert/treq

Thomas Grainger

commit sha c32fad5054b0d12d0477dbeb706d81dfa50cd645

remove flow_collect, apply flow control behaviour to collect also simplify collect - because dataRecieved must not be called between pauseProducing and resumeProducing

view details

push time in a month

push eventgraingert/treq

Thomas Grainger

commit sha af3814eef29bca1cfd871e8a8556008a9ddcdfa1

remove flow_collect, apply flow control behaviour to collect also simplify collect - because dataRecieved must not be called between pauseProducing and resumeProducing

view details

push time in a month

PullRequestEvent

pull request commenttwisted/treq

add flow_collect, a version of collect that respects flow control Fixes #238

flow_collect can then be used something like this

import functools

from twisted.internet import defer, threads
import treq

@defer.inlineCallbacks
def download_file(url):
    response = yield treq.get(url, unbuffered=True)
    f = yield threads.deferToThread(io.open, dest, 'wb')
    def write(data):
        return deferToThread(f.write, data)
    try:
        yield treq.flow_collect(response, functools.partial(threads.deferToThread, f.write))
    finally:
        yield deferToThread(f.close)
graingert

comment created time in a month

pull request commenttwisted/treq

add flow_collect, a version of collect that respects flow control Fixes #238

also provides reduce, to allow easy collecting of data between calls

graingert

comment created time in a month

more