profile
viewpoint

Bttstrp/bootstrap-switch 5102

Turn checkboxes and radio buttons in toggle switches.

6si/shipwright 111

Shipwright | The right way to build, tag and ship Docker containers.

binarydud/redshift_sqlalchemy 51

Amazon Redshift SQLAlchemy Dialect

denji/cpulimit 10

CPU usage limiter for Linux, Solaris, *BSD, macOS

bcoe/imaplib2 9

Fork of Piers Lauder's imaplib2 library for Python.

chrissorchard/malucrawl 5

GDP 23: Trending Terms Malware Crawler

danpalmer/mondo-bills 2

A service to monitor subscriptions and bills coming out of your Mondo account automatically.

issue commentboto/botocore

Support asyncio

You can support anyio and python 2 with one codebase using https://pypi.org/project/unasync/

jamesls

comment created time in 2 days

issue commentpython-pillow/Pillow

CVE for <7.1.0 references non-existent 6.2.3 release

To be fair, those notes don't imply that 6.x will not continue to get security fixes

Pillow 6.x the last series to support Python 2.

untitaker

comment created time in 2 days

issue commentpython-pillow/Pillow

CVE for <7.1.0 references non-existent 6.2.3 release

@radarhere I've got no argument, I was just wanted to see the discussion for my information

untitaker

comment created time in 2 days

issue commentpython-pillow/Pillow

CVE for <7.1.0 references non-existent 6.2.3 release

There was discussion about adding security patches to the 6.2.x series,

@radarhere is there a public link to that discussion?

untitaker

comment created time in 2 days

issue commentThe-Compiler/pytest-mccabe

Fix PytestDeprecationWarning

@impredicative you can run also McCabe in pytest with https://pypi.org/project/pytest-flake8/

impredicative

comment created time in 3 days

issue commentpypa/setuptools

Deprecate test command

PyPA is working hard to create decoupled tools that can specialize in a domain and do that thing well under possibly independent maintenance and enable competing tools to fill the same need perhaps in a more specialized way.

The good things about python at one point were that it was batteries-included, that "There should be one-- and preferably only one --obvious way to do it." and "Simple is better than complex.". Specialized micromanagement tools with competing implementations is the opposite of these philosophies. They make it impossible to know what the current best practice is for python packaging is.

Here's some of the fears, uncertainties and doubts anyone I've introduced to python packaging has come across eventually:

* Do I make requirements-test.txt, requirements.txt and requirements-dev.txt or do I use `test_requires`, `install_requires`, `build_requires`, or do I use setup.py's extras?

* is setup.py getting deprecated? Should we be throwing it out already? Marking our setup.py's with deprecation warnings?

* virtualenv vs conda?

* pip-run vs pipenv vs virtualenv vs virtualenvwrapper?

* scripts vs entry_points?

https://packaging.python.org has a mixture of old and new information on these subjects, and little clear guidance on what we're supposed to be using now or how it's all supposed to fit together. setup.py was nice -- a single, declarative place for all the important bits about making a package -- now there are 5 files you need -- 6 if you use type annotations -- just to write metadata about a package.

I appreciate that you took the time to explain the flaws in the old ways and some of your best practices, and I appreciate your decade (decades, counting everyone's time in PyPA) of work on corralling the python packaging issue; I know it's too late now but I wish the old system could have been refined into a golden standard instead of being balkanized into a long period of limbo and uncertainty.

I think discuss.python.org may be a better location for this discussion

https://discuss.python.org/t/proposal-for-tests-entry-point-in-pyproject-toml/2077/9

pganssle

comment created time in 3 days

issue commentpytest-dev/pytest-randomly

crashes with numpy and --randomly-seed=7106521602475165645

def _to_bytes(x):
    return x.to_bytes(x.bit_length(), "big")

def _from_bytes(x):
    return int.from_bytes(x, "big")

def _sha512(x):
    return hashlib.sha512(x).digest()

def _truncate_seed(seed):
    seed = abs(seed)
    return (
        seed
        if seed <= 2 ** 32 - 1
        else _from_bytes(_sha512(_to_bytes(seed))[:32//8])
    )
graingert

comment created time in 6 days

pull request commentpytest-dev/pytest

Create empty_file.py

related to this? https://github.com/MKSeymour/pytest/pull/1

MKSeymour

comment created time in 7 days

pull request commentmsoulier/tftpy

replace deprecated log.warn( with log.warning(

@msoulier ^

graingert

comment created time in 7 days

pull request commentpytest-dev/pytest-randomly

default seed to random.Random().getrandbits(32)

@adamchainz https://github.com/pytest-dev/pytest-randomly/issues/269

graingert

comment created time in 8 days

issue openedpaullouisageneau/libdatachannel

WebTransport

There's a new WebRTC adjacent protocol in the works: https://tools.ietf.org/id/draft-vvv-webtransport-http3-02.html

WebTransport is a protocol framework that enables clients constrained by the Web security model to communicate with a remote server using a secure multiplexed transport. This document describes Http3Transport, a WebTransport protocol that is based on HTTP/3 [HTTP3] and provides support for unidirectional streams, bidirectional streams and datagrams, all multiplexed within the same HTTP/3 connection.

@paullouisageneau is this something within the remit of libdatachannel?

created time in 8 days

issue commentpytest-dev/pytest-randomly

crashes with numpy and --randomly-seed=7106521602475165645

also this is legacy seeding ? https://numpy.org/doc/1.19/reference/random/bit_generators/index.html#seeding-and-entropy https://numpy.org/doc/1.19/reference/random/generated/numpy.random.RandomState.seed.html#numpy.random.RandomState.seed

not sure what the modern seeding looks like

graingert

comment created time in 8 days

issue openedpytest-dev/pytest-randomly

crashes with numpy and --randomly-seed=7106521602475165645

 INTERNALERROR>   File "/home/runner/work/pytest-randomly/pytest-randomly/.tox/py36/lib/python3.6/site-packages/pytest_randomly.py", line 144, in _reseed
INTERNALERROR>     np_random.seed(seed)
INTERNALERROR>   File "mtrand.pyx", line 243, in numpy.random.mtrand.RandomState.seed
INTERNALERROR>   File "_mt19937.pyx", line 166, in numpy.random._mt19937.MT19937._legacy_seeding
INTERNALERROR>   File "_mt19937.pyx", line 180, in numpy.random._mt19937.MT19937._legacy_seeding
INTERNALERROR> ValueError: Seed must be between 0 and 2**32 - 1

looks like some sort of seed truncation is needed:

def _numpy_seed(seed):
    return seed if 0 <= seed <= 2**32-1 else random.Random(seed).getrandbits(32)

created time in 8 days

pull request commentpytest-dev/pytest-randomly

default seed to random.Random().getrandbits(32)

 INTERNALERROR>   File "/home/runner/work/pytest-randomly/pytest-randomly/.tox/py36/lib/python3.6/site-packages/pytest_randomly.py", line 144, in _reseed
INTERNALERROR>     np_random.seed(seed)
INTERNALERROR>   File "mtrand.pyx", line 243, in numpy.random.mtrand.RandomState.seed
INTERNALERROR>   File "_mt19937.pyx", line 166, in numpy.random._mt19937.MT19937._legacy_seeding
INTERNALERROR>   File "_mt19937.pyx", line 180, in numpy.random._mt19937.MT19937._legacy_seeding
INTERNALERROR> ValueError: Seed must be between 0 and 2**32 - 1
graingert

comment created time in 8 days

pull request commentpytest-dev/pytest-randomly

default seed to random.Random().getrandbits(32)

ah no it's not, just specific to numpy's random seed

graingert

comment created time in 8 days

pull request commentpytest-dev/pytest-randomly

default seed to random.Random().getrandbits(32)

It's too big for python 3.6

graingert

comment created time in 8 days

push eventgraingert/pytest-randomly

Thomas Grainger

commit sha b87ea8ba90c38deb288d22a639ce1feae9e84089

random seed should be less than 2**32-1

view details

push time in 8 days

Pull request review commentpytest-dev/pytest-randomly

default seed to random.Random().getrandbits(64)

 def pytest_addoption(parser):         type=seed_type,         help="""Set the seed that pytest-randomly uses (int), or pass the                 special value 'last' to reuse the seed from the previous run.-                Default behaviour: use int(time.time()), so the seed is+                Default behaviour: use random.Random().getrandbits(64), so the seed is
                Default behaviour: use random.Random().getrandbits(32), so the seed is
graingert

comment created time in 8 days

Pull request review commentpytest-dev/pytest-randomly

default seed to random.Random().getrandbits(64)

     have_numpy = False  -default_seed = int(time.time())+default_seed = random.Random().getrandbits(64)
default_seed = random.Random().getrandbits(32)
graingert

comment created time in 8 days

pull request commentpytest-dev/pytest-randomly

default seed to random.Random().getrandbits(64)

when investigating a failure with pytest-randomly==1.2.3 and pytest-xdist==1.31 I was seeing some cases where every worker selected the same seed (because all processes started so quickly)

I don't know if this new default provides any other actual real world benefit, but it feels "more correct"

graingert

comment created time in 8 days

push eventgraingert/pytest-randomly

Thomas Grainger

commit sha e60fd8051073fce8ef38c14fb810bfdce299ed52

default seed to random.Random().getrandbits(64) Fixed #267

view details

push time in 8 days

fork graingert/pytest-randomly

:game_die: Pytest plugin to randomly order tests and control random.seed

fork in 8 days

issue openedpytest-dev/pytest-randomly

seed based on best avialable random source (os.urandom or time.time() + pid + time.monotonic())

cpython defaults to using (os.urandom or time.time() + pid + time.monotonic()) for a random.seed: https://github.com/python/cpython/blob/d0981e61a5869c48e0a70a512967558391272a93/Modules/_randommodule.c#L233-L262

these functions aren't actually available to python code, but random.Random().getrandbits(64) seems to be the next best thing.

created time in 8 days

push eventgraingert/pytest

Ronny Pfannschmidt

commit sha c99c7d0f95170a5e308ed6c37e63b2d90794a4f9

deprecate direct node construction and introduce Node.from_parent

view details

Ronny Pfannschmidt

commit sha 15ffe6320498f37a57dd23a45866e5903d61f56c

update doc examples **untested**

view details

Bruno Oliveira

commit sha a3c8246b6053de15d9b95bfa7a425d59054c2693

Node from parent (#5975) Node from parent

view details

Felix Yan

commit sha b7bc52f770dd3352cfaf54ed5ec82df382013e2d

Correct a typo in _pytest/config/__init__.py

view details

Claudio Madotto

commit sha f9f092a5e6dc27d28b220fde75b348f086ef85c0

Fix for issue #5430 - junit-xml: logs are not passed to junit report for tests failed not in a teardown phase

view details

Claudio Madotto

commit sha d940d0b6570535a4e39fed31166fef67ed8769af

Create changelog file and update AUTHORS

view details

Claudio Madotto

commit sha 2d24c062b6c1beb914399174c1fd9190f6093371

Avoid duplicating system-out and system-error tags

view details

Florian Bruhin

commit sha ed67312bca2b8b51c6b309df1201be0f89bbb6ae

Merge pull request #6268 from felixonmars/patch-2 Correct a typo in _pytest/config/__init__.py

view details

Daniel Hahler

commit sha d7d5cf4136d8345187aa20442047da9f05401d53

Merge pull request #6215 from blueyed/cleanup-exc _idval: remove trailing newline from exception

view details

Daniel Hahler

commit sha 57f3dc19b9a26748f9238a0f9af8022c1cfcc106

tox: docs: --keep-going and posargs `--keep-going` makes sense with `-W` to see all warnings/errors. `{posargs:}` is useful for passing in custom args.

view details

Daniel Hahler

commit sha b9dd0e621004f8849f6487316b6ff85f9691d251

docs: add missing `log_cli` confval

view details

Daniel Hahler

commit sha bc7282576f0490a67795b1844ed8e6c6ab497223

typing: minor improvements

view details

Daniel Hahler

commit sha b7d908f4a5a8d27ab7cb84b2eb430830c641f7df

Merge pull request #6269 from blueyed/docs tox: docs: --keep-going and posargs

view details

Daniel Hahler

commit sha a8230d77f45984e80c4b528cd6f1909128816ed5

Merge pull request #6270 from blueyed/docs-log_cli docs: add missing `log_cli` confval

view details

Daniel Hahler

commit sha 47ae1fb36b287b68bd0f3f46955af97df523ccea

Merge pull request #6271 from blueyed/typing typing: minor improvements

view details

Anthony Sottile

commit sha 9d900930dbf52fc79ac9414c1f6d9ec485f55e18

Merge pull request #6242 from nicoddemus/testdir-changelog Add link to testdir fixture in CHANGELOG entry

view details

zupermanzupereroe

commit sha 69ad2026f606b2b9d6ea018aa37b10a8c7bf379c

Merge pull request #1 from pytest-dev/master Update repository

view details

Claudio Madotto

commit sha b66dc800081bff90b82b6e3649da5838c7531089

Fix for issue #5430 - junit-xml: logs are not passed to junit report for tests failed not in a teardown phase

view details

Claudio Madotto

commit sha 91b3ff1bb73afdbc5dfcda1f15fb241027e4d0e7

Create changelog file and update AUTHORS

view details

Claudio Madotto

commit sha 31d5cedc6d087d7f5932e8f53e968c15d72fa463

Avoid duplicating system-out and system-error tags

view details

push time in 8 days

issue openedm-burst/flake8-pytest-style

When I have addfinalizer in test, no violation happens

Bug report

disallow addfinalizer in factories as fixtures pattern:

What's wrong

I have

# "Factories as fixtures" pattern
@pytest.fixture()
def my_factory(request):
    def create_resource(arg):
        resource = acquire_resource(arg)
        request.addfinalizer(resource.release)
        return resource
    return create_resource

How it should work

it should report the addfinalizer call in favour of yield fixtures:

# "Factories as fixtures" pattern
@pytest.fixture()
def my_factory(request):
    with contextlib.ExitStack() as stack:
        def create_resource(arg):
            resource = acquire_resource(arg)
            stack.callback(resource.release)
            return resource
        yield create_resource

System information

  • Operating system: NA
  • Python version: NA
  • flake8 version: NA
  • flake8-pytest-style version: NA

created time in 9 days

GollumEvent

Pull request review commentpytest-dev/pytest

Rephrase entry-point to avoid conveying setuptools must be used.

 it in your setuptools-invocation:         classifiers=["Framework :: Pytest"],     ) +Or via tool specific mechanism when using other packaging framework like `poetry+<https://python-poetry.org/docs/pyproject/#plugins>`_ or `flit+<https://flit.readthedocs.io/en/stable/entrypoints.html#specifying-entry-points>`_.

Is there a list of other PyPA interoperability specifications? Or is it really just defacto pip implementation defined?

Carreau

comment created time in 13 days

Pull request review commentpytest-dev/pytest

Rephrase entry-point to avoid conveying setuptools must be used.

 it in your setuptools-invocation:         classifiers=["Framework :: Pytest"],     ) +Or via tool specific mechanism when using other packaging framework like `poetry+<https://python-poetry.org/docs/pyproject/#plugins>`_ or `flit+<https://flit.readthedocs.io/en/stable/entrypoints.html#specifying-entry-points>`_.

The entry point file format was originally developed to allow packages built with setuptools to provide integration point metadata that would be read at runtime with pkg_resources. It is now defined as a PyPA interoperability specification in order to allow build tools other than setuptools to publish pkg_resources compatible entry point metadata, and runtime libraries other than pkg_resources to portably read published entry point metadata (potentially with different caching and conflict resolution strategies).

Carreau

comment created time in 13 days

Pull request review commentpytest-dev/pytest

Rephrase entry-point to avoid conveying setuptools must be used.

 it in your setuptools-invocation:         classifiers=["Framework :: Pytest"],     ) +Or via tool specific mechanism when using other packaging framework like `poetry+<https://python-poetry.org/docs/pyproject/#plugins>`_ or `flit+<https://flit.readthedocs.io/en/stable/entrypoints.html#specifying-entry-points>`_.

Seems they're defined here now: https://packaging.python.org/specifications/entry-points/

Carreau

comment created time in 13 days

Pull request review commentpytest-dev/pytest

Rephrase entry-point to avoid conveying setuptools must be used.

 it in your setuptools-invocation:         classifiers=["Framework :: Pytest"],     ) +Or via tool specific mechanism when using other packaging framework like `poetry+<https://python-poetry.org/docs/pyproject/#plugins>`_ or `flit+<https://flit.readthedocs.io/en/stable/entrypoints.html#specifying-entry-points>`_.

That's the sdist shim for build systems without PEP517/518 here's how it works when creating whl:

https://github.com/takluyver/flit/blob/master/flit_core/flit_core/wheel.py#L193

Carreau

comment created time in 13 days

Pull request review commentpytest-dev/pytest

Rephrase entry-point to avoid conveying setuptools must be used.

 it in your setuptools-invocation:         classifiers=["Framework :: Pytest"],     ) +Or via tool specific mechanism when using other packaging framework like `poetry+<https://python-poetry.org/docs/pyproject/#plugins>`_ or `flit+<https://flit.readthedocs.io/en/stable/entrypoints.html#specifying-entry-points>`_.

I didn't think flit used setuptools to make wheels

Carreau

comment created time in 13 days

issue openedjazzband/pip-tools

Feature: pip-sync --dry-run should return a non-zero exit code if changes were to occur

What's the problem this feature will solve?

I'm looking to add a pre-commit hook to check the environment is up to date

-   repo: local
    hooks:
    -   id: pip-sync
        name: pip-sync check
        entry: pip-sync --dry-run
        language: system
        always_run: true
        pass_filenames: false

Describe the solution you'd like

$ pip-sync --dry-run
Would install:
  numpy==1.18.5
$ $?
2

Alternative Solutions

various | awk stuff

Additional context

NA

created time in 13 days

issue commentdnanhkhoa/nb_black

Remove trailing semicolons in notebook cells

so black_nb could strip all trailing whitespace and trailing ; before passing the code to black

then add 1 trailing ; if it removed any ;

czwilling

comment created time in 13 days

issue commentpytest-dev/pytest-xdist

Provide an environment variable to set the number of CPUs used (-n)

xdist does use os.sched_getaffinity

https://github.com/pytest-dev/pytest-xdist/blob/master/src/xdist/plugin.py#L10

so I presume when https://bugs.python.org/issue36054 is fixed this will no longer happen?

arthurlogilab

comment created time in 13 days

issue openedmore-itertools/more-itertools

a function to rotate an iterable

>>> tuple(rotate([1, 2, 3, 4, 5], 2))
(3, 4, 5, 1, 2)

created time in 14 days

push eventgraingert/pre-commit-hooks-safety

Thomas Grainger

commit sha 85998991cb321c2108be8a34eb7e50f579222518

parse args with argparse

view details

push time in 14 days

pull request commentLucas-C/pre-commit-hooks-safety

parse args with argparse Fixes #9

@Lucas-C tests added

graingert

comment created time in 14 days

push eventgraingert/pre-commit-hooks-safety

Thomas Grainger

commit sha 0923ac2ee838ab54f68243abbf06a3600bd6708f

parse args with argparse

view details

push time in 14 days

push eventgraingert/pre-commit-hooks-safety

Lucas Cimon

commit sha 9400bd3ed7f226ac6c82dd54a20dda5427d37b3a

Adding test_poetry_requirements

view details

Thomas Grainger

commit sha 9c274a8beb377da59cb873180833a97efce390bd

parse args with argparse

view details

push time in 14 days

issue commentpeterbe/hashin

get sha256 hash from /simple (PEP503) endpoint

the simple index api is an html subset, designed to be amenable to simple processing:

https://github.com/pypa/pip/blob/0b5ad47cbfe986335790e728b787c580b0b3c8b1/src/pip/_vendor/distlib/locators.py#L821-L822

graingert

comment created time in 14 days

issue commentpeterbe/hashin

get sha256 hash from /simple (PEP503) endpoint

@peterbe see the page source of https://m.devpi.net/root/pypi/+simple/devpi-server/

graingert

comment created time in 14 days

pull request commentpytest-dev/pytest

Rephrase entry-point to avoid conveying setuptools must be used.

the python.org docs seem very setuptoolsy: Read the setuptools docs for more information on entrypoints, their definition, and usage.

Carreau

comment created time in 14 days

Pull request review commentpytest-dev/pytest

Rephrase entry-point to avoid conveying setuptools must be used.

 it in your setuptools-invocation:         classifiers=["Framework :: Pytest"],     ) +Or via tools dependants mechanism when using other packaging framework like `poetry
Or via tool specific mechanism when using other packaging framework like `poetry
Carreau

comment created time in 14 days

PR opened takluyver/entrypoints

Add note about importlib.metadata
+3 -0

0 comment

1 changed file

pr created time in 14 days

push eventgraingert/entrypoints

Thomas Grainger

commit sha e02c9547fe3e2cd0677a9d8644c99bd16a3c321b

Add note about importlib.metadata

view details

push time in 14 days

fork graingert/entrypoints

Discover and load entry points from installed packages

https://entrypoints.readthedocs.io/

fork in 14 days

pull request commentpytest-dev/pytest

Rephrase entry-point to avoid conveying setuptools must be used.

https://pypi.org/project/importlib-metadata/ provides the standard way to get entrypoint information

Carreau

comment created time in 14 days

issue commentdevpi/devpi

support the PyPI JSON api

@fschulze

Another option that would be standardized across HTTP hosts https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Want-Digest

then hashers could request alternative hash algorithms than SHA256

graingert

comment created time in 14 days

issue commentpeterbe/hashin

get sha256 hash from /simple (PEP503) endpoint

Another option that would be standardized across HTTP hosts https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Want-Digest

graingert

comment created time in 14 days

issue openedpeterbe/hashin

get sha256 hash from /simple (PEP503) endpoint

What's the problem this feature will solve?

when using devpi or other non- pypi.org servers the hashing falls back to downloading the asset and hashing it locally

Describe the solution you'd like

use the sha256 hash from the /simple endpoint pypi.org and devpi both provide sha256 hashes as a fragment in their href

It's optional and may not include the user' preferred hash function, so pip-compile should still fall-back on the JSON api/downloading assets:

The URL SHOULD include a hash in the form of a URL fragment with the following syntax: #<hashname>=<hashvalue>, where <hashname> is the lowercase name of the hash function (such as sha256) and <hashvalue> is the hex encoded digest. Repositories SHOULD choose a hash function from one of the ones guaranteed to be available via the hashlib module in the Python standard library (currently md5, sha1, sha224, sha256, sha384, sha512). The current recommendation is to use sha256.

for example artifactory's pypi implementation only puts md5 in the fragment of their simple href https://www.jfrog.com/jira/browse/RTFACT-18495

Alternative Solutions

https://github.com/devpi/devpi/issues/801#issuecomment-623510074

Additional context

/cc @fschulze https://github.com/jazzband/pip-tools/pull/1109 view-source on: https://m.devpi.net/root/pypi/+simple/devpi-server/ and view-source on: https://pypi.org/simple/devpi-server/

created time in 14 days

pull request commentLucas-C/pre-commit-hooks-safety

parse args with argparse Fixes #9

No hurry, but I won't merge this without tests, as mentioned in my comment above ;)

yeah of course, I'll add tests once you're happy with the design of the cli

graingert

comment created time in 14 days

issue commentLucas-C/pre-commit-hooks-safety

support `--ignore=x,y,z` ignore in `args: [`

this is missing support for --ignore=x,y,z

graingert

comment created time in 14 days

issue commentbenjaminp/six

six.iterbytes name collision with (deferred) PEP 0467

/cc @ncoghlan @ethanfurman

graingert

comment created time in 15 days

issue openedbenjaminp/six

six.iterbytes name collision with (deferred) PEP 0467

https://www.python.org/dev/peps/pep-0467/#addition-of-optimised-iterator-methods-that-produce-bytes-objects

>>> tuple(b"ABC".iterbytes())
(b'A', b'B', b'C')

in an ideal world I'd like to see:

six.iterbytes(b"ABC")
(b'A', b'B', b'C')

six.iterords(b"ABC")
(65, 66, 67)

but that would require a major version change, as it's changing iterbytes to do the opposite thing

created time in 15 days

fork graingert/safety

Safety checks your installed dependencies for known security vulnerabilities

https://pyup.io/safety/

fork in 16 days

issue commentpyupio/safety

support shell globs with a new command that takes multiple file options

@lf1up https://click.palletsprojects.com/en/7.x/arguments/#variadic-arguments it looks like you can pass nargs=-1 now

graingert

comment created time in 16 days

Pull request review commentLucas-C/pre-commit-hooks-safety

parse args with argparse Fixes #9

 from __future__ import print_function++import argparse import sys+ from safety.cli import check   def main(argv=None):-    if argv is None:-        argv = sys.argv[1:]+    parser = argparse.ArgumentParser()+    parser.add_argument(+        "--full-report",+        default="--full-report",+        const="--full-report",+        action="store_const",+    )+    parser.add_argument(+        "--short-report", dest="full_report", const="--short-report", action="store_const"+    )+    parser.add_argument("--ignore", action="append")

I do not want to re-define all existing / supported safety flags here

there's no need to redefine them all, only the ones needed to change the behaviour

graingert

comment created time in 16 days

issue commentpytest-dev/pytest-xdist

Allow richer expressions in -n auto

auto_detect_cpus is now a bit more complicated:

https://github.com/pytest-dev/pytest-xdist/blob/59caed8e2fed326746d899a85b62924408df6a2b/src/xdist/plugin.py#L8-L28

pytest --numprocesses=$(python -c 'print(__import__('pytest.plugin').plugin.auto_detect_cpus() - 1)')
gappleto97

comment created time in 16 days

push eventgraingert/aioconsole

Thomas Grainger

commit sha 630a6e8532b380afa896729bbcb6ab1fa09d47c7

Update aioconsole/stream.py

view details

push time in 16 days

Pull request review commentvxgmichel/aioconsole

fix stantard/standard typo

 async def open_stantard_pipe_connection(pipe_in, pipe_out, pipe_err, *, loop=Non     return in_reader, out_writer, err_writer  +open_stantard_pipe_connection = open_standard_pipe_connection++
graingert

comment created time in 16 days

Pull request review commentvxgmichel/aioconsole

fix stantard/standard typo

 async def open_stantard_pipe_connection(pipe_in, pipe_out, pipe_err, *, loop=Non     return in_reader, out_writer, err_writer  +open_stantard_pipe_connection = open_standard_pipe_connection

Can you use a suggestion? Then I can apply it as I'm afk

graingert

comment created time in 16 days

pull request commentLucas-C/pre-commit-hooks-safety

parse args with argparse

this allows --full-report to be enabled by default

I think it should be doable without defining an extra option :)

it only defines one option: full_report

graingert

comment created time in 16 days

Pull request review commentLucas-C/pre-commit-hooks-safety

parse args with argparse

 from __future__ import print_function++import argparse import sys+ from safety.cli import check   def main(argv=None):-    if argv is None:-        argv = sys.argv[1:]+    parser = argparse.ArgumentParser()+    parser.add_argument(+        "--full-report",+        default="--full-report",+        const="--full-report",+        action="store_const",+    )+    parser.add_argument(+        "--short-report", dest="full_report", const="--short-report", action="store_const"+    )+    parser.add_argument("--ignore", action="append")

this is because I want to support --ignore=1,2,3

graingert

comment created time in 16 days

push eventgraingert/pre-commit-hooks-safety

Thomas Grainger

commit sha d6a9231fbe33dc1fb79c1f2792299bcd05047702

parse args with argparse

view details

push time in 16 days

push eventgraingert/pre-commit-hooks-safety

Thomas Grainger

commit sha 460c447ef0e3a785a32d13423c2419181c2a8d6f

parse args with argparse

view details

push time in 16 days

pull request commentLucas-C/pre-commit-hooks-safety

parse args with argparse

Why adding a --full-report option ? I'm not sure it's needed, I think --short-report is enough.

this allows --full-report to be enabled by default

graingert

comment created time in 16 days

Pull request review commentLucas-C/pre-commit-hooks-safety

parse args with argparse

 from __future__ import print_function++import argparse import sys+ from safety.cli import check   def main(argv=None):-    if argv is None:-        argv = sys.argv[1:]+    parser = argparse.ArgumentParser()+    parser.add_argument(+        "--full-report",+        default="--full-report",+        const="--full-report",+        action="store_const",+    )+    parser.add_argument(+        "--short-report", dest="full_report", const="--short-report", action="store_const"+    )+    parser.add_argument("--ignore", action="append")+    parser.add_argument("files", nargs="*", action="append")+    ns, rest = parser.parse_known_args(argv)+    ignore = [+        arg+        for vs in ns.ignore
        for vs in ns.ignore or []
graingert

comment created time in 16 days

Pull request review commentLucas-C/pre-commit-hooks-safety

parse args with argparse

 from __future__ import print_function++import argparse import sys+ from safety.cli import check   def main(argv=None):-    if argv is None:-        argv = sys.argv[1:]+    parser = argparse.ArgumentParser()+    parser.add_argument(+        "--full-report",+        default="--full-report",+        const="--full-report",+        action="store_const",+    )+    parser.add_argument(+        "--short-report", dest="full_report", const="--short-report", action="store_const"+    )+    parser.add_argument("--ignore", action="append")+    parser.add_argument("files", nargs="*", action="append")
    parser.add_argument("files", nargs="*")
graingert

comment created time in 16 days

issue openedpriyankcommits/pyfiddleio

shutting down?

Dear Pyfiddle User,

This is Priyank, author of Pyfiddle.io.

Thank you for being part of this fun and creative journey of writing Python feature-fully from a browser and executing in a serverless - containerised - powerful temporary systems.

Today I have to tell you that I will be shutting down Pyfiddle in the coming few weeks. The maintenance costs of Pyfiddle are getting higher and being a single owner / developer / maintainer is becoming harder by the day.

There might still be a slim hope to keep Pyfiddle running, a total of $1000 donation (which are the current dues) from this community of 10K users could be a way.

The link to donate is at, https://www.paypal.com/webapps/shoppingcart?flowlogging_id=redacted&mfid=redacted#/checkout/openButton

Irrespective of the what the future holds, this has been something to remember.

For any questions, feel free to email me at pulumati.priyank@gmail.com

Regards, Priyank

created time in 16 days

PR opened vxgmichel/aioconsole

fix stantard/standard typo
+5 -2

0 comment

1 changed file

pr created time in 17 days

push eventgraingert/aioconsole

Thomas Grainger

commit sha 0791d03c7feaa0e29396e41f6e32b7a0035f8bc3

fix stantard/standard typo

view details

push time in 17 days

fork graingert/aioconsole

Asynchronous console and interfaces for asyncio

http://aioconsole.readthedocs.io

fork in 17 days

pull request commentLucas-C/pre-commit-hooks-safety

parse args with argparse

@Lucas-C it looks like travis is disconnected from github

graingert

comment created time in 17 days

pull request commentLucas-C/pre-commit-hooks-safety

parse args with argparse

this supports nicer --ignore=1,2,3 syntax and allows requirements files starting with - to be passed to safety.check.main

graingert

comment created time in 17 days

push eventgraingert/pre-commit-hooks-safety

Thomas Grainger

commit sha c10ad74010c04cdcfee019da4c5c0e11fbebd686

parse args with argparse

view details

push time in 17 days

fork graingert/pre-commit-hooks-safety

A pre-commit hook to check your Python dependencies against safety-db

fork in 17 days

CommitCommentEvent
CommitCommentEvent
CommitCommentEvent

issue openedpyupio/safety

support shell globs with a new command that takes multiple file options

  • safety version: NA
  • Python version: NA
  • Operating System: NA

Description

I'm trying to run safety check -r **/requirements*.txt but -r only allows one command

introduce a new command that supports unixy [FILE...] safety check_requirements [OPTION...] [FILE...]

created time in 17 days

issue closedawsebcli/awsebcli

Loosen the version constraint of docopt to avoid dependency conflicts

Hi, awsebcli locked the version constraint of docopt as docopt >= 0.6.1, < 0.7, which leads a troubling scenario to its direct downstream project li-aws-deploy which has dependency docopt.

What makes the situation worse is that the downstream projects [li-aws-deploy,mentorship-backend] of awsebcli are also have dependency docopt.

Could you please loosen the version constraint of docopt? Benefit of this is that users using both of awsebcli and docopt can upgrade their third party libraries in a timely manner to reduce technical debts.

Solution

The dependency trees of your project and affected downstream projects are shown as follows. Taking the version constraints of upstream and downstream projects into comprehensive consideration, you can

  1. Loosen click to be docopt >=0.6.1.

@graingert May I submit a PR to this issue?

Thanks for your attention. Best, Neolith

closed time in 17 days

NeolithEra

issue commentawsebcli/awsebcli

Loosen the version constraint of docopt to avoid dependency conflicts

@NeolithEra this is just an import of the pypi source files to git, I don't maintain the package

NeolithEra

comment created time in 17 days

issue commentpytest-dev/pytest

No warning when class is skipped due to __init__

@nicoddemus imho init support kinda makes sense for fixtures:

class TestFoo:
    def __init__(self, tmp_path, postgres):
        self.path = tmp_path / "foo"
        self.data = some_data()

maybe it also makes sense for attr.s/dataclasses:

@attr.ib(frozen=True)
class TestFoo:
    tmp_path = attr.ib()
    postgres = attr.ib()

    def test_foo(self):
        path = self.tmp_path / "foo"
pytestbot

comment created time in 20 days

issue openedpre-commit/pre-commit

special handling of source-container formats, esp. ipynb

I'm working on a project with several .ipynb files and I'd like to be able to run things like add-trailing-comma and pyupgrade on the code inside the "code" cells. This works great with black_nbconvert, but black without add-trailing-comma is

it feels like something in the scope of pre-commit, eg files with files in them, eg ipynb files, rst files with embedded code, or even .zip and .tgz files to open the container format into multiple files run pre-commit hooks on them and then re-construct them into the original file

created time in 20 days

issue commentjazzband/pip-tools

get sha256 hash from /simple (PEP503) endpoint

Another option that would be standardized across HTTP hosts https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Want-Digest

graingert

comment created time in 20 days

issue openedchriskuehl/identify

detect ipynb files

created time in 20 days

issue commentadamchainz/flake8-comprehensions

"Unnecessary dict call" false positives

This example could be rewritten to use literals, but it would be less succinct and (I assume, but haven't confirmed) less performant.

def foo(data):
    defaults = {'a': 1, 'b': 2}
    return dict(defaults, **data)
  2           0 LOAD_CONST               1 (1)
              2 LOAD_CONST               2 (2)
              4 LOAD_CONST               3 (('a', 'b'))
              6 BUILD_CONST_KEY_MAP      2
              8 STORE_FAST               1 (defaults)

  3          10 LOAD_GLOBAL              0 (dict)
             12 LOAD_FAST                1 (defaults)
             14 BUILD_TUPLE              1
             16 LOAD_FAST                0 (data)
             18 CALL_FUNCTION_EX         1
             20 RETURN_VALUE
def foo(data):
    return {"a": 1, "b": 2, **data}
  2           0 LOAD_CONST               1 (1)
              2 LOAD_CONST               2 (2)
              4 LOAD_CONST               3 (('a', 'b'))
              6 BUILD_CONST_KEY_MAP      2
              8 LOAD_FAST                0 (data)
             10 BUILD_MAP_UNPACK         2
             12 RETURN_VALUE

I'm assuming that BUILD_MAP_UNPACK is faster than LOAD_GLOBAL,LOAD_FAST,CALL_FUNCTION_EX

faulkner

comment created time in 20 days

issue commentPyCQA/flake8-commas

Require commas after splat in Python 3

For the last 3 cases you should get a C816

PeterJCLaw

comment created time in 21 days

issue commentPyCQA/flake8-commas

Add test cases for python3.7 and python3.8

@sobolevn a PR would be great thank you!

sobolevn

comment created time in 21 days

issue closedPyCQA/flake8-commas

Is there a way to not require trailing commas on multi-line function calls?

Is it possible to not require trailing commas on multiline function/method calls? At the moment they're getting flagged with C812, which we want for the other multiline errors, just not for function and method calls.

Ideally if the error code for function and method calls was different than C812 we could make our own exceptions for those in our flake8 config.

closed time in 21 days

dbarbar

issue commentPyCQA/flake8-commas

Is there a way to not require trailing commas on multi-line function calls?

some_function(
    a,
    b, # there should always be a trailing comma here
)

imho this is working as designed

dbarbar

comment created time in 21 days

issue commentPyCQA/flake8-commas

trailing *args should not require comma

@PeterJCLaw can you create a issue for that?

graingert

comment created time in 21 days

issue commentPythonCharmers/python-future

surrogateescape handler broken when encountering UnicodeEncodeError

@jmadler @wence- looks like this was fixed here: https://github.com/PythonCharmers/python-future/commit/da5e6d241bb6a58a5a1e2e941602037d47115781

wence-

comment created time in 21 days

issue commentsarugaku/vistir

surrogateescape not working

the reason being:

Python 2.7.16 (default, Oct  7 2019, 17:36:04) 
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> u'fo\udcf6e\udce9ba'.encode("utf8", errors="strict")
'fo\xed\xb3\xb6e\xed\xb3\xa9ba'

doesn't trigger the error handler

graingert

comment created time in 21 days

issue openedsarugaku/vistir

surrogateescape not working

Python 3.8.2 (default, Apr 27 2020, 15:53:34) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> b"fo\xf6e\xe9ba".decode("utf8", "surrogateescape").encode('utf-8', 'surrogateescape')
b'fo\xf6e\xe9ba'
Python 2.7.16 (default, Oct  7 2019, 17:36:04) 
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from vistir.backports.surrogateescape import register_surrogateescape
>>> register_surrogateescape()
>>> b"fo\xf6e\xe9ba".decode("utf8", "surrogateescape").encode('utf-8', 'surrogateescape')
'fo\xed\xb3\xb6e\xed\xb3\xa9ba'

see also: https://github.com/PythonCharmers/python-future/issues/291

created time in 21 days

more