greenlet 3.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. greenlet-3.3.1/.clang-format +29 -0
  2. greenlet-3.3.1/.github/dependabot.yml +13 -0
  3. greenlet-3.3.1/.github/workflows/tests.yml +244 -0
  4. greenlet-3.3.1/.pylintrc +215 -0
  5. greenlet-3.3.1/.readthedocs.yml +28 -0
  6. greenlet-3.3.1/AUTHORS +51 -0
  7. greenlet-3.3.1/CHANGES.rst +746 -0
  8. greenlet-3.3.1/LICENSE +30 -0
  9. greenlet-3.3.1/LICENSE.PSF +47 -0
  10. greenlet-3.3.1/MANIFEST.in +58 -0
  11. greenlet-3.3.1/PKG-INFO +98 -0
  12. greenlet-3.3.1/README.rst +59 -0
  13. greenlet-3.3.1/benchmarks/chain.py +251 -0
  14. greenlet-3.3.1/dev-requirements.txt +2 -0
  15. greenlet-3.3.1/docs/Makefile +153 -0
  16. greenlet-3.3.1/docs/_static/custom.css +99 -0
  17. greenlet-3.3.1/docs/api.rst +97 -0
  18. greenlet-3.3.1/docs/c_api.rst +99 -0
  19. greenlet-3.3.1/docs/caveats.rst +55 -0
  20. greenlet-3.3.1/docs/changes.rst +1 -0
  21. greenlet-3.3.1/docs/conf.py +302 -0
  22. greenlet-3.3.1/docs/contextvars.rst +132 -0
  23. greenlet-3.3.1/docs/creating_executing_greenlets.rst +180 -0
  24. greenlet-3.3.1/docs/development.rst +30 -0
  25. greenlet-3.3.1/docs/greenlet.rst +180 -0
  26. greenlet-3.3.1/docs/greenlet_gc.rst +216 -0
  27. greenlet-3.3.1/docs/gui_example.rst +239 -0
  28. greenlet-3.3.1/docs/history.rst +5 -0
  29. greenlet-3.3.1/docs/index.rst +164 -0
  30. greenlet-3.3.1/docs/make.bat +190 -0
  31. greenlet-3.3.1/docs/python_threads.rst +70 -0
  32. greenlet-3.3.1/docs/switching.rst +168 -0
  33. greenlet-3.3.1/docs/tracing.rst +90 -0
  34. greenlet-3.3.1/make-manylinux +71 -0
  35. greenlet-3.3.1/pyproject.toml +70 -0
  36. greenlet-3.3.1/setup.cfg +4 -0
  37. greenlet-3.3.1/setup.py +201 -0
  38. greenlet-3.3.1/src/greenlet/CObjects.cpp +157 -0
  39. greenlet-3.3.1/src/greenlet/PyGreenlet.cpp +774 -0
  40. greenlet-3.3.1/src/greenlet/PyGreenlet.hpp +35 -0
  41. greenlet-3.3.1/src/greenlet/PyGreenletUnswitchable.cpp +147 -0
  42. greenlet-3.3.1/src/greenlet/PyModule.cpp +292 -0
  43. greenlet-3.3.1/src/greenlet/TBrokenGreenlet.cpp +45 -0
  44. greenlet-3.3.1/src/greenlet/TExceptionState.cpp +62 -0
  45. greenlet-3.3.1/src/greenlet/TGreenlet.cpp +725 -0
  46. greenlet-3.3.1/src/greenlet/TGreenlet.hpp +837 -0
  47. greenlet-3.3.1/src/greenlet/TGreenletGlobals.cpp +94 -0
  48. greenlet-3.3.1/src/greenlet/TMainGreenlet.cpp +160 -0
  49. greenlet-3.3.1/src/greenlet/TPythonState.cpp +439 -0
  50. greenlet-3.3.1/src/greenlet/TStackState.cpp +265 -0
  51. greenlet-3.3.1/src/greenlet/TThreadState.hpp +523 -0
  52. greenlet-3.3.1/src/greenlet/TThreadStateCreator.hpp +102 -0
  53. greenlet-3.3.1/src/greenlet/TThreadStateDestroy.cpp +223 -0
  54. greenlet-3.3.1/src/greenlet/TUserGreenlet.cpp +662 -0
  55. greenlet-3.3.1/src/greenlet/__init__.py +71 -0
  56. greenlet-3.3.1/src/greenlet/greenlet.cpp +323 -0
  57. greenlet-3.3.1/src/greenlet/greenlet.h +164 -0
  58. greenlet-3.3.1/src/greenlet/greenlet_allocator.hpp +76 -0
  59. greenlet-3.3.1/src/greenlet/greenlet_compiler_compat.hpp +98 -0
  60. greenlet-3.3.1/src/greenlet/greenlet_cpython_compat.hpp +156 -0
  61. greenlet-3.3.1/src/greenlet/greenlet_exceptions.hpp +171 -0
  62. greenlet-3.3.1/src/greenlet/greenlet_internal.hpp +107 -0
  63. greenlet-3.3.1/src/greenlet/greenlet_msvc_compat.hpp +100 -0
  64. greenlet-3.3.1/src/greenlet/greenlet_refs.hpp +1118 -0
  65. greenlet-3.3.1/src/greenlet/greenlet_slp_switch.hpp +103 -0
  66. greenlet-3.3.1/src/greenlet/greenlet_thread_support.hpp +31 -0
  67. greenlet-3.3.1/src/greenlet/platform/__init__.py +0 -0
  68. greenlet-3.3.1/src/greenlet/platform/setup_switch_x64_masm.cmd +2 -0
  69. greenlet-3.3.1/src/greenlet/platform/switch_aarch64_gcc.h +124 -0
  70. greenlet-3.3.1/src/greenlet/platform/switch_alpha_unix.h +30 -0
  71. greenlet-3.3.1/src/greenlet/platform/switch_amd64_unix.h +87 -0
  72. greenlet-3.3.1/src/greenlet/platform/switch_arm32_gcc.h +79 -0
  73. greenlet-3.3.1/src/greenlet/platform/switch_arm32_ios.h +67 -0
  74. greenlet-3.3.1/src/greenlet/platform/switch_arm64_masm.asm +53 -0
  75. greenlet-3.3.1/src/greenlet/platform/switch_arm64_masm.obj +0 -0
  76. greenlet-3.3.1/src/greenlet/platform/switch_arm64_msvc.h +17 -0
  77. greenlet-3.3.1/src/greenlet/platform/switch_csky_gcc.h +48 -0
  78. greenlet-3.3.1/src/greenlet/platform/switch_loongarch64_linux.h +31 -0
  79. greenlet-3.3.1/src/greenlet/platform/switch_m68k_gcc.h +38 -0
  80. greenlet-3.3.1/src/greenlet/platform/switch_mips_unix.h +65 -0
  81. greenlet-3.3.1/src/greenlet/platform/switch_ppc64_aix.h +103 -0
  82. greenlet-3.3.1/src/greenlet/platform/switch_ppc64_linux.h +105 -0
  83. greenlet-3.3.1/src/greenlet/platform/switch_ppc_aix.h +87 -0
  84. greenlet-3.3.1/src/greenlet/platform/switch_ppc_linux.h +84 -0
  85. greenlet-3.3.1/src/greenlet/platform/switch_ppc_macosx.h +82 -0
  86. greenlet-3.3.1/src/greenlet/platform/switch_ppc_unix.h +82 -0
  87. greenlet-3.3.1/src/greenlet/platform/switch_riscv_unix.h +41 -0
  88. greenlet-3.3.1/src/greenlet/platform/switch_s390_unix.h +87 -0
  89. greenlet-3.3.1/src/greenlet/platform/switch_sh_gcc.h +36 -0
  90. greenlet-3.3.1/src/greenlet/platform/switch_sparc_sun_gcc.h +92 -0
  91. greenlet-3.3.1/src/greenlet/platform/switch_x32_unix.h +63 -0
  92. greenlet-3.3.1/src/greenlet/platform/switch_x64_masm.asm +111 -0
  93. greenlet-3.3.1/src/greenlet/platform/switch_x64_masm.obj +0 -0
  94. greenlet-3.3.1/src/greenlet/platform/switch_x64_msvc.h +60 -0
  95. greenlet-3.3.1/src/greenlet/platform/switch_x86_msvc.h +326 -0
  96. greenlet-3.3.1/src/greenlet/platform/switch_x86_unix.h +105 -0
  97. greenlet-3.3.1/src/greenlet/slp_platformselect.h +77 -0
  98. greenlet-3.3.1/src/greenlet/tests/__init__.py +248 -0
  99. greenlet-3.3.1/src/greenlet/tests/_test_extension.c +258 -0
  100. greenlet-3.3.1/src/greenlet/tests/_test_extension_cpp.cpp +229 -0
  101. greenlet-3.3.1/src/greenlet/tests/fail_clearing_run_switches.py +47 -0
  102. greenlet-3.3.1/src/greenlet/tests/fail_cpp_exception.py +33 -0
  103. greenlet-3.3.1/src/greenlet/tests/fail_initialstub_already_started.py +78 -0
  104. greenlet-3.3.1/src/greenlet/tests/fail_slp_switch.py +29 -0
  105. greenlet-3.3.1/src/greenlet/tests/fail_switch_three_greenlets.py +44 -0
  106. greenlet-3.3.1/src/greenlet/tests/fail_switch_three_greenlets2.py +55 -0
  107. greenlet-3.3.1/src/greenlet/tests/fail_switch_two_greenlets.py +41 -0
  108. greenlet-3.3.1/src/greenlet/tests/leakcheck.py +336 -0
  109. greenlet-3.3.1/src/greenlet/tests/test_contextvars.py +312 -0
  110. greenlet-3.3.1/src/greenlet/tests/test_cpp.py +73 -0
  111. greenlet-3.3.1/src/greenlet/tests/test_extension_interface.py +115 -0
  112. greenlet-3.3.1/src/greenlet/tests/test_gc.py +86 -0
  113. greenlet-3.3.1/src/greenlet/tests/test_generator.py +59 -0
  114. greenlet-3.3.1/src/greenlet/tests/test_generator_nested.py +168 -0
  115. greenlet-3.3.1/src/greenlet/tests/test_greenlet.py +1365 -0
  116. greenlet-3.3.1/src/greenlet/tests/test_greenlet_trash.py +187 -0
  117. greenlet-3.3.1/src/greenlet/tests/test_leaks.py +457 -0
  118. greenlet-3.3.1/src/greenlet/tests/test_stack_saved.py +19 -0
  119. greenlet-3.3.1/src/greenlet/tests/test_throw.py +128 -0
  120. greenlet-3.3.1/src/greenlet/tests/test_tracing.py +299 -0
  121. greenlet-3.3.1/src/greenlet/tests/test_version.py +41 -0
  122. greenlet-3.3.1/src/greenlet/tests/test_weakref.py +35 -0
  123. greenlet-3.3.1/src/greenlet.egg-info/PKG-INFO +98 -0
  124. greenlet-3.3.1/src/greenlet.egg-info/SOURCES.txt +127 -0
  125. greenlet-3.3.1/src/greenlet.egg-info/dependency_links.txt +1 -0
  126. greenlet-3.3.1/src/greenlet.egg-info/requires.txt +9 -0
  127. greenlet-3.3.1/src/greenlet.egg-info/top_level.txt +1 -0
  128. greenlet-3.3.1/tox.ini +33 -0
  129. greenlet-3.3.1/ubuntu-test +47 -0
@@ -0,0 +1,29 @@
1
+ # A clang-format style that approximates Python's PEP 7 -*- mode: yaml; -*-
2
+ # Initially based on
3
+ # https://gist.github.com/pganssle/0e3a5f828b4d07d79447f6ced8e7e4db
4
+ BasedOnStyle: Google
5
+ Language: Cpp
6
+
7
+ AlignAfterOpenBracket: Align
8
+ AllowShortBlocksOnASingleLine: false
9
+ AllowShortIfStatementsOnASingleLine: Never
10
+ AllowShortLoopsOnASingleLine: false
11
+ AlwaysBreakAfterReturnType: All
12
+
13
+ BinPackArguments: false
14
+ BreakBeforeBraces: Stroustrup
15
+ BreakBeforeTernaryOperators: true
16
+
17
+ ColumnLimit: 79
18
+ DerivePointerAlignment: false
19
+
20
+ IndentWidth: 4
21
+ IndentPPDirectives: AfterHash
22
+
23
+
24
+ PointerAlignment: Left
25
+ ReflowComments: true
26
+ SpaceBeforeParens: ControlStatements
27
+ SpacesInParentheses: false
28
+ TabWidth: 4
29
+ UseTab: Never
@@ -0,0 +1,13 @@
1
+ # Keep GitHub Actions up to date with GitHub's Dependabot...
2
+ # https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
3
+ # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
4
+ version: 2
5
+ updates:
6
+ - package-ecosystem: github-actions
7
+ directory: /
8
+ groups:
9
+ github-actions:
10
+ patterns:
11
+ - "*" # Group all Actions updates into a single larger pull request
12
+ schedule:
13
+ interval: monthly
@@ -0,0 +1,244 @@
1
+ name: tests
2
+
3
+ on: [push, pull_request, workflow_dispatch]
4
+
5
+ env:
6
+ PYTHONHASHSEED: 1042466059
7
+ ZOPE_INTERFACE_STRICT_IRO: 1
8
+ PYTHONUNBUFFERED: 1
9
+ PYTHONDONTWRITEBYTECODE: 1
10
+ PYTHONDEVMODE: 1
11
+ PYTHONFAULTHANDLER: 1
12
+ PIP_UPGRADE_STRATEGY: eager
13
+ PIP_NO_WARN_SCRIPT_LOCATION: 1
14
+ # Uploading built wheels for releases.
15
+ # TWINE_PASSWORD is encrypted and stored directly in the
16
+ # repo settings.
17
+ TWINE_USERNAME: __token__
18
+
19
+
20
+ jobs:
21
+ test:
22
+ runs-on: ${{ matrix.os }}
23
+ strategy:
24
+ matrix:
25
+ python-version:
26
+ - "3.10"
27
+ - "3.11"
28
+ - "3.12"
29
+ - "3.13"
30
+ - "3.14"
31
+ - "3.14t"
32
+
33
+ # Recall the macOS and windows builds upload built wheels so all supported versions
34
+ # need to run on mac.
35
+ os:
36
+ - ubuntu-latest
37
+ - macos-latest
38
+ - windows-latest
39
+ - windows-11-arm
40
+ exclude:
41
+ # 3.10 not available for windows arm
42
+ - os: windows-11-arm
43
+ python-version: "3.10"
44
+ # 3.14t not available for windows arm
45
+ - os: windows-11-arm
46
+ python-version: "3.14t"
47
+ steps:
48
+ - uses: actions/checkout@v6
49
+ - name: Set up Python
50
+ uses: actions/setup-python@v6
51
+ with:
52
+ python-version: ${{ matrix.python-version }}
53
+ cache: 'pip'
54
+ cache-dependency-path: setup.py
55
+ allow-prereleases: true
56
+ - name: Install dependencies
57
+ run: |
58
+ python -m pip install -U pip setuptools wheel
59
+ python -m pip install -U twine
60
+ - name: Install greenlet (non-Mac)
61
+ if: ${{ ! startsWith(runner.os, 'Mac') }}
62
+ run: |
63
+ # setuptools doesn't want you running 'python setup.py' anymore,
64
+ # but pip hides all the intersting compiler output by default, and the
65
+ # only way to get anything useful out is to ask *everything* to be verbose,
66
+ # which is much more junk than we need to wade through, making it hard to
67
+ # see what we want. What's the point of having warnings at all if we can't
68
+ # see them, though?
69
+ python -m pip wheel -v --wheel-dir ./dist .
70
+ python -m pip install -U -e ".[test,docs]"
71
+ env:
72
+ # Ensure we test with assertions enabled.
73
+ # As opposed to the manylinux builds, which we distribute and
74
+ # thus only use O3 (because Ofast enables fast-math, which has
75
+ # process-wide effects), we test with Ofast here, because we
76
+ # expect that some people will compile it themselves with that setting.
77
+ CPPFLAGS: "-Ofast -UNDEBUG -Wall"
78
+ CFLAGS: "-Ofast -UNDEBUG -Wall"
79
+ - name: Install greenlet (Mac)
80
+ if: startsWith(runner.os, 'Mac')
81
+ run: |
82
+ python -m pip wheel -v --wheel-dir ./dist .
83
+ python -m pip install -U -e ".[test,docs]"
84
+ ls -l dist
85
+ # Something in the build system isn't detecting that we're building for both,
86
+ # so we're getting tagged with just x86_64. Force the universal2 tag.
87
+ # (I've verified that the .so files are in fact universal, with both architectures.)
88
+ # The macosx_11_0 tag is conservative: At this writing,
89
+ # on GHA, Python 3.7/3.8/3.9/3.10 all produce that tag, while
90
+ # 3.11/3.12 produce the less restrictive macosx_10_9 tag. (Locally on JAM's mac,
91
+ # the official CPython builds produce 10_9 for everything from 3.9 onward.)
92
+ wheel tags --remove --platform-tag macosx_11_0_universal2 dist/*whl
93
+ env:
94
+ # Unlike the above, we are actually distributing these
95
+ # wheels, so they need to be built for production use.
96
+ CPPFLAGS: "-O3 -flto -ffunction-sections"
97
+ CFLAGS: "-O3 -flto -ffunction-sections"
98
+ # Build for both architectures
99
+ ARCHFLAGS: "-arch x86_64 -arch arm64"
100
+
101
+ - name: Check greenlet build
102
+ if: ${{ ! startsWith(runner.os, 'Windows') }}
103
+ run: |
104
+ ls -l dist
105
+ twine check dist/*
106
+ - name: Store greenlet wheel
107
+ uses: actions/upload-artifact@v6
108
+ with:
109
+ name: greenlet-${{ matrix.os }}-${{ matrix.python-version }}.whl
110
+ path: dist/*whl
111
+ - name: Test
112
+ run: |
113
+ python -VV
114
+ python -c 'import greenlet._greenlet as G; assert G.GREENLET_USE_STANDARD_THREADING'
115
+ python -m unittest discover -v greenlet.tests
116
+ - name: Doctest
117
+ env:
118
+ # XXX: On 3.14t, when the thread-local bytecode cache is
119
+ # enabled, sphinx crashes on module cleanup: there is a
120
+ # reference to pdb.set_trace in ``glob``, and when the
121
+ # shutdown sequence tries to clear that value, it segfaults
122
+ # dec-reffing it after taking it out of the module dict. The
123
+ # object appears to be corrupt, but it is utterly unclear how
124
+ # we could have done this. It is 100% reliable on bath Mac and
125
+ # Linux. It can be traced down to a very simple doctest
126
+ # snippet in greenlet_gc.rst, but running that same snippet
127
+ # standalone in a unit test doesn't produce the error.
128
+ #
129
+ # So this is a temporary workaround.
130
+ PYTHON_TLBC: "0"
131
+ run: |
132
+ sphinx-build -b doctest -d docs/_build/doctrees2 docs docs/_build/doctest2
133
+ - name: Lint
134
+ if: matrix.python-version == '3.14' && startsWith(runner.os, 'Linux')
135
+ # We only need to do this on one version.
136
+ # We do this here rather than a separate job to avoid the compilation overhead.
137
+ run: |
138
+ pip install -U pylint
139
+ python -m pylint --rcfile=.pylintrc greenlet
140
+
141
+ - name: Publish package to PyPI (mac)
142
+ # We cannot 'uses: pypa/gh-action-pypi-publish@v1.4.1' because
143
+ # that's apparently a container action, and those don't run on
144
+ # the Mac.
145
+ if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && (startsWith(runner.os, 'Mac') || startsWith(runner.os, 'Windows')) }}
146
+ env:
147
+ TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
148
+ run: |
149
+ twine upload --skip-existing dist/*
150
+
151
+ CodeQL:
152
+ runs-on: ubuntu-latest
153
+ permissions:
154
+ # required for all workflows
155
+ security-events: write
156
+ steps:
157
+ - uses: actions/checkout@v6
158
+ - name: Set up Python
159
+ uses: actions/setup-python@v6
160
+ with:
161
+ python-version: "3.10"
162
+ cache: 'pip'
163
+ cache-dependency-path: setup.py
164
+ - name: Install dependencies
165
+ run: |
166
+ python -m pip install -U pip
167
+ python -m pip install -U setuptools wheel
168
+ # Initializes the CodeQL tools for scanning.
169
+ - name: Initialize CodeQL
170
+ uses: github/codeql-action/init@v4
171
+ with:
172
+ languages: python, cpp
173
+ - name: Install greenlet
174
+ run: |
175
+ python setup.py build
176
+ # - name: Autobuild
177
+ # uses: github/codeql-action/autobuild@v1
178
+ - name: Perform CodeQL Analysis
179
+ uses: github/codeql-action/analyze@v4
180
+
181
+ riscv64:
182
+ runs-on: ubuntu-latest
183
+ name: RiscV 64
184
+ steps:
185
+ - name: checkout
186
+ uses: actions/checkout@v6
187
+ - name: Set up Python
188
+ uses: actions/setup-python@v6
189
+ with:
190
+ python-version: "3.13"
191
+ - name: Set up QEMU
192
+ uses: docker/setup-qemu-action@v3
193
+ with:
194
+ platforms: all
195
+ - name: Build and test greenlet
196
+ env:
197
+ DOCKER_IMAGE: riscv64/ubuntu:latest
198
+ run: bash ./ubuntu-test
199
+
200
+
201
+ manylinux:
202
+ runs-on: ubuntu-latest
203
+ # We use a regular Python matrix entry to share as much code as possible.
204
+ strategy:
205
+ matrix:
206
+ python-version:
207
+ - "3.14"
208
+ image:
209
+ - manylinux_2_28_x86_64
210
+ - manylinux_2_28_aarch64
211
+ - manylinux_2_28_ppc64le
212
+ - manylinux_2_28_s390x
213
+ - musllinux_1_2_x86_64
214
+ - musllinux_1_2_aarch64
215
+ name: ${{ matrix.image }}
216
+
217
+ steps:
218
+ - name: checkout
219
+ uses: actions/checkout@v6
220
+ - name: Set up Python ${{ matrix.python-version }}
221
+ uses: actions/setup-python@v6
222
+ with:
223
+ python-version: ${{ matrix.python-version }}
224
+ - name: Set up QEMU
225
+ uses: docker/setup-qemu-action@v3
226
+ with:
227
+ platforms: all
228
+ - name: Build and test greenlet
229
+ env:
230
+ DOCKER_IMAGE: quay.io/pypa/${{ matrix.image }}
231
+ run: bash ./make-manylinux
232
+ - name: Store greenlet wheels
233
+ uses: actions/upload-artifact@v6
234
+ with:
235
+ path: wheelhouse/*whl
236
+ name: ${{ matrix.image }}_wheels.zip
237
+ - name: Publish package to PyPI
238
+ uses: pypa/gh-action-pypi-publish@v1.13.0
239
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
240
+ with:
241
+ user: __token__
242
+ password: ${{ secrets.TWINE_PASSWORD }}
243
+ skip_existing: true
244
+ packages_dir: wheelhouse/
@@ -0,0 +1,215 @@
1
+ [MASTER]
2
+ load-plugins=pylint.extensions.bad_builtin,
3
+ pylint.extensions.code_style,
4
+ pylint.extensions.dict_init_mutate,
5
+ pylint.extensions.dunder,
6
+ pylint.extensions.comparison_placement,
7
+ pylint.extensions.confusing_elif,
8
+ pylint.extensions.for_any_all,
9
+ pylint.extensions.consider_refactoring_into_while_condition,
10
+ pylint.extensions.check_elif,
11
+ pylint.extensions.eq_without_hash,
12
+ pylint.extensions.overlapping_exceptions,
13
+
14
+ # pylint.extensions.comparetozero,
15
+ # Takes out ``if x == 0:`` and wants you to write ``if not x:``
16
+ # but in many cases, the == 0 is actually much more clear.
17
+
18
+ # pylint.extensions.mccabe,
19
+ # We have too many too-complex methods. We should enable this and fix them
20
+ # one by one.
21
+
22
+ # pylint.extensions.redefined_variable_type,
23
+ # We use that pattern during initialization.
24
+
25
+ # magic_value wants you to not use arbitrary strings and numbers
26
+ # inline in the code. But it's overzealous and has way too many false
27
+ # positives. Trust people to do the most readable thing.
28
+ # pylint.extensions.magic_value
29
+
30
+ # Empty comment would be good, except it detects blank lines within
31
+ # a single comment block.
32
+ #
33
+ # Those are often used to separate paragraphs, like here.
34
+ # pylint.extensions.empty_comment,
35
+
36
+ # consider_ternary_expression is a nice check, but is also overzealous.
37
+ # Trust the human to do the readable thing.
38
+ # pylint.extensions.consider_ternary_expression,
39
+
40
+ # redefined_loop_name tends to catch us with things like
41
+ # for name in (a, b, c): name = name + '_column' ...
42
+ # pylint.extensions.redefined_loop_name,
43
+
44
+ # This wants you to turn ``x in (1, 2)`` into ``x in {1, 2}``.
45
+ # They both result in the LOAD_CONST bytecode, one a tuple one a
46
+ # frozenset. In theory a set lookup using hashing is faster than
47
+ # a linear scan of a tuple; but if the tuple is small, it can often
48
+ # actually be faster to scan the tuple.
49
+ # pylint.extensions.set_membership,
50
+
51
+ # Fix zope.cachedescriptors.property.Lazy; the property-classes doesn't seem to
52
+ # do anything.
53
+ # https://stackoverflow.com/questions/51160955/pylint-how-to-specify-a-self-defined-property-decorator-with-property-classes
54
+ # For releases prior to 2.14.2, this needs to be a one-line, quoted string. After that,
55
+ # a multi-line string.
56
+ # - Make zope.cachedescriptors.property.Lazy look like a property;
57
+ # fixes pylint thinking it is a method.
58
+ # - Run in Pure Python mode (ignore C extensions that respect this);
59
+ # fixes some issues with zope.interface, like IFoo.providedby(ob)
60
+ # claiming not to have the right number of parameters...except no, it does not.
61
+ init-hook =
62
+ import astroid.bases
63
+ astroid.bases.POSSIBLE_PROPERTIES.add('Lazy')
64
+ astroid.bases.POSSIBLE_PROPERTIES.add('LazyOnClass')
65
+ astroid.bases.POSSIBLE_PROPERTIES.add('readproperty')
66
+ astroid.bases.POSSIBLE_PROPERTIES.add('non_overridable')
67
+ import os
68
+ os.environ['PURE_PYTHON'] = ("1")
69
+ # Ending on a quoted string
70
+ # breaks pylint 2.14.5 (it strips the trailing quote. This is
71
+ # probably because it tries to handle one-line quoted strings as well as multi-blocks).
72
+ # The parens around it fix the issue.
73
+
74
+ extension-pkg-whitelist=greenlet._greenlet
75
+
76
+ # Control the amount of potential inferred values when inferring a single
77
+ # object. This can help the performance when dealing with large functions or
78
+ # complex, nested conditions.
79
+ # gevent: The changes for Python 3.7 in _ssl3.py lead to infinite recursion
80
+ # in pylint 2.3.1/astroid 2.2.5 in that file unless we this this to 1
81
+ # from the default of 100.
82
+ limit-inference-results=1
83
+
84
+ [MESSAGES CONTROL]
85
+
86
+ # Disable the message, report, category or checker with the given id(s). You
87
+ # can either give multiple identifier separated by comma (,) or put this option
88
+ # multiple time (only on the command line, not in the configuration file where
89
+ # it should appear only once).
90
+ # NOTE: comments must go ABOVE the statement. In Python 2, mixing in
91
+ # comments disables all directives that follow, while in Python 3, putting
92
+ # comments at the end of the line does the same thing (though Py3 supports
93
+ # mixing)
94
+
95
+
96
+ # invalid-name, ; We get lots of these, especially in scripts. should fix many of them
97
+ # protected-access, ; We have many cases of this; legit ones need to be examinid and commented, then this removed
98
+ # no-self-use, ; common in superclasses with extension points
99
+ # too-few-public-methods, ; Exception and marker classes get tagged with this
100
+ # exec-used, ; should tag individual instances with this, there are some but not too many
101
+ # global-statement, ; should tag individual instances
102
+ # multiple-statements, ; "from gevent import monkey; monkey.patch_all()"
103
+ # locally-disabled, ; yes, we know we're doing this. don't replace one warning with another
104
+ # cyclic-import, ; most of these are deferred imports
105
+ # too-many-arguments, ; these are almost always because that's what the stdlib does
106
+ # redefined-builtin, ; likewise: these tend to be keyword arguments like len= in the stdlib
107
+ # undefined-all-variable, ; XXX: This crashes with pylint 1.5.4 on Travis (but not locally on Py2/3
108
+ # ; or landscape.io on Py3). The file causing the problem is unclear. UPDATE: identified and disabled
109
+ # that file.
110
+ # see https://github.com/PyCQA/pylint/issues/846
111
+ # useless-suppression: the only way to avoid repeating it for specific statements everywhere that we
112
+ # do Py2/Py3 stuff is to put it here. Sadly this means that we might get better but not realize it.
113
+ # duplicate-code: Yeah, the compatibility ssl modules are much the same
114
+ # In pylint 1.8.0, inconsistent-return-statements are created for the wrong reasons.
115
+ # This code raises it, even though there's only one return (the implicit 'return None' is presumably
116
+ # what triggers it):
117
+ # def foo():
118
+ # if baz:
119
+ # return 1
120
+ # In Pylint 2dev1, needed for Python 3.7, we get spurious 'useless return' errors:
121
+ # @property
122
+ # def foo(self):
123
+ # return None # generates useless-return
124
+ # Pylint 2.4 adds import-outside-toplevel. But we do that a lot to defer imports because of patching.
125
+ # Pylint 2.4 adds self-assigning-variable. But we do *that* to avoid unused-import when we
126
+ # "export" the variable and don't have a __all__.
127
+ # Pylint 2.6+ adds some python-3-only things that don't apply: raise-missing-from, super-with-arguments, consider-using-f-string, redundant-u-string-prefix
128
+ # unnecessary-lambda-assignment: New check introduced in v2.14.0
129
+ # unnecessary-dunder-call: New check introduced in v2.14.0
130
+ # consider-using-assignment-expr: wants you to use the walrus operator.
131
+ # It hits way too much and its not clear they would be improvements.
132
+ # confusing-consecutive-elif: Are they though?
133
+ disable=wrong-import-position,
134
+ wrong-import-order,
135
+ missing-docstring,
136
+ ungrouped-imports,
137
+ invalid-name,
138
+ protected-access,
139
+ too-few-public-methods,
140
+ exec-used,
141
+ global-statement,
142
+ multiple-statements,
143
+ locally-disabled,
144
+ cyclic-import,
145
+ too-many-arguments,
146
+ redefined-builtin,
147
+ useless-suppression,
148
+ duplicate-code,
149
+ undefined-all-variable,
150
+ inconsistent-return-statements,
151
+ useless-return,
152
+ useless-object-inheritance,
153
+ import-outside-toplevel,
154
+ self-assigning-variable,
155
+ raise-missing-from,
156
+ super-with-arguments,
157
+ consider-using-f-string,
158
+ consider-using-assignment-expr,
159
+ redundant-u-string-prefix,
160
+ unnecessary-lambda-assignment,
161
+ unnecessary-dunder-call,
162
+ use-dict-literal,
163
+ confusing-consecutive-elif,
164
+
165
+
166
+ enable=consider-using-augmented-assign
167
+
168
+ [FORMAT]
169
+ max-line-length=160
170
+ max-module-lines=1100
171
+
172
+ [MISCELLANEOUS]
173
+ # List of note tags to take in consideration, separated by a comma.
174
+ #notes=FIXME,XXX,TODO
175
+ # Disable that, we don't want them in the report (???)
176
+ notes=
177
+
178
+ [VARIABLES]
179
+
180
+ dummy-variables-rgx=_.*
181
+
182
+ [TYPECHECK]
183
+
184
+ # List of members which are set dynamically and missed by pylint inference
185
+ # system, and so shouldn't trigger E1101 when accessed. Python regular
186
+ # expressions are accepted.
187
+ # gevent: this is helpful for py3/py2 code.
188
+ generated-members=exc_clear
189
+
190
+ # List of classes names for which member attributes should not be checked
191
+ # (useful for classes with attributes dynamically set). This can work
192
+ # with qualified names.
193
+ #ignored-classes=SSLContext, SSLSocket, greenlet, Greenlet, parent, dead
194
+
195
+
196
+ # List of module names for which member attributes should not be checked
197
+ # (useful for modules/projects where namespaces are manipulated during runtime
198
+ # and thus existing member attributes cannot be deduced by static analysis. It
199
+ # supports qualified module names, as well as Unix pattern matching.
200
+ ignored-modules=gevent._corecffi,gevent.os,os,greenlet,threading,gevent.libev.corecffi,gevent.socket,gevent.core,gevent.testing.support
201
+
202
+ [DESIGN]
203
+ max-attributes=12
204
+ max-parents=10
205
+
206
+ [BASIC]
207
+ bad-functions=input
208
+ # Prospector turns ot unsafe-load-any-extension by default, but
209
+ # pylint leaves it off. This is the proximal cause of the
210
+ # undefined-all-variable crash.
211
+ unsafe-load-any-extension = yes
212
+
213
+ # Local Variables:
214
+ # mode: conf
215
+ # End:
@@ -0,0 +1,28 @@
1
+ # .readthedocs.yml
2
+ # Read the Docs configuration file
3
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
+
5
+ # Required
6
+ version: 2
7
+
8
+ # Build documentation in the docs/ directory with Sphinx
9
+ sphinx:
10
+ builder: html
11
+ configuration: docs/conf.py
12
+
13
+
14
+ # Set the version of Python and requirements required to build your
15
+ # docs
16
+
17
+ build:
18
+ # os is required for some reason
19
+ os: ubuntu-22.04
20
+ tools:
21
+ python: "3.11"
22
+
23
+ python:
24
+ install:
25
+ - method: pip
26
+ path: .
27
+ extra_requirements:
28
+ - docs
greenlet-3.3.1/AUTHORS ADDED
@@ -0,0 +1,51 @@
1
+ Original Authors
2
+ ----------------
3
+ * Armin Rigo
4
+ * Christian Tismer
5
+
6
+ Contributors
7
+ ------------
8
+ * Al Stone
9
+ * Alexander Schmidt
10
+ * Alexey Borzenkov
11
+ * Andreas Schwab
12
+ * Armin Ronacher
13
+ * Bin Wang <feisuzhu@163.com>
14
+ * Bob Ippolito
15
+ * ChangBo Guo
16
+ * Christoph Gohlke
17
+ * Denis Bilenko
18
+ * Dirk Mueller
19
+ * Donovan Preston
20
+ * Fantix King
21
+ * Floris Bruynooghe
22
+ * Fredrik Fornwall
23
+ * Gerd Woetzel
24
+ * Giel van Schijndel
25
+ * Gökhan Karabulut
26
+ * Gustavo Niemeyer
27
+ * Guy Rozendorn
28
+ * Hye-Shik Chang
29
+ * Jared Kuolt
30
+ * Jason Madden
31
+ * Josh Snyder
32
+ * Kyle Ambroff
33
+ * Laszlo Boszormenyi
34
+ * Mao Han
35
+ * Marc Abramowitz
36
+ * Marc Schlaich
37
+ * Marcin Bachry
38
+ * Matt Madison
39
+ * Matt Turner
40
+ * Michael Ellerman
41
+ * Michael Matz
42
+ * Ralf Schmitt
43
+ * Robie Basak
44
+ * Ronny Pfannschmidt
45
+ * Samual M. Rushing
46
+ * Tony Bowles
47
+ * Tony Breeds
48
+ * Trevor Bowen
49
+ * Tulio Magno Quites Machado Filho
50
+ * Ulrich Weigand
51
+ * Victor Stinner