1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-02 21:26:33 +03:00

10 Commits

Author SHA1 Message Date
f97b9daf1b fix DebugWipeLoader being used for zipimporter
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/664

Need to insure DebugWipeLoader doesn't get used for zipimporter files.  The original imp.find_module that I replaced did not support zipimporter the new importlib find_spec does find the them.

Reviewed By: itamaro

Differential Revision: D52556833

fbshipit-source-id: bf5892a950a965bb3b17ab951910db2e33b69a34
2024-01-05 08:07:42 -08:00
0dc2acaa7d DebugWipeFinder fixes for 3.12
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/662

find_module has been deprecated for some time. Instead use find_spec

Reviewed By: itamaro

Differential Revision: D52495680

fbshipit-source-id: 9b827a783af2d858816a8d197530874f680502f3
2024-01-04 12:59:20 -08:00
6983dc11b2 fix eden build with python 3.12
Summary:
X-link: https://github.com/facebookincubator/velox/pull/7653

fix eden build with python 3.12

python 3.12 removes many long deprecated unittest features including  _TextTestResult (deprecated in Python 3.2)

notices as fedora 39 ships with python 3.12

X-link: https://github.com/facebook/sapling/pull/778

Differential Revision: D51455615

fbshipit-source-id: f690f14b24b2645578113f769669179fba476657
2023-11-20 07:20:07 -08:00
d3102141dc Fix typos discovered by codespell
Summary:
`codespell --ignore-words-list=arithmetics,atleast,crate,crated,deriver,ect,hel,onl,startin,whats --skip="*.lock"`
* https://pypi.org/project/codespell

X-link: https://github.com/facebookincubator/mvfst/pull/307

Reviewed By: hanidamlaj, lnicco

Differential Revision: D47809078

Pulled By: kvtsoy

fbshipit-source-id: 566557f2389746db541ff265a5dec8d6404b3701
2023-07-26 17:10:41 -07:00
55f4585d07 Back out "Fix typos discovered by codespell"
Summary:
Original commit changeset: 337824bc37bc

Original Phabricator Diff: D47722462

Reviewed By: jbeshay, terrelln, lnicco

Differential Revision: D47801753

fbshipit-source-id: 795ffcccbc2223608e2a707ec2e5bcc7dd974eb3
2023-07-26 12:49:13 -07:00
4246f00ff1 Re-sync with internal repository (#456)
Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com>
2023-07-25 10:04:09 -07:00
4fb4756ec9 remove legacy __future__ imports
Summary: The future is now.

Reviewed By: xavierd

Differential Revision: D33714537

fbshipit-source-id: 8d282bbe7391c4b72b70dab54a5c252060fba457
2022-01-24 20:23:34 -08:00
40b6e08b08 Opt in opensource/fbcode_builder to pyfmt
Reviewed By: zertosh

Differential Revision: D29612107

fbshipit-source-id: ac450058134e23a3831db35d2e49c80eb8cde36a
2021-07-09 06:24:09 -07:00
2efb266799 Fix bug in optimizing module loader for coverage collection
Summary:
In coverage collection mode a special module loader is prepended to
`sys.meta_path`. In very specific conditions this module loader can end up
returning a loader pointing to a _completely wrong module_. When importing
symbols from the wrong module errors occur.

The conditions to trigger the bug are:

- running in coverage collection mode, enabling the custom loader
- the test binary is a zip (e.g. par_style=fastzip)
- having a module name where the end part matches the name of a builtin Python
  module

When these conditions were met, the special loader would return the builtin
Python module instead of the expected module. E.g. when loading a module like
`myapp.somemod.platform` in a zip style binary.

The custom loader first calls `imp.find_module()` to find the module it wants
to return a wrapped loader for. This fails for modules included in the test
binary, because the builtin `imp` module can not load from zips. This was the
trigger leading to the call to the buggy code.

When the initial call to `imp.find_module()` failed, the custom loader would
try a second call, asking the internal loader to this time try any path on
`sys.path`. For most module names this call would also fail, making the custom
loader return `None`, after which Python tries other loaders on `sys.path`.
However, when the final part of the module that was asked to load matches the
name of a Python builtin module, then the second call to the `imp` module would
succeed, returning a loader for the builtin module. E.g. `platform` when asking
for `myapp.somemod.platform`.

This diff fixes the issue by removing the broken second call to the internal
loader. This will never have worked, we just have not triggered or noticed
triggering the wrong loading before.

Differential Revision: D20798119

fbshipit-source-id: dffb54e308106a81af21b63c5ee64c6ca2041920
2020-04-02 02:42:24 -07:00
b072f4002f getdeps: add an add_fb_python_unittest() function
Summary:
Add a function for defining Python unit tests.  This creates the test
executable, and also emits logic to perform test discovery for ctest.

Reviewed By: simpkins

Differential Revision: D17610034

fbshipit-source-id: cdf15b0b04acc1d3e906a1e2a95eb327951176ba
2019-09-30 10:46:28 -07:00