astral-sh / packse

Python packaging scenarios
Apache License 2.0
99 stars 10 forks source link

Running packse fetch and serve, get `UnicodeDecodeError` #147

Closed notatallshaw closed 6 months ago

notatallshaw commented 6 months ago

Steps to Reproduce:

Output:

Cloning repository https://github.com/astral-sh/packse
Checking out directory 'scenarios' at ref 0.3.7
Found does-not-exist.json
Found example.json
Found excluded.json
Found extras.json
Found incompatible-versions.json
Found local.json
Found prereleases.json
Found requires-python.json
Found wheels.json
Found yanked.json

Output:

$ packse serve scenarios/
Performing initial build...
Building 'local-simple-5b70bb3c' in directory 'build/local-simple-5b70bb3c'
Building 'package-only-prereleases-85d9c93d' in directory 'build/package-only-prereleases-85d9c93d'
Building 'example-961b4c22' in directory 'build/example-961b4c22'
Building 'local-not-used-with-sdist-207c9df5' in directory 'build/local-not-used-with-sdist-207c9df5'
Building 'local-not-latest-b8eed201' in directory 'build/local-not-latest-b8eed201'
Building 'local-used-without-sdist-ea57116a' in directory 'build/local-used-without-sdist-ea57116a'
Building 'package-only-prereleases-in-range-4c7ed550' in directory 'build/package-only-prereleases-in-range-4c7ed550'
Building 'requires-greater-version-does-not-exist-b33b2dca' in directory 'build/requires-greater-version-does-not-exist-b33b2dca'
Building 'local-transitive-confounding-082fdb86' in directory 'build/local-transitive-confounding-082fdb86'
Building 'requires-less-version-does-not-exist-a71baf60' in directory 'build/requires-less-version-does-not-exist-a71baf60'
Building 'local-transitive-a79dc870' in directory 'build/local-transitive-a79dc870'
Building 'requires-package-does-not-exist-388e8135' in directory 'build/requires-package-does-not-exist-388e8135'
Building 'transitive-requires-package-does-not-exist-ed146f67' in directory 'build/transitive-requires-package-does-not-exist-ed146f67'
Building 'requires-package-only-prereleases-in-range-global-opt-in-8229237e' in directory 'build/requires-package-only-prereleases-in-range-global-opt-in-8229237e'
Building 'requires-package-prerelease-and-final-any-7c7cec06' in directory 'build/requires-package-prerelease-and-final-any-7c7cec06'
Building 'package-prerelease-specified-only-prerelease-available-2b59d4b1' in directory 'build/package-prerelease-specified-only-prerelease-available-2b59d4b1'
Building 'requires-exact-version-does-not-exist-ef648a78' in directory 'build/requires-exact-version-does-not-exist-ef648a78'
Building 'package-prerelease-specified-only-final-available-1284cb1e' in directory 'build/package-prerelease-specified-only-final-available-1284cb1e'
Building 'package-multiple-prereleases-kinds-ca392ea8' in directory 'build/package-multiple-prereleases-kinds-ca392ea8'
Building 'package-prerelease-specified-mixed-available-4204a13b' in directory 'build/package-prerelease-specified-mixed-available-4204a13b'
Building 'transitive-package-only-prereleases-589ddff5' in directory 'build/transitive-package-only-prereleases-589ddff5'
Building 'transitive-prerelease-and-stable-dependency-73a8bb29' in directory 'build/transitive-prerelease-and-stable-dependency-73a8bb29'
Building 'transitive-package-only-prereleases-in-range-opt-in-dc3b4feb' in directory 'build/transitive-package-only-prereleases-in-range-opt-in-dc3b4feb'
Building 'package-multiple-prereleases-numbers-b08385b3' in directory 'build/package-multiple-prereleases-numbers-b08385b3'
Building 'transitive-package-only-prereleases-in-range-91d42144' in directory 'build/transitive-package-only-prereleases-in-range-91d42144'
Building 'transitive-prerelease-and-stable-dependency-many-versions-b550f888' in directory 'build/transitive-prerelease-and-stable-dependency-many-versions-b550f888'
Building 'transitive-prerelease-and-stable-dependency-opt-in-87b86d9c' in directory 'build/transitive-prerelease-and-stable-dependency-opt-in-87b86d9c'
Building 'transitive-prerelease-and-stable-dependency-many-versions-holes-34e5a2d3' in directory 'build/transitive-prerelease-and-stable-dependency-many-versions-holes-34e5a2d3'
Building 'package-only-prereleases-boundary-dd941311' in directory 'build/package-only-prereleases-boundary-dd941311'
Building 'package-prereleases-boundary-16ba0350' in directory 'build/package-prereleases-boundary-16ba0350'
Building 'package-prereleases-global-boundary-ca458d54' in directory 'build/package-prereleases-global-boundary-ca458d54'
Building 'package-prereleases-specifier-boundary-ed960178' in directory 'build/package-prereleases-specifier-boundary-ed960178'
Building 'specific-tag-and-default-0336e09c' in directory 'build/specific-tag-and-default-0336e09c'
Building 'only-wheels-f756804e' in directory 'build/only-wheels-f756804e'
Building 'no-wheels-0bb7827a' in directory 'build/no-wheels-0bb7827a'
Building 'no-wheels-with-matching-platform-c1494f5f' in directory 'build/no-wheels-with-matching-platform-c1494f5f'
Building 'no-sdist-no-wheels-with-matching-platform-46f0c229' in directory 'build/no-sdist-no-wheels-with-matching-platform-46f0c229'
Building 'no-sdist-no-wheels-with-matching-python-7b1e0ba3' in directory 'build/no-sdist-no-wheels-with-matching-python-7b1e0ba3'
Building 'no-sdist-no-wheels-with-matching-abi-2f8e7202' in directory 'build/no-sdist-no-wheels-with-matching-abi-2f8e7202'
Building 'no-wheels-no-build-1db1b462' in directory 'build/no-wheels-no-build-1db1b462'
Building 'only-wheels-no-binary-859a4cea' in directory 'build/only-wheels-no-binary-859a4cea'
Building 'no-build-bb7d81b8' in directory 'build/no-build-bb7d81b8'
Building 'no-binary-b1d20084' in directory 'build/no-binary-b1d20084'
Building 'package-only-yanked-2919761d' in directory 'build/package-only-yanked-2919761d'
Building 'requires-package-yanked-and-unyanked-any-c1d7f24e' in directory 'build/requires-package-yanked-and-unyanked-any-c1d7f24e'
Building 'package-only-yanked-in-range-f1ab2a3f' in directory 'build/package-only-yanked-in-range-f1ab2a3f'
Building 'package-yanked-specified-mixed-available-e9d957b6' in directory 'build/package-yanked-specified-mixed-available-e9d957b6'
Building 'transitive-package-only-yanked-in-range-e2eb8cbc' in directory 'build/transitive-package-only-yanked-in-range-e2eb8cbc'
Building 'transitive-package-only-yanked-fbebea19' in directory 'build/transitive-package-only-yanked-fbebea19'
Building 'transitive-package-only-yanked-in-range-opt-in-637e27eb' in directory 'build/transitive-package-only-yanked-in-range-opt-in-637e27eb'
Building 'transitive-yanked-and-unyanked-dependency-opt-in-b2a53fbd' in directory 'build/transitive-yanked-and-unyanked-dependency-opt-in-b2a53fbd'
Building 'transitive-yanked-and-unyanked-dependency-0abad3b6' in directory 'build/transitive-yanked-and-unyanked-dependency-0abad3b6'
Building 'direct-incompatible-versions-516a39b2' in directory 'build/direct-incompatible-versions-516a39b2'
Building 'transitive-incompatible-with-root-version-c4bc5b1f' in directory 'build/transitive-incompatible-with-root-version-c4bc5b1f'
Building 'transitive-incompatible-with-transitive-4132b57a' in directory 'build/transitive-incompatible-with-transitive-4132b57a'
Building 'python-version-does-not-exist-db416e00' in directory 'build/python-version-does-not-exist-db416e00'
Building 'python-less-than-current-c050f6d5' in directory 'build/python-less-than-current-c050f6d5'
Building 'python-greater-than-current-f9f64a8d' in directory 'build/python-greater-than-current-f9f64a8d'
Building 'python-greater-than-current-many-63ea5ba6' in directory 'build/python-greater-than-current-many-63ea5ba6'
Building 'python-greater-than-current-patch-23c0760c' in directory 'build/python-greater-than-current-patch-23c0760c'
Building 'python-greater-than-current-excluded-2255f47c' in directory 'build/python-greater-than-current-excluded-2255f47c'
Building 'python-greater-than-current-backtrack-f53b1cd6' in directory 'build/python-greater-than-current-backtrack-f53b1cd6'
Building 'incompatible-python-compatible-override-cc53ff2b' in directory 'build/incompatible-python-compatible-override-cc53ff2b'
Building 'compatible-python-incompatible-override-df025f97' in directory 'build/compatible-python-incompatible-override-df025f97'
Building 'incompatible-python-compatible-override-unavailable-no-wheels-161a27c2' in directory 'build/incompatible-python-compatible-override-unavailable-no-wheels-161a27c2'
Building 'incompatible-python-compatible-override-available-no-wheels-6e4d1670' in directory 'build/incompatible-python-compatible-override-available-no-wheels-6e4d1670'
Building 'incompatible-python-compatible-override-no-compatible-wheels-1b13caa9' in directory 'build/incompatible-python-compatible-override-no-compatible-wheels-1b13caa9'
Building 'incompatible-python-compatible-override-other-wheel-497d1feb' in directory 'build/incompatible-python-compatible-override-other-wheel-497d1feb'
Building 'python-patch-override-no-patch-8429e03a' in directory 'build/python-patch-override-no-patch-8429e03a'
Building 'python-patch-override-patch-compatible-b6cdac48' in directory 'build/python-patch-override-patch-compatible-b6cdac48'
Building 'extra-required-bbd42201' in directory 'build/extra-required-bbd42201'
Building 'missing-extra-d7b6e0b1' in directory 'build/missing-extra-d7b6e0b1'
Building 'multiple-extras-required-73ee83b9' in directory 'build/multiple-extras-required-73ee83b9'
Building 'all-extras-required-61571b3c' in directory 'build/all-extras-required-61571b3c'
Building 'extra-incompatible-with-extra-eeb916b5' in directory 'build/extra-incompatible-with-extra-eeb916b5'
Building 'extra-incompatible-with-extra-not-requested-97cf0638' in directory 'build/extra-incompatible-with-extra-not-requested-97cf0638'
Building 'extra-incompatible-with-root-6faf09f6' in directory 'build/extra-incompatible-with-root-6faf09f6'
Building 'extra-does-not-exist-backtrack-05f843a2' in directory 'build/extra-does-not-exist-backtrack-05f843a2'
Building 'excluded-only-version-d5e62e6c' in directory 'build/excluded-only-version-d5e62e6c'
Building 'excluded-only-compatible-version-26dd59e3' in directory 'build/excluded-only-compatible-version-26dd59e3'
Building 'dependency-excludes-range-of-compatible-versions-cb8d51de' in directory 'build/dependency-excludes-range-of-compatible-versions-cb8d51de'
Building 'dependency-excludes-non-contiguous-range-of-compatible-versions-5d038b4f' in directory 'build/dependency-excludes-non-contiguous-range-of-compatible-versions-5d038b4f'
Exception in thread serve-build-scenarios:
Traceback (most recent call last):
  File "/home/damian/.pyenv/versions/3.12.1/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/home/damian/.pyenv/versions/3.12.1/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/home/damian/.pyenv/versions/packse_testing_312/lib/python3.12/site-packages/packse/serve.py", line 79, in build_scenarios
    build(
  File "/home/damian/.pyenv/versions/packse_testing_312/lib/python3.12/site-packages/packse/build.py", line 88, in build
    results = [future.result() for future in futures]
               ^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.1/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.1/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/home/damian/.pyenv/versions/3.12.1/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/packse_testing_312/lib/python3.12/site-packages/packse/build.py", line 179, in build_scenario
    future.result()
  File "/home/damian/.pyenv/versions/3.12.1/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.1/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/home/damian/.pyenv/versions/3.12.1/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/packse_testing_312/lib/python3.12/site-packages/packse/build.py", line 232, in build_scenario_package
    package_destination = create_from_template(
                          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/packse_testing_312/lib/python3.12/site-packages/packse/template.py", line 63, in create_from_template
    chevron_blue.render(file_path.read_text(), scope, no_escape=True)
                        ^^^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.1/lib/python3.12/pathlib.py", line 1028, in read_text
    return f.read()
           ^^^^^^^^
  File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcb in position 0: invalid continuation byte
Build thread failed..
zanieb commented 6 months ago

Interesting thanks I've never seen this I'll try to reproduce.

Can you packse build the scenarios separately from serve?

zanieb commented 6 months ago

Sorry I can't reproduce this on Arch Linux or macOS.

notatallshaw commented 6 months ago

Sorry, I've been unable to work on OSS for a few days, as soon as I get a chance I'll create a clean environment and try and reproduce.

notatallshaw commented 6 months ago

Still reproducible in a clean environment. I'm using pyenv because it compiles directly from CPython and, at least with pip, installer tests can be sensitive to changes different distributers make.:

  1. In a fresh directory
  2. pyenv install 3.12 (And fix any compiler errors if there are any)
  3. pyenv virtualenv uv_testing_312
  4. pyenv activate uv_testing_312
  5. pip install packse[serve]
  6. packse fetch
  7. packse build scenarios/

Trackeback:

Traceback (most recent call last):
  File "/home/damian/.pyenv/versions/uv_testing_312/bin/packse", line 8, in <module>
    sys.exit(entrypoint())
             ^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/envs/uv_testing_312/lib/python3.12/site-packages/packse/cli.py", line 44, in entrypoint
    args.call(args)
  File "/home/damian/.pyenv/versions/3.12.2/envs/uv_testing_312/lib/python3.12/site-packages/packse/cli.py", line 76, in _call_build
    build(
  File "/home/damian/.pyenv/versions/3.12.2/envs/uv_testing_312/lib/python3.12/site-packages/packse/build.py", line 88, in build
    results = [future.result() for future in futures]
               ^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/home/damian/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/envs/uv_testing_312/lib/python3.12/site-packages/packse/build.py", line 179, in build_scenario
    future.result()
  File "/home/damian/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/home/damian/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/envs/uv_testing_312/lib/python3.12/site-packages/packse/build.py", line 232, in build_scenario_package
    package_destination = create_from_template(
                          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/envs/uv_testing_312/lib/python3.12/site-packages/packse/template.py", line 64, in create_from_template
    chevron_blue.render(file_path.read_text(), scope, no_escape=True)
                        ^^^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/lib/python3.12/pathlib.py", line 1028, in read_text
    return f.read()
           ^^^^^^^^
  File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcb in position 0: invalid continuation byte

I put a breakpoint around line 64, in create_from_template, and I found these values:

(Pdb)  file_path
PosixPath('/home/damian/.pyenv/versions/3.12.2/envs/uv_testing_312/lib/python3.12/site-packages/packse/templates/package/{{ package-name }}-{{ version }}/src/{{ module-name }}/__pycache__/__init__.cpython-312.pyc')
(Pdb) scope
{'scenario-name': 'local-used-without-sdist', 'package-name': 'local-used-without-sdist-ea57116a', 'module-name': 'local_used_without_sdist_ea57116a', 'version': '0.0.0', 'dependencies': [<Requirement('local-used-without-sdist-a-ea57116a==1.2.3')>], 'optional-dependencies': [], 'requires-python': '>=3.8', 'description': 'Even if there is a 1.2.3 version published, if it is unavailable for some reason (no sdist and no compatible wheels in this case), a 1.2.3 version with a local segment should be usable instead.'}
(Pdb) new_file_path
PosixPath('/home/damian/testing_remote/packse/build/local-simple-5b70bb3c/local-simple-5b70bb3c-0.0.0/src/local_simple_5b70bb3c/__pycache__/__init__.cpython-312.pyc')
(Pdb) file_path.read_bytes()
b'\xcb\r\r\n\x00\x00\x00\x00\xa1L\xf2e\x1e\x00\x00\x00\xe3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\xf3\x08\x00\x00\x00\x97\x00d\x00Z\x00y\x01)\x02z\r{{ version }}N)\x01\xda\x0b__version__\xa9\x00\xf3\x00\x00\x00\x00\xfa\xb0/home/damian/.pyenv/versions/3.12.2/envs/uv_testing_312/lib/python3.12/site-packages/packse/templates/package/{{ package-name }}-{{ version }}/src/{{ module-name }}/__init__.py\xfa\x08<module>r\x06\x00\x00\x00\x01\x00\x00\x00s\n\x00\x00\x00\xf0\x03\x01\x01\x01\xd8\x0e\x1d\x81\x0br\x04\x00\x00\x00'
zanieb commented 6 months ago

Thanks for the additional details! If you just git clone this repository and run packse build scenarios do you get the same error?

I'll attempt to reproduce again but I was using pyenv on Linux so I think we're pretty close to the same environment.

notatallshaw commented 6 months ago

Okay, I found a differentiator or it working vs. not working, if I install packse from either pypi or source directory then it fails, regardless of whether I packse fetch the scenarios or git clone the scenarios.

However, it works fine if I git clone packse source and then pip install in editable mode.

  1. git clone https://github.com/astral-sh/packse
  2. cd packse/
  3. pip install .[serve] --force
  4. packse build --force scenarios/

Output:

Building 'dependency-excludes-non-contiguous-range-of-compatible-versions-5d038b4f' in directory '/home/damian/testing_remote/packse/build/dependency-excludes-non-contiguous-range-of-compatible-versions-5d038b4f'
Traceback (most recent call last):
  File "/home/damian/.pyenv/versions/uv_testing_312/bin/packse", line 8, in <module>
    sys.exit(entrypoint())
             ^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/envs/uv_testing_312/lib/python3.12/site-packages/packse/cli.py", line 44, in entrypoint
    args.call(args)
  File "/home/damian/.pyenv/versions/3.12.2/envs/uv_testing_312/lib/python3.12/site-packages/packse/cli.py", line 76, in _call_build
    build(
  File "/home/damian/.pyenv/versions/3.12.2/envs/uv_testing_312/lib/python3.12/site-packages/packse/build.py", line 88, in build
    results = [future.result() for future in futures]
               ^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/home/damian/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/envs/uv_testing_312/lib/python3.12/site-packages/packse/build.py", line 179, in build_scenario
    future.result()
  File "/home/damian/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/home/damian/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/envs/uv_testing_312/lib/python3.12/site-packages/packse/build.py", line 232, in build_scenario_package
    package_destination = create_from_template(
                          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/envs/uv_testing_312/lib/python3.12/site-packages/packse/template.py", line 63, in create_from_template
    chevron_blue.render(file_path.read_text(), scope, no_escape=True)
                        ^^^^^^^^^^^^^^^^^^^^^
  File "/home/damian/.pyenv/versions/3.12.2/lib/python3.12/pathlib.py", line 1028, in read_text
    return f.read()
           ^^^^^^^^
  File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcb in position 0: invalid continuation byte
  1. pip install -e .
  2. packse build --force scenarios/
  3. Success!

Not looked into why that's happening though.

notatallshaw commented 6 months ago

Stepping back a little bit, it seems that this function is trying to read templated source files and write out concrete source files.

For whatever reason in my environment it ends up reading pyc files, I don't think it should be. I think it would be reasonable to have an exclude (pyc files and __pycache__ directories) filter or an include filter (only py files?).

If I change:

    for root, _, files in template_path.walk():

To:

    for root, dirs, files in template_path.walk():
        with contextlib.suppress(ValueError):
            dirs.remove("__pycache__")

And reinstall, I no longer get an error.

Have you been install with uv pip install rather than pip install? Does perhaps one generate bytecode by default and the other doesn't?

zanieb commented 6 months ago

Ah pip install does compile byte-code on install default whereas uv pip install requires opt-in! Nice catch!

We should definitely filter those files from the walk.

notatallshaw commented 6 months ago

It looks like poetry doesn't compile by default either and you need to pass --compile to the install command.

I could raise a PR to add this to the CI test environment and update the code as above, if you'd like?