Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too permissive with substitution using $ENV_VAR instead of ${ENV_VAR} #545

Open
2 tasks done
psarka opened this issue Nov 8, 2023 · 5 comments
Open
2 tasks done

Comments

@psarka
Copy link

psarka commented Nov 8, 2023

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

This is not exact repro, as I don't know how to set it up. But approximately, this is the environment.yml file:

channels:
  - conda-forge
pip-repositories:
  - https://__token__:$GITLAB_PKG_REGISTRY_TOKEN@gitlab.com/api/v4/projects/12345/packages/pypi/simple
platforms:
  - linux-64
dependencies:
  - my_private_package = 1.0

Command conda-lock works fine, and produces approximatelly this kind of entry in the conda-lock.yml file:

- name: my_private_package
  version: 1.0
  manager: pip
  platform: linux-64
  dependencies:
    click: '>=5.0'
  url: https://__token__:$GITLAB_PKG_REGISTRY_TOKEN@gitlab.com/api/v4/projects/12345/packages/pypi/files/71..45/my_private_package-py3-none-any.whl
  hash:
    sha256: 71..45
  category: main
  optional: false

However, this then fails to install with conda-lock install. The key part of the stack trace looks like this:

INFO:root:Collecting my_private_package@ https://__token__:****@gitlab.com/api/v4/projects/12345/packages/pypi/files/71..45/my_private_package-1.0-py3-none-any.whl#sha256=71..45 (from -r /tmp/tmpantev93m (line 29))
INFO:root:User for gitlab.com:
ERROR:root:ERROR: Exception:
...
ERROR:root:EOFError: EOF when reading a line
ERROR:root:
ERROR:root:ERROR conda.cli.main_run:execute(49): `conda run pip install --no-deps -r /tmp/tmpantev93m` failed. (See above for error)

I tried to run pip install my_private_package@ https://__token__:****@gitlab.com/api/v4/projects/12345/packages/pypi/files/71..45/my_private_package-1.0-py3-none-any.whl#sha256=71..45 manually, and indeed it opens an input prompt for a user, even though it is specified as __token__ in the url

(top) psarka@hdsvm0007:~/yfp-pipelines$ pip install https://__token__:****@gitlab.com/api/v4/projects/...
Collecting my_private_package==1.0
User for gitlab.com: 

Conda Info

active environment : top
    active env location : /home/psarka/miniforge3/envs/top
            shell level : 2
       user config file : /home/psarka/.condarc
 populated config files : /home/psarka/miniforge3/.condarc
          conda version : 23.10.0
    conda-build version : not installed
         python version : 3.10.12.final.0
       virtual packages : __archspec=1=zen2
                          __glibc=2.31=0
                          __linux=5.4.0=0
                          __unix=0=0
       base environment : /home/psarka/miniforge3  (writable)
      conda av data dir : /home/psarka/miniforge3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /home/psarka/miniforge3/pkgs
                          /home/psarka/.conda/pkgs
       envs directories : /home/psarka/miniforge3/envs
                          /home/psarka/.conda/envs
               platform : linux-64
             user-agent : conda/23.10.0 requests/2.31.0 CPython/3.10.12 Linux/5.4.0-165-generic ubuntu/20.04.5 glibc/2.31 solver/libmamba conda-libmamba-solver/23.11.0 libmambapy/1.5.3
                UID:GID : 1002:1003
             netrc file : None
           offline mode : False

Conda Config

No response

Conda list

No response

Additional Context

(top) psarka@hdsvm0007:~/yfp-pipelines$ conda-lock --version
conda-lock, version 2.4.2

@maresb
Copy link
Contributor

maresb commented Nov 8, 2023

and indeed it opens an input prompt for a user, even though it is specified as token in the url

Hmm, I wonder if the token or password contain some characters, e.g. $ or @, which are being parsed improperly? (Although GitLab generates sane tokens in my experience.)

I did a quick test by setting up a new deploy token and uploading a package. The following command works correctly for me:

pip install my_private_package@https://deploy_token_user:deploy_token_pass@gitlab.com/api/v4/projects/12345/packages/pypi/files/b1...ce/my_private_package-2.2.1.post1.dev16%2Bg6dab24f.d20231108-py3-none-any.whl

If I remove deploy_token_user:deploy_ token_pass@ or mangle the password then I get the user prompt. Could you please debug this on your end?

I'm intrigued that you have a space character between my_private_package@ and https://. Is that correct?

@psarka
Copy link
Author

psarka commented Nov 8, 2023

Oh dear, I left the ***** instead of token when trying manual pip install command 🤦‍♂️ Token is sane, and it works when I remove it.

But conda-lock install still fails, and yes, I have spaces for all pip packages. Here is a full output of the install command:

(top) psarka@hdsvm0007:~/yfp-pipelines$ conda-lock install --name yfp-pipelines conda-lock.yml
WARNING:conda_lock.conda_lock:WARNING: installation of pip dependencies is only supported by the 'conda-lock install' and 'micromamba install' commands. Other tools may silently ignore them. For portability, we recommend using the newer unified lockfile format (i.e. removing the --kind=explicit argument.
INFO:root:Downloading and Extracting Packages: ...working... done
INFO:root:
INFO:root:Downloading and Extracting Packages: ...working... done
INFO:root:Preparing transaction: ...working... done
INFO:root:Verifying transaction: ...working... done
INFO:root:Executing transaction: ...working...
INFO:root:
INFO:root:done
INFO:root:Collecting adbc-driver-manager@ https://files.pythonhosted.org/packages/9c/95/61253f831318dbd00a37b14cbb9d97e1e91c4c2ad646256a7793407bce1f/adbc_driver_manager-0.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=922991761f5aa4641e067ecbec7b333fe25cbca82448e642c00c616b31688a15 (from -r /tmp/tmpe9ho589n (line 1))
INFO:root:  Using cached adbc_driver_manager-0.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB)
INFO:root:Collecting brotli@ https://files.pythonhosted.org/packages/b3/e7/ca2993c7682d8629b62630ebf0d1f3bb3d579e667ce8e7ca03a0a0576a2d/Brotli-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=a469274ad18dc0e4d316eefa616d1d0c2ff9da369af19fa6f3daa4f09671fd61 (from -r /tmp/tmpe9ho589n (line 3))
INFO:root:  Using cached Brotli-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB)
INFO:root:Collecting cloudpickle@ https://files.pythonhosted.org/packages/96/43/dae06432d0c4b1dc9e9149ad37b4ca8384cf6eb7700cd9215b177b914f0a/cloudpickle-3.0.0-py3-none-any.whl#sha256=246ee7d0c295602a036e86369c77fecda4ab17b506496730f2f576d9016fd9c7 (from -r /tmp/tmpe9ho589n (line 5))
INFO:root:  Using cached cloudpickle-3.0.0-py3-none-any.whl (20 kB)
INFO:root:Collecting inflate64@ https://files.pythonhosted.org/packages/62/d6/fe113b12773cad2c093d381c2b1629f9cfa240c9ad86a7f9f9079e7a51b5/inflate64-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=3e243ea9bd36a035059f2365bd6d156ff59717fbafb0255cb0c75bf151bf6904 (from -r /tmp/tmpe9ho589n (line 7))
INFO:root:  Using cached inflate64-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (96 kB)
INFO:root:Collecting more-itertools@ https://files.pythonhosted.org/packages/5a/cb/6dce742ea14e47d6f565589e859ad225f2a5de576d7696e0623b784e226b/more_itertools-10.1.0-py3-none-any.whl#sha256=64e0735fcfdc6f3464ea133afe8ea4483b1c5fe3a3d69852e6503b43a0b222e6 (from -r /tmp/tmpe9ho589n (line 9))
INFO:root:  Using cached more_itertools-10.1.0-py3-none-any.whl (55 kB)
INFO:root:Collecting multivolumefile@ https://files.pythonhosted.org/packages/22/31/ec5f46fd4c83185b806aa9c736e228cb780f13990a9cf4da0beb70025fcc/multivolumefile-0.2.3-py3-none-any.whl#sha256=237f4353b60af1703087cf7725755a1f6fcaeeea48421e1896940cd1c920d678 (from -r /tmp/tmpe9ho589n (line 11))
INFO:root:  Using cached multivolumefile-0.2.3-py3-none-any.whl (17 kB)
INFO:root:Collecting pybcj@ https://files.pythonhosted.org/packages/9e/13/af86c86cdfb293e82dd0b6c4bbdf08645cd8993456ee3fb911c3eeed1b22/pybcj-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=8007371f6f2b462f5aa05d5c2135d0a1bcf5b7bdd9bd15d86c730f588d10b7d3 (from -r /tmp/tmpe9ho589n (line 13))
INFO:root:  Using cached pybcj-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (50 kB)
INFO:root:Collecting pycryptodomex@ https://files.pythonhosted.org/packages/23/23/3f3d042c96ff7bece5b126365593b1f9c8e3ae62ce80d44e9da39c5e8a73/pycryptodomex-3.19.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=c74eb1f73f788facece7979ce91594dc177e1a9b5d5e3e64697dd58299e5cb4d (from -r /tmp/tmpe9ho589n (line 15))
INFO:root:  Using cached pycryptodomex-3.19.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
INFO:root:Collecting pyppmd@ https://files.pythonhosted.org/packages/31/7c/956ebf1f07506bb59e6f13ef068d91f1bec828758d399b455b175b668f6c/pyppmd-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=ec8a2447e69444703e2b273247bfcd4b540ec601780eff07da16344c62d2993d (from -r /tmp/tmpe9ho589n (line 17))
INFO:root:  Using cached pyppmd-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141 kB)
INFO:root:Collecting pyzstd@ https://files.pythonhosted.org/packages/c3/7f/0d5c048cacb906fa40485b5bb9dc5de5993bff2e4c85fa77e5a89c413205/pyzstd-0.15.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=7c420878726d677da7484f6021dbe7e1f9345a791b155de632c6ce36678fb621 (from -r /tmp/tmpe9ho589n (line 19))
INFO:root:  Using cached pyzstd-0.15.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (412 kB)
INFO:root:Collecting slicer@ https://files.pythonhosted.org/packages/78/c2/b3f55dfdb8af9812fdb9baf70cacf3b9e82e505b2bd4324d588888b81202/slicer-0.0.7-py3-none-any.whl#sha256=0b94faa5251c0f23782c03f7b7eedda91d80144059645f452c4bc80fab875976 (from -r /tmp/tmpe9ho589n (line 21))
INFO:root:  Using cached slicer-0.0.7-py3-none-any.whl (14 kB)
INFO:root:Collecting texttable@ https://files.pythonhosted.org/packages/24/99/4772b8e00a136f3e01236de33b0efda31ee7077203ba5967fcc76da94d65/texttable-1.7.0-py2.py3-none-any.whl#sha256=72227d592c82b3d7f672731ae73e4d1f88cd8e2ef5b075a7a7f01a23a3743917 (from -r /tmp/tmpe9ho589n (line 23))
INFO:root:  Using cached texttable-1.7.0-py2.py3-none-any.whl (10 kB)
INFO:root:Collecting adbc-driver-postgresql@ https://files.pythonhosted.org/packages/d8/c5/5c873b1387262b043782597b421660ae6ee1e3cc0e07879bb91bb7ca3b7e/adbc_driver_postgresql-0.7.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=044d4e6b92d29f0dde0d234ed6efcb956ba97d7bda321ed8ad0d6349403876ad (from -r /tmp/tmpe9ho589n (line 25))
INFO:root:  Using cached adbc_driver_postgresql-0.7.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB)
INFO:root:Collecting brotlicffi@ https://files.pythonhosted.org/packages/be/20/201559dff14e83ba345a5ec03335607e47467b6633c210607e693aefac40/brotlicffi-1.1.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=9feb210d932ffe7798ee62e6145d3a757eb6233aa9a4e7db78dd3690d7755814 (from -r /tmp/tmpe9ho589n (line 27))
INFO:root:  Using cached brotlicffi-1.1.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB)
INFO:root:Collecting dagster@ https://__token__:****@gitlab.com/api/v4/projects/46286183/packages/pypi/files/71355f67f432e812968226eb285c6b806b146ce8121f0cdcc5d3df06a8de2145/dagster-1.4.16+hds.8-py3-none-any.whl#sha256=71355f67f432e812968226eb285c6b806b146ce8121f0cdcc5d3df06a8de2145 (from -r /tmp/tmpe9ho589n (line 29))
INFO:root:User for gitlab.com:
ERROR:root:ERROR: Exception:
ERROR:root:Traceback (most recent call last):
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
ERROR:root:    status = run_func(*args)
ERROR:root:             ^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/cli/req_command.py", line 245, in wrapper
ERROR:root:    return func(self, options, args)
ERROR:root:           ^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/commands/install.py", line 377, in run
ERROR:root:    requirement_set = resolver.resolve(
ERROR:root:                      ^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 76, in resolve
ERROR:root:    collected = self.factory.collect_root_requirements(root_reqs)
ERROR:root:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 513, in collect_root_requirements
ERROR:root:    reqs = list(
ERROR:root:           ^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 474, in _make_requirements_from_install_req
ERROR:root:    cand = self._make_candidate_from_link(
ERROR:root:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 211, in _make_candidate_from_link
ERROR:root:    self._link_candidate_cache[link] = LinkCandidate(
ERROR:root:                                       ^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 293, in __init__
ERROR:root:    super().__init__(
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 156, in __init__
ERROR:root:    self.dist = self._prepare()
ERROR:root:                ^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 225, in _prepare
ERROR:root:    dist = self._prepare_distribution()
ERROR:root:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 304, in _prepare_distribution
ERROR:root:    return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
ERROR:root:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/operations/prepare.py", line 525, in prepare_linked_requirement
ERROR:root:    return self._prepare_linked_requirement(req, parallel_builds)
ERROR:root:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/operations/prepare.py", line 596, in _prepare_linked_requirement
ERROR:root:    local_file = unpack_url(
ERROR:root:                 ^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/operations/prepare.py", line 168, in unpack_url
ERROR:root:    file = get_http_url(
ERROR:root:           ^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/operations/prepare.py", line 109, in get_http_url
ERROR:root:    from_path, content_type = download(link, temp_dir.path)
ERROR:root:                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/network/download.py", line 134, in __call__
ERROR:root:    resp = _http_get_download(self._session, link)
ERROR:root:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/network/download.py", line 117, in _http_get_download
ERROR:root:    resp = session.get(target_url, headers=HEADERS, stream=True)
ERROR:root:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_vendor/requests/sessions.py", line 602, in get
ERROR:root:    return self.request("GET", url, **kwargs)
ERROR:root:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/network/session.py", line 519, in request
ERROR:root:    return super().request(method, url, *args, **kwargs)
ERROR:root:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_vendor/requests/sessions.py", line 589, in request
ERROR:root:    resp = self.send(prep, **send_kwargs)
ERROR:root:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_vendor/requests/sessions.py", line 710, in send
ERROR:root:    r = dispatch_hook("response", hooks, r, **kwargs)
ERROR:root:        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_vendor/requests/hooks.py", line 30, in dispatch_hook
ERROR:root:    _hook_data = hook(hook_data, **kwargs)
ERROR:root:                 ^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/network/auth.py", line 500, in handle_401
ERROR:root:    username, password, save = self._prompt_for_password(parsed.netloc)
ERROR:root:                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/network/auth.py", line 455, in _prompt_for_password
ERROR:root:    username = ask_input(f"User for {netloc}: ") if self.prompting else None
ERROR:root:               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR:root:  File "/home/psarka/miniforge3/envs/yfp-pipelines/lib/python3.11/site-packages/pip/_internal/utils/misc.py", line 255, in ask_input
ERROR:root:    return input(message)
ERROR:root:           ^^^^^^^^^^^^^^
ERROR:root:EOFError: EOF when reading a line
ERROR:root:
ERROR:root:ERROR conda.cli.main_run:execute(49): `conda run pip install --no-deps -r /tmp/tmpe9ho589n` failed. (See above for error)
Traceback (most recent call last):
  File "/home/psarka/miniforge3/envs/top/bin/conda-lock", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/psarka/miniforge3/envs/top/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/psarka/miniforge3/envs/top/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/psarka/miniforge3/envs/top/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/psarka/miniforge3/envs/top/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/psarka/miniforge3/envs/top/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/psarka/miniforge3/envs/top/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/psarka/miniforge3/envs/top/lib/python3.11/site-packages/conda_lock/conda_lock.py", line 1493, in install
    install_func(file=lockfile)
  File "/home/psarka/miniforge3/envs/top/lib/python3.11/site-packages/conda_lock/conda_lock.py", line 241, in do_conda_install
    _conda(["run"], ["pip", "install", "--no-deps", "-r", str(requirements_path)])
  File "/home/psarka/miniforge3/envs/top/lib/python3.11/site-packages/conda_lock/invoke_conda.py", line 129, in _invoke_conda
    raise subprocess.CalledProcessError(
conda_lock._vendor.poetry.utils._compat.CalledProcessError: Command '['/home/psarka/miniforge3/condabin/mamba', 'run', '--name', 'yfp-pipelines', 'pip', 'install', '--no-deps', '-r', '/tmp/tmpe9ho589n']' returned non-zero exit status 2.

@maresb
Copy link
Contributor

maresb commented Nov 8, 2023

@psarka, could you try replacing $GITLAB_PKG_REGISTRY_TOKEN with ${GITLAB_PKG_REGISTRY_TOKEN} and see if that works?

@maresb
Copy link
Contributor

maresb commented Nov 8, 2023

Assuming my hypothesis is correct, I think it's a bug that conda-lock silently enables environment variable substitution without braces

@maresb maresb changed the title pip-repositories lock but do not install when using private gitlab repo Too permissive with substitution using $ENV_VAR instead of ${ENV_VAR} Nov 8, 2023
@psarka
Copy link
Author

psarka commented Nov 9, 2023

Sorry for lag, got distracted yesterday.

Yes, it works! 🎉 Thank you @maresb ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants