Skip to content

OSX + homebrew [email protected]: pybuilder/_vendor/virtualenv.py change_prefix does not consider symlinks, raises invalid AssertionError #771

Closed

Description

@hoxu

I have installed Python 3 on macOS 11.3 (Big Sur) with brew install [email protected]. Homebrew installs Python 3.9 under /usr/local/Cellar/[email protected], and symlinks /usr/local/opt/[email protected] -> ../Cellar/[email protected]/3.9.4.

python3 is a symlink /usr/local/bin/python3 -> ../Cellar/[email protected]/3.9.4/bin/python3.
pip3 is a symlink /usr/local/bin/pip3 -> ../Cellar/[email protected]/3.9.4/bin/pip3.

$ head -1 $(which pip3)
#!/usr/local/opt/[email protected]/bin/python3.9

I used pip3 install --user pybuilder to install pybuilder:

$ which pyb
/Users/username/Library/Python/3.9/bin/pyb
$ head -1 $(which pyb)
#!/usr/local/opt/[email protected]/bin/python3.9
$ pyb
PyBuilder version 0.12.10
Build started at 2021-04-28 10:36:15
------------------------------------------------------------
------------------------------------------------------------
BUILD FAILED - AssertionError: Filename /usr/local/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py does not start with any of these prefixes: ['/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/Extras/lib/python', '/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9', '/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9', '/Users/username/Library/Python/3.9/lib/python/site-packages', '/Users/username/.local/lib/python/3.9/site-packages', '/Users/username/Library/Python/3.9/site-packages', '/Library/Python/3.9/site-packages'] (pybuilder/_vendor/virtualenv.py:1272)
------------------------------------------------------------
Build finished at 2021-04-28 10:36:15
Build took 0 seconds (64 ms)

AssertionError is raised from change_prefix:

raise AssertionError("Filename {} does not start with any of these prefixes: {}".format(filename, prefixes))

Activity

  1. dindurthy commented on May 3, 2021

    @dindurthy

    Are there any workarounds? We're completely blocked.

  2. arcivanov commented on May 4, 2021

    @arcivanov
    Member

    Hello, unfortunately I'm completely swamped right now with work.

    We don't test with Brew Python, but we do test with PyEnv Python on Mac and it works: https://travis-ci.com/github/pybuilder/pybuilder/jobs/502734233

    I would highly recommend using PyEnv with Brew regardless as Brew Python contains the following warning:

    Important: Python may be upgraded to a newer version at any time. Consider using a version manager such as pyenv if you require stability of minor or patch versions for virtual environments.

    https://docs.brew.sh/Homebrew-and-Python

  3. arcivanov commented on May 4, 2021

    @arcivanov
    Member

    I see why this is happening and it's brew-specific, unfortunately.

  4. arcivanov commented on May 4, 2021

    @arcivanov
    Member

    @hoxu could you please run the build with pyb -vX so that the full exception will be printed out?

  5. hoxu commented on May 4, 2021

    @hoxu
    ContributorAuthor

    Are there any workarounds? We're completely blocked.

    @dindurthy you could use OSX-shipped python3 for pybuilder execution by prepending /usr/bin to PATH. Here is an example with which:

    $ which -a python3
    /usr/local/bin/python3
    /usr/bin/python3
    $ python3 --version
    Python 3.9.4
    $ PATH=/usr/bin:$PATH which -a python3
    /usr/bin/python3
    /usr/local/bin/python3
    /usr/bin/python3
    $ PATH=/usr/bin:$PATH python3 --version
    Python 3.8.2
    
  6. hoxu commented on May 4, 2021

    @hoxu
    ContributorAuthor

    @arcivanov:

    + pyb -vX
    [DEBUG] Registered Python environment 'system': CPython version 3.9.4.final.0 on darwin in ['/Users/username/XXX/vebuild/bin/python3.9']
    PyBuilder version 0.12.10
    Build started at 2021-05-04 08:48:51
    ------------------------------------------------------------
    [DEBUG] Loading project module from ./build.py
    [DEBUG] Setting up plugins VEnv at '/Users/username/XXX/.pybuilder/plugins/cpython-3.9.4.final.0'
    Traceback (most recent call last):
      File "/Users/username/XXX/vebuild/lib/python3.9/site-packages/pybuilder/cli.py", line 461, in main
        reactor.prepare_build(property_overrides=options.property_overrides,
      File "/Users/username/XXX/vebuild/lib/python3.9/site-packages/pybuilder/reactor.py", line 203, in prepare_build
        self._setup_plugin_directory(reset_plugins, no_venvs)
      File "/Users/username/XXX/vebuild/lib/python3.9/site-packages/pybuilder/reactor.py", line 517, in _setup_plugin_directory
        plugin_env = per["pybuilder"] = PythonEnv(plugin_dir, self).create_venv(with_pip=True,
      File "/Users/username/XXX/vebuild/lib/python3.9/site-packages/pybuilder/python_env.py", line 209, in create_venv
        create_venv(self._env_dir,
      File "/Users/username/XXX/vebuild/lib/python3.9/site-packages/pybuilder/python_env.py", line 429, in create_venv
        virtualenv.create_environment(
      File "/Users/username/XXX/vebuild/lib/python3.9/site-packages/pybuilder/_vendor/virtualenv.py", line 1161, in create_environment
        install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
      File "/Users/username/XXX/vebuild/lib/python3.9/site-packages/pybuilder/_vendor/virtualenv.py", line 1450, in install_python
        copy_required_modules(home_dir, symlink)
      File "/Users/username/XXX/vebuild/lib/python3.9/site-packages/pybuilder/_vendor/virtualenv.py", line 1340, in copy_required_modules
        dst_filename = change_prefix(filename, dst_prefix)
      File "/Users/username/XXX/vebuild/lib/python3.9/site-packages/pybuilder/_vendor/virtualenv.py", line 1272, in change_prefix
        raise AssertionError("Filename {} does not start with any of these prefixes: {}".format(filename, prefixes))
    AssertionError: Filename /usr/local/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py does not start with any of these prefixes: ['/Users/username/XXX/vebuild/Extras/lib/python', '/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9', '/Users/username/Library/Python/3.9/lib/python/site-packages', '/Users/username/XXX/vebuild', '/Users/username/.local/lib/python/3.9/site-packages', '/Users/username/Library/Python/3.9/site-packages', '/Library/Python/3.9/site-packages']
    ------------------------------------------------------------
    BUILD FAILED - AssertionError: Filename /usr/local/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py does not start with any of these prefixes: ['/Users/username/XXX/vebuild/Extras/lib/python', '/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9', '/Users/username/Library/Python/3.9/lib/python/site-packages', '/Users/username/XXX/vebuild', '/Users/username/.local/lib/python/3.9/site-packages', '/Users/username/Library/Python/3.9/site-packages', '/Library/Python/3.9/site-packages'] (pybuilder/_vendor/virtualenv.py:1272)
    ------------------------------------------------------------
    Build finished at 2021-05-04 08:48:51
    Build took 0 seconds (64 ms)
    
  7. dindurthy commented on May 4, 2021

    @dindurthy

    Changing PATH won't work without breaking too many other things, unfortunately. I think the only workaround is to not use brew python.

  8. hoxu commented on Aug 25, 2021

    @hoxu
    ContributorAuthor

    So change_prefix function is comparing /usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py to sys.prefix, that points to symlink-containing /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9 on Homebrew python.

    @arcivanov: wouldn't this be fixed by simply changing:

     def change_prefix(filename, dst_prefix):
    -    prefixes = [sys.prefix]
    +    prefixes = [os.path.realpath(sys.prefix)]
    >>> sys.prefix
    '/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9'
    >>> os.path.realpath(sys.prefix)
    '/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9'

    If so, would you accept PR with the above change?

  9. arcivanov commented on Sep 5, 2021

    @arcivanov
    Member

    If you could could you please retest with latest --pre and let me know?

  10. hoxu commented on Sep 6, 2021

    @hoxu
    ContributorAuthor

    First reproduction with 0.12.10:

    $ pyb
    PyBuilder version 0.12.10
    Build started at 2021-09-06 08:48:40
    ------------------------------------------------------------
    ------------------------------------------------------------
    BUILD FAILED - AssertionError: Filename /usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py does not start with any of these prefixes: ['/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/Extras/lib/python', '/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9', '/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9', '/Users/username/Library/Python/3.9/lib/python/site-packages', '/Users/username/.local/lib/python/3.9/site-packages', '/Users/username/Library/Python/3.9/site-packages', '/Library/Python/3.9/site-packages'] (pybuilder/_vendor/virtualenv.py:1272)
    ------------------------------------------------------------
    Build finished at 2021-09-06 08:48:40
    Build took 0 seconds (68 ms)
    

    Then test with --pre:

    $ pip3 install --user --pre --upgrade pybuilder
    <clip>
    Successfully installed pybuilder-0.13.0.dev20210905004524
    $ pyb
    PyBuilder version 0.13.0.dev20210905004524
    Build started at 2021-09-06 08:50:08
    ------------------------------------------------------------
    ------------------------------------------------------------
    BUILD FAILED - StopIteration:  (virtualenv/run/plugin/discovery.py:22)
    ------------------------------------------------------------
    Build finished at 2021-09-06 08:50:08
    Build took 0 seconds (153 ms)
    

    A different error, I call it progress :)

    $ pyb -vX
    [DEBUG] Registered Python environment 'system': CPython version 3.9.6.final.0 on darwin in ['/usr/local/opt/[email protected]/bin/python3.9']
    PyBuilder version 0.13.0.dev20210905004524
    Build started at 2021-09-06 08:54:14
    ------------------------------------------------------------
    [DEBUG] Loading project module from ./build.py
    [DEBUG] Setting up plugins VEnv at '/Users/username/XXX/.pybuilder/plugins/cpython-3.9.6.final.0'
    Traceback (most recent call last):
      File "/Users/username/Library/Python/3.9/lib/python/site-packages/pybuilder/cli.py", line 461, in main
        reactor.prepare_build(property_overrides=options.property_overrides,
      File "/Users/username/Library/Python/3.9/lib/python/site-packages/pybuilder/reactor.py", line 203, in prepare_build
        self._setup_plugin_directory(reset_plugins, no_venvs)
      File "/Users/username/Library/Python/3.9/lib/python/site-packages/pybuilder/reactor.py", line 517, in _setup_plugin_directory
        plugin_env = per["pybuilder"] = PythonEnv(plugin_dir, self).create_venv(with_pip=True,
      File "/Users/username/Library/Python/3.9/lib/python/site-packages/pybuilder/python_env.py", line 214, in create_venv
        create_venv(self._env_dir,
      File "/Users/username/Library/Python/3.9/lib/python/site-packages/pybuilder/python_env.py", line 453, in create_venv
        virtualenv.cli_run(args, setup_logging=False)
      File "/Users/username/Library/Python/3.9/lib/python/site-packages/pybuilder/_vendor/virtualenv/run/__init__.py", line 30, in cli_run
        of_session = session_via_cli(args, options, setup_logging, env)
      File "/Users/username/Library/Python/3.9/lib/python/site-packages/pybuilder/_vendor/virtualenv/run/__init__.py", line 48, in session_via_cli
        parser, elements = build_parser(args, options, setup_logging, env)
      File "/Users/username/Library/Python/3.9/lib/python/site-packages/pybuilder/_vendor/virtualenv/run/__init__.py", line 69, in build_parser
        discover = get_discover(parser, args)
      File "/Users/username/Library/Python/3.9/lib/python/site-packages/pybuilder/_vendor/virtualenv/run/plugin/discovery.py", line 22, in get_discover
        default=next(iter(choices)),
    StopIteration
    ------------------------------------------------------------
    BUILD FAILED - StopIteration:  (virtualenv/run/plugin/discovery.py:22)
    ------------------------------------------------------------
    Build finished at 2021-09-06 08:54:14
    Build took 0 seconds (129 ms)
    

    Is this a regression?

  11. arcivanov commented on Sep 6, 2021

    @arcivanov
    Member

    Yes and no. 😄 This is apparently a bug in virtualenv, which is bundled in PyB. Let me see if VEnv can fix it on their end.

  12. arcivanov commented on Sep 6, 2021

    @arcivanov
    Member

    @hoxu
    Would you kindly please:

    1. pip3 install --user virtualenv into your homebrewed Python environment.
    2. virtualenv -vvv --with-traceback ~/testvenv
    3. Capture the output and post it here? Does it fail?
  13. hoxu commented on Sep 6, 2021

    @hoxu
    ContributorAuthor
    $ realpath $(which pip3)
    /usr/local/Cellar/[email protected]/3.9.7/bin/pip3
    $ pip3 install --user virtualenv
    Collecting virtualenv
      Downloading virtualenv-20.7.2-py2.py3-none-any.whl (5.3 MB)
         |████████████████████████████████| 5.3 MB 3.6 MB/s
    Requirement already satisfied: six<2,>=1.9.0 in /usr/local/lib/python3.9/site-packages (from virtualenv) (1.15.0)
    Collecting backports.entry-points-selectable>=1.0.4
      Downloading backports.entry_points_selectable-1.1.0-py2.py3-none-any.whl (6.2 kB)
    Collecting distlib<1,>=0.3.1
      Downloading distlib-0.3.2-py2.py3-none-any.whl (338 kB)
         |████████████████████████████████| 338 kB 4.0 MB/s
    Collecting filelock<4,>=3.0.0
      Downloading filelock-3.0.12-py3-none-any.whl (7.6 kB)
    Collecting platformdirs<3,>=2
      Downloading platformdirs-2.3.0-py3-none-any.whl (13 kB)
    Installing collected packages: platformdirs, filelock, distlib, backports.entry-points-selectable, virtualenv
    Successfully installed backports.entry-points-selectable-1.1.0 distlib-0.3.2 filelock-3.0.12 platformdirs-2.3.0 virtualenv-20.7.2
    $ realpath $(which virtualenv)
    /Users/username/Library/Python/3.9/bin/virtualenv
    $ virtualenv -vvv --with-traceback /tmp/testvenv
    <clip>
    1790 created virtual environment CPython3.9.7.final.0-64 in 1677ms
      creator CPython3Posix(dest=/private/tmp/testvenv, clear=False, no_vcs_ignore=False, global=False)
      seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/username/Library/Application Support/virtualenv)
        added seed packages: pip==21.2.3, setuptools==57.4.0, wheel==0.37.0
      activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator [WARNING __main__:19]
    $ echo $?
    0
    

    So nope, doesn't fail. Let me know if you need the full output regardless.

  14. arcivanov commented on Sep 6, 2021

    @arcivanov
    Member

    Could you please post the shebang of the virtualenv file (first line)?
    And yes please post the whole output.

  15. hoxu commented on Sep 7, 2021

    @hoxu
    ContributorAuthor
    $ head -n1 $(which virtualenv)
    #!/usr/local/opt/[email protected]/bin/python3.9
    $ realpath /usr/local/opt/[email protected]/bin/python3.9
    /usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/bin/python3.9
    
    $ virtualenv -vvv --with-traceback /tmp/testvenv
    114 setup logging to NOTSET [DEBUG report:43]
    140 find interpreter for spec PythonSpec(path=/usr/local/opt/[email protected]/bin/python3.9) [INFO builtin:62]
    140 proposed PythonInfo(spec=CPython3.9.7.final.0-64, exe=/usr/local/opt/[email protected]/bin/python3.9, platform=darwin, version='3.9.7 (default, Sep  3 2021, 12:37:55) \n[Clang 12.0.5 (clang-1205.0.22.9)]', encoding_fs_io=utf-8-utf-8) [INFO builtin:69]
    140 accepted PythonInfo(spec=CPython3.9.7.final.0-64, exe=/usr/local/opt/[email protected]/bin/python3.9, platform=darwin, version='3.9.7 (default, Sep  3 2021, 12:37:55) \n[Clang 12.0.5 (clang-1205.0.22.9)]', encoding_fs_io=utf-8-utf-8) [DEBUG builtin:71]
    143 filesystem is not case-sensitive [DEBUG info:28]
    186 create virtual environment via CPython3Posix(dest=/private/tmp/testvenv, clear=False, no_vcs_ignore=False, global=False) [INFO session:52]
    186 create folder /private/tmp/testvenv/bin [DEBUG _sync:25]
    186 create folder /private/tmp/testvenv/lib/python3.9/site-packages [DEBUG _sync:25]
    187 write /private/tmp/testvenv/pyvenv.cfg [DEBUG pyenv_cfg:34]
    187     home = /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9 [DEBUG pyenv_cfg:38]
    187     implementation = CPython [DEBUG pyenv_cfg:38]
    187     version_info = 3.9.7.final.0 [DEBUG pyenv_cfg:38]
    187     virtualenv = 20.7.2 [DEBUG pyenv_cfg:38]
    187     include-system-site-packages = false [DEBUG pyenv_cfg:38]
    187     base-prefix = /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9 [DEBUG pyenv_cfg:38]
    187     base-exec-prefix = /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9 [DEBUG pyenv_cfg:38]
    187     base-executable = /usr/local/opt/[email protected]/bin/python3.9 [DEBUG pyenv_cfg:38]
    187 symlink /usr/local/opt/[email protected]/bin/python3.9 to /private/tmp/testvenv/bin/python [DEBUG _sync:44]
    188 create virtualenv import hook file /private/tmp/testvenv/lib/python3.9/site-packages/_virtualenv.pth [DEBUG api:95]
    189 create /private/tmp/testvenv/lib/python3.9/site-packages/_virtualenv.py [DEBUG api:98]
    190 ============================== target debug ============================== [DEBUG session:54]
    190 debug via /private/tmp/testvenv/bin/python /Users/username/Library/Python/3.9/lib/python/site-packages/virtualenv/create/debug.py [DEBUG creator:224]
    190 {
      "sys": {
        "executable": "/private/tmp/testvenv/bin/python",
        "_base_executable": "/private/tmp/testvenv/bin/python",
        "prefix": "/private/tmp/testvenv",
        "base_prefix": "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9",
        "real_prefix": null,
        "exec_prefix": "/private/tmp/testvenv",
        "base_exec_prefix": "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9",
        "path": [
          "/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python39.zip",
          "/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9",
          "/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload",
          "/private/tmp/testvenv/lib/python3.9/site-packages"
        ],
        "meta_path": [
          "<class '_virtualenv._Finder'>",
          "<class '_frozen_importlib.BuiltinImporter'>",
          "<class '_frozen_importlib.FrozenImporter'>",
          "<class '_frozen_importlib_external.PathFinder'>"
        ],
        "fs_encoding": "utf-8",
        "io_encoding": "utf-8"
      },
      "version": "3.9.7 (default, Sep  3 2021, 12:37:55) \n[Clang 12.0.5 (clang-1205.0.22.9)]",
      "makefile_filename": "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib/python3.9/config-3.9-darwin/Makefile",
      "os": "<module 'os' from '/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py'>",
      "site": "<module 'site' from '/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site.py'>",
      "datetime": "<module 'datetime' from '/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/datetime.py'>",
      "math": "<module 'math' from '/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/math.cpython-39-darwin.so'>",
      "json": "<module 'json' from '/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py'>"
    } [DEBUG session:55]
    248 add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/username/Library/Application Support/virtualenv) [INFO session:59]
    251 got embed update of distribution setuptools from /Users/username/Library/Application Support/virtualenv/wheel/3.9/embed/1/setuptools.json [DEBUG via_disk_folder:135]
    252 got embed update of distribution wheel from /Users/username/Library/Application Support/virtualenv/wheel/3.9/embed/1/wheel.json [DEBUG via_disk_folder:135]
    252 got embed update of distribution pip from /Users/username/Library/Application Support/virtualenv/wheel/3.9/embed/1/pip.json [DEBUG via_disk_folder:135]
    256 got embed update of distribution setuptools from /Users/username/Library/Application Support/virtualenv/wheel/3.9/embed/1/setuptools.json [DEBUG via_disk_folder:135]
    256 got embed update of distribution pip from /Users/username/Library/Application Support/virtualenv/wheel/3.9/embed/1/pip.json [DEBUG via_disk_folder:135]
    256 got embed update of distribution wheel from /Users/username/Library/Application Support/virtualenv/wheel/3.9/embed/1/wheel.json [DEBUG via_disk_folder:135]
    257 install setuptools from wheel /Users/username/Library/Python/3.9/lib/python/site-packages/virtualenv/seed/wheels/embed/setuptools-57.4.0-py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
    257 install pip from wheel /Users/username/Library/Python/3.9/lib/python/site-packages/virtualenv/seed/wheels/embed/pip-21.2.3-py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
    257 install wheel from wheel /Users/username/Library/Python/3.9/lib/python/site-packages/virtualenv/seed/wheels/embed/wheel-0.37.0-py2.py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
    258 Attempting to acquire lock 4507837008 on /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-57.4.0-py3-none-any.lock [DEBUG filelock:270]
    258 Attempting to acquire lock 4507839552 on /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-21.2.3-py3-none-any.lock [DEBUG filelock:270]
    258 Attempting to acquire lock 4507839648 on /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.37.0-py2.py3-none-any.lock [DEBUG filelock:270]
    259 Lock 4507839552 acquired on /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-21.2.3-py3-none-any.lock [INFO filelock:274]
    259 Lock 4507839648 acquired on /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.37.0-py2.py3-none-any.lock [INFO filelock:274]
    259 build install image for pip-21.2.3-py3-none-any.whl to /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-21.2.3-py3-none-any [DEBUG base:52]
    259 Lock 4507837008 acquired on /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-57.4.0-py3-none-any.lock [INFO filelock:274]
    259 build install image for wheel-0.37.0-py2.py3-none-any.whl to /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.37.0-py2.py3-none-any [DEBUG base:52]
    259 build install image for setuptools-57.4.0-py3-none-any.whl to /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-57.4.0-py3-none-any [DEBUG base:52]
    287 Attempting to release lock 4507839648 on /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.37.0-py2.py3-none-any.lock [DEBUG filelock:315]
    287 Lock 4507839648 released on /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.37.0-py2.py3-none-any.lock [INFO filelock:318]
    288 copy directory /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.37.0-py2.py3-none-any/wheel-0.37.0.dist-info to /private/tmp/testvenv/lib/python3.9/site-packages/wheel-0.37.0.dist-info [DEBUG _sync:52]
    335 copy directory /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.37.0-py2.py3-none-any/wheel to /private/tmp/testvenv/lib/python3.9/site-packages/wheel [DEBUG _sync:52]
    412 Attempting to release lock 4507837008 on /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-57.4.0-py3-none-any.lock [DEBUG filelock:315]
    412 Lock 4507837008 released on /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-57.4.0-py3-none-any.lock [INFO filelock:318]
    413 copy directory /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-57.4.0-py3-none-any/setuptools-57.4.0.dist-info to /private/tmp/testvenv/lib/python3.9/site-packages/setuptools-57.4.0.dist-info [DEBUG _sync:52]
    414 copy /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.37.0-py2.py3-none-any/wheel-0.37.0.virtualenv to /private/tmp/testvenv/lib/python3.9/site-packages/wheel-0.37.0.virtualenv [DEBUG _sync:52]
    417 generated console scripts wheel-3.9 wheel3 wheel wheel3.9 [DEBUG base:48]
    427 copy /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-57.4.0-py3-none-any/distutils-precedence.pth to /private/tmp/testvenv/lib/python3.9/site-packages/distutils-precedence.pth [DEBUG _sync:52]
    432 copy /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-57.4.0-py3-none-any/setuptools-57.4.0.virtualenv to /private/tmp/testvenv/lib/python3.9/site-packages/setuptools-57.4.0.virtualenv [DEBUG _sync:52]
    433 copy directory /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-57.4.0-py3-none-any/setuptools to /private/tmp/testvenv/lib/python3.9/site-packages/setuptools [DEBUG _sync:52]
    529 Attempting to release lock 4507839552 on /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-21.2.3-py3-none-any.lock [DEBUG filelock:315]
    529 Lock 4507839552 released on /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-21.2.3-py3-none-any.lock [INFO filelock:318]
    530 copy /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-21.2.3-py3-none-any/pip-21.2.3.virtualenv to /private/tmp/testvenv/lib/python3.9/site-packages/pip-21.2.3.virtualenv [DEBUG _sync:52]
    530 copy directory /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-21.2.3-py3-none-any/pip to /private/tmp/testvenv/lib/python3.9/site-packages/pip [DEBUG _sync:52]
    657 copy directory /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-57.4.0-py3-none-any/pkg_resources to /private/tmp/testvenv/lib/python3.9/site-packages/pkg_resources [DEBUG _sync:52]
    684 copy directory /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-57.4.0-py3-none-any/_distutils_hack to /private/tmp/testvenv/lib/python3.9/site-packages/_distutils_hack [DEBUG _sync:52]
    688 generated console scripts  [DEBUG base:48]
    1776 copy directory /Users/username/Library/Application Support/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-21.2.3-py3-none-any/pip-21.2.3.dist-info to /private/tmp/testvenv/lib/python3.9/site-packages/pip-21.2.3.dist-info [DEBUG _sync:52]
    1785 generated console scripts pip-3.9 pip3 pip3.9 pip [DEBUG base:48]
    1786 add activators for Bash, CShell, Fish, PowerShell, Python [INFO session:64]
    1789 write /private/tmp/testvenv/pyvenv.cfg [DEBUG pyenv_cfg:34]
    1789    home = /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9 [DEBUG pyenv_cfg:38]
    1789    implementation = CPython [DEBUG pyenv_cfg:38]
    1789    version_info = 3.9.7.final.0 [DEBUG pyenv_cfg:38]
    1789    virtualenv = 20.7.2 [DEBUG pyenv_cfg:38]
    1789    include-system-site-packages = false [DEBUG pyenv_cfg:38]
    1789    base-prefix = /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9 [DEBUG pyenv_cfg:38]
    1789    base-exec-prefix = /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9 [DEBUG pyenv_cfg:38]
    1789    base-executable = /usr/local/opt/[email protected]/bin/python3.9 [DEBUG pyenv_cfg:38]
    1790 created virtual environment CPython3.9.7.final.0-64 in 1677ms
      creator CPython3Posix(dest=/private/tmp/testvenv, clear=False, no_vcs_ignore=False, global=False)
      seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/username/Library/Application Support/virtualenv)
        added seed packages: pip==21.2.3, setuptools==57.4.0, wheel==0.37.0
      activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator [WARNING __main__:19]
    
  16. 15 remaining items

  17. hoxu commented on Sep 14, 2021

    @hoxu
    ContributorAuthor

    I run pybuilder mostly with a custom build script in a virtualenv like this:

    python3 -m venv vebuild
    . vebuild/bin/activate
    pip --disable-pip-version-check install pybuilder
    

    But I get the same AssertionError outside virtualenv with pybuilder installed with pip3 install --user pybuilder==0.12.10.

    Apologies for not having enough time to dig properly into this.

    Maybe @dindurthy could take a look at the GitHub Actions workflow logs and see if there are any differences to local execution?

  18. hoxu commented on Sep 14, 2021

    @hoxu
    ContributorAuthor

    Same exception with pybuilder installed withpip3 install pybuilder as well.

  19. hoxu commented on Sep 14, 2021

    @hoxu
    ContributorAuthor
    ['', '/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python39.zip', '/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9', '/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload', '/usr/local/lib/python3.9/site-packages']
    /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9
    /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9
    /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9
    /usr/local/opt/[email protected]/bin/python3.9
    

    Here is a diff from mine to GHA:

      ['',
       '/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python39.zip',
       '/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9',
       '/usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload',
    -  '/Users/username/Library/Python/3.9/lib/python/site-packages',
       '/usr/local/lib/python3.9/site-packages']
      /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9
    
  20. arcivanov commented on Sep 15, 2021

    @arcivanov
    Member

    Rejoice! I was able to reproduce this issue on Linux :) At least the StopIteration part that is.

  21. hoxu commented on Sep 15, 2021

    @hoxu
    ContributorAuthor

    @arcivanov let me know when --pre with #794 is available, so that I can try to reproduce this with the StopIteration fix. Good job fixing it :)

  22. arcivanov commented on Sep 15, 2021

    @arcivanov
    Member

    @hoxu go ahead please with --pre testing. :)

  23. arcivanov commented on Sep 16, 2021

    @arcivanov
    Member

    @hoxu did you have a chance to try it out?

  24. hoxu commented on Sep 17, 2021

    @hoxu
    ContributorAuthor

    Working on other projects, but a quick test with --pre PyBuilder version 0.13.0.dev20210917052200 & Python 3.9.7 seems to indicate that this issue is fixed! Awesome, good job!

    I think this can be closed after a release.

  25. arcivanov commented on Sep 17, 2021

    @arcivanov
    Member

    Glad to hear! The release is a bit away, as an issue in virtualenv has been discovered as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions