profile
viewpoint
John Vandenberg jayvdb @coala; @PyCQA; @BesutKode @wikimedia-id; University of New England, Australia Jakarta; Perth https://ghuser.io/jayvdb Wikipedia/Wikimedia developer and trainer; Software quality assurance; Big data edu analyst

guyzmo/git-repo 819

Git-Repo: CLI utility to manage git services from your workspace

CleanCut/green 665

Green is a clean, colorful, fast python test runner.

coala/projects 99

A website that showcases interesting projects, using Angular JS.

brechtm/citeproc-py 87

Yet another Python CSL Processor

imsky/PocketEuler 78

:heavy_plus_sign: Offline version of Project Euler.

bunbun/nested-dict 25

nested_dict provides python dictionaries with multiple levels of nested-ness

coala/git-task-list 25

Git Task Lists

bskinn/stdio-mgr 10

Context manager for mocking/wrapping stdin/stdout/stderr

issue commentenpaul/tox-poetry-installer

Failure in non-poetry project

  File "/usr/lib/python3.8/site-packages/tox_poetry_installer.py", line 285, in tox_testenv_install_deps
    raise err
  File "/usr/lib/python3.8/site-packages/tox_poetry_installer.py", line 270, in tox_testenv_install_deps
    poetry = PoetryFactory().create_poetry(venv.envconfig.config.toxinidir)
  File "/usr/lib/python3.8/site-packages/poetry/factory.py", line 38, in create_poetry
    poetry_file = self.locate(cwd)
  File "/usr/lib/python3.8/site-packages/poetry/factory.py", line 336, in locate
    raise RuntimeError(
RuntimeError: Poetry could not find a pyproject.toml file in /path/to/pytest-djangoapp or its parents
jayvdb

comment created time in 4 hours

issue commentenpaul/tox-poetry-installer

Failure in non-poetry project

tox plugins should not assume they are installed in a venv dedicated to a single project. tox is usually installed outside any venv, as it creates the venvs for any project. Adding a check would be great. A warning isnt appropriate if the project isnt using poetry; even a notice would be superfluous. A debug level log entry would suffice.

jayvdb

comment created time in 7 hours

pull request commentDirectXMan12/should_be

Support CPython 3.8

@DirectXMan12 ping

PromyLOPh

comment created time in 21 hours

issue commentpyenv/pyenv

SQLite extension support

I tried

PYTHON_CONFIGURE_OPTS="–enable-loadable-sqlite-extensions" pyenv install 3.6.11`
pyenv: /home/jayvdb/.pyenv/versions/3.6.11 already exists
continue with installation? (y/N) y
Downloading Python-3.6.11.tar.xz...
-> https://www.python.org/ftp/python/3.6.11/Python-3.6.11.tar.xz
Installing Python-3.6.11...

BUILD FAILED (openSUSE 20190617 using python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20200928183804.619
Results logged to /tmp/python-build.20200928183804.619.log

Last 10 log lines:
/tmp/python-build.20200928183804.619/Python-3.6.11 /tmp/python-build.20200928183804.619 ~/projects/foo/bar
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: –-enable-loadable-sqlite-extensions
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking build system type... Invalid configuration `–-enable-loadable-sqlite-extensions': machine `–-enable-loadable-sqlite' not recognized
configure: error: /bin/sh ./config.sub –-enable-loadable-sqlite-extensions failed

Then I tried

PYTHON_CONFIGURE_OPTS="--target=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu –-enable-loadable-sqlite-extensions" pyenv install 3.6.11

That built, but the sqlite error still occurred.

jayvdb

comment created time in 21 hours

issue openedpyenv/pyenv

SQLite extension support

SpatiaLite and therefore django gis fails without SQLite extension support

django.core.exceptions.ImproperlyConfigured: SpatiaLite requires SQLite to be configured to allow extension loading.

Python on Linux at least should be built with –enable-loadable-sqlite-extensions on Python 3 and without SQLITE_OMIT_LOAD_EXTENSION on Python 2. It should be enabled on other platforms if the build instructions provide instructions that provide sqlite devel deps which are sufficient to build this.

https://docs.python.org/2.7/library/sqlite3.html#f1

https://docs.python.org/3.7/library/sqlite3.html#f1

created time in a day

pull request commentsinoroc/tox-poetry-dev-dependencies

Use importlib.metadata if present

fwiw, my commit message has an explicit URL, not just a #xx precisely so it solves that problem. A practise enforced by @coala which also has gitlab and github repos. But I am happy to follow whatever convention you wish. Please let me know when the CI is fixed.

The importlib-metadata change is not urgent anyway,

It makes your plugin incompatible with distros which do not provide packages for importlib-metadata and importlib-resources (and dataclasses and other backports), so it is impossible to import them without installing from pip into system packages, never a good idea.

jayvdb

comment created time in a day

issue openeddanhper/asdf-python

Please create tags on GitHub

Versioned releases are needed as a basis for distro packaging.

created time in a day

issue commenttox-dev/tox

ability to define required plugins in tox.ini

Was the ability to blacklist plugins added?

ssbarnea

comment created time in a day

PR opened itziakos/tox-edm

README.rst: Update EDM name
+1 -1

0 comment

1 changed file

pr created time in a day

push eventjayvdb/tox-edm

John Vandenberg

commit sha f7795e054a22e0b75fa00e1321519afc38d178b4

README.rst: Update EDM name

view details

push time in a day

fork jayvdb/tox-edm

A plugin for tox to support edm based environments

fork in a day

pull request commentsinoroc/tox-poetry-dev-dependencies

Use importlib.metadata if present

How about I change the CI so that mypy is only used on py38?

And yes, I can adjust setup.cfg to not install the unnecessary dependency.

jayvdb

comment created time in a day

issue openedsignalpillar/tox-battery

Replace pep8 with pycodestyle

pep8 was deprecated years ago.

created time in a day

push eventjayvdb/tox-poetry-dev-dependencies

John Vandenberg

commit sha 408dc49c23a1cde5e07a0a86e318b46b6caabba6

Use importlib.metadata if present Closes https://github.com/sinoroc/tox-poetry-dev-dependencies/issues/17

view details

push time in a day

issue openedenpaul/tox-poetry-installer

Failure in non-poetry project

  File "/usr/lib/python3.8/site-packages/tox_poetry_installer.py", line 269, in tox_testenv_install_deps
    poetry = PoetryFactory().create_poetry(venv.envconfig.config.toxinidir)
  File "/usr/lib/python3.8/site-packages/poetry/factory.py", line 42, in create_poetry
    raise RuntimeError(
RuntimeError: [tool.poetry] section not found in pyproject.toml

created time in a day

push eventjayvdb/tox-poetry-dev-dependencies

John Vandenberg

commit sha 690b90a396fb939760a2236294e0cdeb8c592089

Use importlib.metadata if present Closes https://github.com/sinoroc/tox-poetry-dev-dependencies/issues/17

view details

push time in a day

issue closedasottile/pip-custom-platform

pip version compatibility

It would be helpful to have setup.cfg narrow down the version range of pip which are supported/tested, and include CI for the earliest supported pip known to work. This is pretty funky hacking and is unavoidably brittle and as you will know pip frequently breaks backwards compatibility intentionally.

When using python 3.7's default venv or virtualenv preinstalled pip, I get the following, which I guess is because pip._internal had not finished being imported:

[  126s] E           subprocess.CalledProcessError: Command '('/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testenv/bin/python', '-m', 'coverage', 'run', '-m', 'pip_custom_platform.main', 'show-platform-name')' returned non-zero exit status 1.
[  126s] 
[  126s] /usr/lib64/python3.7/subprocess.py:347: CalledProcessError
[  126s] ----------------------------- Captured stderr call -----------------------------
[  126s] Traceback (most recent call last):
[  126s]   File "/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/pip_custom_platform/main.py", line 9, in <module>
[  126s]     exit(main())
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 270, in entry
[  126s]     tuple(patches) + ('--', original_entry_point) + tuple(argv)
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 258, in main
[  126s]     return entry.load()()
[  126s]   File "/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testenv/lib64/python3.7/site-packages/pkg_resources/__init__.py", line 2411, in load
[  126s]     return self.resolve()
[  126s]   File "/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testenv/lib64/python3.7/site-packages/pkg_resources/__init__.py", line 2417, in resolve
[  126s]     module = __import__(self.module_name, fromlist=['__name__'], level=0)
[  126s]   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
[  126s]   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 173, in load_module
[  126s]     module = importmod(fullname)
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 94, in importmod
[  126s]     return __import__(mod, fromlist=[str('__name__')], level=0)
[  126s]   File "/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testenv/lib64/python3.7/site-packages/pip/_internal/__init__.py", line 40, in <module>
[  126s]     from pip._internal.cli.autocompletion import autocomplete
[  126s]   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
[  126s]   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 173, in load_module
[  126s]     module = importmod(fullname)
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 94, in importmod
[  126s]     return __import__(mod, fromlist=[str('__name__')], level=0)
[  126s]   File "/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testenv/lib64/python3.7/site-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
[  126s]     from pip._internal.cli.main_parser import create_main_parser
[  126s]   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
[  126s]   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 173, in load_module
[  126s]     module = importmod(fullname)
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 94, in importmod
[  126s]     return __import__(mod, fromlist=[str('__name__')], level=0)
[  126s]   File "/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testenv/lib64/python3.7/site-packages/pip/_internal/cli/main_parser.py", line 12, in <module>
[  126s]     from pip._internal.commands import (
[  126s]   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
[  126s]   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 173, in load_module
[  126s]     module = importmod(fullname)
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 94, in importmod
[  126s]     return __import__(mod, fromlist=[str('__name__')], level=0)
[  126s]   File "/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testenv/lib64/python3.7/site-packages/pip/_internal/commands/__init__.py", line 6, in <module>
[  126s]     from pip._internal.commands.completion import CompletionCommand
[  126s]   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
[  126s]   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 173, in load_module
[  126s]     module = importmod(fullname)
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 94, in importmod
[  126s]     return __import__(mod, fromlist=[str('__name__')], level=0)
[  126s]   File "/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testenv/lib64/python3.7/site-packages/pip/_internal/commands/completion.py", line 6, in <module>
[  126s]     from pip._internal.cli.base_command import Command
[  126s]   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
[  126s]   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 173, in load_module
[  126s]     module = importmod(fullname)
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 94, in importmod
[  126s]     return __import__(mod, fromlist=[str('__name__')], level=0)
[  126s]   File "/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testenv/lib64/python3.7/site-packages/pip/_internal/cli/base_command.py", line 25, in <module>
[  126s]     from pip._internal.index import PackageFinder
[  126s]   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
[  126s]   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 173, in load_module
[  126s]     module = importmod(fullname)
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 94, in importmod
[  126s]     return __import__(mod, fromlist=[str('__name__')], level=0)
[  126s]   File "/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testenv/lib64/python3.7/site-packages/pip/_internal/index.py", line 32, in <module>
[  126s]     from pip._internal.pep425tags import get_supported
[  126s]   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
[  126s]   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
[  126s]   File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
[  126s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 175, in load_module
[  126s]     hook_fn(module, self._entry_data[entry])
[  126s]   File "/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/pip_custom_platform/pymonkey.py", line 17, in pymonkey_patch
[  126s]     mod.supported_tags = mod.get_supported()
[  126s]   File "/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testenv/lib64/python3.7/site-packages/pip/_internal/pep425tags.py", line 340, in get_supported
[  126s]     if is_manylinux2010_compatible():
[  126s]   File "/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testenv/lib64/python3.7/site-packages/pip/_internal/pep425tags.py", line 196, in is_manylinux2010_compatible
[  126s]     return pip._internal.utils.glibc.have_compatible_glibc(2, 12)
[  126s] AttributeError: module 'pip' has no attribute '_internal'

When I use pip 19.3.1

[  110s] _____________________________ test_pymonkey_patch ______________________________
[  110s] 
[  110s] tmpdir = local('/tmp/pytest-of-abuild/pytest-0/test_pymonkey_patch0')
[  110s] 
[  110s]     def test_pymonkey_patch(tmpdir):
[  110s]         findlinks_dir = tmpdir.join('findlinks_dir').strpath
[  110s]         download_dest = tmpdir.join('downloads').mkdir().strpath
[  110s]     
[  110s]         call_coverage(
[  110s]             '-m', 'pymonkey', 'pip-custom-platform', '--', 'uses-pip',
[  110s]             '--platform', 'plat1',
[  110s]             findlinks_dir, download_dest,
[  110s] >           'testing/project_with_c', 'project-with-c',
[  110s]         )
[  110s] 
[  110s] tests/main_test.py:179: 
[  110s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  110s] tests/main_test.py:14: in call_coverage
[  110s]     subprocess.check_call((sys.executable, '-m', 'coverage', 'run') + cmd)
[  110s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  110s] 
[  110s] popenargs = (('/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testenv/bin/python', '-m', 'coverage', 'run', '-m', 'pymonkey', ...),)
[  110s] kwargs = {}, retcode = 1
[  110s] cmd = ('/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testenv/bin/python', '-m', 'coverage', 'run', '-m', 'pymonkey', ...)
[  110s] 
[  110s]     def check_call(*popenargs, **kwargs):
[  110s]         """Run command with arguments.  Wait for command to complete.  If
[  110s]         the exit code was zero then return, otherwise raise
[  110s]         CalledProcessError.  The CalledProcessError object will have the
[  110s]         return code in the returncode attribute.
[  110s]     
[  110s]         The arguments are the same as for the call function.  Example:
[  110s]     
[  110s]         check_call(["ls", "-l"])
[  110s]         """
[  110s]         retcode = call(*popenargs, **kwargs)
[  110s]         if retcode:
[  110s]             cmd = kwargs.get("args")
[  110s]             if cmd is None:
[  110s]                 cmd = popenargs[0]
[  110s] >           raise CalledProcessError(retcode, cmd)
[  110s] E           subprocess.CalledProcessError: Command '('/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testenv/bin/python', '-m', 'coverage', 'run', '-m', 'pymonkey', 'pip-custom-platform', '--', 'uses-pip', '--platform', 'plat1', '/tmp/pytest-of-abuild/pytest-0/test_pymonkey_patch0/findlinks_dir', '/tmp/pytest-of-abuild/pytest-0/test_pymonkey_patch0/downloads', 'testing/project_with_c', 'project-with-c')' returned non-zero exit status 1.
[  110s] 
[  110s] /usr/lib64/python3.7/subprocess.py:347: CalledProcessError
[  110s] ----------------------------- Captured stderr call -----------------------------
[  110s] /usr/lib/python3.7/site-packages/pymonkey.py:6: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
[  110s]   import imp
[  110s] Traceback (most recent call last):
[  110s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 277, in <module>
[  110s]     sys.exit(main())
[  110s]   File "/usr/lib/python3.7/site-packages/pymonkey.py", line 258, in main
[  110s]     return entry.load()()
[  110s]   File "/home/abuild/rpmbuild/BUILD/pip-custom-platform-0.5.0/testing/uses_pip/uses_pip.py", line 12, in main
[  110s]     assert not pip_main(['wheel', pkg, '--wheel-dir', findlinks])
[  110s] TypeError: 'module' object is not callable

I havent investigated that last one at all. fwiw, the reason I am trying to get this working is trying to control pip to fetch the appropriate target needed by an invocation of https://github.com/indygreg/PyOxidizer

closed time in a day

jayvdb

issue commentasottile/pip-custom-platform

pip version compatibility

A lower bound that low isnt worth adding, and agree upper bounds isnt useful, so closing.

Some packages which use pip internals list a pip 'supported version' and include that if there are import errors, but even that isnt sufficient if pip internals are modified in a non-breaking way, esp return types.

It might be worth switching to using pip-shims or pip-api (the author of this one is keen to add more functionality when needed, but can be a bit slow to respond/review), as most distros already maintain packages for those, keeping them up to date.

jayvdb

comment created time in a day

PullRequestReviewEvent

PR opened sinoroc/tox-poetry-dev-dependencies

Use importlib.metadata if present

Closes https://github.com/sinoroc/tox-poetry-dev-dependencies/issues/17

+4 -1

0 comment

1 changed file

pr created time in a day

create barnchjayvdb/tox-poetry-dev-dependencies

branch : importlib-metadata

created branch time in a day

issue openedsinoroc/tox-poetry-dev-dependencies

Use importlib.metadata if it exists

Python 3.8 does not need importlib_metadata - it is part of stdlib as importlib.metadata.

  File "/usr/lib/python3.8/site-packages/tox_poetry_dev_dependencies/__init__.py", line 5, in <module>
    from . import _meta
  File "/usr/lib/python3.8/site-packages/tox_poetry_dev_dependencies/_meta.py", line 5, in <module>
    import importlib_metadata
ModuleNotFoundError: No module named 'importlib_metadata'

created time in a day

issue openedrpkilby/tox-factor

Incompatible with older tox

tox 2.9 (default on openSUSE 15.2)

[   38s] tests/test_test.py:3: in <module>
[   38s]     from tox_factor.test import ToxTestCase
[   38s] ../../BUILDROOT/python-tox-factor-0.1.2-lp152.7.1.x86_64/usr/lib/python3.6/site-packages/tox_factor/test.py:10: in <module>
[   38s]     from tox_factor.compat import TOX_PARALLEL_ENV
[   38s] ../../BUILDROOT/python-tox-factor-0.1.2-lp152.7.1.x86_64/usr/lib/python3.6/site-packages/tox_factor/compat.py:4: in <module>
[   38s]     from tox.config.parallel import ENV_VAR_KEY as TOX_PARALLEL_ENV
[   38s] E   ModuleNotFoundError: No module named 'tox.config.parallel'; 'tox.config' is not a package

It doesnt bother me (I use Tumbleweed), but declaring a minimum version of tox would be a good idea.

created time in a day

startedrpkilby/tox-factor

started time in a day

startedBernardo-MG/tox-test-command

started time in a day

PR opened apihackers/tox-asdf

README.md: Fix spelling
+1 -1

0 comment

1 changed file

pr created time in a day

push eventjayvdb/tox-asdf

John Vandenberg

commit sha f30f93f8081453b808aaa66a1d967f6b5dd74161

README.md: Fix spelling

view details

push time in a day

fork jayvdb/tox-asdf

A Tox plugin using asdf to find python executables.

fork in a day

issue commentjyveapp/django-action-framework

Smoke test failure: ValueError: invalid literal for int() with base 10: '<path:pk>'

I also get this when using schemathesis with the DAF DRF actions.

jayvdb

comment created time in a day

issue commentjyveapp/django-action-framework

rest framework actions do not provide sane schema

also the url is

object/<pk>/action-name/

when it would be better to be

object/<int:pk>/action-name/

jayvdb

comment created time in 2 days

pull request commentgoogle/sre_yield

Avoid unnecessary instantiations

Rebased and repr tests updated to illustrate the internal structural simplification and its ramifications.

jayvdb

comment created time in 2 days

push eventjayvdb/sre_yield

John Vandenberg

commit sha ab740ecd585aed2de89cc425ba4494cd427af2fc

Update repr tests

view details

push time in 2 days

push eventjayvdb/sre_yield

John Vandenberg

commit sha e25d2892663b483333b735d956313ae9c0656f19

test_slicing: Move instantiation into test methods

view details

Tim Hatch

commit sha aec585275baf64ab249be2eccd18e1efcba869bf

Merge pull request #31 from jayvdb/move-test-instantiation test_slicing: Move instantiation into test methods

view details

John Vandenberg

commit sha 56e65dfe5a61c6d71ac56940905d84a936a4be96

Add repr test module

view details

Tim Hatch

commit sha 3af063a0054c4646608b43b941fbfcbe4e01214a

Merge pull request #32 from jayvdb/test-repr Add repr test module

view details

John Vandenberg

commit sha 695e71df447de71142ce2123b8751af19f9c1297

Avoid unnecessary instantiations 0, 1, many principle for avoiding unnecessary instantiation of ConcatenatedSequence and CombinatoricsSequence which only act as placeholders. This improves the benchmark results, and the overhead of additional branches early performs well under typical workloads.

view details

John Vandenberg

commit sha d8b806645fe19e75126abf246cc915c94f7c9796

Update repr tests

view details

push time in 2 days

pull request commentchristophercrouzet/gorilla

Implement a New Public Function to Revert a Patch

I did a local-only rebuild of https://github.com/streeter/django-db-readonly/pull/22/files using gorilla with this PR, and it worked perfectly.

christophercrouzet

comment created time in 2 days

issue openedjyveapp/django-action-framework

InstallDAFActions.__new__ doesnt allow subclasses

If ActionMixin is used to define a class, and that class is subclassed, it fails to find the methods.

This causes problems for drf-spectacular OpenAPI generator, as it creates subclasses dynamically, and they fail with

  File "daf/rest_framework.py", line 25, in __new__
    assert not hasattr(cls, method_name)
AssertionError

e.g.

class DRFAction1(DetailAction):
    action = FooBar
    form_class = forms.Form


class DAFViewSet(ActionMixin, viewsets.ModelViewSet):
    ...

    daf_actions = [
        ...
    ]


class DAFViewSetSubclass(DAFViewSet):
    pass

created time in 2 days

issue commentjyveapp/django-action-framework

rest framework actions do not provide sane schema

It looks like as_interface is using @action. I'm not sure why I am seeing a list type schema for the actions (I'll dig into that), but adding the schema= arg will make the OpenAPI much more accurate.

jayvdb

comment created time in 2 days

issue openedjyveapp/django-action-framework

rest framework actions do not provide sane schema

Extra object actions should use either

@action(detail=True, schema=None) to declare they are ID based rather than list based, which changes the schema accordingly, but will only partially fix the schema.

or

@action(detail=True, schema=...) allows accurately describing the parameters, which seems highly desirable/expected behaviour for this library.

created time in 2 days

issue commentjyveapp/django-action-framework

Unhelpful error due to unexpected exception being caught

It looks like this is the same type of problem as https://github.com/jyveapp/django-action-framework/issues/6

jayvdb

comment created time in 2 days

pull request commentchristophercrouzet/gorilla

Implement a New Public Function to Revert a Patch

ok, I'll give it spin shortly and report back

christophercrouzet

comment created time in 2 days

issue commentamarlearning/github-sectory

Tests

Sorry, I have a full plate. I'd like to use this as a package, as a dependency in my own library. Until you restructure it to be a package, this is not useful for me.

And I dont want to restructure it - the blame/ownership of the new lines in the new files should be the primary author, not me.

jayvdb

comment created time in 2 days

issue openedHipo/django-admin-favorite-filters

Admin new

Django admin 'new' functionality has not been disabled, but it does not work because "Additional Information" is not modifiable.

Allowing creation of new items is likely to be painful to build, as it needs to support any query filter string, and not often people would use it. So I think it is best to disable add.

created time in 2 days

startedHipo/django-admin-favorite-filters

started time in 2 days

startedkux/django-admin-extend

started time in 3 days

issue commenttolomea/django-data-browser

Compatibility with qsessions

Sounds looks an appropriate approach. Thanks for fixing.

jayvdb

comment created time in 3 days

issue openeddjango-admin-tools/django-admin-tools

Menu: Detect most important model per app

For menus of apps with multiple models, usually one is the most important, and the others are related and less frequently used.

One basic strategy would be to detect where app and model names are identical. e.g. order.Order.

It would be nice if that model is first in the sub-menu for that app.

created time in 3 days

issue openeddjango-admin-tools/django-admin-tools

Menu: Collapse sub-menus of apps with only one model

Many apps have only one model. Pushing their modeladmin into a sub-menu that has only a single item adds extra work required to access them.

created time in 3 days

starteddjango-admin-tools/django-admin-tools

started time in 3 days

issue commentamirasaran/django-restful-admin

RestFulModelAdmin incompatibility with from django.contrib.admin.ModelAdmin

On mixin vs subclass, that is irrelevant. Re-read my issue. If django-restful-admin is going to use ModelAdmin features, it needs to be able to be part of the MRO of a ModelAdmin subclass. A mixin is just a lazy and monkey-ier way of doing that, avoiding the brittle nature of subclassing. But in this case "brittle" is another way of describing type-safety.

jayvdb

comment created time in 3 days

PR opened rendrom/geonote

README: Note where dynamit is based
+2 -0

0 comment

1 changed file

pr created time in 3 days

push eventjayvdb/geonote

John Vandenberg

commit sha a1a467bb456d6d1d5d1d6e6e40d343d1a385b92e

README: Note where dynamit is based

view details

push time in 3 days

fork jayvdb/geonote

Web-based application for storage geodata

http://geonote.ru/

fork in 3 days

issue commentz4r/django-dynamite

Changing Entity slug name fucks up everything

Does https://github.com/brentrojas/django-dynamite/commit/1206c71bedf8459893e5388fcc8464720a2f035a fix it?

guandalf

comment created time in 3 days

Pull request review commentgoogle/sre_yield

Indexing tests and fixes

 def testOtherCases(self):         )         self.assertEqual(len(sre_yield.AllStrings("..", charset="0123456789")), 100)         self.assertEqual(len(sre_yield.AllStrings("0*")), 65536)+        self.assertEqual(sre_yield.AllStrings("[01]*").__len__(), 2 ** 65536 - 1)++    def testOverflowError(self):         # For really big lists, we can't use the len() function any more-        with self.assertRaises(OverflowError):+        with self.assertRaises(OverflowError) as cm:

As the message strings are long, the single line syntax doesnt fit in a single line - and can look quite messy in a with.

Also the messages often change over time, while the Exception subclass and trigger logic usually does not.

jayvdb

comment created time in 3 days

PullRequestReviewEvent

push eventjayvdb/django-admin-favorite-filters

John Vandenberg

commit sha ccccbbd1997127218790fc69cf920f6d0ccc9e24

setup.py: Add url

view details

push time in 4 days

fork jayvdb/django-admin-favorite-filters

A small Django package that enables users save their favorite filters on Django Admin.

fork in 4 days

issue openedtolomea/django-data-browser

Split build.sh

Do you mind splitting build.sh , so the frontend build can be run by someone like me, without invoking publish-like functionality which isnt appropriate for me.

created time in 4 days

issue openedtolomea/django-data-browser

Compatibility with qsessions

Recent versions of https://github.com/QueraTeam/django-qsessions causes a failure.

It seems a common class of possible problems.

https://github.com/QueraTeam/django-qsessions/commit/120ba23f4b995e3234170c7df28c99c296e59b1d

It would be great if orm_admin.py get_models skipped models it can not load.

Traceback (most recent call last):
  File "/home/python3.8/lib/python3.8/site-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__
    return self.application(environ, start_response)
  File "/home/python3.8/lib/python3.8/site-packages/django/core/handlers/wsgi.py", line 133, in __call__
    response = self.get_response(request)
  File "/home/python3.8/lib/python3.8/site-packages/django/core/handlers/base.py", line 75, in get_response
    response = self._middleware_chain(request)
  File "/home/python3.8/lib/python3.8/site-packages/django/core/handlers/exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "/home/python3.8/lib/python3.8/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "/home/python3.8/lib/python3.8/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "/home/python3.8/lib/python3.8/site-packages/django_extensions/management/technical_response.py", line 37, in null_technical_500_response
    six.reraise(exc_type, exc_value, tb)
  File "/home/python3.8/lib/python3.8/site-packages/six.py", line 702, in reraise
    raise value.with_traceback(tb)
  File "/home/python3.8/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/home/python3.8/lib/python3.8/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/python3.8/lib/python3.8/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/python3.8/lib/python3.8/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/python3.8/lib/python3.8/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/home/python3.8/lib/python3.8/site-packages/data_browser/views.py", line 116, in query_html
    config = _get_config(request)
  File "/home/python3.8/lib/python3.8/site-packages/data_browser/views.py", line 77, in _get_config
    orm_models = get_models(request)
  File "/home/python3.8/lib/python3.8/site-packages/data_browser/orm_admin.py", line 323, in get_models
    _get_fields_for_model(request, model, model_admins[model], admin_fields)
  File "/home/python3.8/lib/python3.8/site-packages/data_browser/orm_admin.py", line 289, in _get_fields_for_model
    orm_field = _get_calculated_field(
  File "/home/python3.8/lib/python3.8/site-packages/data_browser/orm_admin.py", line 165, in _get_calculated_field
    field_func = getattr(admin, field_name, None)
TypeError: getattr(): attribute name must be string

created time in 4 days

startedQueraTeam/django-qsessions

started time in 4 days

startedmodlinltd/django-advanced-filters

started time in 4 days

issue closedzencore-cn/zencore-issues

django-tabbed-changeform-admin v0.1.3 vs django-static-jquery3 v5.0.0

django-tabbed-changeform-admin v0.1.3 refers to jquery3/jquery.js

django-static-jquery3 v5.0.0 moved jquery3/jquery.js to jquery/jquery.js , breaking django-tabbed-changeform-admin

closed time in 4 days

jayvdb

push eventjayvdb/sre_yield

John Vandenberg

commit sha 0b126e43eada56e86108795bc0342e69b03f6466

Custom sampler

view details

push time in 4 days

PR opened google/sre_yield

POC: Custom repetitions

This is an idea for allowing custom thinning of repeats. It currently replaces \w\w and similar with three preset values, but the implementation could be a generated set, and could be generically reducing the complete set defined by the regex to be a subset (i.e. sampling/lossy compression).

Only the test depends on https://github.com/jayvdb/sre-tools . I am happy to directly contribute a copy of the relevant code here if there is a desire to incorporate this type of functionality. Personally I am happy to call the simplification algorithm before invoking sre_yield, so I am not pushing for inclusion of that feature. However there are a lot of optimisations that can be done by only merging adjacent identical nodes whilst doing the expansion, because sre_yield is already creating its own internal tree.

+53 -1

0 comment

3 changed files

pr created time in 4 days

create barnchjayvdb/sre_yield

branch : example-sampler

created branch time in 4 days

PR opened Bogdanp/cursive_re

setup.py: Add url
+1 -0

0 comment

1 changed file

pr created time in 4 days

push eventjayvdb/cursive_re

John Vandenberg

commit sha 01ec012d256f8499f0bdbb3e767d1c5b3d6582c0

setup.py: Add url

view details

push time in 4 days

fork jayvdb/cursive_re

Readable regular expressions for Python 3.6 and up.

fork in 4 days

push eventjayvdb/sre_yield

John Vandenberg

commit sha 68ad6ae702ef60cc4f576b88a0d8aeda76d2c254

Move by==1 check into divmod_iter The same check is needed in when descending into divmod_iter_basic. Fixes https://github.com/google/sre_yield/issues/37

view details

John Vandenberg

commit sha 14d495560d576cb87af780a947e91ea01f5df845

Add slicing tests

view details

John Vandenberg

commit sha d7a427f8267324e894ef943e1da5d9c0a9f51796

Exception message tests

view details

John Vandenberg

commit sha afee0f8caf7bc307ef0659c2aa4c4dd8a1e8b947

Improve exception for slice step 0 Raises ValueError instead of ZeroDivisionError. Closes https://github.com/google/sre_yield/issues/34

view details

John Vandenberg

commit sha 1bef76e5e192ba7eb1e9e659d3f245945460cd89

Prevent IndexError with slices Fixes https://github.com/google/sre_yield/issues/35

view details

John Vandenberg

commit sha f56846aa926d165a4ac62a0b62c6f7ae655c6930

Fix reverse step bugs Fixes https://github.com/google/sre_yield/issues/36

view details

John Vandenberg

commit sha 63c9935e54f7b1036b241ae76b09301bea07d8ae

Use common message for IndexError Fixes https://github.com/google/sre_yield/issues/37

view details

push time in 5 days

PR opened google/sre_yield

Indexing tests and fixes
+150 -37

0 comment

4 changed files

pr created time in 5 days

create barnchjayvdb/sre_yield

branch : indexing-errors

created branch time in 5 days

issue openedgoogle/sre_yield

IndexError not raised causing infinite loop

sre_yield.AllStrings("x?").get_item(2) doesnt raise IndexError and ends up lost.

It goes into divmod_iter(1, 1) -> divmod_iter_basic(1, 1) and never gets out.

created time in 5 days

issue openedgoogle/sre_yield

Reverse slices can produce empty sets

>>> "12345678"[99:-99:-1]
'87654321'
>>> AllStrings("[abcdef]")[99:-99:-1]
[]

created time in 5 days

issue openedgoogle/sre_yield

Slices should not raise IndexError

It is a nice oddity of slices that they never raise an IndexError. I've found two uses of slices which cause them.

>>> [0, 1, 2, 3][slice(99,-99)]
[]
>>> AllStrings("[abcdef]")[slice(99,-99)]
Traceback (most recent call last):
  File "sre_yield/__init__.py", line 137, in __getitem__
    result = SlicedSequence(self, slicer=i)
  File "sre_yield/__init__.py", line 167, in __init__
    self.start, self.stop, self.step = slice_indices(slicer, raw.__len__())
  File "sre_yield/__init__.py", line 97, in slice_indices
    stop = _adjust_index(stop, size)
  File "sre_yield/__init__.py", line 107, in _adjust_index
    raise IndexError("Out of range")
IndexError: Out of range
>>> "abcdef"[99::-1]
'fedcba'
>>> AllStrings("[abcdef]")[99::-1]
Traceback (most recent call last):
  File "sre_yield/__init__.py", line 140, in __getitem__
    result = [item for item in result]
  File "sre_yield/__init__.py", line 140, in <listcomp>
    result = [item for item in result]
  File "sre_yield/__init__.py", line 148, in __iter__
    yield self.get_item(i)
  File "sre_yield/__init__.py", line 176, in get_item
    return self.raw[j]
  File "sre_yield/__init__.py", line 144, in __getitem__
    return self.get_item(i)
  File "re_yield/__init__.py", line 405, in get_item
    return super().get_item(i)
  File "sre_yield/__init__.py", line 126, in get_item
    return self.raw.get_item(i, d)
  File "sre_yield/__init__.py", line 217, in get_item
    raise IndexError("Index %d out of bounds" % (i,))
IndexError: Index 6 out of bounds

created time in 5 days

issue openedgoogle/sre_yield

Slice step 0 causes ZeroDivisionError

>>> slice(0,1,0)
slice(0, 1, 0)
>>> [0, 1, 2, 3][slice(0,1,0)]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: slice step cannot be zero
>>> AllStrings("[abcdef]")[0:1:0]
Traceback (most recent call last):
  File "sre_yield/__init__.py", line 137, in __getitem__
    result = SlicedSequence(self, slicer=i)
  File "sre_yield/__init__.py", line 170, in __init__
    self.length = (
ZeroDivisionError: integer division or modulo by zero

created time in 5 days

push eventjayvdb/sre_yield

John Vandenberg

commit sha 547a213a151f274c98a453a4821a1e725b5594ab

Add tests for unsupported sequence operations

view details

John Vandenberg

commit sha 04c1681b98338bb49410013a5aa0f2e84268c008

Move by==1 check up to divmod_iter The same check is needed in when descending into divmod_iter_basic.

view details

John Vandenberg

commit sha f8772ee69728b3fe0ef58e90d1d59b654cb8154a

Use common func for IndexError

view details

push time in 5 days

create barnchjayvdb/sre_yield

branch : index-error

created branch time in 5 days

issue openedgoogle/sre_yield

repr is slow

https://github.com/google/sre_yield/pull/32 test case testBenchInputSlow shows repr can be very slow.

It looks like repeat sequence objects are the cause, but https://github.com/google/sre_yield/pull/30 fixes it for the PR 32 test cases (only), so my gut feeling is a wrapper concat/combin object which uses repr(self.list_lengths) which hits list.__repr__ and that is causing a full expansion to occur. I am pretty confident that PR doesnt really solve it - it only solves the most basic cases.

created time in 5 days

startedgoogle/sre_yield

started time in 5 days

pull request commentgoogle/sre_yield

Avoid unnecessary instantiations

If you like, I can rebase this PR on top of https://github.com/google/sre_yield/pull/32 to show the changes to the internal structures to the baseline.

jayvdb

comment created time in 5 days

PR opened google/sre_yield

Add repr test module
+154 -0

0 comment

1 changed file

pr created time in 5 days

create barnchjayvdb/sre_yield

branch : test-repr

created branch time in 5 days

push eventjayvdb/sre_yield

John Vandenberg

commit sha ae8937432f172a7e5c45c98855aec2f3d8cc5361

Final

view details

push time in 5 days

push eventjayvdb/sre_yield

John Vandenberg

commit sha e88fbc4f286e12a2c5b865efe748ff105eebe766

Wierd

view details

push time in 5 days

push eventjayvdb/sre_yield

John Vandenberg

commit sha 90ea319d7a45be0aef8d3c2cefce849df4b65cba

debug

view details

push time in 5 days

push eventjayvdb/sre_yield

John Vandenberg

commit sha 3a43b99c9a7661ce57e4a6abe1c33ea7da2a5b10

Python 3.6 v3

view details

push time in 5 days

push eventjayvdb/sre_yield

John Vandenberg

commit sha 4e7bd044261d89b607e0e324370274b79ffac871

Python 3.6 v2

view details

push time in 5 days

push eventjayvdb/sre_yield

John Vandenberg

commit sha c38d862faa86cd7e33e7fdf77a45cef6a3206f74

Python 3.6

view details

push time in 5 days

push eventjayvdb/sre_yield

John Vandenberg

commit sha c3aed325b27934ead6e5f258e298b3f597377189

Add repr test module

view details

push time in 5 days

create barnchjayvdb/sre_yield

branch : show-internal-tree

created branch time in 5 days

issue openedjayvdb/sre-tools

Convert SubPattern back to string

After modification of the SubPattern, it is helpful to be able to get a representation as a string regex, either to use as a replacement of the original and feed back into sre_parse.parse, or to use in tests to show the transform that occurred in a more readable manner than a parse tree.

created time in 5 days

issue commentamirasaran/django-restful-admin

RestFulModelAdmin incompatibility with from django.contrib.admin.ModelAdmin

If you can get a test suite started (c.f. https://github.com/amirasaran/django-restful-admin/issues/11), I'll make RestFulModelAdmin a normal django.contrib.admin.ModelAdmin subclass, and then you can integrate features from django.contrib.admin.ModelAdmin.

jayvdb

comment created time in 5 days

issue openedamirasaran/django-restful-admin

Tests

The current functionality needs tests coverage.

created time in 5 days

PR opened amirasaran/django-restful-admin

MANIFEST.in: Create

Closes https://github.com/amirasaran/django-restful-admin/issues/7

+2 -0

0 comment

1 changed file

pr created time in 5 days

create barnchjayvdb/django-restful-admin

branch : sdist

created branch time in 5 days

release jayvdb/sre-tools

0.0.1

released time in 6 days

created tagjayvdb/sre-tools

tag0.0.1

created time in 6 days

more