repo stringclasses 37
values | instance_id stringlengths 17 34 | base_commit stringlengths 40 40 | patch stringlengths 291 1.62M | test_patch stringlengths 307 76.5k | problem_statement stringlengths 40 59.9k | hints_text stringlengths 0 149k | created_at stringdate 2018-06-13 17:01:37 2024-12-20 00:40:00 | merged_at stringdate 2018-09-24 06:57:54 2024-12-20 20:16:12 | PASS_TO_PASS stringlengths 2 601k | PASS_TO_FAIL stringclasses 11
values | FAIL_TO_PASS stringlengths 18 605k | FAIL_TO_FAIL stringclasses 60
values | install stringlengths 217 12.7k | test_framework stringclasses 10
values | test_commands stringclasses 10
values | version null | environment_setup_commit null | docker_image_root stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kibitzr/kibitzr | kibitzr__kibitzr-108 | c3073a81ebbabf35f351d29a8096486f8c17aaf5 | diff --git a/docs/gotify.rst b/docs/gotify.rst
new file mode 100644
index 0000000..9a1ec8d
--- /dev/null
+++ b/docs/gotify.rst
@@ -0,0 +1,57 @@
+.. _gotify:
+
+=================
+Gotify Notifier
+=================
+
+Kibitzr supports sending notifications via Gotify_.
+
+Configuration
+-------------
+
+The Gotify notif... | diff --git a/tests/unit/notifiers/test_gotify.py b/tests/unit/notifiers/test_gotify.py
new file mode 100644
index 0000000..cfbcc45
--- /dev/null
+++ b/tests/unit/notifiers/test_gotify.py
@@ -0,0 +1,81 @@
+import pytest
+from kibitzr.notifier.gotify import GotifyNotify
+
+from ...compat import mock
+from ...helpers impo... | Add http notifier
Please and a notifier which executes http requests. This could be used to communicate with web hooks or other web based API. For example sending messages via [Gotify](https://gotify.net/).
| There are so many nuances to send HTTP requests, that I've left this task to `shell` and `python` notifiers.
Consider authentication, methods, payloads, content types. Exposing all these options through YAML config seems to be not maintainable.
But you're welcome to add a PR with `gotify` notifier, that will load cre... | 2021-10-10T19:58:18Z | 2021-10-11T15:06:03Z | [] | [] | ["tests/unit/notifiers/test_gotify.py::test_gotify_sample", "tests/unit/notifiers/test_gotify.py::test_gotify_no_verification", "tests/unit/notifiers/test_gotify.py::test_gotify_override_defaults"] | [] | {"install": ["curl -L https://github.com/mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-linux64.tar.gz | tar zxf -", "uv pip install -e ."], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nenvlist = py27, py3{5,6,7}, flake8\n\n[testenv:flake8]\nbasepython=python\ndeps=flake8\ncommands=flake8 ki... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
getnikola/nikola | getnikola__nikola-3728 | b28c2bcd1dac5a03cc5554d4ed09693c2afcaf4c | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7476c2077..ae5f499fa 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -15,13 +15,13 @@ jobs:
strategy:
fail-fast: false
matrix:
- python: ['3.7', '3.8', '3.9', '3.10', '3.11']
+ python: ['3.7',... | diff --git a/tests/data/plugin_manager/broken.plugin b/tests/data/plugin_manager/broken.plugin
new file mode 100644
index 000000000..1a5f9e05c
--- /dev/null
+++ b/tests/data/plugin_manager/broken.plugin
@@ -0,0 +1,12 @@
+[Core]
+name = broken
+module = broken
+
+[Documentation]
+author = Chris Warrick
+version = 1.0
+w... | Templates can no longer be found in plugins
### Environment
**Python Version:** 3.11.6
**Nikola Version:** GitHub master
**Operating System:** Linux
### Description:
```pytb
Traceback (most recent call last):
File "/home/kwpolska/virtualenvs/nikola/lib64/python3.11/site-packages/mako/lookup.py", line... | 2024-01-02T23:22:05Z | 2024-01-07T12:43:54Z | [] | [] | ["tests/integration/test_future_post.py::test_archive_exists", "tests/integration/test_dev_server.py::test_basepath[http://local.host:456/-]", "tests/test_command_import_wordpress.py::test_transform_multiple_captions_in_a_post", "tests/test_path_handlers.py::test_taxonomy_overview_path[categories-index:path/to/tags.htm... | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.11", "pip_packages": ["aiohttp==3.9.1", "aiosignal==1.3.1", "anyio==4.2.0", "argon2-cffi==23.1.0", "argon2-cffi-bindings==21.2.0", "arrow==1.3.0", "asttokens==2.4.1", "async-lru==2.0.4", "attrs==23.2.0", "babel==2.14.0", "beautifulsoup4==4.12.2", "ble... | null | ["pytest --tb=no -rA -p no:cacheprovider"] | null | null | swa-bench:sw.eval | |
aimhubio/aim | aimhubio__aim-2671 | fba120b9c1d47261dac68041d9938b9caa257b79 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 57c867207b..b7a5e45a19 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@
- Add the ability to create custom UI boards (roubkar, arsengit, KaroMourad)
- Relocate aim explorers to `Explorers` page (arsengit)
- Add functionality for custom context in the PyTor... | diff --git a/tests/ext/test_tensorboard_run.py b/tests/ext/test_tensorboard_run.py
new file mode 100644
index 0000000000..2738244eb3
--- /dev/null
+++ b/tests/ext/test_tensorboard_run.py
@@ -0,0 +1,86 @@
+import time
+
+from aim.ext.resource.log import LogLine
+from aim.ext.tensorboard_tracker.run import Run as Tensorb... | Extend `aim.ext.tensorboard_tracker.run.Run` to also allow system stats, parameters, and stdout capture.
## 🚀 Feature
Allow capturing of system parameters and terminal logs by the `aim.ext.tensorboard_tracker.run.Run`, as this is great feature shouldn't be only available to the default `Run`.
### Motivation
T... | 2023-04-21T18:03:17Z | 2023-05-04T19:09:01Z | [] | [] | ["tests/ext/test_tensorboard_run.py::TestTensorboardRun::test_tensorboard_tracker_run__terminal_capture", "tests/ext/test_tensorboard_run.py::TestTensorboardRun::test_tensorboard_tracker_run__system_params_captured", "tests/ext/test_tensorboard_run.py::TestTensorboardRun::test_tensorboard_tracker_run__system_stats_capt... | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee pytest.ini <<EOF_1234810234\n[pytest]\naddopts = --color=no -rA --tb=no -p no:cacheprovider --pdbcls=IPython.terminal.debugger:Pdb\n\n\nEOF_1234810234"], "python": "3.11", "pip_packages": ["absl-py==1.4.0", "aimrecords==0.0.7", "aimrocks==0.4.0", "aiofiles==23.1... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval | |
aimhubio/aim | aimhubio__aim-2669 | fba120b9c1d47261dac68041d9938b9caa257b79 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 57c867207b..2017eb2edd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,7 +13,8 @@
### Fixes
-- Convert NaNs and Infs in responses to strings (n-gao)
+- Convert NaNs and Infs in responses to strings (n-gao)
+- Import `Image` and `Audio` for `TensorboardFolderTrack... | diff --git a/tests/README.md b/tests/README.md
index 3b7f693039..8dbe0c6f2e 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -5,6 +5,7 @@ Be able to test the correctness of the
- `aim engine`
- `aim sdk`
- `aim ql`
+ - `extensions`
### Folder Structure
@@ -16,6 +17,8 @@ tests
test_*.py
ql
t... | `TensorboardFolderTracker` missing Image import
## 🐛 Bug
Currently the `TensorboardFolderTracker` will crash if there are any images that need to be parsed. This is because currently `aim.Image` is only imported during type checking, however `_process_tb_event` attempts to create an `Image` instance, without access... | 2023-04-21T16:13:40Z | 2023-05-04T18:59:37Z | ["tests/ext/test_tensorboard_tracker.py::TestTensorboardTracker::test__process_tb_scalar_plugin_event"] | [] | ["tests/ext/test_tensorboard_tracker.py::TestTensorboardTracker::test__process_tb_image_event", "tests/ext/test_tensorboard_tracker.py::TestTensorboardTracker::test__process_tb_image_plugin_event", "tests/ext/test_tensorboard_tracker.py::TestTensorboardTracker::test__process_tb_scalar_simple_value_event"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee pytest.ini <<EOF_1234810234\n[pytest]\naddopts = --color=no -rA --tb=no -p no:cacheprovider --pdbcls=IPython.terminal.debugger:Pdb\n\n\nEOF_1234810234"], "python": "3.11", "pip_packages": ["absl-py==1.4.0", "aimrecords==0.0.7", "aimrocks==0.4.0", "aiofiles==23.1... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval | |
jpadilla/pyjwt | jpadilla__pyjwt-1005 | 26a63fc7cd54caa84aef7b4ac30f3f69b0037f6f | diff --git a/.gitignore b/.gitignore
index 1ab5db68..5cf69467 100644
--- a/.gitignore
+++ b/.gitignore
@@ -63,3 +63,6 @@ target/
.mypy_cache
pip-wheel-metadata/
.venv/
+
+
+.idea
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 1ea1758b..0241b5b3 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -27,6 +27,8 @@ Chang... | diff --git a/tests/test_api_jwt.py b/tests/test_api_jwt.py
index 3c0a975b..43fa2e21 100644
--- a/tests/test_api_jwt.py
+++ b/tests/test_api_jwt.py
@@ -14,6 +14,8 @@
InvalidAudienceError,
InvalidIssuedAtError,
InvalidIssuerError,
+ InvalidJTIError,
+ InvalidSubjectError,
MissingRequiredClaimErr... | Implement sub and jti check
Hello,
As per the jwt.org site, our library does not fully support all checks.
https://jwt.io/libraries?language=Python
Do we have a timeline for when sub and jti check might be implemented?
Thanks
| This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
@jpadilla I've opened a PR #991 which can close this issue. Do let me know if it needs changes
@Divan009 thanks for the great for fixing this issue. The codecoverage test fails though on... | 2024-10-10T20:09:21Z | 2024-10-13T19:03:37Z | [] | [] | ["tests/test_api_jwt.py::TestJWT::test_check_issuer_list_when_valid", "tests/test_api_jwt.py::TestJWT::test_decode_no_algorithms_verify_signature_false", "tests/test_api_jwt.py::TestJWT::test_check_audience_when_valid", "tests/test_api_jwt.py::TestJWT::test_custom_json_encoder", "tests/test_api_jwt.py::TestJWT::test_de... | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[flake8]\nmin_python_version = 3.8\nignore= E501, E203, W503, E704\n\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.8: py38, typing\n 3.9: py39\n 3.10: py31... | tox -- | null | null | null | swa-bench:sw.eval |
jpadilla/pyjwt | jpadilla__pyjwt-886 | 12420204cfef8fea7644532b9ca82c0cc5ca3abe | diff --git a/docs/usage.rst b/docs/usage.rst
index 9a673c3e..55097e82 100644
--- a/docs/usage.rst
+++ b/docs/usage.rst
@@ -291,8 +291,7 @@ Retrieve RSA signing keys from a JWKS endpoint
>>> signing_key = jwks_client.get_signing_key_from_jwt(token)
>>> data = jwt.decode(
... token,
- ... signin... | diff --git a/tests/test_api_jwk.py b/tests/test_api_jwk.py
index 4754db60..326e012a 100644
--- a/tests/test_api_jwk.py
+++ b/tests/test_api_jwk.py
@@ -65,6 +65,7 @@ def test_should_load_key_without_alg_from_dict(self):
assert jwk.key_type == "RSA"
assert isinstance(jwk.Algorithm, RSAAlgorithm)
... | Should `jwt.decode` accept `PyJWK` keys?
First of all, thanks for `pyjwt`!
I'm implementing the consumer side of an OIDC flow, with the verification keys being retrieved periodically from the OIDC provider's JSON Web Key (JWK) set. I then turn each JWK's contents into this library's `PyJWK` type.
## Expected Resu... | Oh, I see now that each `PyJWK` also has a `key` attribute, which provides a concrete `Algorithm` instance:
https://github.com/jpadilla/pyjwt/blob/777efa2f51249f63b0f95804230117723eca5d09/jwt/api_jwk.py#L60
The documentation implies that this should work:
https://pyjwt.readthedocs.io/en/stable/usage.html#retri... | 2023-04-28T23:01:35Z | 2024-05-11T19:55:49Z | ["tests/test_api_jws.py::TestJWS::test_decode_warns_on_unsupported_kwarg", "tests/test_api_jws.py::TestJWS::test_bytes_secret", "tests/test_api_jws.py::TestJWS::test_decode_invalid_header_string", "tests/test_api_jws.py::TestJWS::test_load_verify_valid_jws", "tests/test_api_jws.py::TestJWS::test_register_algo_does_not_... | [] | ["tests/test_api_jwk.py::TestPyJWK::test_should_load_key_okp_without_alg_from_dict", "tests/test_api_jwk.py::TestPyJWK::test_should_load_key_without_alg_from_dict", "tests/test_api_jws.py::TestJWS::test_decodes_with_jwk_and_no_algorithm", "tests/test_api_jwk.py::TestPyJWK::test_should_load_key_ec_p521_from_dict", "test... | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[flake8]\nmin_python_version = 3.8\nignore= E501, E203, W503, E704\n\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.8: py38, typing\n 3.9: py39\n 3.10: py31... | tox -- | null | null | null | swa-bench:sw.eval |
jpadilla/pyjwt | jpadilla__pyjwt-881 | d8b12421654840418fd25b86553795c0c09ed0a9 | diff --git a/jwt/algorithms.py b/jwt/algorithms.py
index 4bcf81b6..ed187152 100644
--- a/jwt/algorithms.py
+++ b/jwt/algorithms.py
@@ -3,8 +3,9 @@
import hashlib
import hmac
import json
+import sys
from abc import ABC, abstractmethod
-from typing import TYPE_CHECKING, Any, ClassVar, NoReturn, cast
+from typing impo... | diff --git a/tests/test_algorithms.py b/tests/test_algorithms.py
index 7a90376b..1a395527 100644
--- a/tests/test_algorithms.py
+++ b/tests/test_algorithms.py
@@ -1,6 +1,6 @@
import base64
import json
-from typing import cast
+from typing import Any, cast
import pytest
@@ -91,11 +91,15 @@ def test_hmac_jwk_shoul... | Support returning `Algorithm.to_jwk(key)` as dict
Currently, the when generating a JWK, the only way to get a `dict` from PyJWT is to:
```python
jwk_str = algo.to_jwk(key)
jwk = json.loads(jwk_str)
```
This is very unfortunate when you want to add more fields into the JWK:
```python
modified_jwk = {
*... | Maybe with a `as_dict` argument to `to_jwk`, with a default value of `False` for backwards compatibility?
Hmm, that might work...
I'm a bit concerned about the return type hint but with `@overload` it should work fine
> I'm a bit concerned about the return type hint but with @overload it should work fine
yes using ... | 2023-04-14T07:25:52Z | 2023-05-09T19:03:15Z | ["tests/test_algorithms.py::TestOKPAlgorithms::test_okp_ed448_jwk_fails_on_invalid_json", "tests/test_algorithms.py::TestAlgorithms::test_rsa_jwk_private_key_with_missing_required_values_is_invalid", "tests/test_algorithms.py::TestOKPAlgorithms::test_okp_ed25519_jwk_public_key_should_parse_and_verify", "tests/test_algo... | [] | ["tests/test_algorithms.py::TestOKPAlgorithms::test_okp_ed448_to_jwk_works_with_from_jwk[True]", "tests/test_algorithms.py::TestAlgorithms::test_rsa_to_jwk_returns_correct_values_for_public_key[True]", "tests/test_algorithms.py::TestOKPAlgorithms::test_okp_ed448_to_jwk_works_with_from_jwk[False]", "tests/test_algorithm... | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[flake8]\nmin_python_version = 3.8\nignore= E501, E203, W503, E704\n\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.8: py38, typing\n 3.9: py39\n 3.10: py31... | tox -- | null | null | null | swa-bench:sw.eval |
jpadilla/pyjwt | jpadilla__pyjwt-847 | 4e15dbd9aaef56b78ac8f885220d94f785d2b30c | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 3c69338f..12117ecc 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -16,6 +16,7 @@ Fixed
~~~~~
- Add classifier for Python 3.11 by @eseifert in `#818 <https://github.com/jpadilla/pyjwt/pull/818>`_
+- Fix ``_validate_iat`` validation by @Viicos in `#847 <https://gith... | diff --git a/tests/test_api_jwt.py b/tests/test_api_jwt.py
index d74973df..24ed240d 100644
--- a/tests/test_api_jwt.py
+++ b/tests/test_api_jwt.py
@@ -227,6 +227,13 @@ def test_decode_raises_exception_if_iat_is_greater_than_now(self, jwt, payload):
with pytest.raises(ImmatureSignatureError):
jwt.d... | PyJWT 2.6.0 IAT Decode Error - TypeError: '>' not supported between instances of 'str' and 'int'
# Summary
Just upgraded to version `2.6.0` and now whenever I try to do a decode of a JWT I get the following error:
```python
def _validate_iat(self, payload, now, leeway):
iat = payload["iat"]
try:
... | +1, same for me
my test is
```Python
import jwt
decoded = jwt.decode(data, pub_key, algorithms=["RS512"])
print(decoded)
```
Happy to provide also a full stack trace
```
Traceback (most recent call last):
File "/jwt.py", line 72, in validate
decoded: dict = decode(data, pub_key, algorithms=["RS512"]... | 2023-01-04T18:40:06Z | 2023-01-15T03:13:02Z | ["tests/test_api_jwt.py::TestJWT::test_decode_no_algorithms_verify_signature_false", "tests/test_api_jwt.py::TestJWT::test_check_audience_when_valid", "tests/test_api_jwt.py::TestJWT::test_custom_json_encoder", "tests/test_api_jwt.py::TestJWT::test_raise_exception_token_without_issuer", "tests/test_api_jwt.py::TestJWT:... | [] | ["tests/test_api_jwt.py::TestJWT::test_decode_works_if_iat_is_str_of_a_number", "tests/test_api_jwt.py::TestJWT::test_decode_complete_warns_on_unsupported_kwarg"] | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[flake8]\nmin_python_version = 3.8\nignore= E501, E203, W503, E704\n\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.8: py38, typing\n 3.9: py39\n 3.10: py31... | tox -- | null | null | null | swa-bench:sw.eval |
jpadilla/pyjwt | jpadilla__pyjwt-775 | 345549567dbb58fd7bf901392cf6b1a626f36e24 | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 8ec7ede8..4d562070 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -18,6 +18,10 @@ Fixed
Added
~~~~~
+- Add ``compute_hash_digest`` as a method of ``Algorithm`` objects, which uses
+ the underlying hash algorithm to compute a digest. If there is no appropriate
+ ... | diff --git a/tests/test_algorithms.py b/tests/test_algorithms.py
index 538078af..894ce282 100644
--- a/tests/test_algorithms.py
+++ b/tests/test_algorithms.py
@@ -45,6 +45,12 @@ def test_algorithm_should_throw_exception_if_from_jwk_not_impl(self):
with pytest.raises(NotImplementedError):
algo.to_j... | Support exposure of hash algorithm digest to handle OIDC at_hash, potentially other spec extensions
#296 was closed with the suggestion that rather than special-case support for OIDC, PyJWT could support pluggable verifiers which handle additional, specialized claim validation behavior.
If there's a general market f... | This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
I may have approached this the wrong way years back when I filed this issue. Perhaps it's too verbose.
But I still think that OIDC is a valid use-case to consider.
I've been happy to... | 2022-07-03T17:06:45Z | 2022-11-02T11:01:53Z | ["tests/test_algorithms.py::TestOKPAlgorithms::test_okp_ed448_jwk_fails_on_invalid_json", "tests/test_algorithms.py::TestAlgorithms::test_rsa_jwk_private_key_with_missing_required_values_is_invalid", "tests/test_algorithms.py::TestOKPAlgorithms::test_okp_ed25519_jwk_public_key_should_parse_and_verify", "tests/test_algo... | [] | ["tests/test_algorithms.py::TestOKPAlgorithms::test_rsa_can_compute_digest", "tests/test_algorithms.py::TestAlgorithms::test_algorithm_should_throw_exception_if_compute_hash_digest_not_impl", "tests/test_algorithms.py::TestOKPAlgorithms::test_okp_ed448_to_jwk_works_with_from_jwk", "tests/test_algorithms.py::TestOKPAlgo... | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[flake8]\nmin_python_version = 3.8\nignore= E501, E203, W503, E704\n\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.8: py38, typing\n 3.9: py39\n 3.10: py31... | tox -- | null | null | null | swa-bench:sw.eval |
jpadilla/pyjwt | jpadilla__pyjwt-725 | 77d791681fa3d0ba65a648de42dd3d671138cb95 | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 498a544a..06d281c1 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -16,6 +16,8 @@ Fixed
Added
~~~~~
+- Add ``PyJWKSet.__getitem__`` for indexing keysets by key ID `#725 <https://github.com/jpadilla/pyjwt/pull/725>`__
+
`v2.3.0 <https://github.com/jpadilla/pyjwt/co... | diff --git a/tests/test_api_jwk.py b/tests/test_api_jwk.py
index 53c05473..6f6cb899 100644
--- a/tests/test_api_jwk.py
+++ b/tests/test_api_jwk.py
@@ -252,3 +252,26 @@ def test_should_load_keys_from_jwk_data_json_string(self):
assert jwk.key_type == "RSA"
assert jwk.key_id == "keyid-abc123"
a... | New API: Retrieving a key by KID from a `PyJWKSet`?
First of all, thanks for creating and maintaining this library!
The current `PyJWKSet` API is pretty thin: it wraps a list of `PyJWK` and provides basic deserialization, but nothing else.
I'd like to propose adding `PyJWKSet.__getitem__`, which would allow a use... | 2022-01-21T15:45:48Z | 2022-01-25T02:12:53Z | ["tests/test_api_jwk.py::TestPyJWK::test_should_load_key_ec_p521_from_dict", "tests/test_api_jwk.py::TestPyJWK::test_should_load_key_from_dict_with_algorithm", "tests/test_api_jwk.py::TestPyJWK::test_should_load_key_from_jwk_data_json_string", "tests/test_api_jwk.py::TestPyJWK::test_should_load_key_ec_p384_from_dict", ... | [] | ["tests/test_api_jwk.py::TestPyJWKSet::test_keyset_should_index_by_kid", "tests/test_api_jwk.py::TestPyJWKSet::test_should_load_keys_from_jwk_data_json_string"] | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.6: py36\n 3.7: py37, docs\n 3.8: py38, typing\n 3.9: py39\n 3.10: py310\n\n\n[tox]\nenvlist =\n # lin... | tox -- | null | null | null | swa-bench:sw.eval | |
jpadilla/pyjwt | jpadilla__pyjwt-657 | fdd795ad08f91fb110d1578619506bfb767fdb30 | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index f122fe76..1c1c4514 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -10,6 +10,8 @@ This project adheres to `Semantic Versioning <https://semver.org/>`__.
Changed
~~~~~~~
+- Remove arbitrary kwalgs. `#657 <https://github.com/jpadilla/pyjwt/pull/657>`__
+
Fixed
~~~~... | diff --git a/tests/test_api_jwt.py b/tests/test_api_jwt.py
index a6230b3c..3f274a37 100644
--- a/tests/test_api_jwt.py
+++ b/tests/test_api_jwt.py
@@ -106,6 +106,17 @@ def test_decode_with_non_mapping_payload_throws_exception(self, jwt):
exception = context.value
assert str(exception) == "Invalid payl... | jwt.jws_api.PyJWS.decode_complete shouldn't accept kwargs argument
Here we are using flask_jwt_extended. There is a call in it that calls jwt.api_jwt.PyJWT.decode with a now disapeared parameter. The problem is that jwt.api_jwt.PyJWT.decode accepts any named parameters, and forwards them to jwt.jws_api.PyJWS.decode_com... | 2021-05-05T09:51:29Z | 2021-08-08T23:40:04Z | ["tests/test_api_jwt.py::TestJWT::test_check_audience_when_valid", "tests/test_api_jwt.py::TestJWT::test_custom_json_encoder", "tests/test_api_jwt.py::TestJWT::test_raise_exception_token_without_issuer", "tests/test_api_jwt.py::TestJWT::test_check_issuer_when_valid", "tests/test_api_jwt.py::TestJWT::test_decode_with_in... | [] | ["tests/test_api_jwt.py::TestJWT::test_decode_no_algorithms_verify_signature_false", "tests/test_api_jwt.py::TestJWT::test_decode_with_unknown_parameter_throws_exception"] | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.6: py36\n 3.7: py37, docs\n 3.8: py38, typing\n 3.9: py39\n\n\n[tox]\nenvlist =\n # lint\n # typing\n... | tox -- | null | null | null | swa-bench:sw.eval | |
jpadilla/pyjwt | jpadilla__pyjwt-644 | 8de44287752f9d2c0112bb3062389462d56ead86 | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index b049e9e8..f122fe76 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -15,6 +15,7 @@ Fixed
- Prefer `headers["alg"]` to `algorithm` in `jwt.encode()`. `#673 <https://github.com/jpadilla/pyjwt/pull/673>`__
- Fix aud validation to support {'aud': null} case. `#670 <http... | diff --git a/tests/test_api_jws.py b/tests/test_api_jws.py
index fbeda024..07d15110 100644
--- a/tests/test_api_jws.py
+++ b/tests/test_api_jws.py
@@ -650,6 +650,65 @@ def test_encode_headers_parameter_adds_headers(self, jws, payload):
assert "testheader" in header_obj
assert header_obj["testheader"] ... | Ability to remove dictionary value "typ": "JWT" from jwt header
Suggest an idea for this project.
Hi, I'm hitting a limitation where I cannot use this library as it is adding the "typ": "JWT" dict to the header automatically.
A similar issue has been reported below.
https://stackoverflow.com/questions/61511738/pyj... | 2021-04-07T12:56:21Z | 2021-08-08T19:09:55Z | ["tests/test_api_jws.py::TestJWS::test_bytes_secret", "tests/test_api_jws.py::TestJWS::test_decode_invalid_header_string", "tests/test_api_jws.py::TestJWS::test_load_verify_valid_jws", "tests/test_api_jws.py::TestJWS::test_register_algo_does_not_allow_duplicate_registration", "tests/test_api_jws.py::TestJWS::test_load_... | [] | ["tests/test_api_jws.py::TestJWS::test_encode_with_typ_none", "tests/test_api_jws.py::TestJWS::test_encode_with_typ_empty_string"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee tox.ini <<EOF_1234810234\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.6: py36\n 3.7: py37, docs\n 3.8: py38, typing\n 3.9: py39\n\n\n[tox]\nenvlist =\n #... | tox -- | null | null | null | swa-bench:sw.eval | |
jpadilla/pyjwt | jpadilla__pyjwt-673 | c8ab900b831c4e859620c964d25737bf95d5eeb8 | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 763822a1..b049e9e8 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -13,6 +13,7 @@ Changed
Fixed
~~~~~
+- Prefer `headers["alg"]` to `algorithm` in `jwt.encode()`. `#673 <https://github.com/jpadilla/pyjwt/pull/673>`__
- Fix aud validation to support {'aud': null} c... | diff --git a/tests/test_api_jws.py b/tests/test_api_jws.py
index b731edce..fbeda024 100644
--- a/tests/test_api_jws.py
+++ b/tests/test_api_jws.py
@@ -166,6 +166,32 @@ def test_encode_algorithm_param_should_be_case_sensitive(self, jws, payload):
exception = context.value
assert str(exception) == "Algo... | Malformed JWTs due to different signing algorithms in `headers` and `algorithm` parameters
Generating JWTs (`encode()`) with `alg` key set in `headers` parameter along with a different `algorithm` parameter value results in malformed JWTs.
Example `headers` and `algorithm` values that will result in malformed token... | I just bumped into a related (usability) issue: using a non-default algorithm with a custom header. (I was doing [OIDC asymmetric signatures][1].)
The `algorithm` parameter has a default, so you have to specify it twice:
```python
key = ...
header = {"typ": "JWT", "alg": "PS256", "kid": "my-key-id"}
claims = {... | 2021-07-22T03:35:31Z | 2021-08-06T02:34:25Z | ["tests/test_api_jws.py::TestJWS::test_bytes_secret", "tests/test_api_jws.py::TestJWS::test_decode_invalid_header_string", "tests/test_api_jws.py::TestJWS::test_encode_decode_ecdsa_related_algorithms[ES384]", "tests/test_api_jws.py::TestJWS::test_decodes_valid_es384_jws", "tests/test_api_jws.py::TestJWS::test_load_veri... | [] | ["tests/test_api_jws.py::TestJWS::test_encode_with_headers_alg_es256", "tests/test_api_jws.py::TestJWS::test_encode_with_headers_alg_none", "tests/test_api_jws.py::TestJWS::test_encode_with_alg_hs256_and_headers_alg_es256"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee tox.ini <<EOF_1234810234\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.6: py36\n 3.7: py37, docs\n 3.8: py38, typing\n 3.9: py39\n\n\n[tox]\nenvlist =\n #... | tox -- | null | null | null | swa-bench:sw.eval |
jpadilla/pyjwt | jpadilla__pyjwt-670 | db18661724305f7bc0663e738759222158900bb8 | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index b138569a..763822a1 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -13,6 +13,8 @@ Changed
Fixed
~~~~~
+- Fix aud validation to support {'aud': null} case. `#670 <https://github.com/jpadilla/pyjwt/pull/670>`__
+
Added
~~~~~
diff --git a/jwt/api_jwt.py b/jwt/api_... | diff --git a/tests/test_api_jwt.py b/tests/test_api_jwt.py
index 56de90c9..1faa05f3 100644
--- a/tests/test_api_jwt.py
+++ b/tests/test_api_jwt.py
@@ -202,6 +202,16 @@ def test_decode_raises_exception_if_nbf_is_not_int(self, jwt):
with pytest.raises(DecodeError):
jwt.decode(example_jwt, "secret", ... | {"aud": null } should be ignored
It is a rare case but I found an example that {”aud”: null }is set.
According to RFC7519(JWT), it is usually a list of strings or a string, but there is no specification about the type of "aud".
## Expected Result
{"aud": null} should be treated the same as unspecified.
## Act... | 2021-07-15T14:03:15Z | 2021-07-30T13:00:54Z | ["tests/test_api_jwt.py::TestJWT::test_check_audience_when_valid", "tests/test_api_jwt.py::TestJWT::test_custom_json_encoder", "tests/test_api_jwt.py::TestJWT::test_raise_exception_token_without_issuer", "tests/test_api_jwt.py::TestJWT::test_check_issuer_when_valid", "tests/test_api_jwt.py::TestJWT::test_decode_with_in... | [] | ["tests/test_api_jwt.py::TestJWT::test_decode_no_algorithms_verify_signature_false", "tests/test_api_jwt.py::TestJWT::test_decode_raises_exception_if_aud_is_none", "tests/test_api_jwt.py::TestJWT::test_raise_exception_token_with_aud_none_and_without_audience"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee tox.ini <<EOF_1234810234\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.6: py36\n 3.7: py37, docs\n 3.8: py38, typing\n 3.9: py39\n\n\n[tox]\nenvlist =\n #... | tox -- | null | null | null | swa-bench:sw.eval | |
jpadilla/pyjwt | jpadilla__pyjwt-643 | fc7a708149d7fc75a9053b76129067c98b49d09f | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index e67381fb..be10c2ba 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -26,6 +26,7 @@ Added
- Add missing exceptions.InvalidKeyError to jwt module __init__ imports `#620 <https://github.com/jpadilla/pyjwt/pull/620>`__
- Add support for ES256K algorithm `#629 <https://git... | diff --git a/tests/test_algorithms.py b/tests/test_algorithms.py
index 2144d484..0ece6d88 100644
--- a/tests/test_algorithms.py
+++ b/tests/test_algorithms.py
@@ -800,3 +800,28 @@ def test_ed25519_jwk_fails_on_invalid_json(self):
v["d"] = "123"
with pytest.raises(InvalidKeyError):
algo.fr... | Support to_jwk for Ed25519Algorithm
after [Support of form_jwk()](https://github.com/jpadilla/pyjwt/issues/621) it would be nice to implement
to_jwk() for Ed25519Algorithm
| 2021-04-06T16:48:57Z | 2021-04-28T11:42:22Z | ["tests/test_algorithms.py::TestAlgorithms::test_rsa_jwk_private_key_with_missing_required_values_is_invalid", "tests/test_algorithms.py::TestAlgorithms::test_hmac_should_reject_nonstring_key", "tests/test_algorithms.py::TestAlgorithms::test_rsa_to_jwk_raises_exception_on_invalid_key", "tests/test_algorithms.py::TestAl... | [] | ["tests/test_algorithms.py::TestEd25519Algorithms::test_ed25519_to_jwk_works_with_from_jwk", "tests/test_algorithms.py::TestEd25519Algorithms::test_ed25519_jwk_fails_on_invalid_json", "tests/test_algorithms.py::TestEd25519Algorithms::test_ed25519_to_jwk_raises_exception_on_invalid_key"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee tox.ini <<EOF_1234810234\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.6: py36\n 3.7: py37, docs\n 3.8: py38, typing\n 3.9: py39\n\n\n[tox]\nenvlist =\n #... | tox -- | null | null | null | swa-bench:sw.eval | |
jpadilla/pyjwt | jpadilla__pyjwt-624 | 88972a9bd962fceee8251cfff0e41f3d77e56551 | diff --git a/jwt/api_jwk.py b/jwt/api_jwk.py
index 3c10e07f..a0f6364d 100644
--- a/jwt/api_jwk.py
+++ b/jwt/api_jwk.py
@@ -1,7 +1,7 @@
import json
from .algorithms import get_default_algorithms
-from .exceptions import PyJWKError, PyJWKSetError
+from .exceptions import InvalidKeyError, PyJWKError, PyJWKSetError
... | diff --git a/tests/test_api_jwk.py b/tests/test_api_jwk.py
index 102af871..e0787f46 100644
--- a/tests/test_api_jwk.py
+++ b/tests/test_api_jwk.py
@@ -1,12 +1,20 @@
import json
+import pytest
+
from jwt.algorithms import has_crypto
from jwt.api_jwk import PyJWK, PyJWKSet
+from jwt.exceptions import InvalidKeyError... | PyJWKClient is not able to detect the ES384 Algorithm from a given key
The `PyJWKClient` is not able to detect the `ES384` Algorithm from a key.
The code breaks with the following error message:
```
[ERROR] PyJWKError: Unable to find a algorithm for key: {'kty': 'EC', 'kid': 'ZWZDBDUHH3G3AK2G', 'x': 'BROh-CQfiSv_K... | I can reproduce this issue, but adding the 'alg' seems to fix it for me. Is this a duplicate of https://github.com/jpadilla/pyjwt/issues/603? | 2021-03-07T04:53:44Z | 2021-03-22T08:14:47Z | ["tests/test_api_jwk.py::TestPyJWK::test_should_load_key_from_dict_with_algorithm", "tests/test_api_jwk.py::TestPyJWK::test_should_load_key_from_jwk_data_json_string", "tests/test_api_jwk.py::TestPyJWKSet::test_should_load_keys_from_jwk_data_dict", "tests/test_api_jwk.py::TestPyJWK::test_should_load_key_from_jwk_data_d... | [] | ["tests/test_api_jwk.py::TestPyJWK::test_should_load_key_ec_p521_from_dict", "tests/test_api_jwk.py::TestPyJWKSet::test_should_load_keys_from_jwk_data_json_string", "tests/test_api_jwk.py::TestPyJWK::test_should_load_key_ec_p384_from_dict", "tests/test_api_jwk.py::TestPyJWK::test_should_load_key_hmac_without_alg_from_d... | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.6: py36\n 3.7: py37, docs\n 3.8: py38, typing\n 3.9: py39\n\n\n[tox]\nenvlist =\n # lint\n # typing\n... | tox -- | null | null | null | swa-bench:sw.eval |
jpadilla/pyjwt | jpadilla__pyjwt-623 | f6d4bbfa9feb9ed56c54de6011678adf48af4ac7 | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index c3850a5a..5c46c975 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -23,6 +23,7 @@ Added
- Add caching by default to PyJWKClient `#611 <https://github.com/jpadilla/pyjwt/pull/611>`__
- Add missing exceptions.InvalidKeyError to jwt module __init__ imports `#620 <https:... | diff --git a/tests/keys/jwk_okp_key_Ed25519.json b/tests/keys/jwk_okp_key_Ed25519.json
new file mode 100644
index 00000000..6451fe95
--- /dev/null
+++ b/tests/keys/jwk_okp_key_Ed25519.json
@@ -0,0 +1,6 @@
+{
+ "kty":"OKP",
+ "crv":"Ed25519",
+ "d":"nWGxne_9WmC6hEr0kuwsxERJxWl7MmkZcDusAxyuf2A",
+ "x":"11qYAYKxCrfVS_... | Support from_jwk for Ed25519Algorithm
I'd like to use `get_signing_key_from_jwk()` for JWT with alg=EdDSA.
But, at the moment, it seems that pyjwt does not support it because `Ed25519Algorithm` does not have `from_jwk()`.
Do you have a plan to support that?
If you don't have the plan, I can send a PR for that.
... | For reference, looks like the spec for this is in [RFC 8037](https://tools.ietf.org/html/rfc8037#section-2).
Yes, in other words, I need from_jwt() for JWT kty=OKP compliant with RFC8037.
| 2021-03-06T04:06:35Z | 2021-03-18T23:23:35Z | ["tests/test_algorithms.py::TestAlgorithms::test_rsa_jwk_private_key_with_missing_required_values_is_invalid", "tests/test_algorithms.py::TestAlgorithms::test_hmac_should_reject_nonstring_key", "tests/test_algorithms.py::TestAlgorithms::test_rsa_to_jwk_raises_exception_on_invalid_key", "tests/test_algorithms.py::TestAl... | [] | ["tests/test_algorithms.py::TestEd25519Algorithms::test_ed25519_prepare_key_should_be_idempotent", "tests/test_algorithms.py::TestEd25519Algorithms::test_ed25519_jwk_public_key_should_parse_and_verify", "tests/test_algorithms.py::TestEd25519Algorithms::test_ed25519_jwk_fails_on_invalid_json", "tests/test_algorithms.py:... | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee tox.ini <<EOF_1234810234\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.6: py36\n 3.7: py37, docs\n 3.8: py38, typing\n 3.9: py39\n\n\n[tox]\nenvlist =\n #... | tox -- | null | null | null | swa-bench:sw.eval |
jpadilla/pyjwt | jpadilla__pyjwt-629 | 22b1d02bb3c7d359e63aaf227851c075b72cae7f | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 42864cbb..ab08e0e3 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -19,6 +19,7 @@ Added
~~~~~
- Add caching by default to PyJWKClient `#611 <https://github.com/jpadilla/pyjwt/pull/611>`__
+- Add support for ES256K algorithm `#629 <https://github.com/jpadilla/pyjwt/... | diff --git a/tests/keys/jwk_ec_key_secp256k1.json b/tests/keys/jwk_ec_key_secp256k1.json
new file mode 100644
index 00000000..1d35ece5
--- /dev/null
+++ b/tests/keys/jwk_ec_key_secp256k1.json
@@ -0,0 +1,8 @@
+{
+ "kty": "EC",
+ "kid": "bilbo.baggins.256k@hobbiton.example",
+ "crv": "secp256k1",
+ "x": "MLnVyPDPQpNm... | Add Support for Algorithm ES256K
In Bitcoin and Ethereum the elliptic curve signature algorithm with curve es256k1 (abbreviation: ES256K) is used. PyJWT currently does not support this algorithm.
| 2021-03-13T11:03:38Z | 2021-03-18T22:08:01Z | ["tests/test_api_jws.py::TestJWS::test_bytes_secret", "tests/test_api_jws.py::TestJWS::test_decode_invalid_header_string", "tests/test_algorithms.py::TestAlgorithms::test_rsa_jwk_private_key_with_missing_required_values_is_invalid", "tests/test_algorithms.py::TestAlgorithms::test_hmac_should_reject_nonstring_key", "tes... | [] | ["tests/test_algorithms.py::TestAlgorithms::test_ec_jwk_public_and_private_keys_should_parse_and_verify", "tests/test_api_jws.py::TestJWS::test_encode_decode_ecdsa_related_algorithms[ES256K]"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee tox.ini <<EOF_1234810234\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.6: py36\n 3.7: py37, docs\n 3.8: py38, typing\n 3.9: py39\n\n\n[tox]\nenvlist =\n #... | tox -- | null | null | null | swa-bench:sw.eval | |
jpadilla/pyjwt | jpadilla__pyjwt-608 | 3993ce1d3503b58cf74699a89ba9e5c18ef9b556 | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 4712e2e5..77467d69 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -10,6 +10,8 @@ This project adheres to `Semantic Versioning <https://semver.org/>`__.
Changed
~~~~~~~
+- Allow claims validation without making JWT signature validation mandatory. `#608 <https://git... | diff --git a/tests/test_api_jwt.py b/tests/test_api_jwt.py
index f161763f..05cb714d 100644
--- a/tests/test_api_jwt.py
+++ b/tests/test_api_jwt.py
@@ -579,6 +579,22 @@ def test_decode_with_verify_exp_option(self, jwt, payload):
options={"verify_exp": True},
)
+ def test_decode_with_ve... | jwt.decode verify_signature=False and verify_exp=True doesn't work properly
When trying to decode an expired token to see if it needs a refresh, the expected exception doesn't raise.
## Expected Result
I expect the following code to raise an `ExpiredSignatureError`
## Actual Result
However it doesn't raise... | It seems that the other claims are only validated if the signature itself is also validated.
https://github.com/jpadilla/pyjwt/blob/master/jwt/api_jwt.py#L98
```py
if options["verify_signature"]:
merged_options = {**self.options, **options}
self._validate_claims(payload, merged_... | 2021-01-22T08:17:07Z | 2021-02-15T16:40:10Z | ["tests/test_api_jwt.py::TestJWT::test_check_audience_when_valid", "tests/test_api_jwt.py::TestJWT::test_custom_json_encoder", "tests/test_api_jwt.py::TestJWT::test_raise_exception_token_without_issuer", "tests/test_api_jwt.py::TestJWT::test_check_issuer_when_valid", "tests/test_api_jwt.py::TestJWT::test_decode_with_in... | [] | ["tests/test_api_jwt.py::TestJWT::test_decode_no_algorithms_verify_signature_false", "tests/test_api_jwt.py::TestJWT::test_decode_with_verify_exp_option_and_signature_off"] | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.6: py36\n 3.7: py37, docs\n 3.8: py38, typing\n 3.9: py39\n\n\n[tox]\nenvlist =\n # lint\n # typing\n... | tox -- | null | null | null | swa-bench:sw.eval |
jpadilla/pyjwt | jpadilla__pyjwt-559 | 2e1e69d4ddfddaba35b6ee99ead1b430654ed661 | diff --git a/jwt/__init__.py b/jwt/__init__.py
index 9d950538..55a5ae38 100644
--- a/jwt/__init__.py
+++ b/jwt/__init__.py
@@ -1,12 +1,10 @@
-from .api_jws import PyJWS
-from .api_jwt import (
- PyJWT,
- decode,
- encode,
+from .api_jws import (
+ PyJWS,
get_unverified_header,
register_algorithm,
... | diff --git a/tests/test_api_jws.py b/tests/test_api_jws.py
index a0456dce..2e8dd901 100644
--- a/tests/test_api_jws.py
+++ b/tests/test_api_jws.py
@@ -215,6 +215,27 @@ def test_decodes_valid_jws(self, jws, payload):
assert decoded_payload == payload
+ def test_decodes_complete_valid_jws(self, jws, paylo... | Fix type annotation
Not sure what happened here. It says it accepts Dict or bytes, then the code immediately checks if it is Mapping on the first line...
| With this change, I receive the following error when running `mypy`:
```
$ tox -e typing
jwt/api_jwt.py:36: error: Argument 1 of "encode" is incompatible with supertype "PyJWS"; supertype defines the argument type as "Union[Dict[Any, Any], bytes]"
jwt/api_jwt.py:36: note: This violates the Liskov substitution pri... | 2020-12-18T16:19:44Z | 2020-12-19T23:32:13Z | ["tests/test_api_jws.py::TestJWS::test_bytes_secret", "tests/test_api_jws.py::TestJWS::test_decode_invalid_header_string", "tests/test_api_jws.py::TestJWS::test_load_verify_valid_jws", "tests/test_api_jws.py::TestJWS::test_register_algo_does_not_allow_duplicate_registration", "tests/test_api_jws.py::TestJWS::test_load_... | [] | ["tests/test_api_jws.py::TestJWS::test_decodes_complete_valid_jws", "tests/test_api_jwt.py::TestJWT::test_decodes_complete_valid_jwt"] | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[pytest]\naddopts = -ra\ntestpaths = tests\nfilterwarnings =\n once::Warning\n ignore:::pympler[.*]\n\n\n[gh-actions]\npython =\n 3.6: py36\n 3.7: py37, docs\n 3.8: py38, lint, manifest, typing\n 3.9: py39\n\n\n[gh-actions:env]\nPLATFORM =... | tox -- | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-5632 | 32d72af53d5e858b617c8a10c531b67e561f8421 | diff --git a/news/fix_python_only_completion.rst b/news/fix_python_only_completion.rst
new file mode 100644
index 0000000000..496dd6d963
--- /dev/null
+++ b/news/fix_python_only_completion.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* <news item>
+
+**Deprecated:**
+
+* <news item>
+
+**Removed... | diff --git a/tests/test_completer.py b/tests/test_completer.py
index 67af4890c9..384e59f179 100644
--- a/tests/test_completer.py
+++ b/tests/test_completer.py
@@ -168,3 +168,8 @@ def comp(context: CommandContext):
"$WOW", "$WOW", 4, 0, {}, multiline_text="'$WOW'", cursor_index=4
)
assert set(comps[0]... | Completion exception when input ends with `@(`
I'm encountering an exception related to completions when the input ends with `@(`. This is particularly annoying with $UPDATE_COMPLETIONS_ON_KEYPRESS=True.
```
$xonsh --no-rc
$xonsh --version
xonsh/0.18.2
$$UPDATE_COMPLETIONS_ON_KEYPRESS = True
$echo @(
Unhandled... | I'm not familiar with the codebase but wanted to try to help at least. Would this be an issue of additional checks in [xonsh/completer.py](https://github.com/xonsh/xonsh/blob/ec5f4d85595a004b4a72c881893379d404da5b0c/xonsh/completer.py#L288), changes to the [CompletionContextParser](https://github.com/xonsh/xonsh/blob/e... | 2024-07-25T15:49:45Z | 2024-07-27T15:33:35Z | ["tests/test_completer.py::test_sanity", "tests/test_completer.py::test_cursor_after_closing_quote_override", "tests/test_completer.py::test_non_exclusive[None-exp2]", "tests/test_completer.py::test_non_exclusive[middle_result1-exp1]", "tests/test_completer.py::test_non_exclusive[middle_result0-exp0]", "tests/test_comp... | [] | ["tests/test_completer.py::test_env_completer_sort", "tests/test_completer.py::test_python_only_context"] | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12", "pip_packages": ["certifi==2024.7.4", "charset-normalizer==3.3.2", "coverage==7.6.0", "distlib==0.3.8", "docutils==0.21.2", "filelock==3.15.4", "idna==3.7", "iniconfig==2.0.0", "packaging==24.1", "platformdirs==4.2.2", "pluggy==1.5.0", "prompt-to... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-5629 | aed574004df082de962d889af1776f149c75727d | diff --git a/news/fix_autocd.rst b/news/fix_autocd.rst
new file mode 100644
index 0000000000..5a0cd4d4c7
--- /dev/null
+++ b/news/fix_autocd.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* <news item>
+
+**Deprecated:**
+
+* <news item>
+
+**Removed:**
+
+* <news item>
+
+**Fixed:**
+
+* Fixed ``... | diff --git a/tests/procs/test_specs.py b/tests/procs/test_specs.py
index 5759230a35..4c1fdd50fe 100644
--- a/tests/procs/test_specs.py
+++ b/tests/procs/test_specs.py
@@ -577,3 +577,12 @@ def _midground(args, decorators=None):
assert spec.cmd == ["sudo", "echo", "1"]
assert spec.alias_name == "xsudo"
ass... | AUTO_CD broken on 0.18.2
## Current Behavior
Since upgrading to 0.18.2 the autocd functionality seems broken (I'm not sure about the previous, shortlived 0.18.{0,1})
Traceback (if applicable):
<details>
```xsh
yggdrasil@midgard:~ % xonsh --no-rc
yggdrasil@midgard ~ @ ls -d mnt2
mnt2
yggdrasil@midgard ~ @ ... | Nice catch! We really have massive refactoring in 0.18 and this behavior need to additional test implemented in test system. Thank you for reporting this! | 2024-07-24T16:38:25Z | 2024-07-24T17:00:53Z | ["tests/procs/test_specs.py::test_specs_with_suspended_captured_process_pipeline[suspended_pipeline0]", "tests/procs/test_specs.py::test_capture_always[True-True-exec-False]", "tests/procs/test_specs.py::test_capture_always[True-False-exec-True]", "tests/procs/test_specs.py::test_cmds_to_specs_thread_subproc", "tests/p... | [] | ["tests/procs/test_specs.py::test_auto_cd"] | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.7.4", "charset-normalizer==3.3.2", "coverage==7.6.0", "distlib==0.3.8", "docutils==0.21.2", "filelock==3.15.4", "idna==3.7", "iniconfig==2.0.0", "packaging==24.1", "platformdirs==4.2.2", "pluggy==1.5.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-5594 | 38e9397f38ad3b20d682099a434014407249a15d | diff --git a/news/exit_n.rst b/news/exit_n.rst
new file mode 100644
index 0000000000..4a3955793f
--- /dev/null
+++ b/news/exit_n.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* Builtin: ``exit`` can return exit code e.g. ``exit 71``.
+
+**Changed:**
+
+* <news item>
+
+**Deprecated:**
+
+* <news item>
+
+**Removed:**
+
+* <news ... | diff --git a/tests/test_integrations.py b/tests/test_integrations.py
index 191831dbc8..3fa30ca478 100644
--- a/tests/test_integrations.py
+++ b/tests/test_integrations.py
@@ -992,8 +992,18 @@ def _echo(args):
@pytest.mark.parametrize(
"cmd, exp_rtn",
[
+ ("2+2", 0),
("import sys; sys.exit(0)"... | Implement `exit N`
If xonsh is set as default user shell, cockpit fails to login with “permission denied”.
Cockpit developers say Shell is supported only if `exit 71` returns 71.
See https://github.com/cockpit-project/cockpit/issues/20741
Is there any way to satisfy Cockpit with a xonsh macro or any hack? How ... | 2024-07-11T10:38:11Z | 2024-07-14T14:13:06Z | ["tests/test_integrations.py::test_spec_modifier_alias", "tests/test_integrations.py::test_aliases_print[case10]", "tests/test_integrations.py::test_argv0", "tests/test_integrations.py::test_xonshrc[-i script.xsh-.*CONFIG_XONSH_RC_XSH.*HOME_XONSHRC.*CONFIG_XONSH_RCD.*CONFIG_XONSH_PY_RCD.*SCRIPT.*]", "tests/test_integra... | [] | ["tests/test_integrations.py::test_single_command_return_code[exit unknown-1]", "tests/test_integrations.py::test_single_command_return_code[__xonsh__.exit=100-100]", "tests/test_integrations.py::test_single_command_return_code[exit 100-100]"] | ["tests/test_integrations.py::test_xonsh_no_close_fds"] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.7.4", "charset-normalizer==3.3.2", "coverage==7.6.0", "distlib==0.3.8", "docutils==0.21.2", "filelock==3.15.4", "idna==3.7", "iniconfig==2.0.0", "packaging==24.1", "platformdirs==4.2.2", "pluggy==1.5.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval | |
xonsh/xonsh | xonsh__xonsh-5473 | 645c335fc6cf3088feb6e657b298d01929e23e55 | diff --git a/docs/tutorial.rst b/docs/tutorial.rst
index 30cf8a1eaa..0a39737e93 100644
--- a/docs/tutorial.rst
+++ b/docs/tutorial.rst
@@ -1275,7 +1275,7 @@ functions. If you don't know what these do, you probably don't need them.
Aliases
-==============================
+=======
Another important xonsh built-in i... | diff --git a/tests/procs/test_specs.py b/tests/procs/test_specs.py
index 1cf74dbc5b..b307fc070a 100644
--- a/tests/procs/test_specs.py
+++ b/tests/procs/test_specs.py
@@ -183,6 +183,7 @@ def test_interrupted_process_returncode(xonsh_session, captured, interactive):
@skip_if_on_windows
+@pytest.mark.flaky(reruns=3,... | Question: how make sudo expand aliases?
What is the official way to make sudo expand aliases, like `alias sudo='sudo '` on bash?
This is what I tried:
```xsh
$ACTUAL_SUDO = $(which sudo)
def sudo_expanding_aliases(args):
$ACTUAL_SUDO @(aliases.eval_alias(args))
aliases['sudo'] = sudo_expanding_aliases
del ... | 2024-06-01T20:20:36Z | 2024-07-11T23:35:21Z | [] | [] | ["tests/procs/test_specs.py::test_specs_with_suspended_captured_process_pipeline[suspended_pipeline0]", "tests/procs/test_specs.py::test_capture_always[True-True-exec-False]", "tests/procs/test_specs.py::test_capture_always[True-False-exec-True]", "tests/test_aliases.py::test_recursive_callable_partial_handles", "tests... | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.7.4", "charset-normalizer==3.3.2", "coverage==7.6.0", "distlib==0.3.8", "docutils==0.21.2", "filelock==3.15.4", "idna==3.7", "iniconfig==2.0.0", "packaging==24.1", "platformdirs==4.2.2", "pluggy==1.5.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval | |
xonsh/xonsh | xonsh__xonsh-5527 | 2788ae3308c19684a38b971ef9e0e05493c91b01 | diff --git a/news/callias_capture_redirect.rst b/news/callias_capture_redirect.rst
new file mode 100644
index 0000000000..243972f3e3
--- /dev/null
+++ b/news/callias_capture_redirect.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* <news item>
+
+**Deprecated:**
+
+* <news item>
+
+**Removed:**
+
... | diff --git a/tests/procs/test_specs.py b/tests/procs/test_specs.py
index d3ee5f1c37..95178a047e 100644
--- a/tests/procs/test_specs.py
+++ b/tests/procs/test_specs.py
@@ -150,6 +150,25 @@ def test_capture_always(
assert exp in capfd.readouterr().out
+@skip_if_on_windows
+@pytest.mark.flaky(reruns=3, reruns_del... | Capture stdout from callable alias in case of redirecting output
## Question
How do you correctly link stdout/stderr when calling external shell commands in custom commands so the output can be passed to the stdin of the external command, allowing it to react correctly?
The minimal case:
```xsh
@aliases.register('a... | hey! You're doing nice thing!
Hmm, for me it looks like a bug because:
```xsh
@aliases.register('a')
def _a():
print("1-hello")
echo 2-hello
$(a)
# '1-hello\n2-hello\n' # Catching stdout is working well in captured subprocess operator.
```
As workaround 1:
```xsh
@aliases.register('a')
def... | 2024-06-22T19:44:21Z | 2024-07-02T07:30:07Z | ["tests/procs/test_specs.py::test_specs_with_suspended_captured_process_pipeline[suspended_pipeline0]", "tests/procs/test_specs.py::test_capture_always[True-True-exec-False]", "tests/procs/test_specs.py::test_capture_always[True-False-exec-True]", "tests/procs/test_specs.py::test_cmds_to_specs_thread_subproc", "tests/p... | [] | ["tests/procs/test_specs.py::test_callias_captured_redirect"] | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.6.2", "charset-normalizer==3.3.2", "coverage==7.5.4", "distlib==0.3.8", "docutils==0.21.2", "filelock==3.15.4", "idna==3.7", "iniconfig==2.0.0", "packaging==24.1", "platformdirs==4.2.2", "pluggy==1.5.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-5475 | 6245e460a6841b1bc51382265e4bb9afa8c9ec58 | diff --git a/news/fix_redir.rst b/news/fix_redir.rst
new file mode 100644
index 0000000000..17633337b7
--- /dev/null
+++ b/news/fix_redir.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* <news item>
+
+**Deprecated:**
+
+* <news item>
+
+**Removed:**
+
+* <news item>
+
+**Fixed:**
+
+* Fixed redir... | diff --git a/tests/procs/test_specs.py b/tests/procs/test_specs.py
index edb9e912e3..312579de72 100644
--- a/tests/procs/test_specs.py
+++ b/tests/procs/test_specs.py
@@ -353,6 +353,14 @@ def my_handler(cmd, **kwargs):
assert not fired
+def test_redirect_to_substitution(xession):
+ s = SubprocSpec.build(
+ ... | Main branch regress: redirect to python substitution
```xsh
xonsh --no-rc
echo 1 > @('/tmp/tmp')
# xonsh: None: unable to open file # it's from specs.py:resolve_redirects because parsing is wrong
```
## For community
⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍 comment**
| Hi @yaxollum!
I found that the commit that did breaking changes:
* [Fix parsing of redirect tokens (#5322)](https://github.com/xonsh/xonsh/commit/08ac0d97590567728d1b0fb817c70eeb617766ca) (08ac0d97590567728d1b0fb817c70eeb617766ca, #5322)
Please take a look and add more tests (I'm using [this](https://github.com/xo... | 2024-06-02T10:55:18Z | 2024-06-02T12:53:00Z | ["tests/test_integrations.py::test_aliases_print[case10]", "tests/test_integrations.py::test_argv0", "tests/test_pipelines.py::test_casting[hash(!(nocommand))-1]", "tests/test_integrations.py::test_script[case10]", "tests/test_pipelines.py::test_command_pipeline_capture[!(echo hi | grep x)---]", "tests/test_integration... | [] | ["tests/procs/test_specs.py::test_redirect_to_substitution", "tests/test_integrations.py::test_script[case3]", "tests/test_integrations.py::test_script[case4]"] | ["tests/test_integrations.py::test_xonsh_no_close_fds"] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.6.2", "charset-normalizer==3.3.2", "coverage==7.5.3", "distlib==0.3.8", "docutils==0.21.2", "filelock==3.14.0", "idna==3.7", "iniconfig==2.0.0", "packaging==24.0", "platformdirs==4.2.2", "pluggy==1.5.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-5443 | 2d966fb1b56f2399b9753880744645b62133e982 | diff --git a/docs/aliases.rst b/docs/aliases.rst
index c3da96f0c2..2c2d95fb2e 100644
--- a/docs/aliases.rst
+++ b/docs/aliases.rst
@@ -157,6 +157,13 @@ Manages xonsh configuration information.
.. command-help:: xonsh.xonfig.xonfig_main
+``xthread`` and ``xunthread``
+=============================
+Use ``xthread`` ... | diff --git a/tests/procs/test_specs.py b/tests/procs/test_specs.py
index 80c51b6f1d..7e795e5c34 100644
--- a/tests/procs/test_specs.py
+++ b/tests/procs/test_specs.py
@@ -10,6 +10,7 @@
from xonsh.procs.posix import PopenThread
from xonsh.procs.proxies import STDOUT_DISPATCHER, ProcProxy, ProcProxyThread
from xonsh.p... | Provide command to register unthreadable commands
See #2102
## For community
⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍 comment**
NixOS: coreutils are not captured because unthredable
_Originally posted by @amacfie in https://github.com/xonsh/xonsh/issues/4214#issuecomment-1328288341_:
... |
Might be that something in https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/xonsh.nix (maybe in everything that gets `source`d) is screwing up our piping.
> Might be that something in https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/xonsh.nix (maybe in everything that gets `source... | 2024-05-26T06:57:29Z | 2024-05-28T15:03:46Z | [] | [] | ["tests/procs/test_specs.py::test_specs_with_suspended_captured_process_pipeline[suspended_pipeline0]", "tests/procs/test_specs.py::test_cmds_to_specs_capture_stdout_not_stderr[False]", "tests/procs/test_specs.py::test_on_command_not_found_fires", "tests/procs/test_specs.py::test_subproc_output_format[cmds4-1\\n2\\n3-e... | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.2.2", "charset-normalizer==3.3.2", "coverage==7.5.3", "distlib==0.3.8", "docutils==0.21.2", "filelock==3.14.0", "idna==3.7", "iniconfig==2.0.0", "packaging==24.0", "platformdirs==4.2.2", "pluggy==1.5.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-5423 | 0f25a5a348e5569982d2b579a1bfa34d68df2418 | diff --git a/news/fix_redir.rst b/news/fix_redir.rst
new file mode 100644
index 0000000000..17633337b7
--- /dev/null
+++ b/news/fix_redir.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* <news item>
+
+**Deprecated:**
+
+* <news item>
+
+**Removed:**
+
+* <news item>
+
+**Fixed:**
+
+* Fixed redir... | diff --git a/tests/procs/test_specs.py b/tests/procs/test_specs.py
index 7274f28fcb..80c51b6f1d 100644
--- a/tests/procs/test_specs.py
+++ b/tests/procs/test_specs.py
@@ -300,3 +300,11 @@ def my_handler(cmd, **kwargs):
subproc.run()
assert "command not found: 'xonshcommandnotfound'" in str(expected.value)... | redirection: unable to open file
## Current Behavior
This snippet:
```xsh
xonsh --no-rc
f = p'/tmp/file.tmp'
echo 'abc' > @(f)
```
returns error: `xonsh: ['/tmp/file.tmp']: unable to open file`
## Expected Behavior
The snippet should redirect string 'abc' to file /tmp/file.tmp
## xonfig
<details>
``... | 2024-05-16T12:11:35Z | 2024-05-26T08:57:35Z | ["tests/test_integrations.py::test_aliases_print[case10]", "tests/test_integrations.py::test_argv0", "tests/test_integrations.py::test_script[case10]", "tests/test_integrations.py::test_aliases_print[case7]", "tests/procs/test_specs.py::test_callable_alias_cls[True]", "tests/test_integrations.py::test_redirect_out_to_f... | [] | ["tests/procs/test_specs.py::test_redirect_to_substitution"] | ["tests/test_integrations.py::test_xonsh_no_close_fds"] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.2.2", "charset-normalizer==3.3.2", "coverage==7.5.2", "distlib==0.3.8", "docutils==0.21.2", "filelock==3.14.0", "idna==3.7", "iniconfig==2.0.0", "packaging==24.0", "platformdirs==4.2.2", "pluggy==1.5.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval | |
xonsh/xonsh | xonsh__xonsh-5431 | 9073a4c33ce30beab07f5614691ec143f2dd35b6 | diff --git a/news/env_detype_all.rst b/news/env_detype_all.rst
new file mode 100644
index 0000000000..9af2c8c2c7
--- /dev/null
+++ b/news/env_detype_all.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* Added ``env.detype_all()`` to get all available variables that is possible to detype.
+
+**Changed:**
+
+* <news item>
+
+**Depre... | diff --git a/tests/test_environ.py b/tests/test_environ.py
index f5beebb3b9..9bf551c2e7 100644
--- a/tests/test_environ.py
+++ b/tests/test_environ.py
@@ -75,6 +75,15 @@ def test_env_detype_no_dict():
assert "YO" not in det
+def test_env_detype_all():
+ env = Env()
+ env._vars["DEFAULT"] = Var.with_defau... | `xonsh.environ.Env().detype()` seems to skip some environment variables otherwise available with string interpolation
## xonfig
<details>
```
+------------------+--------------------------+
| xonsh | 0.11.0 |
| Git SHA | 4af68065 |
| Commit Date | Jan... | **EDIT**: I had some prior confusion `xonsh.environ.Env()` (original env) and `xonsh.environ.XSH.env` (current enviornment)
I've updated my issue to focus more on the missing vars that don't show up in `$(env)`. String interpolation hides most of these issues from daily use 😉
| 2024-05-21T15:46:13Z | 2024-05-22T02:23:12Z | ["tests/test_environ.py::test_register_custom_var_str[0-0]", "tests/test_environ.py::test_thread_local_swap", "tests/test_environ.py::test_lscolors_events[tw-None-new_in2-create new key]", "tests/test_environ.py::test_register_custom_var_str[27.0-27.0]", "tests/test_environ.py::test_register_custom_var_bool[lol-True]",... | [] | ["tests/test_environ.py::test_env_detype_all"] | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.2.2", "charset-normalizer==3.3.2", "coverage==7.5.1", "distlib==0.3.8", "docutils==0.21.2", "filelock==3.14.0", "idna==3.7", "iniconfig==2.0.0", "packaging==24.0", "platformdirs==4.2.2", "pluggy==1.5.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-5366 | 55b341d47753967c70a4dcf9ff30690877f66048 | diff --git a/news/funcalias.rst b/news/funcalias.rst
new file mode 100644
index 0000000000..895388b78b
--- /dev/null
+++ b/news/funcalias.rst
@@ -0,0 +1,24 @@
+**Added:**
+
+* Added FuncAlias to process callable aliases.
+* Added alias name printing in case of exception in alias.
+
+**Changed:**
+
+* <news item>
+
+**D... | diff --git a/tests/test_aliases.py b/tests/test_aliases.py
index da2b1eac10..a2c0e45a34 100644
--- a/tests/test_aliases.py
+++ b/tests/test_aliases.py
@@ -9,7 +9,7 @@
from xonsh.aliases import Aliases, ExecAlias
-def cd(args, stdin=None, **kwargs):
+def cd(args, stdin=None):
return args
@@ -30,10 +30,11 @... | Show alias function description using superhelp
Enrich [superhelp](https://xon.sh/tutorial.html#help-superhelp-with) by showing the alias function description.
```xsh
@aliases.register("hello")
def _alias_hello():
"""Show world."""
print('world')
hello
# world
# Now:
hello?
# Unknown locale, ass... | 2024-04-25T16:57:55Z | 2024-05-13T13:11:59Z | ["tests/test_tools.py::test_is_int[inp5-False]", "tests/test_tools.py::test_subproc_toks_and_or[x-or-y]", "tests/test_tools.py::test_replace_logical_line[x = 14 + 2-0-x = 14 + 2-1]", "tests/test_tools.py::test_set_to_pathsep[inp3-a:b:c]", "tests/test_tools.py::test_subproc_toks_and_paren", "tests/test_integrations.py::... | [] | ["tests/test_integrations.py::test_aliases_print[case9]", "tests/test_integrations.py::test_aliases_print[case7]", "tests/test_integrations.py::test_aliases_print[case0]", "tests/test_integrations.py::test_aliases_print[case4]", "tests/test_integrations.py::test_aliases_print[case1]", "tests/test_integrations.py::test_... | ["tests/test_integrations.py::test_xonsh_no_close_fds"] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.2.2", "charset-normalizer==3.3.2", "coverage==7.5.1", "distlib==0.3.8", "docutils==0.21.2", "filelock==3.14.0", "idna==3.7", "iniconfig==2.0.0", "packaging==24.0", "platformdirs==4.2.1", "pluggy==1.5.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval | |
xonsh/xonsh | xonsh__xonsh-5396 | cdc1d602a243ca84346278ebac18f49bfde903de | diff --git a/news/main_d.rst b/news/main_d.rst
new file mode 100644
index 0000000000..ea5660f9a4
--- /dev/null
+++ b/news/main_d.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* <news item>
+
+**Deprecated:**
+
+* <news item>
+
+**Removed:**
+
+* <news item>
+
+**Fixed:**
+
+* Fixed ``xonsh -DVAR=... | diff --git a/tests/test_integrations.py b/tests/test_integrations.py
index bdc303313c..deccff8bf3 100644
--- a/tests/test_integrations.py
+++ b/tests/test_integrations.py
@@ -49,6 +49,7 @@ def run_xonsh(
single_command=False,
interactive=False,
path=None,
+ add_args: list = None,
):
env = dict(o... | Run xonsh with `-DVAR VAL`: ValueError: not enough values to unpack
```xsh
xonsh --no-rc --no-env -DCOLOR_OUTPUT 0 # space between -DVAR and VALUE
```
```xsh
Traceback (most recent call last):
File "/Users/pc/.local/xonsh-env/lib/python3.12/site-packages/xonsh/main.py", line 478, in main
args = premain(arg... | 2024-05-06T09:52:23Z | 2024-05-06T12:09:10Z | ["tests/test_integrations.py::test_script[case11]", "tests/test_integrations.py::test_script[case17]", "tests/test_integrations.py::test_argv0", "tests/test_integrations.py::test_script[case23]", "tests/test_integrations.py::test_script[case10]", "tests/test_integrations.py::test_subshells[\\nwith open('tttt', 'w') as ... | [] | ["tests/test_integrations.py::test_main_d"] | ["tests/test_integrations.py::test_xonsh_no_close_fds"] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.2.2", "charset-normalizer==3.3.2", "coverage==7.5.1", "distlib==0.3.8", "docutils==0.21.2", "filelock==3.14.0", "idna==3.7", "iniconfig==2.0.0", "packaging==24.0", "platformdirs==4.2.1", "pluggy==1.5.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval | |
xonsh/xonsh | xonsh__xonsh-5391 | c3cd47e1da46c94e8678a389d5c758311cfb8f24 | diff --git a/news/fix_process_traceback.rst b/news/fix_process_traceback.rst
new file mode 100644
index 0000000000..4a2b8fddfb
--- /dev/null
+++ b/news/fix_process_traceback.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* <news item>
+
+**Deprecated:**
+
+* <news item>
+
+**Removed:**
+
+* <news ... | diff --git a/tests/test_integrations.py b/tests/test_integrations.py
index 25b6aad660..bdc303313c 100644
--- a/tests/test_integrations.py
+++ b/tests/test_integrations.py
@@ -3,6 +3,7 @@
"""
import os
+import re
import shutil
import subprocess as sp
import tempfile
@@ -995,3 +996,47 @@ def test_run_fail_not_on_p... | Empty stack trace when XONSH_SHOW_TRACEBACK=False and RAISE_SUBPROC_ERROR=True
```xsh
$XONSH_SHOW_TRACEBACK = False
$RAISE_SUBPROC_ERROR = True
ls 123
# ls: 123: No such file or directory
# Traceback (most recent call last):
# File "<stdin>", line 1, in <module>
#
sleep 10
# ^C
# Traceback (most recent ... | 2024-05-03T23:14:18Z | 2024-05-04T09:50:32Z | ["tests/test_integrations.py::test_script[case11]", "tests/test_integrations.py::test_script[case17]", "tests/test_integrations.py::test_argv0", "tests/test_integrations.py::test_script[case23]", "tests/test_integrations.py::test_script[case10]", "tests/test_integrations.py::test_subshells[\\nwith open('tttt', 'w') as ... | [] | ["tests/test_integrations.py::test_raise_subproc_error_with_show_traceback[True]", "tests/test_integrations.py::test_raise_subproc_error_with_show_traceback[False]"] | ["tests/test_integrations.py::test_xonsh_no_close_fds"] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.2.2", "charset-normalizer==3.3.2", "coverage==7.5.1", "distlib==0.3.8", "docutils==0.21.2", "filelock==3.14.0", "idna==3.7", "iniconfig==2.0.0", "packaging==24.0", "platformdirs==4.2.1", "pluggy==1.5.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval | |
xonsh/xonsh | xonsh__xonsh-5380 | a5f0308a5a27b1ca48e0b2b0bdf18b61e618754f | diff --git a/news/waitpid_returncode.rst b/news/waitpid_returncode.rst
new file mode 100644
index 0000000000..98566e8392
--- /dev/null
+++ b/news/waitpid_returncode.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* <news item>
+
+**Deprecated:**
+
+* <news item>
+
+**Removed:**
+
+* <news item>
+
+... | diff --git a/tests/procs/test_specs.py b/tests/procs/test_specs.py
index f2591e74be..402707e8b3 100644
--- a/tests/procs/test_specs.py
+++ b/tests/procs/test_specs.py
@@ -1,6 +1,7 @@
"""Tests the xonsh.procs.specs"""
import itertools
+import signal
import sys
from subprocess import Popen
@@ -8,7 +9,12 @@
fro... | Implement pipefail and errexit
I want to know when a command other then the last command in the pipeline fails for any reason. If a command in the middle of a pipeline fails, the last command simply sees a EOF in its stdin. In many cases this will result in the last command returning success. Silently ignoring such err... | More context:
Executing an external command can fail for a million different reasons. Here are some examples:
1. The external command is not installed
2. It encounters an internal bug and [fails fast and loud](https://en.wikipedia.org/wiki/Fail-fast)
3. It receives bad input due to a bug in my script
4. An admin k... | 2024-05-01T07:11:37Z | 2024-05-02T20:10:53Z | [] | [] | ["tests/procs/test_specs.py::test_cmds_to_specs_capture_stdout_not_stderr[False]", "tests/procs/test_specs.py::test_on_command_not_found_fires", "tests/procs/test_specs.py::test_subproc_output_format[cmds4-1\\n2\\n3-exp_list_lines4]", "tests/procs/test_specs.py::test_capture_always[True-True-exec-False]", "tests/procs/... | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.2.2", "charset-normalizer==3.3.2", "coverage==7.5.0", "distlib==0.3.8", "docutils==0.21.2", "filelock==3.14.0", "idna==3.7", "iniconfig==2.0.0", "packaging==24.0", "platformdirs==4.2.1", "pluggy==1.5.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-5377 | c3a12b2a9c2958ce2a8e97a59b41f030f24cb45c | diff --git a/docs/bash_to_xsh.rst b/docs/bash_to_xsh.rst
index 919ef266e8..f6aae62d69 100644
--- a/docs/bash_to_xsh.rst
+++ b/docs/bash_to_xsh.rst
@@ -31,6 +31,9 @@ line is ``#!/usr/bin/env xonsh``.
There is no notion of an escaping character in xonsh like the backslash (``\``) in bash.
Single or doub... | diff --git a/tests/procs/test_specs.py b/tests/procs/test_specs.py
index dedff4ac3a..f2591e74be 100644
--- a/tests/procs/test_specs.py
+++ b/tests/procs/test_specs.py
@@ -80,7 +80,7 @@ def test_capture_always(
exp = "HELLO\nBYE\n"
cmds = [["echo", "-n", exp]]
if pipe:
- exp = exp.splitlines()[1] +... | Re-thinking the command substitution operators
# Abstract
This is a proposal for re-designing the command substitution (a.k.a command pipelines) mechanisms in xonsh.
A simple example for command substitution in bash:
```bash
echo hi $(whoami)
```
#### NOTE: This example is very basic and naïve. Please look ... | Hi @daniel-shimon, this has been discussed (and rejected) several times already. The reasoning, if I remember correctly, was that the trailing newline is part of the captured output and therefore should be kept as is. What if the terminating newline character is significant to your pipeline? For instance `echo "foo" | ... | 2024-04-29T22:07:19Z | 2024-05-02T15:48:25Z | ["tests/test_pipelines.py::test_casting[hash(!(nocommand))-1]", "tests/test_integrations.py::test_argv0", "tests/test_integrations.py::test_script[case10]", "tests/test_pipelines.py::test_command_pipeline_capture[!(echo hi | grep x)---]", "tests/procs/test_specs.py::test_callable_alias_cls[True]", "tests/test_integrati... | [] | ["tests/procs/test_specs.py::test_capture_always[True-False-exec-True]", "tests/procs/test_specs.py::test_specs_resolve_args_list", "tests/test_pipelines.py::test_command_pipeline_capture[!(echo hi | grep h)-hi--hi\\n]", "tests/procs/test_specs.py::test_capture_always[True-True-func-True]", "tests/test_pipelines.py::te... | ["tests/test_integrations.py::test_xonsh_no_close_fds"] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.2.2", "charset-normalizer==3.3.2", "coverage==7.5.0", "distlib==0.3.8", "docutils==0.21.2", "filelock==3.14.0", "idna==3.7", "iniconfig==2.0.0", "packaging==24.0", "platformdirs==4.2.1", "pluggy==1.5.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-5349 | e30dd960e2ec91b2df71ec95417a8b97645fb898 | diff --git a/news/path_imp.rst b/news/path_imp.rst
new file mode 100644
index 0000000000..20704b3278
--- /dev/null
+++ b/news/path_imp.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* Added PATH.prepend(path) to add path to the beginning.
+
+**Changed:**
+
+* EnvPath methods (append, remove, add, insert) prepare the path before a... | diff --git a/tests/test_tools.py b/tests/test_tools.py
index f37edc0e6f..0cddc26532 100644
--- a/tests/test_tools.py
+++ b/tests/test_tools.py
@@ -1014,6 +1014,46 @@ def test_env_path_add_pathlib():
]
+def test_env_path_append_remove_pathlib_path():
+ path = EnvPath()
+
+ # Append-remove
+ path.append... | Can't remove Path objects from $PATH
If you add a `Path` object to `$PATH`, it is coerced to a string. However, the same coercion doesn't happen with `.remove()`
For example, this fails:
```
🐚 $PATH.append(p"~/node_modules/.bin")
🐚 $PATH.remove(p"~/node_modules/.bin")
ValueError
```
(The work-around is t... | If anybody wants to add the path temporarily there is `swap`:
```python
print($PATH)
with ${...}.swap(PATH=$PATH+[p"~/node_modules/.bin"]):
print($PATH)
print($PATH)
# ['/bin', '/usr/games', '/usr/local/games', '/snap/bin']
# ['/bin', '/usr/games', '/usr/local/games', '/snap/bin', PosixPath('/home/user/n... | 2024-04-20T19:29:48Z | 2024-04-21T08:03:42Z | ["tests/test_tools.py::test_is_bool_or_int[True-True]", "tests/test_tools.py::test_deprecated_docstrings_with_empty_docstring[arguments3-my_function has been deprecated]", "tests/test_tools.py::test_is_completions_display_value[-False]", "tests/test_tools.py::test_env_path_with_pathlib_path_objects[inp5-exp5]", "tests/... | [] | ["tests/test_tools.py::test_env_path_append_remove_pathlib_path", "tests/test_tools.py::test_is_tok_color_dict[val4-False]"] | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.2.2", "charset-normalizer==3.3.2", "coverage==7.4.4", "distlib==0.3.8", "docutils==0.21.1", "filelock==3.13.4", "idna==3.7", "iniconfig==2.0.0", "packaging==24.0", "platformdirs==4.2.0", "pluggy==1.5.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-5326 | 08ac0d97590567728d1b0fb817c70eeb617766ca | diff --git a/news/brackets-in-args.rst b/news/brackets-in-args.rst
new file mode 100644
index 0000000000..1478e6c574
--- /dev/null
+++ b/news/brackets-in-args.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* Square brackets can now be used in command arguments without quotes (e.g. `echo a[b]`)
+
+**Changed:**
+
+* <news item>
+
+... | diff --git a/tests/test_parser.py b/tests/test_parser.py
index ae57dfa2a6..ee131ed8ee 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -2649,6 +2649,25 @@ def test_echo_slash_question(check_xonsh_ast):
check_xonsh_ast({}, "![echo /?]", False)
+@pytest.mark.parametrize(
+ "case",
+ [
+ ... | Syntax errors in subprocess commands containing []
I am trying to run a command which should be getting passed to a subprocess (in this case rake). The command itself includes square brackets (`[]`) which results in a traceback.
The command: `rake so_thing[some,parameters]`
The error:
<details>
```
Traceback... | This also happens with pip+extras.
I assumed that would be the case. I tried wrapping it in a subprocess call (`$[rake do_stuff[foo,bar]]`) but got the same traceback.
The work around would be `rake "do_stuff[foo,bar]"`, but I think this is common enough to be a bug. (Assuming the parser guys think it's doable.)
I was ... | 2024-04-08T19:37:32Z | 2024-04-09T17:03:43Z | ["tests/test_parser.py::test_lambda_x_kwy", "tests/test_parser.py::test_macro_call_one_trailing[if True:\\n pass]", "tests/test_parser.py::test_syntax_error_assign_lambda", "tests/test_parser.py::test_syntax_error_augassign_ops[-x]", "tests/test_parser.py::test_macro_call_three_args[(x,y)-x=10-if True:\\n pass]", "te... | [] | ["tests/test_parser.py::test_echo_brackets[a[b]]", "tests/test_parser.py::test_echo_brackets[a[b[c]]]", "tests/test_parser.py::test_echo_brackets[[a]b[[]c[d,e]f[]g,h]]", "tests/test_parser.py::test_echo_brackets[a[b]c]", "tests/test_parser.py::test_echo_brackets[[a]b]", "tests/test_parser.py::test_echo_brackets[[[]]]",... | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.2.2", "charset-normalizer==3.3.2", "coverage==7.4.4", "distlib==0.3.8", "docutils==0.21", "filelock==3.13.4", "idna==3.6", "iniconfig==2.0.0", "packaging==24.0", "platformdirs==4.2.0", "pluggy==1.4.0", "prompt-to... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-5322 | 7461c507b210d1492cac6d2f517ba459ec86bea8 | diff --git a/news/fix-redirect-structure.rst b/news/fix-redirect-structure.rst
new file mode 100644
index 0000000000..a84244a867
--- /dev/null
+++ b/news/fix-redirect-structure.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* <news item>
+
+**Deprecated:**
+
+* <news item>
+
+**Removed:**
+
+* <ne... | diff --git a/tests/test_integrations.py b/tests/test_integrations.py
index 84cdecbabc..d689a29160 100644
--- a/tests/test_integrations.py
+++ b/tests/test_integrations.py
@@ -886,6 +886,27 @@ def _echo(args):
assert out == exp
+@skip_if_no_xonsh
+@pytest.mark.parametrize(
+ "cmd, exp",
+ [
+ ("ech... | Unable to pass a single ">" as an argument
`echo spam ">" eggs` is handled and executed exactly the same as `echo spam > eggs`.
I think this is because of how data is sent to `cmd_to_specs()` eg both are passed as `['echo', 'spam', '>', 'eggs']`.
Also:
* `echo spam @(">") eggs`
## For community
⬇️ **Please ... | 2024-04-04T22:34:32Z | 2024-04-05T07:51:54Z | ["tests/test_integrations.py::test_argv0", "tests/test_lexer.py::test_float_literals[1e10]", "tests/test_integrations.py::test_script[case10]", "tests/test_lexer.py::test_pipe", "tests/test_lexer.py::test_redir_whitespace[>]", "tests/test_lexer.py::test_float_literals[.0]", "tests/test_lexer.py::test_assignment", "test... | ["tests/test_integrations.py::test_script[case2] - assert 'The Truth is ...", "tests/test_integrations.py::test_subshells[\\nwith open('tttt', 'w') as fp:\\n fp.write(\"Wow mom!\\\\n\")\\n\\n(wc) < tttt\\n-None- 1 2 9 <stdin>\\n]", "tests/test_integrations.py::test_script[case17]", "tests/test_integrations.py::test... | ["tests/test_lexer.py::test_ioredir2[2>1]", "tests/test_lexer.py::test_ioredir1[all>]", "tests/test_integrations.py::test_redirect_argument[echo '2>1'-2>1\\n]", "tests/test_lexer.py::test_ioredir1[out>]", "tests/test_lexer.py::test_ioredir1[e>]", "tests/test_integrations.py::test_redirect_argument[echo '>'->\\n]", "tes... | ["tests/test_integrations.py::test_xonsh_no_close_fds"] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.2.2", "charset-normalizer==3.3.2", "coverage==7.4.4", "distlib==0.3.8", "docutils==0.20.1", "filelock==3.13.3", "idna==3.6", "iniconfig==2.0.0", "packaging==24.0", "platformdirs==4.2.0", "pluggy==1.4.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval | |
xonsh/xonsh | xonsh__xonsh-5013 | 04cba39a53ccb7bb8e8a5a23939ed8d000687d6b | diff --git a/news/fix-pymode-ioredirect.rst b/news/fix-pymode-ioredirect.rst
new file mode 100644
index 0000000000..719727694a
--- /dev/null
+++ b/news/fix-pymode-ioredirect.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* <news item>
+
+**Deprecated:**
+
+* <news item>
+
+**Removed:**
+
+* <news ... | diff --git a/tests/test_lexer.py b/tests/test_lexer.py
index 3f3804d6be..c707c1cc5f 100644
--- a/tests/test_lexer.py
+++ b/tests/test_lexer.py
@@ -477,3 +477,36 @@ def test_tolerant_lexer(s):
lexer.input(s)
error_tokens = list(tok for tok in lexer if tok.type == "ERRORTOKEN")
assert all(tok.value in s fo... | Expression `2>0` not parsed correctly
When I enter the expression `2>0` in a Xonsh shell, I would expect it to evaluate it as a boolean and print `True` - that is what Python does. Instead, Xonsh attempts to parse it as a subprocess command and gives an error:
```
xonsh.tools.XonshError: xonsh: subprocess mode: comma... | 2022-12-15T02:25:20Z | 2024-04-04T10:34:54Z | ["tests/test_lexer.py::test_single_f_string_literal", "tests/test_lexer.py::test_not_really_and_pre_post", "tests/test_lexer.py::test_tolerant_lexer[\"]", "tests/test_lexer.py::test_float_literals[0.]", "tests/test_lexer.py::test_ioredir[o>]", "tests/test_lexer.py::test_ioredir[err>out]", "tests/test_lexer.py::test_tri... | [] | ["tests/test_lexer.py::test_pymode_not_ioredirect[36+2>>3-exp3]", "tests/test_lexer.py::test_pymode_not_ioredirect[2>1-exp0]", "tests/test_lexer.py::test_pymode_not_ioredirect[3>2>1-exp2]", "tests/test_lexer.py::test_pymode_not_ioredirect[a>b-exp1]", "tests/test_lexer.py::test_tolerant_lexer[\"\"\"]"] | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.12.7", "pip_packages": ["certifi==2024.2.2", "charset-normalizer==3.3.2", "coverage==7.4.4", "distlib==0.3.8", "docutils==0.20.1", "filelock==3.13.3", "idna==3.6", "iniconfig==2.0.0", "packaging==24.0", "platformdirs==4.2.0", "pluggy==1.4.0", "prompt-... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval | |
xonsh/xonsh | xonsh__xonsh-5211 | 5305b54257072ba7b10fd08c46d75d1eb76b5bb5 | diff --git a/news/fix-cd-home-no-os-environ.rst b/news/fix-cd-home-no-os-environ.rst
new file mode 100644
index 0000000000..3a59ff4ca3
--- /dev/null
+++ b/news/fix-cd-home-no-os-environ.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* <news item>
+
+**Deprecated:**
+
+* <news item>
+
+**Removed:**... | diff --git a/tests/test_dirstack.py b/tests/test_dirstack.py
index 3f9a0f8c1d..c106061d68 100644
--- a/tests/test_dirstack.py
+++ b/tests/test_dirstack.py
@@ -101,3 +101,16 @@ def test_cd_autopush(xession, tmpdir):
dirstack.popd([])
assert old_dir == os.getcwd()
+
+
+def test_cd_home(xession, tmpdir... | cd only respects HOME from os.environ and not XSH $HOME
## Expected Behavior
Set the $HOME variable, for example /tmp
$HOME = "/tmp"
then call 'cd' by itself, pwd should read /tmp
## Current Behavior
$HOME = "/tmp"
then call "cd", pwd will be equal to os.environ['HOME']
I am on Ubuntu, this happens for the ... | I can reproduce:
```xsh
$UPDATE_OS_ENVIRON
# False
$HOME = '/tmp'
cd
pwd
# /home/user # Expected: /tmp
$UPDATE_OS_ENVIRON = True
$HOME = '/tmp'
cd
pwd
# /tmp # As expected
```
It looks this question about defaults. Should UPDATE_OS_ENVIRON be True by default or not. What side effects will be if so... | 2023-09-24T02:36:49Z | 2023-09-25T08:53:16Z | ["tests/test_dirstack.py::test_cdpath_simple", "tests/test_dirstack.py::test_cdpath_expansion", "tests/test_dirstack.py::test_simple", "tests/test_dirstack.py::test_cdpath_collision", "tests/test_dirstack.py::test_cdpath_events"] | [] | ["tests/test_dirstack.py::test_cd_home", "tests/test_dirstack.py::test_cd_autopush"] | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.11", "pip_packages": ["coverage==7.3.1", "distlib==0.3.7", "docutils==0.20.1", "filelock==3.12.4", "iniconfig==2.0.0", "packaging==23.1", "platformdirs==3.10.0", "pluggy==1.3.0", "prompt-toolkit==3.0.39", "pygments==2.16.1", "pyte==0.8.1", "pytest==7.... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-4973 | 9c1a751fee6263c0c23552c810e1cb4c88ec3bf5 | diff --git a/news/Fix assigning dictionary to XONSH_STYLE_OVERRIDES variable.rst b/news/Fix assigning dictionary to XONSH_STYLE_OVERRIDES variable.rst
new file mode 100644
index 0000000000..f112b7dee0
--- /dev/null
+++ b/news/Fix assigning dictionary to XONSH_STYLE_OVERRIDES variable.rst
@@ -0,0 +1,23 @@
+**Added:**
+
... | diff --git a/tests/test_tools.py b/tests/test_tools.py
index 09176e4383..41201610a2 100644
--- a/tests/test_tools.py
+++ b/tests/test_tools.py
@@ -61,6 +61,7 @@
is_string,
is_string_or_callable,
is_string_seq,
+ is_tok_color_dict,
is_writable_file,
logfile_opt_to_str,
path_to_str,
@@ -2... | $XONSH_STYLE_OVERRIDES cannot be assigned dict of {Token: str}
<!--- Provide a general summary of the issue in the Title above -->
## xonfig
<details>
```
+------------------+----------------------+
| xonsh | 0.9.27 |
| Git SHA | 71fe9014 |
| Commit Date |... | Hello, has this issue been fixed yet? If not, I would be interested in working on it.
Hey @IAustin-YangI -- looks like it's still an issue on `main`, so you should definitely feel free to take a crack at it! | 2022-10-21T04:39:08Z | 2022-10-24T14:46:53Z | [] | [] | ["tests/test_tools.py::test_is_bool_or_int[True-True]", "tests/test_tools.py::test_deprecated_docstrings_with_empty_docstring[arguments3-my_function has been deprecated]", "tests/test_tools.py::test_is_completions_display_value[-False]", "tests/test_tools.py::test_env_path_with_pathlib_path_objects[inp5-exp5]", "tests/... | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.11", "pip_packages": ["attrs==22.1.0", "coverage==6.5.0", "distlib==0.3.6", "docutils==0.19", "filelock==3.8.0", "iniconfig==1.1.1", "packaging==21.3", "platformdirs==2.5.2", "pluggy==1.0.0", "prompt-toolkit==3.0.31", "py==1.11.0", "pygments==2.13.0",... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-4920 | 6fa83f830579d2bad39b1842911951f55a9da22c | diff --git a/news/fix-gitstatus-no-git.rst b/news/fix-gitstatus-no-git.rst
new file mode 100644
index 0000000000..d8487e0e47
--- /dev/null
+++ b/news/fix-gitstatus-no-git.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* When there is no git repository, the values of all ``gitstatus`` prompt fields... | diff --git a/tests/prompt/test_gitstatus.py b/tests/prompt/test_gitstatus.py
index ce20044e7d..72e780df6f 100644
--- a/tests/prompt/test_gitstatus.py
+++ b/tests/prompt/test_gitstatus.py
@@ -79,19 +79,14 @@ def test_gitstatus_clean(prompts, fake_proc):
def test_no_git(prompts, fake_process, tmp_path):
os.chdir(tm... | {gitstatus: {}} is no longer autohiding gitstatus
`{gitstatus: {}}` in my right prompt no longer hides itself when I'm not in a git repository.
## xonfig
<details>
```
$ xonfig
+------------------+---------------------+
| xonsh | 0.13.0 |
| Python | 3.10.5 |
... | Related to #4697
@jnoortheen please take a look
Thanks @jnoortheen. @t184256 please update from master!
Hm, not quite:
```
$ xonsh --no-rc
$ $RIGHT_PROMPT='<{gitstatus: {}}>'
$ $PROMPT_FIELDS['gitstatus'].fragments = () < >
$ < >
``... | 2022-08-13T14:54:12Z | 2022-08-17T04:38:02Z | ["tests/prompt/test_gitstatus.py::test_gitstatus_dirty[hidden0-{CYAN}gitstatus-opt\\u2191\\xb77\\u2193\\xb72{RESET}|{RED}\\u25cf1{RESET}{BLUE}+3{RESET}{BLUE}+49{RESET}{RED}-26{RESET}]", "tests/prompt/test_gitstatus.py::test_gitstatus_dirty[hidden1-{CYAN}gitstatus-opt\\u2191\\xb77\\u2193\\xb72{RESET}|{RED}\\u25cf1{RESET... | [] | ["tests/prompt/test_gitstatus.py::test_no_git", "tests/prompt/test_gitstatus.py::test_gitstatus_clean"] | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.10", "pip_packages": ["attrs==22.1.0", "coverage==6.4.4", "distlib==0.3.5", "docutils==0.19", "filelock==3.8.0", "iniconfig==1.1.1", "packaging==21.3", "platformdirs==2.5.2", "pluggy==1.0.0", "prompt-toolkit==3.0.30", "py==1.11.0", "pygments==2.13.0",... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-4919 | ffe7b3445cf64b25a741d214581d57871196fd34 | diff --git a/news/fix-procproxy-capture.rst b/news/fix-procproxy-capture.rst
new file mode 100644
index 0000000000..8d71c963a5
--- /dev/null
+++ b/news/fix-procproxy-capture.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* With ``$THREAD_SUBPROCS=False``: When a callable alias is executed with ``!... | diff --git a/tests/procs/test_specs.py b/tests/procs/test_specs.py
index bb22d9c46c..826b867b7d 100644
--- a/tests/procs/test_specs.py
+++ b/tests/procs/test_specs.py
@@ -166,3 +166,18 @@ def __call__(self, *args, **kwargs):
spec = cmds_to_specs(cmds, captured="stdout")[0]
proc = spec.run()
assert proc.f... | bug: no error message in cd when $THREAD_SUBPROCS is False
<!--- Provide a general summary of the issue in the Title above -->
<!--- If you have a question along the lines of "How do I do this Bash command in xonsh"
please first look over the Bash to Xonsh translation guide: https://xon.sh/bash_to_xsh.html
If you do... | After further investigation it seems that it is not due to bashisms at all sorry.
I removed and readded things in my xonshrc and found out that it was due to the way I started X in xonshrc (linked possibly to https://github.com/xonsh/xonsh/issues/1156).
I don't know why but at some point, removing bashism also sol... | 2022-08-11T03:13:29Z | 2022-08-11T17:20:21Z | ["tests/procs/test_specs.py::test_cmds_to_specs_capture_stdout_not_stderr[False]", "tests/procs/test_specs.py::test_capture_always[True-True-exec-False]", "tests/procs/test_specs.py::test_capture_always[True-False-exec-True]", "tests/procs/test_specs.py::test_run_subproc_background[object-False]", "tests/procs/test_spe... | [] | ["tests/procs/test_specs.py::test_procproxy_not_captured[hiddenobject]"] | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.10", "pip_packages": ["attrs==22.1.0", "coverage==6.4.3", "distlib==0.3.5", "docutils==0.19", "filelock==3.8.0", "iniconfig==1.1.1", "packaging==21.3", "platformdirs==2.5.2", "pluggy==1.0.0", "prompt-toolkit==3.0.30", "py==1.11.0", "pygments==2.12.0",... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-4916 | cb75d27300cd4e4898ff4bfe82c398080c0d19de | diff --git a/news/fix-term-title-update.rst b/news/fix-term-title-update.rst
new file mode 100644
index 0000000000..88cf5453e0
--- /dev/null
+++ b/news/fix-term-title-update.rst
@@ -0,0 +1,24 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* The terminal's title is updated with the current command's name even if the... | diff --git a/tests/prompt/test_base.py b/tests/prompt/test_base.py
index 1f102ed16e..9b633633b2 100644
--- a/tests/prompt/test_base.py
+++ b/tests/prompt/test_base.py
@@ -4,7 +4,7 @@
import pytest
from xonsh.prompt import env as prompt_env
-from xonsh.prompt.base import PromptFields, PromptFormatter
+from xonsh.pro... | Running swaymsg sometimes fail in xonsh
The `swaymsg` command of the sway window manager seems to sometimes break with xonsh.
## xonfig
<details>
```
+------------------+-----------------+
| xonsh | 0.9.24 |
| Python | 3.9.1 |
| PLY | 3.11 |
... | Can't repeat on Ubuntu.
```python
for i in range(100):
swaymsg -t get_inputs 1>/dev/null
# 100 lines of:
# 00:00:00.009 [swaymsg/main.c:417] Unable to retrieve socket path
```
> Can't repeat on Ubuntu.
>
> ```python
> for i in range(100):
> swaymsg -t get_inputs 1>/dev/null
>
> # 100 lines of:... | 2022-08-09T04:54:43Z | 2022-08-10T04:20:09Z | ["tests/prompt/test_base.py::test_format_prompt_with_various_prepost[]]-]", "tests/prompt/test_base.py::test_promptformatter_clears_cache", "tests/prompt/test_base.py::test_format_prompt_with_invalid_func", "tests/prompt/test_base.py::TestEnvNamePrompt::test_search_order", "tests/prompt/test_base.py::TestPromptFromVenv... | [] | ["tests/prompt/test_job.py::test_current_job", "tests/prompt/test_base.py::test_format_prompt_with_format_spec[{none_pf:{} | }xonsh-xonsh-fields0]"] | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.10", "pip_packages": ["coverage==7.6.0", "distlib==0.3.8", "docutils==0.21.2", "exceptiongroup==1.2.2", "filelock==3.15.4", "iniconfig==2.0.0", "packaging==24.1", "platformdirs==4.2.2", "pluggy==1.5.0", "prompt-toolkit==3.0.47", "pygments==2.18.0", "p... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
xonsh/xonsh | xonsh__xonsh-4907 | 86e4f004e30529f7ef210da9f03ac3223518f85c | diff --git a/news/fix-empty-gitstatus.rst b/news/fix-empty-gitstatus.rst
new file mode 100644
index 0000000000..3a920da1cb
--- /dev/null
+++ b/news/fix-empty-gitstatus.rst
@@ -0,0 +1,23 @@
+**Added:**
+
+* <news item>
+
+**Changed:**
+
+* <news item>
+
+**Deprecated:**
+
+* <news item>
+
+**Removed:**
+
+* <news item>
... | diff --git a/tests/prompt/test_gitstatus.py b/tests/prompt/test_gitstatus.py
index 9e13628b7c..ce20044e7d 100644
--- a/tests/prompt/test_gitstatus.py
+++ b/tests/prompt/test_gitstatus.py
@@ -1,3 +1,5 @@
+import os
+
import pytest
from xonsh.prompt import gitstatus
@@ -14,6 +16,7 @@ def prompts(xession):
fields... | {gitstatus: {}} is no longer autohiding gitstatus
`{gitstatus: {}}` in my right prompt no longer hides itself when I'm not in a git repository.
## xonfig
<details>
```
$ xonfig
+------------------+---------------------+
| xonsh | 0.13.0 |
| Python | 3.10.5 |
... | Related to #4697
@jnoortheen please take a look | 2022-08-03T06:26:56Z | 2022-08-03T13:39:43Z | ["tests/prompt/test_gitstatus.py::test_gitstatus_dirty[hidden0-{CYAN}gitstatus-opt\\u2191\\xb77\\u2193\\xb72{RESET}|{RED}\\u25cf1{RESET}{BLUE}+3{RESET}{BLUE}+49{RESET}{RED}-26{RESET}]", "tests/prompt/test_gitstatus.py::test_gitstatus_dirty[hidden1-{CYAN}gitstatus-opt\\u2191\\xb77\\u2193\\xb72{RESET}|{RED}\\u25cf1{RESET... | [] | ["tests/prompt/test_gitstatus.py::test_no_git", "tests/prompt/test_gitstatus.py::test_gitstatus_clean"] | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.10", "pip_packages": ["coverage==7.6.0", "distlib==0.3.8", "docutils==0.21.2", "exceptiongroup==1.2.2", "filelock==3.15.4", "iniconfig==2.0.0", "packaging==24.1", "platformdirs==4.2.2", "pluggy==1.5.0", "prompt-toolkit==3.0.47", "pygments==2.18.0", "p... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
Maratyszcza/PeachPy | Maratyszcza__PeachPy-130 | 628422aee67650a3a09403390ea639869f6f65af | diff --git a/appveyor.yml b/appveyor.yml
index 960475f..bc86d4b 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,12 +1,19 @@
-version: 0.2.0.{build}
+# appveyor.yml - https://www.appveyor.com/docs/lang/python
+---
+image:
+ - Visual Studio 2022
environment:
matrix:
- PYTHON: C:\Python27-x64
- PYTHON: C:\Py... | diff --git a/codegen/x86_64_nacl_test.py b/codegen/x86_64_nacl_test.py
index c2b1374..87d12ff 100644
--- a/codegen/x86_64_nacl_test.py
+++ b/codegen/x86_64_nacl_test.py
@@ -6,6 +6,8 @@
from codegen.code import CodeWriter, CodeBlock
import operator
import json
+import os
+import six
instruction_set = read_instru... | pytest tests/x86_64/test_load.py is failing
Fixed in #130 with a strict xfail when run on non-x86 hardware.
% `pytest tests/x86_64/test_load.py`
```
================================== test session starts ==================================
platform darwin -- Python 3.10.6, pytest-7.1.3, pluggy-1.0.0
rootdir: /Use... | 2022-09-21T18:30:48Z | 2022-09-27T19:15:59Z | [] | [] | ["(tests.test_literal.UInt32)", "(tests.test_literal.UInt32x16)", "(tests.test_literal.UInt64x2)", "(tests.test_literal.UInt64x8)", "(tests.test_literal.UInt64)", "(tests.test_literal.UInt32x4)", "(tests.test_literal.UInt32x2)", "(tests.test_literal.Float32)", "(tests.test_literal.UInt32x8)", "(tests.test_literal.UInt6... | ["======================================================================", "Failure: ModuleNotFoundError (No module named 'peachpy.x86_64.avx') ... ERROR", "Failure: ModuleNotFoundError (No module named 'pytest') ... ERROR", "(errors=19)"] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.9", "pip_packages": ["colorama==0.4.5", "nose==1.3.7", "rednose==1.3.0", "setuptools==65.4.0", "six==1.16.0", "termstyle==0.1.11", "wheel==0.44.0"]} | nosetests -v | null | null | null | swa-bench:sw.eval | |
graphql-python/graphene | graphql-python__graphene-1478 | f09b2e5a81ea3ca108ccc972b65966ec363a4e78 | diff --git a/graphene/types/schema.py b/graphene/types/schema.py
index 1a33a93d3..7fa046ddb 100644
--- a/graphene/types/schema.py
+++ b/graphene/types/schema.py
@@ -1,3 +1,4 @@
+from enum import Enum as PyEnum
import inspect
from functools import partial
@@ -169,10 +170,16 @@ def create_enum(graphene_type):
... | diff --git a/graphene/types/tests/test_enum.py b/graphene/types/tests/test_enum.py
index 298cc233b..9b3082df1 100644
--- a/graphene/types/tests/test_enum.py
+++ b/graphene/types/tests/test_enum.py
@@ -565,3 +565,36 @@ def test_iterable_instance_creation_enum():
for c in TestEnum:
result.append(c.name)
... | cannot have Enum member named "description"
if the enum contains member called "descrpition" or "deprecation_reason", graphql schema-bullding validations die with error like :
TypeError: The description of the enum value must be a string
Happens on latest beta version, and depends on grapql's version.
This seems... | 2022-11-17T13:19:50Z | 2022-12-01T10:06:25Z | ["graphene/types/tests/test_definition.py::test_includes_interfaces_subtypes_in_the_type_map", "graphene/types/tests/test_dynamic.py::test_nonnull", "graphene/types/tests/test_type_map.py::test_objecttype_with_possible_types", "graphene/tests/issues/test_1419.py::test_parse_literal_with_variables[GenericScalar-\"foo\"]... | [] | ["graphene/types/tests/test_enum.py::test_iterable_instance_creation_enum", "graphene/types/tests/test_enum.py::test_enum_description_member_not_interpreted_as_property"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nenvlist = py3{6,7,8,9,10}, # mypy, # pre-commit\nskipsdist = true\n\n[testenv]\ndeps =\n .[test]\nsetenv =\n PYTHONPATH = .:{envdir}\ncommands =\n py{36,37,38,39,310}: pytest --color=no -rA --tb=no -p no:cacheprovider ... | tox -- | null | null | null | swa-bench:sw.eval | |
graphql-python/graphene | graphql-python__graphene-1473 | f891a3683dbc1198d6b7dfad1835a16ca3562452 | diff --git a/graphene/types/enum.py b/graphene/types/enum.py
index 0f68236b4..58e65c69e 100644
--- a/graphene/types/enum.py
+++ b/graphene/types/enum.py
@@ -56,6 +56,9 @@ def __call__(cls, *args, **kwargs): # noqa: N805
return super(EnumMeta, cls).__call__(*args, **kwargs)
# return cls._meta.enum(*ar... | diff --git a/graphene/types/tests/test_enum.py b/graphene/types/tests/test_enum.py
index ab1e093e8..298cc233b 100644
--- a/graphene/types/tests/test_enum.py
+++ b/graphene/types/tests/test_enum.py
@@ -543,3 +543,25 @@ def test_hashable_instance_creation_enum():
assert trilogy_map[Episode.NEWHOPE] == "better"
... | KeyError: 0 while iterating PyEnum-style
KeyError: 0 arises when I try to iterate over graphene Enums. The same code with PyEnums works fine:
```
from graphene import Enum
class Class(Enum):
FIRST = "first"
SECOND = "second"
for c in Class:
print(c)
```
* **What is the expected behavior?**
O... | **Workaround** for anyone arriving from googling @BasilisAndr:
The underlying `PyEnum` is accessible via the `__enum__` attribute, so you can iterate like:
```python
for c in Class.__enum__:
print(c)
```
@doneel thanks for this. Maybe if the `graphene.enum` doesn't have an `__iter__` and `__next__` implemented... | 2022-11-13T19:25:46Z | 2022-11-16T20:30:49Z | ["graphene/types/tests/test_definition.py::test_includes_interfaces_subtypes_in_the_type_map", "graphene/types/tests/test_dynamic.py::test_nonnull", "graphene/types/tests/test_type_map.py::test_objecttype_with_possible_types", "graphene/tests/issues/test_1419.py::test_parse_literal_with_variables[GenericScalar-\"foo\"]... | [] | ["graphene/types/tests/test_enum.py::test_enum_iteration", "graphene/types/tests/test_enum.py::test_hashable_instance_creation_enum", "graphene/types/tests/test_enum.py::test_iterable_instance_creation_enum"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nenvlist = py3{6,7,8,9,10}, # mypy, # pre-commit\nskipsdist = true\n\n[testenv]\ndeps =\n .[test]\nsetenv =\n PYTHONPATH = .:{envdir}\ncommands =\n py{36,37,38,39,310}: pytest --color=no -rA --tb=no -p no:cacheprovider ... | tox -- | null | null | null | swa-bench:sw.eval |
graphql-python/graphene | graphql-python__graphene-1190 | 80e3498750e26babb5d7cb0fec4441d9842af39a | diff --git a/docs/execution/dataloader.rst b/docs/execution/dataloader.rst
index 8a8e2ae3e..618909512 100644
--- a/docs/execution/dataloader.rst
+++ b/docs/execution/dataloader.rst
@@ -4,7 +4,7 @@ Dataloader
DataLoader is a generic utility to be used as part of your application's
data fetching layer to provide a simp... | diff --git a/tests_asyncio/test_dataloader.py b/tests_asyncio/test_dataloader.py
new file mode 100644
index 000000000..fb8d1630e
--- /dev/null
+++ b/tests_asyncio/test_dataloader.py
@@ -0,0 +1,79 @@
+from collections import namedtuple
+from unittest.mock import Mock
+from pytest import mark
+from aiodataloader import D... | Update dataloader docs to use aiodataloader
graphql-core dropped support for the Promise library (since asyncio is now the official way to do async code in Python). @syrusakbary has already created an asyncio version of dataloader: https://github.com/syrusakbary/aiodataloader . We should update the documentation.
| 2020-04-26T12:23:13Z | 2022-08-13T13:14:44Z | [] | [] | ["graphene/relay/tests/test_node_custom.py::test_gets_the_correct_typename_for_users", "graphene/tests/issues/test_1419.py::test_parse_literal_with_variables[Int-1]", "graphene/types/tests/test_type_map.py::test_interface_with_interfaces", "graphene/relay/tests/test_connection_query.py::test_respects_a_smaller_last", "... | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nenvlist = py3{6,7,8,9,10}, # mypy, # pre-commit\nskipsdist = true\n\n[testenv]\ndeps =\n .[test]\nsetenv =\n PYTHONPATH = .:{envdir}\ncommands =\n py{36,37,38,39,310}: pytest --color=no -rA --tb=no -p no:cacheprovider ... | tox -- | null | null | null | swa-bench:sw.eval | |
graphql-python/graphene | graphql-python__graphene-1036 | 167c8c203cc2607fd3b80359de4b6064ac2e5234 | diff --git a/graphene/relay/node.py b/graphene/relay/node.py
index d9c4c0f6c..4b324a93a 100644
--- a/graphene/relay/node.py
+++ b/graphene/relay/node.py
@@ -48,7 +48,7 @@ def get_resolver(self, parent_resolver):
class NodeField(Field):
- def __init__(self, node, type=False, deprecation_reason=None, name=None, *... | diff --git a/graphene/relay/tests/test_node.py b/graphene/relay/tests/test_node.py
index fbce1d547..a0f406086 100644
--- a/graphene/relay/tests/test_node.py
+++ b/graphene/relay/tests/test_node.py
@@ -110,6 +110,17 @@ def test_node_field_custom():
assert node_field.node_type == Node
+def test_node_field_args()... | relay.NodeField does not propagate arguments to Field
The [current implementation](https://github.com/graphql-python/graphene/blob/167c8c203cc2607fd3b80359de4b6064ac2e5234/graphene/relay/node.py#L51) of `NodeField`'s constructor does not propagate `name`, `deprecation_reason` or `**kwargs` to its parent `Field` constru... | 2019-07-16T16:23:50Z | 2019-09-27T08:54:47Z | ["graphene/relay/tests/test_node_custom.py::test_gets_the_correct_typename_for_users", "graphene/relay/tests/test_connection_query.py::test_respects_a_smaller_last", "graphene/types/tests/test_structures.py::test_list_with_lazy_partial_type", "graphene/utils/tests/test_orderedtype.py::test_orderedtype_hash", "graphene/... | [] | ["graphene/relay/tests/test_node.py::test_node_field_args"] | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nenvlist = py3{6,7,8,9,10}, # mypy, # pre-commit\nskipsdist = true\n\n[testenv]\ndeps =\n .[test]\nsetenv =\n PYTHONPATH = .:{envdir}\ncommands =\n py{36,37,38,39,310}: pytest --color=no -rA --tb=no -p no:cacheprovider --cov=graphene graphe... | tox -- | null | null | null | swa-bench:sw.eval | |
graphql-python/graphene | graphql-python__graphene-957 | abff3d75a39bc8f2d1fdb48aafa1866cf47dfff6 | diff --git a/graphene/types/enum.py b/graphene/types/enum.py
index 6e6bab8f3..7b8e71f52 100644
--- a/graphene/types/enum.py
+++ b/graphene/types/enum.py
@@ -46,7 +46,12 @@ def __prepare__(name, bases, **kwargs): # noqa: N805
def __call__(cls, *args, **kwargs): # noqa: N805
if cls is Enum:
d... | diff --git a/graphene/tests/issues/test_956.py b/graphene/tests/issues/test_956.py
new file mode 100644
index 000000000..72ff97133
--- /dev/null
+++ b/graphene/tests/issues/test_956.py
@@ -0,0 +1,8 @@
+import graphene
+
+
+def test_issue():
+ options = {"description": "This my enum", "deprecation_reason": "For the f... | Cannot create a enum with a deprecation reason supplied
## How to reproduce
```python
options = {
'description': 'This my enum',
'deprecation_reason': 'For the funs'}
graphene.Enum('MyEnum', [('some', 'data')], **options)
```
## What happened
```
File "/Users/Development/saleor/saleor/graphql/core/... | 2019-05-02T13:15:48Z | 2019-05-06T17:17:34Z | ["graphene/relay/tests/test_node_custom.py::test_gets_the_correct_typename_for_users", "graphene/relay/tests/test_connection_query.py::test_respects_a_smaller_last", "graphene/types/tests/test_structures.py::test_list_with_lazy_partial_type", "graphene/utils/tests/test_orderedtype.py::test_orderedtype_hash", "graphene/... | [] | ["graphene/tests/issues/test_956.py::test_issue"] | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nenvlist = py3{6,7,8,9,10}, # mypy, # pre-commit\nskipsdist = true\n\n[testenv]\ndeps =\n .[test]\nsetenv =\n PYTHONPATH = .:{envdir}\ncommands =\n py{36,37,38,39,310}: pytest --color=no -rA --tb=no -p no:cacheprovider --cov=graphene graphe... | tox -- | null | null | null | swa-bench:sw.eval | |
graphql-python/graphene | graphql-python__graphene-864 | 96d497c2b8f5495fe603ffb1a7675e95f342dd2c | diff --git a/graphene/types/datetime.py b/graphene/types/datetime.py
index 739032b03..3519d76db 100644
--- a/graphene/types/datetime.py
+++ b/graphene/types/datetime.py
@@ -4,6 +4,7 @@
from aniso8601 import parse_date, parse_datetime, parse_time
from graphql.language import ast
+from six import string_types
from... | diff --git a/graphene/types/tests/test_datetime.py b/graphene/types/tests/test_datetime.py
index 98e5e7abe..0d9ee1146 100644
--- a/graphene/types/tests/test_datetime.py
+++ b/graphene/types/tests/test_datetime.py
@@ -2,6 +2,7 @@
import pytz
from graphql import GraphQLError
+import pytest
from ..datetime import D... | [Enhancement] DateTime inputs should accept Python datetimes
`DateTime`, `Date`, and `Time` will not accept corresponding instances of `datetime.*` when used as variables, you have to format your variables as strings.
The following code simply providing Python datetimes should be supported in addition to string form... | 2018-11-09T07:32:34Z | 2019-03-31T10:57:35Z | ["graphene/relay/tests/test_node_custom.py::test_gets_the_correct_typename_for_users", "graphene/relay/tests/test_connection_query.py::test_respects_a_smaller_last", "graphene/types/tests/test_structures.py::test_list_with_lazy_partial_type", "graphene/utils/tests/test_orderedtype.py::test_orderedtype_hash", "graphene/... | [] | ["graphene/types/tests/test_datetime.py::test_datetime_query_variable", "graphene/types/tests/test_datetime.py::test_date_query_variable", "graphene/types/tests/test_datetime.py::test_time_query_variable"] | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nenvlist = py3{6,7,8,9,10}, # mypy, # pre-commit\nskipsdist = true\n\n[testenv]\ndeps =\n .[test]\nsetenv =\n PYTHONPATH = .:{envdir}\ncommands =\n py{36,37,38,39,310}: pytest --color=no -rA --tb=no -p no:cacheprovider --cov=graphene graphe... | tox -- | null | null | null | swa-bench:sw.eval | |
benoitc/gunicorn | benoitc__gunicorn-3003 | add8a4c951f02a67ca1f81264e5c107fa68e6496 | diff --git a/gunicorn/http/message.py b/gunicorn/http/message.py
index 64b2060c0..1f93c7145 100644
--- a/gunicorn/http/message.py
+++ b/gunicorn/http/message.py
@@ -139,7 +139,10 @@ def set_body_reader(self):
self.body = Body(ChunkedReader(self, self.unreader))
elif content_length is not None:
... | diff --git a/tests/requests/invalid/022.http b/tests/requests/invalid/022.http
new file mode 100644
index 000000000..521c7a06e
--- /dev/null
+++ b/tests/requests/invalid/022.http
@@ -0,0 +1,3 @@
+GET /first HTTP/1.0\r\n
+Content-Length: -0\r\n
+\r\n
\ No newline at end of file
diff --git a/tests/requests/invalid/022.py... | Improper parsing of Content-Length
## Description
gunicorn currently parses Content-Length using `int`. This causes problems because `int` accepts a lot more than should be acceptable in that content. The biggest problem characters are, '-', '+', and '_'.
# Examples
## HTTP requests in which gunicorn misinterprets... | 2023-05-31T01:42:50Z | 2023-07-10T22:14:24Z | ["tests/test_invalid_requests.py::test_http_parser[/testbed/tests/requests/invalid/021.http]", "tests/test_http.py::test_readline_zero_size", "tests/test_sock.py::test_unix_socket_close_unlink", "tests/test_util.py::test_import_app_bad[support:create_app(Gunicorn)-AppImportError-literal values]", "tests/test_config.py:... | [] | ["tests/test_invalid_requests.py::test_http_parser[/testbed/tests/requests/invalid/022.http]", "tests/test_invalid_requests.py::test_http_parser[/testbed/tests/requests/invalid/024.http]", "tests/workers/test_ggevent.py::test_import", "tests/test_invalid_requests.py::test_http_parser[/testbed/tests/requests/invalid/023... | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nenvlist = py{37,38,39,310,311,py3}, lint, docs-lint, pycodestyle\nskipsdist = false\n; Can\\'t set skipsdist and use_develop in tox v4 to true due to https://github.com/tox-dev/tox/issues/2730\n\n[testenv]\nuse_develop = true\nco... | null | ["tox -e py"] | null | null | swa-bench:sw.eval | |
benoitc/gunicorn | benoitc__gunicorn-2067 | 235f06c3aff23f72edd17f2054e29cb49102002e | diff --git a/docs/source/settings.rst b/docs/source/settings.rst
index 16d8961ae..e759ded79 100644
--- a/docs/source/settings.rst
+++ b/docs/source/settings.rst
@@ -363,6 +363,17 @@ statsd_host
.. versionadded:: 19.1
+.. _statsd-socket:
+
+statsd_socket
+~~~~~~~~~~~~~
+
+* ``--statsd-socket STATSD_SOCKET``
+* ``No... | diff --git a/tests/test_config.py b/tests/test_config.py
index 0587c63cf..db108b9b0 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -306,13 +306,20 @@ def nworkers_changed_3(server, new_value, old_value):
assert c.nworkers_changed(1, 2, 3) == 3
-def test_statsd_changes_logger():
+def test_stats... | Add option to report stats over a unix domain socket
I have a setup where DataDog's **statsd** agent listens on a **unix domain socket** (as opposed to a network UDP). Reasons for using UDS are listed [here](https://docs.datadoghq.com/developers/dogstatsd/unix_socket/)
It would be useful if gunicorn allowed me to re... | 2019-06-26T12:38:29Z | 2023-05-07T18:39:17Z | ["tests/test_config.py::test_pos_int_validation", "tests/test_config.py::test_default_config_file", "tests/test_config.py::test_reload[options1-True]", "tests/test_config.py::test_bool_validation", "tests/test_config.py::test_load_enviroment_variables_config", "tests/test_config.py::test_umask_config[options4-18]", "te... | [] | ["tests/test_config.py::test_bind_fd", "tests/test_config.py::test_statsd_socket_changes_logger"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nenvlist = py{37,38,39,310,311,py3}, lint, docs-lint, pycodestyle\nskipsdist = false\n; Can\\'t set skipsdist and use_develop in tox v4 to true due to https://github.com/tox-dev/tox/issues/2730\n\n[testenv]\nuse_develop = true\nco... | tox -e py -- | null | null | null | swa-bench:sw.eval | |
benoitc/gunicorn | benoitc__gunicorn-2178 | 8c367521f831525d81ad52749b9ef54fce4ffedc | diff --git a/docs/source/run.rst b/docs/source/run.rst
index 0da87374a..71abc739f 100644
--- a/docs/source/run.rst
+++ b/docs/source/run.rst
@@ -44,8 +44,29 @@ Example with the test app:
You can now run the app with the following command::
+.. code-block:: text
+
$ gunicorn --workers=2 test:app
+The variabl... | diff --git a/tests/support.py b/tests/support.py
index af412348f..f50c24226 100644
--- a/tests/support.py
+++ b/tests/support.py
@@ -7,19 +7,32 @@
HOST = "127.0.0.1"
-@validator
-def app(environ, start_response):
- """Simplest possible application object"""
-
- data = b'Hello, World!\n'
- status = '200 OK... | v20 issue: Failed to find application object 'create_app()' in 'app'
I had neglected to pin my version of gunicorn, and the run command started breaking this morning when I re-deployed my app and it automatically upgraded to 20.0.
Downgrading my version of gunicorn back to 19.9 fixed the issue.
This is the comma... | I have experienced this issue also, i.e.
`Failed to find application object 'create_app()' in 'app'`
and pinning to version 19.9.0 solves the issue.
I initially though the fix was to change the gunicorn command from:
`gunicorn --bind 0.0.0.0:$PORT app:create_app()`
to:
`gunicorn --bind 0.0.0.0:$PORT app:create_... | 2019-11-17T17:59:46Z | 2019-11-19T21:49:44Z | ["tests/test_util.py::test_parse_address[127.0.0.1:8000-expected9]", "tests/test_util.py::test_parse_address[unix:/var/run/test.sock-/var/run/test.sock]", "tests/test_util.py::test_parse_address[localhost:8000-expected8]", "tests/test_util.py::test_warn", "tests/test_util.py::test_parse_address[[::1]-expected7]", "test... | [] | ["tests/test_util.py::test_import_app_bad[support:create_app(Gunicorn)-AppImportError-literal values]", "tests/test_util.py::test_split_request_uri[///a/b?c=1#d-expected4]", "tests/test_util.py::test_import_app_bad[support:error_factory(1)-AppImportError-error_factory() takes]", "tests/test_util.py::test_import_app_bad... | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nenvlist = py35, py36, py37, py38, pypy3, lint\nskipsdist = True\n\n[testenv]\nusedevelop = True\ncommands = pytest --color=no -rA --tb=no -p no:cacheprovider {posargs}\ndeps =\n -rrequirements_test.txt\n\n[testenv:lint]\ncommands =\n pylint -j0 \\\... | tox --recreate -- | null | null | null | swa-bench:sw.eval |
benoitc/gunicorn | benoitc__gunicorn-1914 | a2a8bc1ae6fa89110f6b2030d8fb7f3a75f1f5b7 | diff --git a/gunicorn/http/wsgi.py b/gunicorn/http/wsgi.py
index 593c8f24d..1b8b9cc0c 100644
--- a/gunicorn/http/wsgi.py
+++ b/gunicorn/http/wsgi.py
@@ -315,7 +315,7 @@ def send_headers(self):
tosend.extend(["%s: %s\r\n" % (k, v) for k, v in self.headers])
header_str = "%s\r\n" % "".join(tosend)
- ... | diff --git a/examples/test.py b/examples/test.py
index ffface083..09ea06f08 100644
--- a/examples/test.py
+++ b/examples/test.py
@@ -20,7 +20,8 @@ def app(environ, start_response):
response_headers = [
('Content-type', 'text/plain'),
('Content-Length', str(len(data))),
- ('X-Gunicorn-Versi... | Encoding headers with ASCII breaks applications expecting them to be encoded in latin-1
Applications, like flask, which expect that the headers are using latin-1 encoding as specified in [rfc5987] will break gunicorn because gunicorn uses ASCII encoding.
Issue #1353 was closed with the comment
> I'm going to close ... | gunicorn implements the last specification (and it used to work with previous versions of flask).
If we want to relax it for old applications maybe we may want yo try to encode to latin1 if encoding to ascii didn't work. Thoughts ? cc @tilgovi
to be more complete, gunicorn use the updated HTTP 1.1 spec (7230 and ... | 2018-11-09T01:58:28Z | 2019-04-18T01:23:21Z | ["tests/test_http.py::test_iter_unreader_chunk", "tests/test_http.py::test_socket_unreader_chunk", "tests/test_http.py::test_readline_zero_size", "tests/test_http.py::test_readline_empty_body", "tests/test_http.py::test_unreader_unread", "tests/test_http.py::test_unreader_read_zero_size", "tests/test_http.py::test_unre... | [] | ["tests/test_http.py::test_eof_reader_read_invalid_size", "tests/test_http.py::test_http_header_encoding"] | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nenvlist = py35, py36, py37, py38, pypy3, lint\nskipsdist = True\n\n[testenv]\nusedevelop = True\ncommands = pytest --color=no -rA --tb=no -p no:cacheprovider {posargs}\ndeps =\n -rrequirements_test.txt\n\n[testenv:lint]\ncommands =\n pylint -j0 \\\... | tox --recreate -- | null | null | null | swa-bench:sw.eval |
benoitc/gunicorn | benoitc__gunicorn-1970 | 7af6f651c04511e631cbb888f527897d4273703c | diff --git a/docs/source/settings.rst b/docs/source/settings.rst
index a9f058992..f67c53635 100644
--- a/docs/source/settings.rst
+++ b/docs/source/settings.rst
@@ -506,9 +506,22 @@ ciphers
~~~~~~~
* ``--ciphers``
-* ``TLSv1``
+* ``None``
+
+SSL Cipher suite to use, in the format of an OpenSSL cipher list.
+
+By de... | diff --git a/tests/test_ssl.py b/tests/test_ssl.py
index 6c16212a8..97e05d86b 100644
--- a/tests/test_ssl.py
+++ b/tests/test_ssl.py
@@ -72,4 +72,4 @@ def test_ciphers():
assert Ciphers.name == 'ciphers'
assert Ciphers.section == 'SSL'
assert Ciphers.cli == ['--ciphers']
- assert Ciphers.default == 'T... | Default SSL ciphers setting disables the most secure ciphers
The default for the [--ciphers](http://docs.gunicorn.org/en/stable/settings.html#ciphers) option is `TLSv1`.
This value is a bad default, because it actively disables new, strong ciphers that are only available with TLSv1.2. In particular, there is no inte... | Thank you for reporting this issue. We're absolutely well aware of this. Gunicorn has not had significant changes to its SSL support for a while. See #1933 and the issues linked in that discussion.
In the meantime, if there is a more sensible default now that Gunicorn only supports Python 3.4+, please submit a pull ... | 2019-01-24T15:12:17Z | 2019-01-24T21:41:05Z | ["tests/test_ssl.py::test_certfile", "tests/test_ssl.py::test_ssl_version", "tests/test_ssl.py::test_keyfile", "tests/test_ssl.py::test_cacerts", "tests/test_ssl.py::test_suppress_ragged_eofs"] | [] | ["tests/test_ssl.py::test_do_handshake_on_connect", "tests/test_ssl.py::test_ciphers"] | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nenvlist = py35, py36, py37, py38, pypy3, lint\nskipsdist = True\n\n[testenv]\nusedevelop = True\ncommands = pytest --color=no -rA --tb=no -p no:cacheprovider {posargs}\ndeps =\n -rrequirements_test.txt\n\n[testenv:lint]\ncommands =\n pylint -j0 \\\... | tox --recreate -- | null | null | null | swa-bench:sw.eval |
benoitc/gunicorn | benoitc__gunicorn-1809 | efdb5acdd08cd79e61adbb746a7ca1247511a5b2 | diff --git a/THANKS b/THANKS
index 8f0c944a8..57ed4dab3 100644
--- a/THANKS
+++ b/THANKS
@@ -60,6 +60,7 @@ Eric Florenzano <floguy@gmail.com>
Eric Shull <eric@elevenbasetwo.com>
Eugene Obukhov <irvind25@gmail.com>
Evan Mezeske <evan@meebo-inc.com>
+Florian Apolloner <florian@apolloner.eu>
Gaurav Kumar <gauravkumar3... | diff --git a/tests/test_config.py b/tests/test_config.py
index 2d0090884..98420bd0c 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -429,3 +429,9 @@ def _test_ssl_version(options, expected):
with AltArgs(cmdline):
app = NoConfigApp()
assert app.cfg.ssl_version == expected
+
+
+def tes... | [Q] Bind to a file descriptor?
Hi guys,
I guess whether it's possible to bind gunicorn to a file descriptor of the open socket? I looked at the code and it seems that there is some code that does this in `sock.py` but I'm not sure whether it's only for child workers purposes or I can specify that in `--bind` parameter... | You can bind it to a unix socket yes: `gunicorn -b unix:/path/to/socket ...`:
http://docs.gunicorn.org/en/19.3/run.html?highlight=unix#commonly-used-arguments
@benoitc please note that I'm talking about `file descriptors`, not about `unix sockets`.
This is done using `socket.fromfd` func. There is already partial sup... | 2018-06-13T17:01:37Z | 2018-11-16T17:21:14Z | ["tests/test_config.py::test_pos_int_validation", "tests/test_config.py::test_default_config_file", "tests/test_config.py::test_reload[options1-True]", "tests/test_config.py::test_bool_validation", "tests/test_config.py::test_load_enviroment_variables_config", "tests/test_config.py::test_bind_fd", "tests/test_config.py... | [] | ["tests/test_util.py::test_split_request_uri[///a/b?c=1#d-expected4]", "tests/test_util.py::test_parse_address[fd://33-33]", "tests/test_util.py::test_parse_fd_invalid"] | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nenvlist = py35, py36, py37, py38, pypy3, lint\nskipsdist = True\n\n[testenv]\nusedevelop = True\ncommands = pytest --color=no -rA --tb=no -p no:cacheprovider {posargs}\ndeps =\n -rrequirements_test.txt\n\n[testenv:lint]\ncommands =\n pylint -j0 \\\... | tox --recreate -- | null | null | null | swa-bench:sw.eval |
benoitc/gunicorn | benoitc__gunicorn-1890 | e5c11e8f8a0c546438c38e3b786953434657bfd0 | diff --git a/THANKS b/THANKS
index 5a19a83f7..8f0c944a8 100644
--- a/THANKS
+++ b/THANKS
@@ -31,6 +31,7 @@ Berker Peksag <berker.peksag@gmail.com>
bninja <andrew@poundpay.com>
Bob Hagemann <bob+code@twilio.com>
Bobby Beckmann <bobby@macs-MacBook-Pro.local>
+Brett Randall <javabrett@gmail.com>
Brian Rosner <brosner@... | diff --git a/tests/test_config.py b/tests/test_config.py
index 714d29262..2d0090884 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -386,3 +386,46 @@ def test_umask_config(options, expected):
with AltArgs(cmdline):
app = NoConfigApp()
assert app.cfg.umask == expected
+
+
+@pytest.mark... | Add support for named constants in the --ssl-version flag
I'm using gunicorn with ssl cert and key. It provides TLS connection 1.0. Is it possible to configure gunicorn to use TLS 1.2?
Add support for named constants in the --ssl-version flag
I'm using gunicorn with ssl cert and key. It provides TLS connection 1.0. Is... | Hi @rrajaravi, did you try setting http://docs.gunicorn.org/en/latest/settings.html#ciphers ?
bump
How to determine it work or not?
http://superuser.com/questions/109213/how-do-i-list-the-ssl-tls-cipher-suites-a-particular-website-offers
can we close this issue?
TL;DR
Gunicorn only appears to support:
TLSv1
SSLv2
... | 2018-10-07T23:41:30Z | 2018-10-31T11:43:41Z | ["tests/test_config.py::test_pos_int_validation", "tests/test_config.py::test_default_config_file", "tests/test_config.py::test_reload[options1-True]", "tests/test_config.py::test_bool_validation", "tests/test_config.py::test_load_enviroment_variables_config", "tests/test_config.py::test_umask_config[options4-18]", "te... | [] | ["tests/test_config.py::test_ssl_version_named_constants_python3[options1-3]", "tests/test_config.py::test_ssl_version_named_constants_python36[options1-4]", "tests/test_config.py::test_ssl_version_named_constants_python36[options3-17]", "tests/test_config.py::test_ssl_version_named_constants_python36[options0-2]", "te... | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nenvlist = py35, py36, py37, py38, pypy3, lint\nskipsdist = True\n\n[testenv]\nusedevelop = True\ncommands = pytest --color=no -rA --tb=no -p no:cacheprovider {posargs}\ndeps =\n -rrequirements_test.txt\n\n[testenv:lint]\ncommands =\n pylint -j0 \\\... | tox --recreate -- | null | null | null | swa-bench:sw.eval |
benoitc/gunicorn | benoitc__gunicorn-1882 | 30554fdb4fdc169997b234e49ab93655a289d76d | diff --git a/gunicorn/http/message.py b/gunicorn/http/message.py
index 0c6bc0538..0dda58dbe 100644
--- a/gunicorn/http/message.py
+++ b/gunicorn/http/message.py
@@ -71,11 +71,11 @@ def parse_headers(self, data):
secure_scheme_headers = cfg.secure_scheme_headers
elif isinstance(self.unreader, Socke... | diff --git a/tests/test_sock.py b/tests/test_sock.py
index 295223490..f70ae09ea 100644
--- a/tests/test_sock.py
+++ b/tests/test_sock.py
@@ -11,6 +11,27 @@
from gunicorn import sock
+@mock.patch('os.stat')
+def test_create_sockets_unix_bytes(stat):
+ conf = mock.Mock(address=[b'127.0.0.1:8000'])
+ log = mock... | HTTPS Headers have "wsgi.url_scheme" set to "http" when using Unix socket between proxy and Gunicorn
Note: This issue follow the discussion from closed #1766
Since version 19.8, when Gunicorn is started with option `--bind unix:/tmp/a_socket.sock`, request's headers are received with `wsgi.url_scheme` set to `http`... | I still cannot reproduce this.
First, I clone the repository and start the server using `DEVENV=true` so that it allows any host, as I will connect directly over the UNIX socket will cURL to test the behavior Gunicorn itself:
``` shellsession
> git clone https://github.com/alorence/gunicorn-test.git
Cloning int... | 2018-09-24T02:28:32Z | 2018-09-24T06:57:54Z | ["tests/test_sock.py::test_socket_close", "tests/test_sock.py::test_unix_socket_close_unlink", "tests/test_sock.py::test_create_sockets_unix_strings"] | [] | ["tests/test_sock.py::test_create_sockets_unix_bytes", "tests/test_sock.py::test_unix_socket_close_without_unlink"] | [] | {"install": [], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nenvlist = py35, py36, py37, py38, pypy3, lint\nskipsdist = True\n\n[testenv]\nusedevelop = True\ncommands = pytest --color=no -rA --tb=no -p no:cacheprovider {posargs}\ndeps =\n -rrequirements_test.txt\n\n[testenv:lint]\ncommands =\n pylint -j0 \\\... | tox --recreate -- | null | null | null | swa-bench:sw.eval |
hynek/doc2dash | hynek__doc2dash-202 | 2a583e3632a3d73cdf2627445efb672fd5d2d92e | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 12fe351..6391a1b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support for linking to [docset playgrounds](https://kapeli.com/docsets#docsetPlaygrounds) using the `--playgr... | diff --git a/tests/test_docsets.py b/tests/test_docsets.py
index 572419e..9ad0fee 100644
--- a/tests/test_docsets.py
+++ b/tests/test_docsets.py
@@ -31,6 +31,7 @@ def test_plist_creation(self, monkeypatch, tmp_path):
playground_url=None,
icon=None,
icon_2x=None,
+ full_... | Add support for DashDocSetDefaultFTSEnabled / DashDocSetFTSNotSupported
https://kapeli.com/docsets#fts
| 2024-01-14T15:10:17Z | 2024-01-14T15:12:44Z | ["tests/test_main.py::TestArguments::test_quiet_and_verbose_conflict", "tests/test_main.py::TestArguments::test_fails_with_missing_index_page", "tests/test_main.py::TestArguments::test_handles_unknown_doc_types", "tests/test_main.py::TestSetupPaths::test_works", "tests/test_main.py::TestArguments::test_fails_if_supplie... | [] | ["tests/test_docsets.py::TestPrepareDocset::test_with_icon", "tests/test_main.py::TestSetupPaths::test_detects_existing_dest", "tests/test_docsets.py::TestPrepareDocset::test_with_index_page", "tests/test_docsets.py::TestPrepareDocset::test_with_online_redirect_url", "tests/test_main.py::test_normal_flow", "tests/test_... | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# SPDX-FileCopyrightText: 2012 Hynek Schlawack <hs@ox.cx>\n#\n# SPDX-License-Identifier: MIT\n\nfrom __future__ import annotations\n\nimport os\nimport re\nimport shutil\nimport sys\n\nfrom pathlib import Path\n\nimport nox\... | nox -- | null | null | null | swa-bench:sw.eval | |
hynek/doc2dash | hynek__doc2dash-201 | e8a4f374588dfb054cb1d984c9c5e72821588528 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index aa5dda5..12fe351 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support for 2x icons using the `--icon-2x` option.
[#200](https://github.com/hynek/doc2dash/pull/200)
+-... | diff --git a/tests/test_docsets.py b/tests/test_docsets.py
index edbcae1..572419e 100644
--- a/tests/test_docsets.py
+++ b/tests/test_docsets.py
@@ -28,6 +28,7 @@ def test_plist_creation(self, monkeypatch, tmp_path):
index_page=None,
enable_js=False,
online_redirect_url=None,
+ ... | Add support for Docset Playgrounds
https://kapeli.com/docsets#docsetPlaygrounds
| 2024-01-14T13:01:38Z | 2024-01-14T13:10:51Z | ["tests/test_main.py::TestArguments::test_fails_if_supplied_parser_fails", "tests/test_main.py::TestSetupPaths::test_add_to_global_overrides_destination", "tests/test_main.py::TestArguments::test_quiet_and_verbose_conflict", "tests/test_main.py::TestArguments::test_fails_with_missing_index_page", "tests/test_main.py::t... | [] | ["tests/test_docsets.py::TestPrepareDocset::test_with_icon", "tests/test_docsets.py::TestPrepareDocset::test_plist_creation", "tests/test_main.py::TestSetupPaths::test_detects_existing_dest", "tests/test_docsets.py::TestPrepareDocset::test_with_index_page", "tests/test_docsets.py::TestPrepareDocset::test_with_javascrip... | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# SPDX-FileCopyrightText: 2012 Hynek Schlawack <hs@ox.cx>\n#\n# SPDX-License-Identifier: MIT\n\nfrom __future__ import annotations\n\nimport os\nimport re\nimport shutil\nimport sys\n\nfrom pathlib import Path\n\nimport nox\... | nox -- | null | null | null | swa-bench:sw.eval | |
hynek/doc2dash | hynek__doc2dash-200 | 4daa9acb4fdcb585025cdac1d0add2f34bf65881 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index b92576f..aa5dda5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,9 +9,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://github.com/hynek/doc2dash/compare/3.0.0...HEAD)
+### Added
+
+- Support for 2x icons... | diff --git a/tests/test_docsets.py b/tests/test_docsets.py
index 5e96162..edbcae1 100644
--- a/tests/test_docsets.py
+++ b/tests/test_docsets.py
@@ -29,6 +29,7 @@ def test_plist_creation(self, monkeypatch, tmp_path):
enable_js=False,
online_redirect_url=None,
icon=None,
+ ... | Add support for 2x icons
https://kapeli.com/docsets#addingicon
| 2024-01-14T12:31:24Z | 2024-01-14T12:36:50Z | ["tests/test_main.py::TestArguments::test_fails_if_supplied_parser_fails", "tests/test_main.py::TestSetupPaths::test_add_to_global_overrides_destination", "tests/test_main.py::TestArguments::test_quiet_and_verbose_conflict", "tests/test_main.py::TestArguments::test_fails_with_missing_index_page", "tests/test_main.py::t... | [] | ["tests/test_docsets.py::TestPrepareDocset::test_with_icon", "tests/test_docsets.py::TestPrepareDocset::test_plist_creation", "tests/test_main.py::TestSetupPaths::test_detects_existing_dest", "tests/test_docsets.py::TestPrepareDocset::test_with_index_page", "tests/test_docsets.py::TestPrepareDocset::test_with_javascrip... | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# SPDX-FileCopyrightText: 2012 Hynek Schlawack <hs@ox.cx>\n#\n# SPDX-License-Identifier: MIT\n\nfrom __future__ import annotations\n\nimport os\nimport re\nimport shutil\nimport sys\n\nfrom pathlib import Path\n\nimport nox\... | nox -- | null | null | null | swa-bench:sw.eval | |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1589 | acd63a84c1510f67fe621d10d3a79003fc6ea39c | diff --git a/elasticsearch_dsl/aggs.py b/elasticsearch_dsl/aggs.py
index 69c2d85e..96b830e0 100644
--- a/elasticsearch_dsl/aggs.py
+++ b/elasticsearch_dsl/aggs.py
@@ -309,6 +309,10 @@ class MultiTerms(Bucket):
name = "multi_terms"
+class CategorizeText(Bucket):
+ name = "categorize_text"
+
+
# metric aggre... | diff --git a/tests/test_aggs.py b/tests/test_aggs.py
index aa928de4..e2848864 100644
--- a/tests/test_aggs.py
+++ b/tests/test_aggs.py
@@ -342,6 +342,23 @@ def test_multi_terms_aggregation():
} == a.to_dict()
+def test_categorize_text_aggregation():
+ a = aggs.CategorizeText(
+ field="tags",
+ ... | Add support for "categorize_text" bucket aggregation
`elasticsearch_dsl/aggs.py` is missing "categorize_text" bucket aggregation. [Categorize text aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-categorize-text-aggregation.html)
| 2022-05-18T20:29:37Z | 2024-04-15T17:21:46Z | ["tests/_sync/test_faceted_search.py::test_date_histogram_interval_types[calendar_interval-1w]", "tests/test_analysis.py::test_conditional_token_filter", "tests/_sync/test_update_by_query.py::test_complex_example", "tests/test_field.py::test_scaled_float", "tests/test_query.py::test_prefix_to_dict", "tests/_async/test_... | [] | ["tests/test_aggs.py::test_categorize_text_aggregation"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval | |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1591 | f091a234f67514ec05d724b735cd81620d4ee07a | diff --git a/elasticsearch_dsl/aggs.py b/elasticsearch_dsl/aggs.py
index d9412e26..69c2d85e 100644
--- a/elasticsearch_dsl/aggs.py
+++ b/elasticsearch_dsl/aggs.py
@@ -209,6 +209,10 @@ class GeohashGrid(Bucket):
name = "geohash_grid"
+class GeohexGrid(Bucket):
+ name = "geohex_grid"
+
+
class GeotileGrid(Bu... | diff --git a/tests/test_aggs.py b/tests/test_aggs.py
index 936c2bcd..aa928de4 100644
--- a/tests/test_aggs.py
+++ b/tests/test_aggs.py
@@ -262,6 +262,12 @@ def test_geohash_grid_aggregation():
assert {"geohash_grid": {"field": "centroid", "precision": 3}} == a.to_dict()
+def test_geohex_grid_aggregation():
+ ... | Add support for "geohex_grid" bucket aggregation
`elasticsearch_dsl/aggs.py` is missing "geohex_grid" bucket aggregation which is introduced in [v8.1.0](https://www.elastic.co/guide/en/elasticsearch/reference/8.1/release-notes-8.1.0.html#feature-8.1.0). [Geohex grid aggregation](https://www.elastic.co/guide/en/elastics... | 2022-05-21T09:46:04Z | 2024-04-15T17:19:22Z | ["tests/_sync/test_faceted_search.py::test_date_histogram_interval_types[calendar_interval-1w]", "tests/test_analysis.py::test_conditional_token_filter", "tests/_sync/test_update_by_query.py::test_complex_example", "tests/test_field.py::test_scaled_float", "tests/test_query.py::test_prefix_to_dict", "tests/_async/test_... | [] | ["tests/test_aggs.py::test_geohex_grid_aggregation"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval | |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1593 | 380b63b132d0e88e58395fe8f6dc10677055f622 | diff --git a/elasticsearch_dsl/aggs.py b/elasticsearch_dsl/aggs.py
index 962cfc35..d9412e26 100644
--- a/elasticsearch_dsl/aggs.py
+++ b/elasticsearch_dsl/aggs.py
@@ -232,6 +232,10 @@ class IPRange(Bucket):
name = "ip_range"
+class IPPrefix(Bucket):
+ name = "ip_prefix"
+
+
class Missing(Bucket):
name... | diff --git a/tests/test_aggs.py b/tests/test_aggs.py
index e908cc00..936c2bcd 100644
--- a/tests/test_aggs.py
+++ b/tests/test_aggs.py
@@ -300,6 +300,30 @@ def test_variable_width_histogram_aggregation():
assert {"variable_width_histogram": {"buckets": 2, "field": "price"}} == a.to_dict()
+def test_ip_prefix_a... | Add support for "ip_prefix" bucket aggregation
`elasticsearch_dsl/aggs.py` is missing "ip_prefix" bucket aggregation which is introduced in [v8.1.0](https://www.elastic.co/guide/en/elasticsearch/reference/8.1/release-notes-8.1.0.html#bug-8.1.0). [IP prefix aggregation](https://www.elastic.co/guide/en/elasticsearch/refe... | 2022-05-21T12:13:36Z | 2024-04-15T17:17:05Z | ["tests/_sync/test_faceted_search.py::test_date_histogram_interval_types[calendar_interval-1w]", "tests/test_analysis.py::test_conditional_token_filter", "tests/_sync/test_update_by_query.py::test_complex_example", "tests/test_field.py::test_scaled_float", "tests/test_query.py::test_prefix_to_dict", "tests/_async/test_... | [] | ["tests/test_aggs.py::test_ip_prefix_aggregation_extra", "tests/test_aggs.py::test_ip_prefix_aggregation"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval | |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1595 | 619daa1c28e687eab539ae3a052a53f9fb66fe07 | diff --git a/elasticsearch_dsl/aggs.py b/elasticsearch_dsl/aggs.py
index 11612fb3..962cfc35 100644
--- a/elasticsearch_dsl/aggs.py
+++ b/elasticsearch_dsl/aggs.py
@@ -278,6 +278,10 @@ class DiversifiedSampler(Bucket):
name = "diversified_sampler"
+class RandomSampler(Bucket):
+ name = "random_sampler"
+
+
... | diff --git a/tests/test_aggs.py b/tests/test_aggs.py
index 16c2ad5f..e908cc00 100644
--- a/tests/test_aggs.py
+++ b/tests/test_aggs.py
@@ -383,3 +383,22 @@ def test_normalize_aggregation():
assert {
"normalize": {"buckets_path": "normalized", "method": "percent_of_sum"}
} == a.to_dict()
+
+
+def test... | Add support for "random_sampler" bucket aggregation
`elasticsearch_dsl/aggs.py` is missing "random_sampler" bucket aggregation which is introduced in [v8.2.0](https://www.elastic.co/guide/en/elasticsearch/reference/8.2/release-notes-8.2.0.html#feature-8.2.0). [Random sampler aggregation](https://www.elastic.co/guide/en... | 2022-05-22T08:53:01Z | 2024-04-15T17:14:45Z | ["tests/_sync/test_faceted_search.py::test_date_histogram_interval_types[calendar_interval-1w]", "tests/test_analysis.py::test_conditional_token_filter", "tests/_sync/test_update_by_query.py::test_complex_example", "tests/test_field.py::test_scaled_float", "tests/test_query.py::test_prefix_to_dict", "tests/_async/test_... | [] | ["tests/test_aggs.py::test_random_sampler_aggregation"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval | |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1629 | 35646106563a1bbd58cedc5d8a3b73363c8760b7 | diff --git a/elasticsearch_dsl/aggs.py b/elasticsearch_dsl/aggs.py
index 61a27f3c..11612fb3 100644
--- a/elasticsearch_dsl/aggs.py
+++ b/elasticsearch_dsl/aggs.py
@@ -329,6 +329,10 @@ class GeoBounds(Agg):
name = "geo_bounds"
+class GeoLine(Agg):
+ name = "geo_line"
+
+
class Max(Agg):
name = "max"
| diff --git a/tests/test_aggs.py b/tests/test_aggs.py
index 32789286..16c2ad5f 100644
--- a/tests/test_aggs.py
+++ b/tests/test_aggs.py
@@ -334,6 +334,17 @@ def test_t_test_aggregation():
} == a.to_dict()
+def test_geo_line_aggregation():
+ a = aggs.GeoLine(point={"field": "centroid"}, sort={"field": "date"}... | Add support for "geo_line" metrics aggregation
`elasticsearch_dsl/aggs.py` is missing "geo_line" metrics aggregation which is introduced in v7.11.0. [Geo-Line aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-geo-line.html)
| 2022-10-16T10:20:30Z | 2024-04-15T16:59:31Z | ["tests/_sync/test_faceted_search.py::test_date_histogram_interval_types[calendar_interval-1w]", "tests/test_analysis.py::test_conditional_token_filter", "tests/_sync/test_update_by_query.py::test_complex_example", "tests/test_field.py::test_scaled_float", "tests/test_query.py::test_prefix_to_dict", "tests/_async/test_... | [] | ["tests/test_aggs.py::test_geo_line_aggregation"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval | |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1631 | 6cfbbe1a5d8bab6790b5299bcdfd84bef026edb2 | diff --git a/elasticsearch_dsl/aggs.py b/elasticsearch_dsl/aggs.py
index 8f91333a..61a27f3c 100644
--- a/elasticsearch_dsl/aggs.py
+++ b/elasticsearch_dsl/aggs.py
@@ -333,6 +333,10 @@ class Max(Agg):
name = "max"
+class MatrixStats(Agg):
+ name = "matrix_stats"
+
+
class MedianAbsoluteDeviation(Agg):
... | diff --git a/tests/test_aggs.py b/tests/test_aggs.py
index 0874a66c..32789286 100644
--- a/tests/test_aggs.py
+++ b/tests/test_aggs.py
@@ -341,6 +341,12 @@ def test_inference_aggregation():
} == a.to_dict()
+def test_matrix_stats_aggregation():
+ a = aggs.MatrixStats(fields=["poverty", "income"])
+
+ ass... | Add support for "matrix_stats" metrics aggregation
`elasticsearch_dsl/aggs.py` is missing "matrix_stats" metrics aggregation. [Matrix stats aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-matrix-stats-aggregation.html)
| 2022-10-16T11:26:42Z | 2024-04-15T16:56:05Z | ["tests/_sync/test_faceted_search.py::test_date_histogram_interval_types[calendar_interval-1w]", "tests/test_analysis.py::test_conditional_token_filter", "tests/_sync/test_update_by_query.py::test_complex_example", "tests/test_field.py::test_scaled_float", "tests/test_query.py::test_prefix_to_dict", "tests/_async/test_... | [] | ["tests/test_aggs.py::test_matrix_stats_aggregation"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval | |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1634 | 0c0bdb786ba87753f632e279b0866b7fdd5b7837 | diff --git a/elasticsearch_dsl/utils.py b/elasticsearch_dsl/utils.py
index c362838a..3b231d25 100644
--- a/elasticsearch_dsl/utils.py
+++ b/elasticsearch_dsl/utils.py
@@ -252,7 +252,9 @@ def get_dsl_class(cls, name, default=None):
f"DSL class `{name}` does not exist in {cls._type_name}."
)... | diff --git a/tests/test_query.py b/tests/test_query.py
index 4b765037..dde4963c 100644
--- a/tests/test_query.py
+++ b/tests/test_query.py
@@ -17,7 +17,7 @@
from pytest import raises
-from elasticsearch_dsl import function, query
+from elasticsearch_dsl import function, query, utils
def test_empty_Q_is_match_... | Expand__to_dot variable cannot be used to control the behavior
Hello,
This pull request: https://github.com/elastic/elasticsearch-dsl-py/pull/809 moved the default for _expand__to_dot to a variable.
At load time, the default for _expand__to_dot will already be set to True. Overwriting EXPAND__TO_DOT after the impor... | 2022-11-09T13:03:10Z | 2024-04-11T14:33:47Z | ["tests/_sync/test_faceted_search.py::test_date_histogram_interval_types[calendar_interval-1w]", "tests/test_analysis.py::test_conditional_token_filter", "tests/_sync/test_update_by_query.py::test_complex_example", "tests/test_field.py::test_scaled_float", "tests/test_query.py::test_prefix_to_dict", "tests/_async/test_... | [] | ["tests/test_query.py::test_expand_double_underscore_to_dot_setting"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval | |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1691 | f0c504538f19d3d70e2fb7d6402071f5fbaafc90 | diff --git a/docs/search_dsl.rst b/docs/search_dsl.rst
index 5912f8274..2dc1388f4 100644
--- a/docs/search_dsl.rst
+++ b/docs/search_dsl.rst
@@ -14,6 +14,8 @@ The ``Search`` object represents the entire search request:
* aggregations
+ * k-nearest neighbor searches
+
* sort
* pagination
@@ -352,6 +354,3... | diff --git a/tests/test_search.py b/tests/test_search.py
index 5cc84ff84..3b47b8216 100644
--- a/tests/test_search.py
+++ b/tests/test_search.py
@@ -234,6 +234,60 @@ class MyDocument(Document):
assert s._doc_type_map == {}
+def test_knn():
+ s = search.Search()
+
+ with raises(TypeError):
+ s.knn(... | Does elasticsearch-dsl-py support knn_search?
Great to see that this package now supports 8+ versions of Elasticsearch ❤️
However, when perusing the documentation, I am not yet seeing explicit support to [knn_search similar to the lower-level python client](https://elasticsearch-py.readthedocs.io/en/latest/api.html... | Hello! Glad that you're happy with elasticsearch-dsl-py 8.x.
Note that the page you linked to mentions that `knn_search` is deprecated in favor of the [knn option](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html#search-api-knn) in the search API. I would suggest supporting that ins... | 2023-12-22T16:41:13Z | 2024-01-03T14:41:25Z | ["tests/test_document.py::test_meta_fields_are_stored_in_meta_and_ignored_by_to_dict", "tests/test_analysis.py::test_conditional_token_filter", "tests/test_field.py::test_scaled_float", "tests/test_document.py::test_from_es_respects_underscored_non_meta_fields", "tests/test_query.py::test_empty_Q_is_match_all", "tests/... | [] | ["tests/test_search.py::test_knn"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1649 | 0e94780a603ebdd8bcc6d85b7e775f558711439e | diff --git a/elasticsearch_dsl/search.py b/elasticsearch_dsl/search.py
index 724c06a52..1fa5b5906 100644
--- a/elasticsearch_dsl/search.py
+++ b/elasticsearch_dsl/search.py
@@ -120,6 +120,7 @@ def __init__(self, using="default", index=None, doc_type=None, extra=None):
self._doc_type = []
self._doc_t... | diff --git a/tests/test_search.py b/tests/test_search.py
index 4da824182..ff1eed430 100644
--- a/tests/test_search.py
+++ b/tests/test_search.py
@@ -256,6 +256,38 @@ def test_sort_by_score():
s.sort("-_score")
+def test_collapse():
+ s = search.Search()
+
+ inner_hits = {"name": "most_recent", "size"... | Add support for collapse param in Search
There's no method for collapse feature. [Collapsing feature](https://www.elastic.co/guide/en/elasticsearch/reference/7.2/search-request-collapse.html) is vary usefull for building suggestions.
To use this feature right now in v7.0.0 of *e-dsl* I can use this workaround:
```p... | What is the status of the feature?
Any update?
Any news ?
You save me !!! thanks
could someone handle this issue?pls....@sethmlarson @dsanders11 @mattjmcnaughton
any update? | 2023-06-14T13:58:03Z | 2023-11-13T06:52:31Z | ["tests/test_document.py::test_meta_fields_are_stored_in_meta_and_ignored_by_to_dict", "tests/test_analysis.py::test_conditional_token_filter", "tests/test_field.py::test_scaled_float", "tests/test_document.py::test_from_es_respects_underscored_non_meta_fields", "tests/test_query.py::test_empty_Q_is_match_all", "tests/... | [] | ["tests/test_search.py::test_collapse", "tests/test_search.py::test_complex_example"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1467 | fac8787b3e26f2e95f3b83fa38c73ddeb9c14afd | diff --git a/docs/faceted_search.rst b/docs/faceted_search.rst
index c2f7e5e0e..bc1777723 100644
--- a/docs/faceted_search.rst
+++ b/docs/faceted_search.rst
@@ -49,7 +49,7 @@ There are several different facets available:
provides an option to split documents into groups based on a value of a field, for example ``Ter... | diff --git a/tests/conftest.py b/tests/conftest.py
index 3a481bbc7..b7326c3fb 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -18,6 +18,7 @@
import os
+import re
from datetime import datetime
from elasticsearch.helpers import bulk
@@ -47,6 +48,16 @@ def client():
skip()
+@fixture(scope="... | Deprecated: Using DateHistogramFacet with intervals seems to be deprecated
Hello there, first of all – thanks for all people contributing to this package.
Declaring documents and setting up faceted search works really, really nicely.
--
When experimenting with the `FacetedSearch` class and `DateHistogramFacet`, ... | 2020-12-04T15:47:10Z | 2020-12-04T19:35:05Z | ["tests/test_document.py::test_meta_fields_are_stored_in_meta_and_ignored_by_to_dict", "tests/test_analysis.py::test_conditional_token_filter", "tests/test_field.py::test_scaled_float", "tests/test_document.py::test_from_es_respects_underscored_non_meta_fields", "tests/test_query.py::test_empty_Q_is_match_all", "tests/... | [] | ["tests/test_faceted_search.py::test_date_histogram_interval_types[interval-1M]", "tests/test_faceted_search.py::test_date_histogram_interval_types[calendar_interval-day]", "tests/test_faceted_search.py::test_date_histogram_interval_types[interval-1d]", "tests/test_faceted_search.py::test_date_histogram_interval_types[... | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval | |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1465 | 16304df14cf7d105f69448ddb1a6e84ace431cb0 | diff --git a/elasticsearch_dsl/__init__.py b/elasticsearch_dsl/__init__.py
index facddf7bd..a1d2ab8b2 100644
--- a/elasticsearch_dsl/__init__.py
+++ b/elasticsearch_dsl/__init__.py
@@ -66,6 +66,7 @@
Percolator,
RangeField,
RankFeature,
+ RankFeatures,
ScaledFloat,
SearchAsYouType,
Short... | diff --git a/tests/test_field.py b/tests/test_field.py
index 2e8ec9689..8bc8d6f03 100644
--- a/tests/test_field.py
+++ b/tests/test_field.py
@@ -177,6 +177,11 @@ def test_constant_keyword():
assert f.to_dict() == {"type": "constant_keyword"}
+def test_rank_features():
+ f = field.RankFeatures()
+ assert ... | Support for Rank Features
Though "RankFeature" data type is supported with [this](https://github.com/elastic/elasticsearch-dsl-py/commit/2c099d527ed4b17d00b63cd4f49defb9ccea2325) commit, the "multi" version of it "[RankFeatures](https://www.elastic.co/guide/en/elasticsearch/reference/master/rank-features.html)" doesn't... | 2020-12-03T19:28:51Z | 2020-12-03T20:12:10Z | [] | [] | ["tests/test_aggs.py::test_filters_correctly_identifies_the_hash", "tests/test_document.py::test_meta_fields_are_stored_in_meta_and_ignored_by_to_dict", "tests/test_aggs.py::test_buckets_to_dict", "tests/test_result.py::test_hits_provide_dot_and_bracket_access_to_attrs", "tests/test_analysis.py::test_conditional_token_... | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval | |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1464 | 3e5703f0c8f6f682c7eea3db9413470876cb254f | diff --git a/elasticsearch_dsl/query.py b/elasticsearch_dsl/query.py
index cedd0a7ae..642ce2c88 100644
--- a/elasticsearch_dsl/query.py
+++ b/elasticsearch_dsl/query.py
@@ -499,6 +499,11 @@ class Script(Query):
name = "script"
+class ScriptScore(Query):
+ name = "script_score"
+ _param_defs = {"query": {... | diff --git a/tests/test_query.py b/tests/test_query.py
index 2e58040f2..2c9823eff 100644
--- a/tests/test_query.py
+++ b/tests/test_query.py
@@ -538,3 +538,18 @@ def test_function_score_from_dict():
assert isinstance(sf, function.BoostFactor)
assert 6 == sf.value
assert {"boost_factor": 6} == sf.to_dict(... | script_score not working
Using `script_score` throws `ValueError(Q() can only accept dict with a single query...`
```json
{
"query": {
"script_score": {
"query": {
"match_all": {}
},
"script": {
"source": """
double weight = 1;
if (doc['type'].val... | 2020-12-03T16:05:45Z | 2020-12-03T16:10:17Z | ["tests/test_document.py::test_meta_fields_are_stored_in_meta_and_ignored_by_to_dict", "tests/test_analysis.py::test_conditional_token_filter", "tests/test_field.py::test_scaled_float", "tests/test_document.py::test_from_es_respects_underscored_non_meta_fields", "tests/test_query.py::test_empty_Q_is_match_all", "tests/... | [] | ["tests/test_query.py::test_script_score"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval | |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1463 | f856f5dc400de065646bf42d2014dab73ee7ad52 | diff --git a/elasticsearch_dsl/response/__init__.py b/elasticsearch_dsl/response/__init__.py
index d35decb4b..022ab158b 100644
--- a/elasticsearch_dsl/response/__init__.py
+++ b/elasticsearch_dsl/response/__init__.py
@@ -113,3 +113,6 @@ def __init__(self, search, response, doc_class=None):
super(AttrDict, self... | diff --git a/tests/test_integration/test_update_by_query.py b/tests/test_integration/test_update_by_query.py
index 1acf153b6..64485391a 100644
--- a/tests/test_integration/test_update_by_query.py
+++ b/tests/test_integration/test_update_by_query.py
@@ -35,6 +35,7 @@ def test_update_by_query_no_script(write_client, setu... | Wrong information on docs for UpdateByQueryResponse
Docs for `UpdateByQuery` shows that is possible to check the response status with `response.success()`
```python
response = ubq.execute()
print(response.success())
# True
print(response.took)
# 12
```
But when trying to reproduce it raises the foll... | 2020-12-03T15:41:09Z | 2020-12-03T15:47:30Z | ["tests/test_document.py::test_meta_fields_are_stored_in_meta_and_ignored_by_to_dict", "tests/test_analysis.py::test_conditional_token_filter", "tests/test_field.py::test_scaled_float", "tests/test_document.py::test_from_es_respects_underscored_non_meta_fields", "tests/test_query.py::test_empty_Q_is_match_all", "tests/... | [] | ["tests/test_update_by_query.py::test_update_by_query_response_success"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval | |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1459 | 99b787cc9d013f9e6ba4c9a7ad7f55e387fb0df0 | diff --git a/elasticsearch_dsl/query.py b/elasticsearch_dsl/query.py
index 48b6ba746..cedd0a7ae 100644
--- a/elasticsearch_dsl/query.py
+++ b/elasticsearch_dsl/query.py
@@ -180,6 +180,11 @@ def _min_should_match(self):
)
def __invert__(self):
+ # Because an empty Bool query is treated like
+ ... | diff --git a/tests/test_query.py b/tests/test_query.py
index 098118d45..2e58040f2 100644
--- a/tests/test_query.py
+++ b/tests/test_query.py
@@ -206,6 +206,12 @@ def test_not_match_none_is_match_all():
assert ~q == query.MatchAll()
+def test_invert_empty_bool_is_match_none():
+ q = query.Bool()
+
+ asser... | ~Bool() should return MatchNone()
`Bool()` is the same as `MatchAll()` so inversion should have the same effect and result in `MatchNone()`
| 2020-12-02T19:18:36Z | 2020-12-02T19:31:16Z | ["tests/test_document.py::test_meta_fields_are_stored_in_meta_and_ignored_by_to_dict", "tests/test_analysis.py::test_conditional_token_filter", "tests/test_field.py::test_scaled_float", "tests/test_document.py::test_from_es_respects_underscored_non_meta_fields", "tests/test_query.py::test_empty_Q_is_match_all", "tests/... | [] | ["tests/test_query.py::test_invert_empty_bool_is_match_none"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval | |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1458 | 5487df02e12e39e16946267d2125620fe48900cf | diff --git a/elasticsearch_dsl/search.py b/elasticsearch_dsl/search.py
index b8323c180..761f6611e 100644
--- a/elasticsearch_dsl/search.py
+++ b/elasticsearch_dsl/search.py
@@ -31,7 +31,7 @@
from .exceptions import IllegalOperation
from .query import Bool, Q
from .response import Hit, Response
-from .utils import At... | diff --git a/tests/test_search.py b/tests/test_search.py
index ec2370ece..35395c53e 100644
--- a/tests/test_search.py
+++ b/tests/test_search.py
@@ -515,3 +515,65 @@ def test_update_from_dict():
"indices_boost": [{"important-documents": 2}],
"_source": ["id", "name"],
} == s.to_dict()
+
+
+def te... | Search `to_dict()` does not serialize `rescore_query`
Hi. It seems like `to_dict()` method of `Search` class does not serialize `rescore_query`content.
Example code:
```python
search = Search(index=index_name)
positive_query = Q(
"function_score",
query=Q('term', tags='a'),
script_score={"scrip... | If no one is working on it, I would like to try this out :)
@Andrii32 From a quick look at `elasticsearch_dsl/search.py`, the following `.extra()` did not perform any kind of serialization (a.k.a `to_dict()` of this issue title), and that explains why it remains object.
```
def extra(self, **kwargs):
"... | 2020-12-02T18:56:06Z | 2020-12-02T19:18:04Z | ["tests/test_document.py::test_meta_fields_are_stored_in_meta_and_ignored_by_to_dict", "tests/test_analysis.py::test_conditional_token_filter", "tests/test_field.py::test_scaled_float", "tests/test_document.py::test_from_es_respects_underscored_non_meta_fields", "tests/test_query.py::test_empty_Q_is_match_all", "tests/... | [] | ["tests/test_search.py::test_rescore_query_to_dict", "tests/test_utils.py::test_recursive_to_dict", "tests/test_update_by_query.py::test_ubq_to_dict"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1456 | e2753443eae73cbf1476f55e9e11c4749a2e32de | diff --git a/elasticsearch_dsl/field.py b/elasticsearch_dsl/field.py
index 6a1ed992a..6e79b4077 100644
--- a/elasticsearch_dsl/field.py
+++ b/elasticsearch_dsl/field.py
@@ -316,6 +316,10 @@ class Keyword(Field):
name = "keyword"
+class ConstantKeyword(Keyword):
+ name = "constant_keyword"
+
+
class Boolean... | diff --git a/tests/test_field.py b/tests/test_field.py
index 9c0c40237..2e8ec9689 100644
--- a/tests/test_field.py
+++ b/tests/test_field.py
@@ -172,6 +172,11 @@ def test_binary():
assert f.deserialize(None) is None
+def test_constant_keyword():
+ f = field.ConstantKeyword()
+ assert f.to_dict() == {"typ... | Support for constant_keyword
When trying to add a field of type [constant_keyword](https://www.elastic.co/guide/en/elasticsearch/reference/7.7/constant-keyword.html) to a Mapping, an exception is returned:
```
DSL class `constant_keyword` does not exist in field.
```
| Creating a custom field using:
```python
class ConstantKeyword(Keyword):
name = 'constant_keyword'
```
and then
```python
mapping.field('service_name', ConstantKeyword(value=svc_name))
```
Seems to result in the correct mapping being applied. Not sure if this is the right way to do it.
From https://g... | 2020-12-02T16:35:39Z | 2020-12-02T19:10:35Z | ["tests/test_document.py::test_meta_fields_are_stored_in_meta_and_ignored_by_to_dict", "tests/test_analysis.py::test_conditional_token_filter", "tests/test_field.py::test_scaled_float", "tests/test_document.py::test_from_es_respects_underscored_non_meta_fields", "tests/test_query.py::test_empty_Q_is_match_all", "tests/... | [] | ["tests/test_field.py::test_constant_keyword"] | [] | {"install": ["uv pip install -e ."], "pre_install": ["tee noxfile.py <<'EOF_1234810234'\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses th... | nox -rs test -- | null | null | null | swa-bench:sw.eval |
elastic/elasticsearch-dsl-py | elastic__elasticsearch-dsl-py-1416 | 2087f466d0ee4fa0452bffcfa14a965b84cd1f9a | diff --git a/elasticsearch_dsl/aggs.py b/elasticsearch_dsl/aggs.py
index 547a5931a..3e8689206 100644
--- a/elasticsearch_dsl/aggs.py
+++ b/elasticsearch_dsl/aggs.py
@@ -306,6 +306,10 @@ class ExtendedStats(Agg):
name = "extended_stats"
+class Boxplot(Agg):
+ name = "boxplot"
+
+
class GeoBounds(Agg):
... | diff --git a/test_elasticsearch_dsl/test_aggs.py b/test_elasticsearch_dsl/test_aggs.py
index a2317c995..bc953338d 100644
--- a/test_elasticsearch_dsl/test_aggs.py
+++ b/test_elasticsearch_dsl/test_aggs.py
@@ -266,3 +266,9 @@ def test_geotile_grid_aggregation():
a = aggs.GeotileGrid(**{"field": "centroid", "precisi... | "boxplot" is not available as an aggregation
ES 7.x includes the "boxplot" [aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-aggregations-metrics-boxplot-aggregation.html#_syntax), which will return the max, min and 25/50/75 percentiles (1st, 2nd, 3rd quartiles) values - the source for a ... | Added in the missing Agg subclass in #1412 | 2020-09-10T15:36:57Z | 2020-09-10T15:42:49Z | [] | [] | ["[ 30%]", "[ 15%]", "[ 92%]", "[ 26%]", "[ 65%]", "[ 25%]", "[ 14%]", "[ 56%]", "[ 74%]", "[ 27%]", "[ 5%]", "[ 63%]", "[ 0%]", "[ 11%]", "[ 62%]", "[ 31%]", "[ 89%]", "[100%]", "[ 28%]", "[ 2%]", "[ 72%]", "[ 93%]", "[ 55%]", "[ 16%]", "[ 67%]", "[ 8%]", "[ 6%]", "[ 10%]", "[ 22%]", "[ 64%]", "[ 70%]", "[ 77%]",... | [] | {"install": ["uv pip install -e ."], "pre_install": [], "python": "3.8", "pip_packages": ["alabaster==0.7.13", "argcomplete==1.12.3", "babel==2.16.0", "certifi==2024.12.14", "charset-normalizer==3.4.1", "colorlog==6.6.0", "coverage==4.5.4", "distlib==0.3.4", "docutils==0.20.1", "elasticsearch==7.17.12", "exceptiongroup... | nox -rs test -- | null | null | null | swa-bench:sw.eval |
gawel/pyquery | gawel__pyquery-221 | 7096042c6563cea07194a6430dea1b2dcb531b2f | diff --git a/CHANGES.rst b/CHANGES.rst
index 971d377..3e0901e 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -3,6 +3,8 @@
- Add nextUntil method
+- Fix escaping of top-level element text in ``.html()`` output
+
1.4.3 (2020-11-21)
------------------
diff --git a/pyquery/pyquery.py b/pyquery/pyquery.py
index e549... | diff --git a/tests/test_pyquery.py b/tests/test_pyquery.py
index d82a556..340e11e 100644
--- a/tests/test_pyquery.py
+++ b/tests/test_pyquery.py
@@ -534,9 +534,10 @@ def test_val_for_textarea(self):
self.assertEqual(d('#textarea-multi').val(), multi_expected)
self.assertEqual(d('#textarea-multi').text... | .html() fails to escape initial html entities
The html() method returns incorrect results in some cases because it fails to escape HTML entities prior to the first tag in the inner HTML:
```
>>> PyQuery("<foo><script>// uh oh</script>bar<boo/></foo>").html()
'<script>// uh oh</script>bar<boo/>'
```
... | Will this be enough if you have childrens ? (also feel free to provide a PR :) ) | 2021-08-02T20:11:58Z | 2021-08-06T06:48:57Z | ["tests/test_pyquery.py::TestTraversal::test_next_all", "tests/test_pyquery.py::TestTraversal::test_is", "tests/test_pyquery.py::TestSelector::test_selector_from_obj", "tests/test_pyquery.py::TestAjax::test_serialize_array", "tests/test_pyquery.py::TestTraversal::test_end", "tests/test_pyquery.py::TestManipulating::tes... | [] | ["tests/test_pyquery.py::TestManipulating::test_val_for_textarea", "tests/test_pyquery.py::TestManipulating::test_html_escape"] | ["tests/test_pyquery.py::TestWebScrappingTimeouts::test_get", "tests/test_pyquery.py::TestXMLNamespace::test_selector_html - Assertio..."] | {"install": [], "pre_install": ["tee pytest.ini <<EOF_1234810234\n[pytest]\nfilterwarnings = \n\tignore::DeprecationWarning\ndoctest_optionflags = ELLIPSIS NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL\naddopts = --color=no -rA --tb=no -p no:cacheprovider --doctest-modules --doctest-glob=\\\"*.rst\\\" --ignore=docs/conf... | tox -e py -- | null | null | null | swa-bench:sw.eval |
hynek/structlog | hynek__structlog-669 | 8da1ba578479c1a40988eff897c08659d901b7cb | diff --git a/CHANGELOG.md b/CHANGELOG.md
index c9f8382b..4e0886fc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,13 +28,15 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/
[#647](https://github.com/hynek/structlog/pull/647)
-
## Fixed
- `structlog.traceback.ExceptionDi... | diff --git a/tests/test_dev.py b/tests/test_dev.py
index 10597dd0..1193c040 100644
--- a/tests/test_dev.py
+++ b/tests/test_dev.py
@@ -614,6 +614,19 @@ def test_enforces_presence_of_exactly_one_default_formatter(self):
]
)
+ def test_does_not_modify_styles(self):
+ """
+ ... | dev.ConsoleRenderer modifies my own style variable
Is it expected that `dev.ConsoleRenderer` [changes the value of my style variable passed with the `level_styles` argument](https://github.com/hynek/structlog/blob/main/src/structlog/dev.py#L634-L641), instead of copying it and modifying its own copy?
Demo:
```pyt... | 2024-11-09T07:00:15Z | 2024-11-09T07:17:36Z | ["tests/test_dev.py::TestConsoleRenderer::test_pickle[1-False-False]", "tests/test_dev.py::TestConsoleRenderer::test_exc_info_exception", "tests/test_dev.py::TestConsoleRenderer::test_timestamp", "tests/test_dev.py::TestConsoleRenderer::test_logger_name", "tests/test_dev.py::TestConsoleRenderer::test_pickle[2-True-True... | [] | ["tests/test_dev.py::TestConsoleRenderer::test_does_not_modify_styles"] | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval | |
hynek/structlog | hynek__structlog-618 | 0a93f827f4bace552588b81c58c27f9c43ffe61e | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9edf242b..645fffaf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -23,6 +23,9 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/
- The `structlog.processors.CallsiteParameterAdder` can now be pickled.
[#603](https://github.com/hynek/st... | diff --git a/tests/processors/test_processors.py b/tests/processors/test_processors.py
index cec06474..91443509 100644
--- a/tests/processors/test_processors.py
+++ b/tests/processors/test_processors.py
@@ -298,28 +298,35 @@ def test_all_parameters(self) -> None:
assert self.parameter_strings == self.get_calls... | Async logger calls report incorrect call site parameters
It appears that the async logger calls (`adebug`, `ainfo`, ...) are unable to access the correct stack frame / call site parameters because the calls are dispatched via `concurrent.futures.thread`.
I need compatibility with `stdlib logging` as well as `structl... | Oof yeah it looks like we've only added tests for AsyncBoundLogger (that is kinda deprecated) but not to the vanilla `a.*()`methods. 😳
I'll see what I can do. As for your 2 point: as long as your loggers don't block a lot on IO, the benefits of async logging is dubious at best, but people asked for it a lot and it ... | 2024-05-13T07:27:16Z | 2024-05-13T15:47:24Z | ["tests/processors/test_processors.py::TestCallsiteParameterAdder::test_e2e[common-with-pre-structlog-parameter_strings46]", "tests/processors/test_processors.py::TestCallsiteParameterAdder::test_e2e[everywhere-structlog-parameter_strings108]", "tests/processors/test_processors.py::TestCallsiteParameterAdder::test_proc... | [] | ["tests/processors/test_processors.py::TestCallsiteParameterAdder::test_async[BoundLogger-ainfo]"] | ["tests/processors/test_processors.py::TestCallsiteParameterAdder::test_e2e[everywhere-logging-parameter_strings95]", "tests/processors/test_processors.py::TestCallsiteParameterAdder::test_processor[logging-parameter_strings8]", "tests/processors/test_processors.py::TestCallsiteParameterAdder::test_e2e[shared-logging-N... | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
hynek/structlog | hynek__structlog-603 | f0c7e8c71eeb504829218b434bfb7774884bec5c | diff --git a/CHANGELOG.md b/CHANGELOG.md
index c2f8df48..cf107bc7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,8 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/
- It is now possible to disable log level-padding in `structlog.dev.LogLevelColumnFormatter` and `structlog.d... | diff --git a/tests/processors/test_processors.py b/tests/processors/test_processors.py
index 865c1f7d..cec06474 100644
--- a/tests/processors/test_processors.py
+++ b/tests/processors/test_processors.py
@@ -11,6 +11,7 @@
import json
import logging
import os
+import pickle
import sys
import threading
@@ -492,6 +4... | `CallsiteParameterAdder` not pickleable
I am developing an application where I bind a collection of data to a logger and ultimately pass that logger into subprocess. For my application, it's desired to have call stack information from the [`CallsiteParameterAdder`](https://github.com/hynek/structlog/blob/186d2eaf7a1d7... | 2024-03-11T18:20:17Z | 2024-03-14T05:37:16Z | ["tests/processors/test_processors.py::TestCallsiteParameterAdder::test_e2e[common-with-pre-structlog-parameter_strings46]", "tests/processors/test_processors.py::TestCallsiteParameterAdder::test_e2e[everywhere-structlog-parameter_strings108]", "tests/processors/test_processors.py::TestCallsiteParameterAdder::test_proc... | ["tests/processors/test_processors.py::TestCallsiteParameterAdder::test_e2e[common-with-pre-logging-parameter_strings29]", "tests/processors/test_processors.py::TestCallsiteParameterAdder::test_processor[logging-parameter_strings1]", "tests/processors/test_processors.py::TestCallsiteParameterAdder::test_e2e[everywhere-... | ["tests/processors/test_processors.py::TestCallsiteParameterAdder::test_pickeable_callsite_parameter_adder"] | ["tests/processors/test_processors.py::TestCallsiteParameterAdder::test_e2e[everywhere-logging-parameter_strings95]", "tests/processors/test_processors.py::TestCallsiteParameterAdder::test_e2e[shared-logging-None]", "tests/processors/test_processors.py::TestCallsiteParameterAdder::test_e2e[shared-logging-parameter_stri... | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval | |
hynek/structlog | hynek__structlog-594 | db834f532618e28d3fb68349a6d76af8493de541 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index fd810dea..9d3b8d5a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,9 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/
- `structlog.processors.LogfmtRenderer` now escapes newlines.
[#592](https://github.com/hynek/structlog/pu... | diff --git a/tests/processors/test_renderers.py b/tests/processors/test_renderers.py
index b3d6e51a..8f225c80 100644
--- a/tests/processors/test_renderers.py
+++ b/tests/processors/test_renderers.py
@@ -275,6 +275,33 @@ def test_newline_in_value(self):
assert r"with_newline=some\nvalue" == rv
+ @pytest.... | LogfmtRenderer has a bug with escaped double quotes
In the code of LogFmtRenderer there is:
`value = f"{value}".replace('"', '\\"')`
However if you are trying to render an escaped double quote like
`"I want to render this \"string\" with logfmtrenderer"`
it ends up rendering it as
`\"I want to render this \... | Hmmm we've used the same approach as python-logfmter IIRC, so they've got the same bug if this is valid.
I'm trying to wrap my head around this, but is there a more precise definition of of logfmt than https://brandur.org/logfmt?
It feels like it accidentally did the right thing and escaped the backslash to prese... | 2024-02-05T08:03:20Z | 2024-02-07T10:08:39Z | ["tests/processors/test_renderers.py::TestTimeStamper::test_pickle[0-other-key-True-%Y]", "tests/processors/test_renderers.py::TestFormatExcInfo::test_nop[]", "tests/processors/test_renderers.py::TestTimeStamper::test_pickle[3-other-key-False-%Y]", "tests/processors/test_renderers.py::TestTimeStamper::test_pickle[5-Non... | [] | ["tests/processors/test_renderers.py::TestLogfmtRenderer::test_escaping[a\"quote-\"a\\\\\"quote\"]", "tests/processors/test_renderers.py::TestLogfmtRenderer::test_escaping[I want to render this \\\\\"string\\\\\" with logfmtrenderer-\"I want to render this \\\\\\\\\\\\\"string\\\\\\\\\\\\\" with logfmtrenderer\"]", "te... | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
hynek/structlog | hynek__structlog-550 | 6323d5fc54a5e5ff09eca7d8b912ab6ef9256992 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9a12c8fb..7a0e35cf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,9 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/
- `structlog.threadlocal.tmp_bind()` now also works with `BoundLoggerLazyProxy` (in other words: before any... | diff --git a/tests/test_stdlib.py b/tests/test_stdlib.py
index 626b1a7c..569bbbd7 100644
--- a/tests/test_stdlib.py
+++ b/tests/test_stdlib.py
@@ -1189,6 +1189,34 @@ def emit(self, record):
assert not records
+ def test_use_get_message_false(self):
+ """
+ If use_get_message_is False, the ... | ProcessorFormatter should be able to pass the message unformatted
https://github.com/hynek/structlog/blob/f7145a6a815083a748ec2e41a1d66dd63ce6c411/src/structlog/stdlib.py#L1016
The problematic pipeline is logging -> ProcessorFormatter -> structlog -> Sentry.
Currently ProcessorFormatter calls `getMessage` on the... | Could you give me more concrete examples of how this would be used? Adding a bool field to ProcessorFormatter shouldn't be a problem, but I'd like to understand what this is exactly about and how it would be used (which also means how I would document it).
Use case: I believe that ProcessorFormatter can only be used as... | 2023-09-07T07:02:12Z | 2023-11-21T07:29:38Z | ["tests/test_stdlib.py::TestExtraAdder::test_add_extra_e2e[allow2-None]", "tests/test_stdlib.py::TestBoundLogger::test_proxies_to_correct_method[info]", "tests/test_stdlib.py::TestExtraAdder::test_add_extra[allow5-None]", "tests/test_stdlib.py::TestExtraAdder::test_add_extra_e2e[allow8-None]", "tests/test_stdlib.py::Te... | [] | ["tests/test_stdlib.py::TestProcessorFormatter::test_use_get_message_false", "tests/test_stdlib.py::test_recreate_defaults[45]"] | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
hynek/structlog | hynek__structlog-572 | 8d3eeb1d9a7f7d5e20d515df45fa7779223bbbba | diff --git a/CHANGELOG.md b/CHANGELOG.md
index cbc966e4..9a12c8fb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,10 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/
- `structlog.threadlocal.tmp_bind()` now also works with `BoundLoggerLazyProxy` (in other words: before an... | diff --git a/tests/test_stdlib.py b/tests/test_stdlib.py
index 4e3c9f56..626b1a7c 100644
--- a/tests/test_stdlib.py
+++ b/tests/test_stdlib.py
@@ -12,7 +12,7 @@
import sys
from io import StringIO
-from typing import Any, Callable, Collection
+from typing import Any, Callable, Collection, Dict
import pytest
impo... | exc_info is not resolved properly when calling BoundLogger.exception
I have a slightly unusual setup that I should explain first. I'm using the maximalist approach of routing all of my structlog and stdlib logging through `ProcessorFormatter` as per [the docs](https://www.structlog.org/en/stable/standard-library.html#r... | Got a small code snippet to demo this behavior?
Sure, I've put together a gist with a minimal example: https://gist.github.com/bcdickinson/b5ec383a518995addc0df629f6c7a83f
Gotcha, I see now. Will look at the codebase to see if there is a bug/better way, but here is a `structlog.processor` and some small changes to you... | 2023-11-03T19:09:15Z | 2023-11-16T06:17:20Z | ["tests/test_stdlib.py::TestExtraAdder::test_add_extra_e2e[allow2-None]", "tests/test_stdlib.py::TestBoundLogger::test_proxies_to_correct_method[info]", "tests/test_stdlib.py::TestExtraAdder::test_add_extra[allow5-None]", "tests/test_stdlib.py::TestExtraAdder::test_add_extra_e2e[allow8-None]", "tests/test_stdlib.py::Te... | [] | ["tests/test_stdlib.py::TestBoundLogger::test_proxies_to_correct_method[exception]", "tests/test_stdlib.py::TestProcessorFormatter::test_non_string_message_warning", "tests/test_stdlib.py::TestAsyncBoundLogger::test_correct_levels[exception]", "tests/test_stdlib.py::test_recreate_defaults[45]", "tests/test_stdlib.py::T... | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
hynek/structlog | hynek__structlog-561 | 44a55f41a9921e54ea545f7d2801be2fb7479ad2 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index bc418de2..68e5ce48 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,11 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/
## [Unreleased](https://github.com/hynek/structlog/compare/23.2.0...HEAD)
+### Fixed
+
+- The return val... | diff --git a/tests/test_config.py b/tests/test_config.py
index 5e741d5d..f9a9f8eb 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -26,6 +26,7 @@
get_logger,
wrap_logger,
)
+from structlog.typing import BindableLogger
@pytest.fixture(name="proxy")
@@ -56,6 +57,16 @@ class Foo(metaclass=ab... | Changes to behavior of `runtime_checkable()` in py 3.12
I came across this - not sure if you'd consider it a bug but hopefully worth bringing to your attention.
We had some code that tries to handle multiple logging libraries which was essentially doing this:
```py
from structlog import get_logger
from structl... | The vanilla `get_logger` returns an Any, I suspect that's more likely to be the issue? See also https://www.structlog.org/en/stable/typing.html
This isn't a static typing issue. It is a runtime issue on python 3.12 where the `BindableLogger` protocol (which is marked `@runtime_checkable`) returns `False` on an `isinsta... | 2023-10-16T10:27:43Z | 2023-10-16T10:38:01Z | ["tests/test_config.py::TestFunctions::test_get_logger_configures_according_to_config", "tests/test_config.py::TestConfigure::test_get_config_is_configured", "tests/test_config.py::TestBoundLoggerLazyProxy::test_pickle[0]", "tests/test_config.py::TestConfigure::test_just_context_class", "tests/test_config.py::TestBound... | [] | ["tests/test_config.py::TestFunctions::test_get_logger_passes_positional_arguments_to_logger_factory", "tests/test_config.py::test_lazy_logger_is_an_instance_of_bindable_logger"] | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
hynek/structlog | hynek__structlog-549 | 25c361c71763df0e7f39d0d36cca08ff4b46e924 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3dd3029c..858080b8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,11 +24,16 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/
- Official support for Python 3.12.
[#515](https://github.com/hynek/structlog/issues/515)
+
- `struct... | diff --git a/tests/test_dev.py b/tests/test_dev.py
index 2d845570..531e76df 100644
--- a/tests/test_dev.py
+++ b/tests/test_dev.py
@@ -7,6 +7,7 @@
import sys
from io import StringIO
+from unittest import mock
import pytest
@@ -560,20 +561,19 @@ def test_set_it(self):
assert {"exc_info": True} == dev.s... | Allow passing arguments to Rich in structlog.dev.rich_traceback
I'm trying to figure out how to turn off locals when printing out stack traces with the rich logger (but also with the JSONRenderer). Can't seem to find a way to do that in the documentation, aside from just extracting it from the final `dict` log record.
... | Just noting here that I've tried using `rich` directly to turn off `show_locals`, without much luck. Seems like this module is overriding it somehow.
Okay I figured out half of it, at least for the JSONRenderer. Instead of `structlog.processors.dict_tracebacks`, I passed:
```python
structlog.processors.ExceptionRen... | 2023-09-07T06:45:08Z | 2023-09-08T04:36:25Z | ["tests/test_dev.py::TestConsoleRenderer::test_pickle[1-False-False]", "tests/test_dev.py::TestConsoleRenderer::test_exc_info_exception", "tests/test_dev.py::TestConsoleRenderer::test_timestamp", "tests/test_dev.py::TestConsoleRenderer::test_logger_name", "tests/test_dev.py::TestConsoleRenderer::test_pickle[2-True-True... | [] | ["tests/test_dev.py::TestRichTracebackFormatter::test_width_minus_one"] | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
hynek/structlog | hynek__structlog-533 | 7c8366e71d5b18cd036c02644bee63a16faf6e2d | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 80dfe728..ae8d7ff0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -32,7 +32,8 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/
- `FilteringBoundLogger.exception()` and `FilteringBoundLogger.aexception()` now support positional argume... | diff --git a/tests/test_dev.py b/tests/test_dev.py
index dfbed0cb..b99966c3 100644
--- a/tests/test_dev.py
+++ b/tests/test_dev.py
@@ -510,6 +510,19 @@ def test_pickle(self, repr_native_str, force_colors, proto):
pickle.dumps(r, proto)
)(None, None, {"event": "foo"})
+ def test_no_exception(s... | AttributeError raised when calling logger.exception without exception information
Hello everyone!
Before I describe the issue, let me provide some context.
### Main issue:
I encountered an error when attempting to call logger.exception outside an except block without including any information about an exception.... | I indeed faced the same problem, trying to migrate from the standard lib to structlog.
I instead used a custom processor, and changed `_figure_out_exc_info`'s signature to OptExcInfo.
I guess following the same behaviour as the standard library would be more intuitive, ans ease migration.
```python
def _figur... | 2023-07-22T15:08:51Z | 2023-07-29T14:53:41Z | ["tests/test_dev.py::TestConsoleRenderer::test_pickle[2-True-True]", "tests/test_processors.py::TestCallsiteParameterAdder::test_e2e[everywhere-structlog-parameter_strings106]", "tests/test_processors.py::TestCallsiteParameterAdder::test_e2e[common-without-pre-logging-parameter_strings5]", "tests/test_processors.py::Te... | [] | ["tests/test_dev.py::TestConsoleRenderer::test_no_exception", "tests/test_processors.py::TestFormatExcInfo::test_no_exception[True]", "tests/test_processors.py::TestFormatExcInfo::test_no_exception[ei1]"] | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
hynek/structlog | hynek__structlog-483 | ccd21e8b5d72bef849fbcbfe50d040d8496ea8e6 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7876c838..e21336ac 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,12 @@ You can find out backwards-compatibility policy [here](https://github.com/hynek/
## [Unreleased](https://github.com/hynek/structlog/compare/22.3.0...HEAD)
+### Fixed
+
+- ConsoleRendere... | diff --git a/tests/test_dev.py b/tests/test_dev.py
index 84660aaa..7266c527 100644
--- a/tests/test_dev.py
+++ b/tests/test_dev.py
@@ -283,6 +283,53 @@ def test_stack_info(self, cr, padded):
assert (padded + "\n" + stack) == rv
+ def test_exc_info_tuple(self, cr, padded):
+ """
+ If exc_in... | ConsoleRenderer does not handle non-tuple exc_info
First, thank you for this great package.
We are using structlog for creating canonical logs in a lambda function. The entrypoint of the lambda function calls another method which handles the event. This method never raises, but code within the other method might tra... | 2022-12-10T04:44:40Z | 2023-02-06T09:31:03Z | ["tests/test_dev.py::TestConsoleRenderer::test_pickle[1-False-False]", "tests/test_dev.py::TestConsoleRenderer::test_timestamp", "tests/test_dev.py::TestConsoleRenderer::test_logger_name", "tests/test_dev.py::TestConsoleRenderer::test_pickle[2-True-True]", "tests/test_dev.py::TestConsoleRenderer::test_pickle[5-True-Fal... | [] | ["tests/test_dev.py::TestConsoleRenderer::test_exc_info_exception", "tests/test_dev.py::TestConsoleRenderer::test_everything[exception]"] | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval | |
hynek/structlog | hynek__structlog-478 | 87cdcaf0205f9b62f793f331160d17cb12316e0d | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8ddee6fa..48eeb0c7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,6 +22,12 @@ This prevents crashes if something different than a string is passed for the *ev
[#475](https://github.com/hynek/structlog/pull/475)
+### Fixed
+
+- String interpolation doesn't cause... | diff --git a/tests/test_log_levels.py b/tests/test_log_levels.py
index fff9cce7..2a0e579c 100644
--- a/tests/test_log_levels.py
+++ b/tests/test_log_levels.py
@@ -61,6 +61,22 @@ async def test_async_one_below(self, bl, cl):
assert [] == cl.calls
+ def test_filtered_interp(self, bl, cl):
+ """
+ ... | Interpolation raises an error for filtered out logs
Interpolation appears to be broken when the log is filtered out. Observed with structulog 22.2.0.
```python
import logging
import structlog
structlog.configure(
processors=[
structlog.contextvars.merge_contextvars,
structlog.processors... | 2022-11-23T09:09:11Z | 2022-11-23T13:58:11Z | ["tests/test_log_levels.py::TestFilteringLogger::test_pickle[10]", "tests/test_log_levels.py::TestFilteringLogger::test_pickle[30]", "tests/test_log_levels.py::TestFilteringLogger::test_alog_interp", "tests/test_log_levels.py::TestFilteringLogger::test_alog_no_args", "tests/test_log_levels.py::TestFilteringLogger::test... | [] | ["tests/test_log_levels.py::TestFilteringLogger::test_async_filtered_interp", "tests/test_log_levels.py::TestFilteringLogger::test_filtered_interp", "tests/test_log_levels.py::TestFilteringLogger::test_async_contextvars_merged[alog-args2]"] | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval | |
hynek/structlog | hynek__structlog-475 | 7cf81c3325054eb36cbde5a353fd2f3eb17f4000 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9d7ed2ef..8ddee6fa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,13 @@ You can find out backwards-compatibility policy [here](https://github.com/hynek/
## [Unreleased](https://github.com/hynek/structlog/compare/22.2.0...HEAD)
+### Changed
+
+- String inter... | diff --git a/tests/test_log_levels.py b/tests/test_log_levels.py
index 1a372733..fff9cce7 100644
--- a/tests/test_log_levels.py
+++ b/tests/test_log_levels.py
@@ -61,6 +61,26 @@ async def test_async_one_below(self, bl, cl):
assert [] == cl.calls
+ def test_no_args(self, bl, cl):
+ """
+ If... | 22.2.0 - TypeError with logger.exception and string interpolation
```
_log_levels.py:156
unsupported operand type(s) for %: '<exception object>' and 'tuple'
```
sample stack https://gist.github.com/alangenfeld/2bc3f1d22e81af428fa487320fc6c797
| Hello @alangenfeld
I confirm the bug. It happens here too. Our bitbucket pipelines kepts hanging for hours. Today bitbucket pipeline service was actually down. So I thought to wait the fix. But next still had the problem. It boiled down to this specific error.
 -> Any:
async def aexception(self: FilteringBoundLogger, ev... | diff --git a/tests/test_log_levels.py b/tests/test_log_levels.py
index 285dbfc2..1a372733 100644
--- a/tests/test_log_levels.py
+++ b/tests/test_log_levels.py
@@ -10,6 +10,11 @@
from structlog import make_filtering_bound_logger
from structlog._log_levels import _LEVEL_TO_NAME
+from structlog.contextvars import (
+ ... | FilteringBoundLogger Async methods - capture context outside of executor thread
Taking the new async methods on `FilteringBoundLogger` for a spin, I noticed context captured with `bind_contextvars()` is not logged.
Narrowed it down to this pattern:
```python
return await asyncio.get_running_loop().run_in... | 2022-11-03T12:19:34Z | 2022-11-03T13:01:16Z | ["tests/test_log_levels.py::TestFilteringLogger::test_pickle[10]", "tests/test_log_levels.py::TestFilteringLogger::test_pickle[30]", "tests/test_log_levels.py::TestFilteringLogger::test_exact_level", "tests/test_log_levels.py::TestFilteringLogger::test_async_exception", "tests/test_log_levels.py::TestFilteringLogger::t... | [] | ["tests/test_log_levels.py::TestFilteringLogger::test_async_contextvars_merged[aexception-args0]", "tests/test_log_levels.py::TestFilteringLogger::test_async_pos_args", "tests/test_log_levels.py::TestFilteringLogger::test_async_contextvars_merged[alog-args2]", "tests/test_log_levels.py::TestFilteringLogger::test_async_... | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval | |
hynek/structlog | hynek__structlog-427 | cf8d6f05a5c683125896985c10fbf11a139085e1 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index dd3a072a..2fc744e1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -73,6 +73,10 @@ So please make sure to **always** properly configure your applications.
[#392](https://github.com/hynek/structlog/pull/392)
- Monkeypatched `sys.stdout`s are now handled more gracefully ... | diff --git a/conftest.py b/conftest.py
index d48e530e..10cb5834 100644
--- a/conftest.py
+++ b/conftest.py
@@ -41,8 +41,8 @@ def _sio():
return StringIO()
-@pytest.fixture
-def event_dict():
+@pytest.fixture(name="event_dict")
+def _event_dict():
"""
An example event dictionary with multiple value ty... | render_to_log_kwargs does not handle all kwargs
Hi, i want to use standard logging for formatting, to use formatting from https://github.com/elastic/ecs-logging-python
But, following configuration:
```python
structlog.configure(
processors=[
# Transform event dict into `logging.Logger` method arg... | +1, I also hit the exact same issue. I'm trying to use the `stdlib.LoggerFactory` and `structlog.stdlib.ProcessorFormatter` to defer all of the log record manipulation into the stdlib logging, but using the `structlog` processors (so that 3rd party libs that use `logging.getLogger()` have consistent formatting with my ... | 2022-07-06T13:37:23Z | 2022-07-06T14:32:19Z | ["tests/test_stdlib.py::TestExtraAdder::test_add_extra_e2e[allow2-None]", "tests/test_stdlib.py::TestBoundLogger::test_proxies_to_correct_method[info]", "tests/test_stdlib.py::TestExtraAdder::test_add_extra[allow5-None]", "tests/test_stdlib.py::TestExtraAdder::test_add_extra_e2e[allow8-None]", "tests/test_stdlib.py::Te... | [] | ["tests/test_stdlib.py::TestAsyncBoundLogger::test_integration", "tests/test_stdlib.py::TestRenderToLogKW::test_handles_special_kw"] | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
hynek/structlog | hynek__structlog-385 | 0605473ccc13698e9c090cfd14e620f3de1ae6a3 | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 4b65f5e4..52047294 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -42,6 +42,9 @@ Changes:
- Added the ``structlog.stdlib.ExtraAdder`` processor that adds extra attributes of ``logging.LogRecord`` objects to the event dictionary.
This processor can be used for addi... | diff --git a/tests/test_processors.py b/tests/test_processors.py
index 60c70fad..e7c3d5b2 100644
--- a/tests/test_processors.py
+++ b/tests/test_processors.py
@@ -4,9 +4,18 @@
# repository for complete details.
import datetime
+import functools
+import inspect
+import itertools
import json
+import logging
+import ... | Add callsite info to event dictionary
I would like to have the following values in the event dictionary (taken from [`logging` module docs](https://docs.python.org/3/library/logging.html#logrecord-attributes)):
Attribute name | Description
-- | --
filename | Filename portion of pathname.
pathname | Full pathname... | I created a draft with code and tests, still need to add docs and other things, but would like some feedback before I proceed much further.
Wow you're putting me really to shame with your industriousness (and generosity – thank you so much!)!
Since – if I'm not mistaken – all this data is available via logging extra... | 2021-12-12T23:22:26Z | 2021-12-16T12:19:51Z | [] | [] | ["tests/test_processors.py::TestCallsiteParameterAdder::test_e2e[everywhere-structlog-parameter_strings106]", "tests/test_processors.py::TestCallsiteParameterAdder::test_e2e[common-without-pre-logging-parameter_strings5]", "tests/test_processors.py::TestTimeStamper::test_pickle[3-other-key-True-None]", "tests/test_proc... | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
hynek/structlog | hynek__structlog-376 | d8d5e75ba779b31a96735486007cc2a281fe12b3 | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 2b0239dc..95cfd52a 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -33,7 +33,8 @@ Deprecations:
Changes:
^^^^^^^^
-*none*
+- Added the ``structlog.processors.LogfmtRenderer`` processor to render log lines using the `logfmt <https://brandur.org/logfmt>`_ format.
+ ... | diff --git a/tests/test_processors.py b/tests/test_processors.py
index 85e58e4b..60c70fad 100644
--- a/tests/test_processors.py
+++ b/tests/test_processors.py
@@ -18,6 +18,7 @@
ExceptionPrettyPrinter,
JSONRenderer,
KeyValueRenderer,
+ LogfmtRenderer,
StackInfoRenderer,
TimeStamper,
Unic... | Logfmt formatter is missing
Hello there!
Is there a way to remove the single quotes, e.g: `level='info'`to `level=info`? I'm using loki and their logfmt parser seems not to like it much (and I can't find how to remove them with structlog).
I could also try processing the logs before shipping them to loki, but if... | No there isn't, because it's really an accident that the repr-based formatter is so similar to logfmt!
I've thought a few times about implementing one but since I don't need it myself, I never bothered. Any chance you could feed Loki JSON?
Sure I can!
I was going with logfmt because they recommend it (it is what ... | 2021-12-02T17:11:02Z | 2021-12-05T04:59:42Z | [] | [] | ["tests/test_processors.py::TestTimeStamper::test_pickle[4-None-False-%Y]", "tests/test_processors.py::TestKeyValueRenderer::test_order_missing", "tests/test_processors.py::TestTimeStamper::test_pickle[2-other-key-True-None]", "tests/test_processors.py::TestTimeStamper::test_pickle[3-None-True-None]", "tests/test_proce... | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
hynek/structlog | hynek__structlog-365 | 2f956be9535bfd4aac9833c3f48396e03d6e47e3 | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 96cdb7f0..11745d6e 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -31,6 +31,13 @@ Changes:
`#364 <https://github.com/hynek/structlog/pull/364>`_
- ``structlog.stdlib.AsyncBoundLogger`` now determines the running loop when logging, not on instantiation.
That has... | diff --git a/tests/test_stdlib.py b/tests/test_stdlib.py
index f47a6016..c95fe846 100644
--- a/tests/test_stdlib.py
+++ b/tests/test_stdlib.py
@@ -11,7 +11,7 @@
import pytest
-from pretend import call_recorder
+from pretend import call_recorder, stub
from structlog import (
PrintLogger,
@@ -484,8 +484,8 @@... | [Feature-Request] Allow copying attrs from stdlib LogRecord into structlog's msg
When `._proxy_to_logger` is called, Python's built-in logging calls `makeRecord` that computes [attributes](https://docs.python.org/3/library/logging.html#logrecord-attributes) that might be useful for some use cases (the most common examp... | Another stupid question, I tried digging through git history but still confused
https://github.com/hynek/structlog/blob/36eeb18c043319f43c33364331a4a5cfcd326bde/src/structlog/stdlib.py#L495-L510
is the `.copy()` on line 510 done to avoid any mutation by `self.processor`? because the comment on 507-509 seems to be... | 2021-11-11T09:12:43Z | 2021-11-19T15:11:42Z | ["tests/test_stdlib.py::TestBoundLogger::test_proxies_to_correct_method[info]", "tests/test_stdlib.py::TestLoggerFactory::test_ignores_frames", "tests/test_stdlib.py::TestAddLogLevelNumber::test_log_level_number_added[debug-10]", "tests/test_stdlib.py::TestBoundLogger::test_proxies_to_correct_method[error]", "tests/tes... | [] | ["tests/test_stdlib.py::TestProcessorFormatter::test_foreign_pre_chain_gets_exc_info", "tests/test_stdlib.py::TestProcessorFormatter::test_remove_processors_meta", "tests/test_stdlib.py::TestProcessorFormatter::test_foreign_pre_chain", "tests/test_stdlib.py::TestProcessorFormatter::test_no_renderer", "tests/test_stdlib... | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[tox]\nmin_version = 4\nenv_list =\n pre-commit,\n mypy-pkg,\n py3{8,9,10,11,12,13}-{tests,mypy}\n py3{8,13}-tests-{colorama,be,rich},\n docs{,-sponsors},\n coverage-report\n\n\n[testenv]\npackage = wheel\nwheel... | pytest --tb=no -rA -p no:cacheprovider | null | null | null | swa-bench:sw.eval |
hynek/structlog | hynek__structlog-350 | 6bd5b32ea58a9f9a8edfd846284f918b78fe3468 | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 2b4d49b2..4332c706 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -39,6 +39,8 @@ Changes:
- All use of ``colorama`` on non-Windows systems has been excised.
Thus, colors are now enabled by default in ``structlog.dev.ConsoleRenderer`` on non-Windows systems.
You... | diff --git a/tests/test_base.py b/tests/test_base.py
index 4021a3e7..62994611 100644
--- a/tests/test_base.py
+++ b/tests/test_base.py
@@ -186,6 +186,16 @@ def test_last_processor_returns_bytes(self):
assert ((b"foo",), {}) == b._process_event(None, "name", {})
+ def test_last_processor_returns_bytearra... | Support bytearray for final processor output
Use case: For performance in concatenating bytes, one might want their final processor to output a `bytearray` instead of `bytes`. This [blog post](https://www.guyrutenberg.com/2020/04/04/fast-bytes-concatenation-in-python/) illustrates that using a `bytearray` is the most p... | Yes, the change should be as simple as you say. May I ask how you'd intend to use it? I've added bytes specifically to support orjson's performance gains. Is there something out there spewing out bytearrays? 🤔
Thanks for the reply, and I'm happy to share my use case, although it may be a little half-baked at this poin... | 2021-08-29T08:00:08Z | 2021-09-01T05:19:39Z | ["tests/test_base.py::TestBinding::test_repr", "tests/test_base.py::TestProcessing::test_last_processor_returns_string", "tests/test_base.py::TestBinding::test_try_unbind", "tests/test_base.py::TestProcessing::test_copies_context_before_processing", "tests/test_base.py::TestProcessing::test_last_processor_returns_tuple... | [] | ["tests/test_base.py::TestProcessing::test_last_processor_returns_bytearray", "tests/test_base.py::TestProxying::test_processor_raising_DropEvent_silently_aborts_chain"] | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[flake8]\nignore = E203,W503,W504\n\n# Keep docs in sync with docs env and .readthedocs.yml.\n[gh-actions]\npython =\n 3.6: py36\n 3.7: py37\n 3.8: py38, docs, lint\n 3.9: py39, manifest, mypy\n 3.10: py310\n py... | tox -- | null | null | null | swa-bench:sw.eval |
hynek/structlog | hynek__structlog-331 | 1f76a041dbeeb4e23a5128c9465a96a0ef789267 | diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index fa6b7c34..edd47b81 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -32,6 +32,8 @@ Changes:
- If the `better-exceptions <https://github.com/qix-/better-exceptions>`_ package is present, ``structlog.dev.ConsoleRenderer`` will now pretty-print exceptions using it.
Pas... | diff --git a/tests/test_threadlocal.py b/tests/test_threadlocal.py
index 1675078f..2cac457e 100644
--- a/tests/test_threadlocal.py
+++ b/tests/test_threadlocal.py
@@ -7,15 +7,18 @@
import pytest
+import structlog
+
from structlog._base import BoundLoggerBase
from structlog._config import wrap_logger
from struct... | Public access to threadlocal._get_context()
Similarly to #266, I find myself needing to access the thread-local context (I need to re-estabish some bound variables after a `clean_threadlocal()`).
I tried to use `structlog.get_context()` but it's not returning the threadlocal context. If this would be accepted, I mig... | Hm you want to be toying with implementation details, that seems rather dangerous to structlog's feature envelope. It seems like this could be solved better with e.g. a processor? I can't be more concrete since I don't know your use-case, but I usually have a processor to inject certain data for each logger. Or have so... | 2021-07-11T08:46:55Z | 2021-07-16T05:39:04Z | [] | [] | ["tests/test_threadlocal.py::TestThreadLocalDict::test_new_class", "tests/test_threadlocal.py::TestNewThreadLocal::test_get_merged", "tests/test_threadlocal.py::TestAsImmutable::test_does_not_affect_global", "tests/test_threadlocal.py::TestNewThreadLocal::test_multiple_binds", "tests/test_threadlocal.py::TestNewThreadL... | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n[flake8]\nignore = E203,W503,W504\n\n# Keep docs in sync with docs env and .readthedocs.yml.\n[gh-actions]\npython =\n 3.6: py36\n 3.7: py37\n 3.8: py38, docs\n 3.9: py39, manifest, mypy\n 3.10: py310\n pypy3: p... | tox -- | null | null | null | swa-bench:sw.eval |
hynek/structlog | hynek__structlog-283 | 30d14a4cd236cc7329a7c311bb7a3882a8eee8fc | diff --git a/.gitignore b/.gitignore
index 3389b0b0..e2dfc7bb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,11 @@
+*.egg-info
+*.pyc
+.cache
.coverage*
+.mypy_cache
+.pytest_cache
.tox
-structlog.egg-info
-htmlcov
dist
docs/_build
-*.pyc
-.cache
-.pytest_cache/
-pip-wheel-metadata/
+htmlcov
+pip-wheel-metada... | diff --git a/conftest.py b/conftest.py
index e4767b2f..ca862f95 100644
--- a/conftest.py
+++ b/conftest.py
@@ -9,7 +9,7 @@
import pytest
-from structlog.stdlib import _NAME_TO_LEVEL
+from structlog._log_levels import _NAME_TO_LEVEL
try:
diff --git a/tests/test_processors.py b/tests/test_processors.py
index f8... | setting log level and redirecting output to file
I am trying to create a pretty basic setup where logging would go to a file and I would be able to set log level.
It doesn't seem to be possible because structlog.stdlib.filter_by_level doesn't work with structlog.PrintLoggerFactory and stdlib.LoggerFactory doesn't kno... | Currently vanilla structlog has no concept of log levels unless you use stdlib integration. It wouldn't be very hard to add but I haven't gotten around to do it.
I have the same question, and got it now. Thanks. | 2020-11-13T08:24:08Z | 2020-11-13T09:17:37Z | [] | [] | ["tests/test_processors.py::TestTimeStamper::test_pickle[4-None-False-%Y]", "tests/test_processors.py::TestKeyValueRenderer::test_order_missing", "tests/test_stdlib.py::TestBoundLogger::test_proxies_to_correct_method[info]", "tests/test_processors.py::TestLevelFilter::test_drop_unknown", "tests/test_processors.py::Test... | [] | {"install": ["uv pip install -e '.[dev]'"], "pre_install": ["tee tox.ini <<EOF_1234810234\n# Keep docs in sync with docs env and .readthedocs.yml.\n[gh-actions]\npython =\n 3.6: py36\n 3.7: py37\n 3.8: py38, docs\n 3.9: py39, manifest, mypy\n pypy3: pypy3\n\n\n[tox]\nenvlist = # lint, # mypy,{py36,py37,p... | tox -- | null | null | null | swa-bench:sw.eval |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.