profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/tomcatling/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

tomcatling/black-nb 29

Runs black on code cells in a Jupyter notebook

tomcatling/e-c-notebooks 1

Recipes for building a JupyterLab environment which can run autonomous jobs on EC2

tomcatling/notebooks 1

A minimal notebook environment for doing quick work

tomcatling/bootstrap-lightbox 0

A simple lightbox plugin based on the bootstrap modal plugin.

tomcatling/CeilidhTunes 0

UCLU Ceilidh Band ABC Collection

tomcatling/certbot-route53 0

Helping create Let's Encrypt certificates for AWS Route53

tomcatling/cloudformation 0

My collection of useful cloudformation templates.

tomcatling/cloudJHub 0

An implementation of JupyterHub within the Amazon cloud, with automatic scaling up and down

tomcatling/DCMotorServo 0

Arduino Library for controlling DC motors with rotary encoders.

startedtomcatling/black-nb

started time in 7 days

issue openedtomcatling/black-nb

Indented comments with trailing question mark trigger Internal Error

This has been fun to chase down!

I thought the popular INTERNAL ERROR: Black produced different code on the second pass of the formatter. had been fixed in last black release, but after ugprading, I realized the one I was hitting was due to black-nb alone.

It has to do with the hide_magic / reveal_magic functions. An indented comment that ends in a question mark will trigger the contains_magic tests and then make the 2nd pass validation tests fail.

This notebook reproduces the issue:

https://gist.github.com/jaimergp/46f74cffcecc4e38ce4471e32cf5f374

I had to modify a function to get more insights on the actual error:

def assert_stable(dst: str, mode: black.FileMode = black.FileMode(),) -> None:
    new_dst = format_str(dst, mode=mode)
    if dst != new_dst:
        print(black.diff(dst, new_dst, "1st pass", "2nd pass"))  # I added this <-----------
        raise AssertionError(
            "INTERNAL ERROR: Black produced different code on the second pass "
            "of the formatter. Check diff above."
        ) from None

My workaround so far is to either remove the trailing question marks or adding something else after it, but it should be addressed here as a bug, ideally.

Thanks!

created time in 9 days

issue closedtomcatling/black-nb

PyPI release

Dear team,

I have observed that there are two new releases for this project, but the last PyPI release still points to v0.4. Is it possible to upload the releases there too?

Thanks!

closed time in 9 days

jaimergp

issue commenttomcatling/black-nb

PyPI release

Hi @jaimergp, it's released now as 0.5.0. I messed up before and released it as 0.0.5 :(

jaimergp

comment created time in 9 days

created tagtomcatling/black-nb

tag0.5.0

Runs black on code cells in a Jupyter notebook

created time in 9 days

startedtomcatling/black-nb

started time in 9 days

issue openedtomcatling/black-nb

PyPI release

Dear team,

I have observed that there are two new releases for this project, but the last PyPI release still points to v0.4. Is it possible to upload the releases there too?

Thanks!

created time in 9 days

startedtomcatling/black-nb

started time in 9 days

release mwouts/jupytext

v1.11.2

released time in 10 days

startedtomcatling/black-nb

started time in 10 days

created tagtomcatling/black-nb

tag0.0.6

Runs black on code cells in a Jupyter notebook

created time in 13 days

push eventtomcatling/black-nb

Liam Coatman

commit sha 4ed6238b699398a721affbf9d508af6b52716e77

Require latest black (#61)

view details

push time in 13 days

create barnchtomcatling/black-nb

branch : liam/require-latest-black

created branch time in 13 days

created tagtomcatling/black-nb

tag0.0.5

Runs black on code cells in a Jupyter notebook

created time in 13 days

push eventtomcatling/black-nb

Liam Coatman

commit sha 7605875f451a734a83619065333a3e28ec46eaec

Fix flake8 violations (#60)

view details

push time in 13 days

PR merged tomcatling/black-nb

Fix flake8 violations
+4 -4

0 comment

1 changed file

liamcoatman

pr closed time in 13 days

PR opened tomcatling/black-nb

Fix flake8 violations
+4 -4

0 comment

1 changed file

pr created time in 13 days

create barnchtomcatling/black-nb

branch : liam/fix-flake8

created branch time in 13 days

pull request commenttomcatling/black-nb

upgrade with the latest black version 21.4b0

Thanks a lot @harshad16 !

harshad16

comment created time in 13 days

push eventtomcatling/black-nb

Harshad Reddy Nalla

commit sha 31028126a76add2b24f94658c03083f713ba16b9

Compatibility with latest black version 21.4b0 (#59)

view details

push time in 13 days

PR merged tomcatling/black-nb

upgrade with the latest black version 21.4b0

updates based on the new black update https://github.com/psf/black/releases/tag/21.4b0 Signed-off-by: Harshad Reddy Nalla hnalla@redhat.com

Fixes: https://github.com/tomcatling/black-nb/issues/58 Related-to: https://github.com/aicoe-aiops/ocp-ci-analysis/issues/246

+53 -5

0 comment

2 changed files

harshad16

pr closed time in 13 days

issue closedtomcatling/black-nb

Incompatability with Black 21.4b0

The following error occurs when I run Run black-nb --clear-output --check . when version 21.4b0 of black is used:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.9/x64/bin/black-nb", line 8, in <module>
    sys.exit(cli())
  File "/opt/hostedtoolcache/Python/3.8.9/x64/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.8.9/x64/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/hostedtoolcache/Python/3.8.9/x64/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/hostedtoolcache/Python/3.8.9/x64/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.8.9/x64/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.8.9/x64/lib/python3.8/site-packages/black_nb/cli.py", line 142, in cli
    target_versions=black.PY36_VERSIONS,
AttributeError: module 'black' has no attribute 'PY36_VERSIONS'

If I fix black to version 20.8b1 this issue does not occur.

Note that new installs of black-nb will automatically use black 21.4b0 and therefore result in errors in new projects.

closed time in 13 days

Luttik

Pull request review commenttomcatling/black-nb

upgrade with the latest black version 21.4b0

 def cli(     check: bool,     include: str,     exclude: str,+    extend_exclude: str,

updated the type as well :+1:

harshad16

comment created time in 14 days

Pull request review commenttomcatling/black-nb

upgrade with the latest black version 21.4b0

     ),     show_default=True, )+@click.option(+    "--extend-exclude",+    type=str,

Absolutely, I have updated these changes.

harshad16

comment created time in 14 days

Pull request review commenttomcatling/black-nb

upgrade with the latest black version 21.4b0

     ),     show_default=True, )+@click.option(+    "--extend-exclude",+    type=str,

Can you add callback=black.validate_regex, to extend-exclude, include and exclude? It returns a Pattern[str] type which is needed by black.get_sources

harshad16

comment created time in 14 days

Pull request review commenttomcatling/black-nb

upgrade with the latest black version 21.4b0

 def cli(     check: bool,     include: str,     exclude: str,+    extend_exclude: str,

After adding the validate_regex callback, the type of include and exclude should be Pattern[str]. The type of extend_exclude should be Optional[Pattern[str]]. The type of stdin_filename should be Optional[str].

harshad16

comment created time in 14 days

startedrebuy-de/aws-nuke

started time in 15 days

PR opened tomcatling/black-nb

upgrade with the latest black version 21.4b0

updates based on the new black update https://github.com/psf/black/releases/tag/21.4b0 Signed-off-by: Harshad Reddy Nalla hnalla@redhat.com

Fixes: https://github.com/tomcatling/black-nb/issues/58 Related-to: https://github.com/aicoe-aiops/ocp-ci-analysis/issues/246

+27 -1

0 comment

1 changed file

pr created time in 15 days

fork harshad16/black-nb

Runs black on code cells in a Jupyter notebook

https://pypi.org/project/black-nb/

fork in 15 days